From 9dad938ebc3952a6652698d323291a442b773e2e Mon Sep 17 00:00:00 2001 From: Alexander Frick Date: Mon, 22 Jan 2024 06:45:17 -0600 Subject: [PATCH] M120 FFMPEG --- TODO.md | 2 + .../config/Chrome/android/arm-neon/config.h | 10 +- .../android/arm-neon/config_components.h | 15 +- .../android/arm-neon/libavutil/ffversion.h | 2 +- .../config/Chrome/android/arm64/config.h | 10 +- .../Chrome/android/arm64/config_components.h | 15 +- .../android/arm64/libavutil/ffversion.h | 2 +- .../config/Chrome/android/ia32/config.h | 12 +- .../Chrome/android/ia32/config_components.h | 15 +- .../Chrome/android/ia32/libavutil/ffversion.h | 2 +- .../config/Chrome/android/x64/config.asm | 6 +- .../config/Chrome/android/x64/config.h | 10 +- .../Chrome/android/x64/config_components.h | 15 +- .../Chrome/android/x64/libavutil/ffversion.h | 2 +- .../chromium/config/Chrome/ios/arm64/config.h | 10 +- .../Chrome/ios/arm64/config_components.h | 15 +- .../Chrome/ios/arm64/libavutil/ffversion.h | 2 +- .../chromium/config/Chrome/ios/x64/config.asm | 6 +- .../chromium/config/Chrome/ios/x64/config.h | 10 +- .../config/Chrome/ios/x64/config_components.h | 15 +- .../Chrome/ios/x64/libavutil/ffversion.h | 2 +- .../config/Chrome/linux-noasm/x64/config.h | 12 +- .../linux-noasm/x64/config_components.h | 15 +- .../linux-noasm/x64/libavutil/ffversion.h | 2 +- .../config/Chrome/linux/arm-neon/config.h | 10 +- .../Chrome/linux/arm-neon/config_components.h | 15 +- .../linux/arm-neon/libavutil/ffversion.h | 2 +- .../chromium/config/Chrome/linux/arm/config.h | 10 +- .../Chrome/linux/arm/config_components.h | 15 +- .../Chrome/linux/arm/libavutil/ffversion.h | 2 +- .../config/Chrome/linux/arm64/config.h | 10 +- .../Chrome/linux/arm64/config_components.h | 15 +- .../Chrome/linux/arm64/libavutil/ffversion.h | 2 +- .../config/Chrome/linux/ia32/config.asm | 8 +- .../config/Chrome/linux/ia32/config.h | 12 +- .../Chrome/linux/ia32/config_components.h | 15 +- .../Chrome/linux/ia32/libavutil/ffversion.h | 2 +- .../config/Chrome/linux/x64/config.asm | 6 +- .../chromium/config/Chrome/linux/x64/config.h | 10 +- .../Chrome/linux/x64/config_components.h | 15 +- .../Chrome/linux/x64/libavutil/ffversion.h | 2 +- .../chromium/config/Chrome/mac/arm64/config.h | 10 +- .../Chrome/mac/arm64/config_components.h | 15 +- .../Chrome/mac/arm64/libavutil/ffversion.h | 2 +- .../chromium/config/Chrome/mac/x64/config.asm | 6 +- .../chromium/config/Chrome/mac/x64/config.h | 10 +- .../config/Chrome/mac/x64/config_components.h | 15 +- .../Chrome/mac/x64/libavutil/ffversion.h | 2 +- .../chromium/config/Chrome/win/arm64/config.h | 10 +- .../Chrome/win/arm64/config_components.h | 15 +- .../Chrome/win/arm64/libavutil/ffversion.h | 2 +- .../config/Chrome/win/ia32/config.asm | 8 +- .../chromium/config/Chrome/win/ia32/config.h | 12 +- .../Chrome/win/ia32/config_components.h | 15 +- .../Chrome/win/ia32/libavutil/ffversion.h | 2 +- .../chromium/config/Chrome/win/x64/config.asm | 6 +- .../chromium/config/Chrome/win/x64/config.h | 10 +- .../config/Chrome/win/x64/config_components.h | 15 +- .../Chrome/win/x64/libavutil/ffversion.h | 2 +- .../config/ChromeOS/linux-noasm/x64/config.h | 12 +- .../linux-noasm/x64/config_components.h | 15 +- .../linux-noasm/x64/libavutil/ffversion.h | 2 +- .../config/ChromeOS/linux/arm-neon/config.h | 10 +- .../linux/arm-neon/config_components.h | 15 +- .../linux/arm-neon/libavutil/ffversion.h | 2 +- .../config/ChromeOS/linux/arm/config.h | 10 +- .../ChromeOS/linux/arm/config_components.h | 15 +- .../ChromeOS/linux/arm/libavutil/ffversion.h | 2 +- .../config/ChromeOS/linux/arm64/config.h | 10 +- .../ChromeOS/linux/arm64/config_components.h | 15 +- .../linux/arm64/libavutil/ffversion.h | 2 +- .../config/ChromeOS/linux/ia32/config.asm | 8 +- .../config/ChromeOS/linux/ia32/config.h | 12 +- .../ChromeOS/linux/ia32/config_components.h | 15 +- .../ChromeOS/linux/ia32/libavutil/ffversion.h | 2 +- .../config/ChromeOS/linux/x64/config.asm | 6 +- .../config/ChromeOS/linux/x64/config.h | 10 +- .../ChromeOS/linux/x64/config_components.h | 15 +- .../ChromeOS/linux/x64/libavutil/ffversion.h | 2 +- .../config/Chromium/android/arm-neon/config.h | 10 +- .../android/arm-neon/config_components.h | 15 +- .../android/arm-neon/libavutil/ffversion.h | 2 +- .../config/Chromium/android/arm64/config.h | 10 +- .../android/arm64/config_components.h | 15 +- .../android/arm64/libavutil/ffversion.h | 2 +- .../config/Chromium/android/ia32/config.h | 12 +- .../Chromium/android/ia32/config_components.h | 15 +- .../android/ia32/libavutil/ffversion.h | 2 +- .../config/Chromium/android/x64/config.asm | 6 +- .../config/Chromium/android/x64/config.h | 10 +- .../Chromium/android/x64/config_components.h | 15 +- .../android/x64/libavutil/ffversion.h | 2 +- .../config/Chromium/ios/arm64/config.h | 10 +- .../Chromium/ios/arm64/config_components.h | 15 +- .../Chromium/ios/arm64/libavutil/ffversion.h | 2 +- .../config/Chromium/ios/x64/config.asm | 6 +- .../chromium/config/Chromium/ios/x64/config.h | 10 +- .../Chromium/ios/x64/config_components.h | 15 +- .../Chromium/ios/x64/libavutil/ffversion.h | 2 +- .../config/Chromium/linux-noasm/x64/config.h | 12 +- .../linux-noasm/x64/config_components.h | 15 +- .../linux-noasm/x64/libavutil/ffversion.h | 2 +- .../config/Chromium/linux/arm-neon/config.h | 10 +- .../linux/arm-neon/config_components.h | 15 +- .../linux/arm-neon/libavutil/ffversion.h | 2 +- .../config/Chromium/linux/arm/config.h | 10 +- .../Chromium/linux/arm/config_components.h | 15 +- .../Chromium/linux/arm/libavutil/ffversion.h | 2 +- .../config/Chromium/linux/arm64/config.h | 10 +- .../Chromium/linux/arm64/config_components.h | 15 +- .../linux/arm64/libavutil/ffversion.h | 2 +- .../config/Chromium/linux/ia32/config.asm | 8 +- .../config/Chromium/linux/ia32/config.h | 12 +- .../Chromium/linux/ia32/config_components.h | 15 +- .../Chromium/linux/ia32/libavutil/ffversion.h | 2 +- .../config/Chromium/linux/x64/config.asm | 6 +- .../config/Chromium/linux/x64/config.h | 10 +- .../Chromium/linux/x64/config_components.h | 15 +- .../Chromium/linux/x64/libavutil/ffversion.h | 2 +- .../config/Chromium/mac/arm64/config.h | 10 +- .../Chromium/mac/arm64/config_components.h | 15 +- .../Chromium/mac/arm64/libavutil/ffversion.h | 2 +- .../config/Chromium/mac/x64/config.asm | 6 +- .../chromium/config/Chromium/mac/x64/config.h | 10 +- .../Chromium/mac/x64/config_components.h | 15 +- .../Chromium/mac/x64/libavutil/ffversion.h | 2 +- .../config/Chromium/win/arm64/config.h | 10 +- .../Chromium/win/arm64/config_components.h | 15 +- .../Chromium/win/arm64/libavutil/ffversion.h | 2 +- .../config/Chromium/win/ia32/config.asm | 8 +- .../config/Chromium/win/ia32/config.h | 12 +- .../Chromium/win/ia32/config_components.h | 15 +- .../Chromium/win/ia32/libavutil/ffversion.h | 2 +- .../config/Chromium/win/x64/config.asm | 6 +- .../chromium/config/Chromium/win/x64/config.h | 10 +- .../Chromium/win/x64/config_components.h | 15 +- .../Chromium/win/x64/libavutil/ffversion.h | 2 +- .../third_party/ffmpeg/chromium/ffmpeg.sigs | 1 + .../ffmpeg/chromium/patches/README | 192 +-- .../chromium/patches/config_flag_changes.txt | 23 + .../ffmpeg/chromium/scripts/build_ffmpeg.py | 4 +- .../third_party/ffmpeg/ffmpeg_generated.gni | 149 +- .../third_party/ffmpeg/libavcodec/4xm.c | 10 +- .../third_party/ffmpeg/libavcodec/8bps.c | 72 +- .../third_party/ffmpeg/libavcodec/Makefile | 31 +- .../ffmpeg/libavcodec/aacdec_template.c | 26 +- .../third_party/ffmpeg/libavcodec/aacenc.c | 14 +- .../ffmpeg/libavcodec/aacenc_ltp.c | 4 +- .../ffmpeg/libavcodec/aacenc_pred.c | 2 +- .../ffmpeg/libavcodec/aacenc_tns.c | 2 +- .../third_party/ffmpeg/libavcodec/aacenctab.h | 8 +- .../ffmpeg/libavcodec/aacps_common.c | 2 +- .../third_party/ffmpeg/libavcodec/aacsbr.h | 2 +- .../ffmpeg/libavcodec/aacsbr_template.c | 2 +- .../ffmpeg/libavcodec/aacsbrdata.h | 266 --- .../third_party/ffmpeg/libavcodec/aactab.c | 4 +- .../ffmpeg/libavcodec/aarch64/Makefile | 3 - .../libavcodec/aarch64/hevcdsp_epel_neon.S | 621 ++++++- .../libavcodec/aarch64/hevcdsp_idct_neon.S | 8 +- .../libavcodec/aarch64/hevcdsp_init_aarch64.c | 20 + .../libavcodec/aarch64/hevcdsp_qpel_neon.S | 588 +++++++ .../libavcodec/aarch64/synth_filter_init.c | 7 - .../libavcodec/aarch64/synth_filter_neon.S | 2 - .../third_party/ffmpeg/libavcodec/ac3dec.c | 4 +- .../third_party/ffmpeg/libavcodec/ac3enc.c | 1 + .../ffmpeg/libavcodec/ac3enc_fixed.c | 2 +- .../ffmpeg/libavcodec/ac3enc_float.c | 2 +- .../third_party/ffmpeg/libavcodec/adx.h | 4 +- .../ffmpeg/libavcodec/adx_parser.c | 10 + .../third_party/ffmpeg/libavcodec/adxdec.c | 2 +- .../third_party/ffmpeg/libavcodec/agm.c | 11 +- .../third_party/ffmpeg/libavcodec/alac.c | 54 +- .../third_party/ffmpeg/libavcodec/allcodecs.c | 2 + .../ffmpeg/libavcodec/alpha/idctdsp_alpha.c | 1 + .../third_party/ffmpeg/libavcodec/amfenc.c | 8 +- .../ffmpeg/libavcodec/amfenc_av1.c | 4 +- .../ffmpeg/libavcodec/amfenc_h264.c | 12 +- .../ffmpeg/libavcodec/amfenc_hevc.c | 4 +- .../third_party/ffmpeg/libavcodec/apedec.c | 134 +- .../third_party/ffmpeg/libavcodec/arbc.c | 3 +- .../ffmpeg/libavcodec/arm/Makefile | 7 - .../libavcodec/arm/synth_filter_init_arm.c | 1 - .../third_party/ffmpeg/libavcodec/asvdec.c | 10 +- .../third_party/ffmpeg/libavcodec/asvenc.c | 1 - .../third_party/ffmpeg/libavcodec/atrac3.c | 4 +- .../ffmpeg/libavcodec/atrac3plus.c | 4 +- .../third_party/ffmpeg/libavcodec/atrac9dec.c | 4 +- .../ffmpeg/libavcodec/audiotoolboxenc.c | 25 +- .../third_party/ffmpeg/libavcodec/av1.h | 7 + .../ffmpeg/libavcodec/av1_levels.c | 92 ++ .../ffmpeg/libavcodec/av1_levels.h | 58 + .../third_party/ffmpeg/libavcodec/av1dec.c | 93 +- .../third_party/ffmpeg/libavcodec/avcodec.c | 9 + .../third_party/ffmpeg/libavcodec/avcodec.h | 167 +- .../third_party/ffmpeg/libavcodec/avfft.c | 195 ++- .../third_party/ffmpeg/libavcodec/avfft.h | 31 + .../third_party/ffmpeg/libavcodec/avpacket.c | 1 + .../third_party/ffmpeg/libavcodec/bgmc.c | 4 +- .../third_party/ffmpeg/libavcodec/bgmc.h | 3 +- .../third_party/ffmpeg/libavcodec/bink.c | 8 +- .../third_party/ffmpeg/libavcodec/bitstream.h | 2 + .../ffmpeg/libavcodec/bitstream_template.h | 31 +- .../third_party/ffmpeg/libavcodec/bonk.c | 2 +- .../third_party/ffmpeg/libavcodec/cavsdec.c | 1 + .../third_party/ffmpeg/libavcodec/cbs.c | 155 +- .../third_party/ffmpeg/libavcodec/cbs.h | 88 +- .../third_party/ffmpeg/libavcodec/cbs_av1.c | 273 ++- .../third_party/ffmpeg/libavcodec/cbs_av1.h | 4 + .../libavcodec/cbs_av1_syntax_template.c | 16 +- .../third_party/ffmpeg/libavcodec/cbs_bsf.c | 5 + .../third_party/ffmpeg/libavcodec/cbs_h2645.c | 153 +- .../third_party/ffmpeg/libavcodec/cbs_h266.h | 7 + .../libavcodec/cbs_h266_syntax_template.c | 312 ++-- .../ffmpeg/libavcodec/cbs_internal.h | 96 +- .../third_party/ffmpeg/libavcodec/cbs_mpeg2.c | 15 +- .../third_party/ffmpeg/libavcodec/cbs_vp9.c | 122 +- .../ffmpeg/libavcodec/cdgraphics.c | 37 +- .../third_party/ffmpeg/libavcodec/cdxl.c | 5 +- .../third_party/ffmpeg/libavcodec/celp_math.h | 2 +- .../third_party/ffmpeg/libavcodec/cfhddata.c | 4 +- .../ffmpeg/libavcodec/clearvideo.c | 12 +- .../third_party/ffmpeg/libavcodec/cllc.c | 14 +- .../third_party/ffmpeg/libavcodec/codec.h | 2 +- .../ffmpeg/libavcodec/codec_desc.c | 7 + .../ffmpeg/libavcodec/codec_desc.h | 2 +- .../third_party/ffmpeg/libavcodec/codec_id.h | 1 + .../third_party/ffmpeg/libavcodec/codec_par.c | 6 +- .../third_party/ffmpeg/libavcodec/codec_par.h | 10 +- .../third_party/ffmpeg/libavcodec/cook.c | 8 +- .../third_party/ffmpeg/libavcodec/cscd.c | 7 +- .../third_party/ffmpeg/libavcodec/cuviddec.c | 7 +- .../third_party/ffmpeg/libavcodec/dca_core.c | 9 +- .../third_party/ffmpeg/libavcodec/dca_lbr.c | 2 +- .../ffmpeg/libavcodec/dca_parser.c | 16 +- .../third_party/ffmpeg/libavcodec/dca_xll.c | 6 +- .../third_party/ffmpeg/libavcodec/dcadec.c | 9 +- .../third_party/ffmpeg/libavcodec/dcahuff.c | 8 +- .../third_party/ffmpeg/libavcodec/dct.h | 34 +- .../third_party/ffmpeg/libavcodec/decode.c | 72 +- .../third_party/ffmpeg/libavcodec/decode.h | 17 +- .../third_party/ffmpeg/libavcodec/defs.h | 143 ++ .../third_party/ffmpeg/libavcodec/dirac.c | 3 + .../third_party/ffmpeg/libavcodec/dirac.h | 6 +- .../third_party/ffmpeg/libavcodec/dirac_dwt.c | 1 + .../third_party/ffmpeg/libavcodec/dnxhddata.c | 14 +- .../third_party/ffmpeg/libavcodec/dnxhddec.c | 44 +- .../third_party/ffmpeg/libavcodec/dnxhdenc.c | 36 +- .../third_party/ffmpeg/libavcodec/dolby_e.c | 4 +- .../third_party/ffmpeg/libavcodec/dvdec.c | 5 +- .../third_party/ffmpeg/libavcodec/dvenc.c | 1 + .../third_party/ffmpeg/libavcodec/dxa.c | 7 +- .../third_party/ffmpeg/libavcodec/dxva2.c | 38 +- .../third_party/ffmpeg/libavcodec/dxva2_av1.c | 31 +- .../ffmpeg/libavcodec/dxva2_h264.c | 31 +- .../ffmpeg/libavcodec/dxva2_hevc.c | 31 +- .../ffmpeg/libavcodec/dxva2_mpeg2.c | 31 +- .../third_party/ffmpeg/libavcodec/dxva2_vc1.c | 61 +- .../third_party/ffmpeg/libavcodec/dxva2_vp9.c | 31 +- .../third_party/ffmpeg/libavcodec/eacmv.c | 5 +- .../third_party/ffmpeg/libavcodec/eamad.c | 3 +- .../third_party/ffmpeg/libavcodec/eatgv.c | 3 +- .../third_party/ffmpeg/libavcodec/encode.c | 33 + .../third_party/ffmpeg/libavcodec/encode.h | 5 + .../ffmpeg/libavcodec/error_resilience.c | 15 +- .../ffmpeg/libavcodec/error_resilience.h | 12 +- .../third_party/ffmpeg/libavcodec/escape124.c | 7 +- .../third_party/ffmpeg/libavcodec/evc.h | 2 +- .../ffmpeg/libavcodec/evc_frame_merge_bsf.c | 3 +- .../third_party/ffmpeg/libavcodec/evc_parse.c | 1 - .../third_party/ffmpeg/libavcodec/evc_parse.h | 1 - .../ffmpeg/libavcodec/evc_parser.c | 2 +- .../third_party/ffmpeg/libavcodec/evc_ps.c | 62 +- .../third_party/ffmpeg/libavcodec/exr.c | 14 +- .../ffmpeg/libavcodec/extract_extradata_bsf.c | 47 +- .../third_party/ffmpeg/libavcodec/faandct.c | 1 + .../third_party/ffmpeg/libavcodec/faanidct.c | 1 + .../third_party/ffmpeg/libavcodec/faxcompr.c | 6 +- .../third_party/ffmpeg/libavcodec/fdctdsp.c | 1 - .../third_party/ffmpeg/libavcodec/fdctdsp.h | 19 +- .../third_party/ffmpeg/libavcodec/ffjni.c | 1 + .../third_party/ffmpeg/libavcodec/fflcms2.c | 51 + .../third_party/ffmpeg/libavcodec/fflcms2.h | 7 + .../third_party/ffmpeg/libavcodec/ffv1dec.c | 40 +- .../third_party/ffmpeg/libavcodec/ffv1enc.c | 9 +- .../third_party/ffmpeg/libavcodec/flac.c | 18 +- .../ffmpeg/libavcodec/flac_parse.h | 4 +- .../third_party/ffmpeg/libavcodec/flacdec.c | 12 +- .../third_party/ffmpeg/libavcodec/flicvideo.c | 280 +++- .../third_party/ffmpeg/libavcodec/fraps.c | 9 +- .../third_party/ffmpeg/libavcodec/g2meet.c | 4 +- .../third_party/ffmpeg/libavcodec/g722dsp.c | 2 + .../third_party/ffmpeg/libavcodec/g722dsp.h | 1 + .../ffmpeg/libavcodec/g729postfilter.c | 4 +- .../third_party/ffmpeg/libavcodec/get_bits.h | 50 +- .../third_party/ffmpeg/libavcodec/gif.c | 3 +- .../third_party/ffmpeg/libavcodec/gifdec.c | 85 +- .../third_party/ffmpeg/libavcodec/h261dec.c | 8 +- .../third_party/ffmpeg/libavcodec/h263dec.c | 11 +- .../third_party/ffmpeg/libavcodec/h2645_sei.c | 112 ++ .../third_party/ffmpeg/libavcodec/h2645_sei.h | 16 + .../ffmpeg/libavcodec/h264_cavlc.c | 32 +- .../third_party/ffmpeg/libavcodec/h264_mb.c | 1 + .../ffmpeg/libavcodec/h264_metadata_bsf.c | 3 +- .../ffmpeg/libavcodec/h264_mvpred.h | 132 ++ .../ffmpeg/libavcodec/h264_parse.c | 14 +- .../ffmpeg/libavcodec/h264_picture.c | 13 +- .../ffmpeg/libavcodec/h264_slice.c | 74 +- .../third_party/ffmpeg/libavcodec/h264dec.c | 64 +- .../third_party/ffmpeg/libavcodec/h264dec.h | 136 +- .../ffmpeg/libavcodec/h266_metadata_bsf.c | 2 +- .../third_party/ffmpeg/libavcodec/h274.c | 32 +- .../third_party/ffmpeg/libavcodec/h274.h | 15 + .../third_party/ffmpeg/libavcodec/hcadec.c | 205 ++- .../third_party/ffmpeg/libavcodec/hevc_ps.c | 21 +- .../third_party/ffmpeg/libavcodec/hevc_refs.c | 14 +- .../third_party/ffmpeg/libavcodec/hevc_sei.c | 50 - .../third_party/ffmpeg/libavcodec/hevc_sei.h | 16 - .../third_party/ffmpeg/libavcodec/hevcdec.c | 152 +- .../third_party/ffmpeg/libavcodec/hevcdec.h | 2 + .../ffmpeg/libavcodec/hevcpred_template.c | 11 +- .../third_party/ffmpeg/libavcodec/hq_hqa.c | 4 +- .../ffmpeg/libavcodec/hq_hqadata.c | 4 +- .../third_party/ffmpeg/libavcodec/hqx.c | 4 +- .../third_party/ffmpeg/libavcodec/hqxvlc.c | 4 +- .../third_party/ffmpeg/libavcodec/huffman.c | 2 +- .../ffmpeg/libavcodec/huffyuvdec.c | 24 +- .../ffmpeg/libavcodec/huffyuvenc.c | 1 + .../ffmpeg/libavcodec/hwaccel_internal.h | 179 ++ .../third_party/ffmpeg/libavcodec/hwaccels.h | 128 +- .../third_party/ffmpeg/libavcodec/hwconfig.h | 7 +- .../third_party/ffmpeg/libavcodec/idctdsp.h | 21 +- .../third_party/ffmpeg/libavcodec/iirfilter.c | 4 + .../third_party/ffmpeg/libavcodec/imc.c | 6 +- .../third_party/ffmpeg/libavcodec/imm4.c | 11 +- .../third_party/ffmpeg/libavcodec/indeo2.c | 4 +- .../third_party/ffmpeg/libavcodec/internal.h | 26 - .../ffmpeg/libavcodec/interplayvideo.c | 3 +- .../third_party/ffmpeg/libavcodec/intrax8.c | 4 +- .../ffmpeg/libavcodec/ituh263dec.c | 14 +- .../third_party/ffmpeg/libavcodec/ivi.c | 12 +- .../third_party/ffmpeg/libavcodec/jfdctfst.c | 2 +- .../ffmpeg/libavcodec/jfdctint_template.c | 2 +- .../third_party/ffmpeg/libavcodec/jni.c | 4 +- .../ffmpeg/libavcodec/jpeg2000dec.c | 14 +- .../ffmpeg/libavcodec/jpeg2000htdec.c | 28 +- .../third_party/ffmpeg/libavcodec/jpegls.c | 1 + .../third_party/ffmpeg/libavcodec/jpegxl.h | 94 ++ .../ffmpeg/libavcodec/jpegxl_parse.c | 520 ++++++ .../ffmpeg/libavcodec/jpegxl_parse.h | 72 + .../ffmpeg/libavcodec/jpegxl_parser.c | 1472 +++++++++++++++++ .../third_party/ffmpeg/libavcodec/kbdwin.c | 24 +- .../third_party/ffmpeg/libavcodec/kbdwin.h | 10 +- .../third_party/ffmpeg/libavcodec/lagarith.c | 68 +- .../ffmpeg/libavcodec/lagarithrac.h | 3 +- .../third_party/ffmpeg/libavcodec/lcldec.c | 11 +- .../third_party/ffmpeg/libavcodec/libaomdec.c | 18 +- .../third_party/ffmpeg/libavcodec/libaomenc.c | 19 +- .../ffmpeg/libavcodec/libaribb24.c | 55 +- .../ffmpeg/libavcodec/libaribcaption.c | 12 +- .../ffmpeg/libavcodec/libfdk-aacenc.c | 28 +- .../third_party/ffmpeg/libavcodec/libjxldec.c | 41 +- .../ffmpeg/libavcodec/libkvazaar.c | 6 +- .../ffmpeg/libavcodec/libopenh264dec.c | 3 +- .../ffmpeg/libavcodec/libopenh264enc.c | 40 +- .../third_party/ffmpeg/libavcodec/libsvtav1.c | 14 +- .../third_party/ffmpeg/libavcodec/libvpxdec.c | 24 +- .../third_party/ffmpeg/libavcodec/libvpxenc.c | 7 +- .../third_party/ffmpeg/libavcodec/libx264.c | 106 +- .../third_party/ffmpeg/libavcodec/libx265.c | 2 +- .../third_party/ffmpeg/libavcodec/magicyuv.c | 93 +- .../ffmpeg/libavcodec/magicyuvenc.c | 154 +- .../ffmpeg/libavcodec/mediacodec_wrapper.c | 76 +- .../ffmpeg/libavcodec/mediacodecenc.c | 35 +- .../third_party/ffmpeg/libavcodec/mfenc.c | 4 +- .../third_party/ffmpeg/libavcodec/mimic.c | 2 +- .../ffmpeg/libavcodec/mips/Makefile | 1 - .../third_party/ffmpeg/libavcodec/mjpegdec.c | 35 +- .../ffmpeg/libavcodec/mjpegdec_common.c | 2 +- .../third_party/ffmpeg/libavcodec/mlpdec.c | 6 +- .../third_party/ffmpeg/libavcodec/mlpenc.c | 54 +- .../third_party/ffmpeg/libavcodec/mmaldec.c | 4 +- .../third_party/ffmpeg/libavcodec/mobiclip.c | 8 +- .../ffmpeg/libavcodec/motionpixels.c | 4 +- .../third_party/ffmpeg/libavcodec/mpc.c | 2 +- .../third_party/ffmpeg/libavcodec/mpc7.c | 10 +- .../third_party/ffmpeg/libavcodec/mpc8.c | 4 +- .../third_party/ffmpeg/libavcodec/mpeg12.c | 16 +- .../third_party/ffmpeg/libavcodec/mpeg12dec.c | 35 +- .../third_party/ffmpeg/libavcodec/mpeg12enc.c | 16 +- .../ffmpeg/libavcodec/mpeg4videodec.c | 31 +- .../ffmpeg/libavcodec/mpeg4videoenc.c | 4 +- .../ffmpeg/libavcodec/mpegaudiodec_common.c | 8 +- .../ffmpeg/libavcodec/mpegaudiodsp.c | 6 +- .../ffmpeg/libavcodec/mpegpicture.c | 15 +- .../third_party/ffmpeg/libavcodec/mpegutils.c | 1 + .../ffmpeg/libavcodec/mpegvideo_dec.c | 57 +- .../ffmpeg/libavcodec/mpegvideo_enc.c | 4 +- .../ffmpeg/libavcodec/mpegvideo_parser.c | 66 +- .../ffmpeg/libavcodec/msmpeg4_vc1_data.c | 10 +- .../ffmpeg/libavcodec/msmpeg4dec.c | 22 +- .../ffmpeg/libavcodec/msmpeg4enc.c | 3 +- .../third_party/ffmpeg/libavcodec/mss2.c | 9 +- .../third_party/ffmpeg/libavcodec/mss4.c | 4 +- .../third_party/ffmpeg/libavcodec/mv30.c | 5 +- .../third_party/ffmpeg/libavcodec/mvha.c | 6 +- .../third_party/ffmpeg/libavcodec/mwsc.c | 3 +- .../third_party/ffmpeg/libavcodec/notchlc.c | 5 +- .../third_party/ffmpeg/libavcodec/nuv.c | 4 +- .../third_party/ffmpeg/libavcodec/nvdec_av1.c | 11 +- .../ffmpeg/libavcodec/nvdec_h264.c | 11 +- .../ffmpeg/libavcodec/nvdec_hevc.c | 11 +- .../ffmpeg/libavcodec/nvdec_mjpeg.c | 11 +- .../ffmpeg/libavcodec/nvdec_mpeg12.c | 21 +- .../ffmpeg/libavcodec/nvdec_mpeg4.c | 11 +- .../third_party/ffmpeg/libavcodec/nvdec_vc1.c | 21 +- .../third_party/ffmpeg/libavcodec/nvdec_vp8.c | 11 +- .../third_party/ffmpeg/libavcodec/nvdec_vp9.c | 11 +- .../third_party/ffmpeg/libavcodec/nvenc.c | 53 +- .../third_party/ffmpeg/libavcodec/nvenc.h | 1 + .../ffmpeg/libavcodec/nvenc_h264.c | 2 + .../ffmpeg/libavcodec/nvenc_hevc.c | 4 +- .../third_party/ffmpeg/libavcodec/omx.c | 19 +- .../third_party/ffmpeg/libavcodec/on2avc.c | 42 +- .../ffmpeg/libavcodec/options_table.h | 8 +- .../third_party/ffmpeg/libavcodec/opus_silk.c | 10 +- .../third_party/ffmpeg/libavcodec/opus_silk.h | 3 +- .../third_party/ffmpeg/libavcodec/osq.c | 481 ++++++ .../third_party/ffmpeg/libavcodec/parsers.c | 4 +- .../third_party/ffmpeg/libavcodec/pcm.c | 3 +- .../third_party/ffmpeg/libavcodec/pcx.c | 3 +- .../third_party/ffmpeg/libavcodec/pdvdec.c | 3 +- .../third_party/ffmpeg/libavcodec/photocd.c | 6 +- .../third_party/ffmpeg/libavcodec/pngenc.c | 3 +- .../third_party/ffmpeg/libavcodec/pnmdec.c | 2 +- .../ffmpeg/libavcodec/ppc/Makefile | 3 - .../ffmpeg/libavcodec/ppc/fdctdsp.c | 1 + .../ffmpeg/libavcodec/ppc/idctdsp.c | 1 + .../libavcodec/ppc/mpegaudiodsp_altivec.c | 2 + .../third_party/ffmpeg/libavcodec/profiles.c | 240 +-- .../third_party/ffmpeg/libavcodec/profiles.h | 46 +- .../third_party/ffmpeg/libavcodec/proresdec.h | 5 + .../ffmpeg/libavcodec/proresdec2.c | 26 +- .../third_party/ffmpeg/libavcodec/proresdsp.c | 8 +- .../third_party/ffmpeg/libavcodec/proresdsp.h | 5 +- .../ffmpeg/libavcodec/proresenc_anatoliy.c | 75 +- .../ffmpeg/libavcodec/pthread_frame.c | 75 +- .../ffmpeg/libavcodec/qdm2_tablegen.h | 4 +- .../third_party/ffmpeg/libavcodec/qdmc.c | 4 +- .../third_party/ffmpeg/libavcodec/qpeg.c | 3 +- .../third_party/ffmpeg/libavcodec/qsvenc.c | 12 +- .../ffmpeg/libavcodec/qsvenc_hevc.c | 2 +- .../third_party/ffmpeg/libavcodec/qtrleenc.c | 3 +- .../third_party/ffmpeg/libavcodec/ralf.c | 14 +- .../third_party/ffmpeg/libavcodec/rasc.c | 10 +- .../ffmpeg/libavcodec/ratecontrol.c | 1 + .../third_party/ffmpeg/libavcodec/raw.c | 2 + .../ffmpeg/libavcodec/riscv/Makefile | 2 + .../ffmpeg/libavcodec/riscv/aacpsdsp_rvv.S | 64 +- .../ffmpeg/libavcodec/riscv/audiodsp_rvv.S | 4 +- .../ffmpeg/libavcodec/riscv/bswapdsp_rvb.S | 43 +- .../ffmpeg/libavcodec/riscv/fmtconvert_rvv.S | 2 +- .../ffmpeg/libavcodec/riscv/g722dsp_init.c | 40 + .../ffmpeg/libavcodec/riscv/g722dsp_rvv.S | 66 + .../libavcodec/riscv/h264_chroma_init_riscv.c | 8 + .../ffmpeg/libavcodec/riscv/h264_mc_chroma.S | 237 ++- .../third_party/ffmpeg/libavcodec/rka.c | 54 +- .../third_party/ffmpeg/libavcodec/rl.c | 4 +- .../third_party/ffmpeg/libavcodec/rl.h | 2 +- .../third_party/ffmpeg/libavcodec/roqvideo.c | 4 +- .../third_party/ffmpeg/libavcodec/roqvideo.h | 4 +- .../ffmpeg/libavcodec/roqvideodec.c | 8 +- .../ffmpeg/libavcodec/roqvideoenc.c | 8 +- .../third_party/ffmpeg/libavcodec/rpzaenc.c | 33 +- .../third_party/ffmpeg/libavcodec/rtjpeg.c | 2 +- .../third_party/ffmpeg/libavcodec/rtjpeg.h | 4 +- .../third_party/ffmpeg/libavcodec/rtv1.c | 8 +- .../third_party/ffmpeg/libavcodec/rv10.c | 8 +- .../third_party/ffmpeg/libavcodec/rv34.c | 10 +- .../ffmpeg/libavcodec/rv34_parser.c | 19 +- .../third_party/ffmpeg/libavcodec/rv40.c | 8 +- .../third_party/ffmpeg/libavcodec/sbcenc.c | 5 +- .../ffmpeg/libavcodec/sbrdsp_template.c | 267 +++ .../third_party/ffmpeg/libavcodec/sga.c | 7 +- .../ffmpeg/libavcodec/sheervideo.c | 8 +- .../third_party/ffmpeg/libavcodec/shorten.c | 2 +- .../third_party/ffmpeg/libavcodec/sipr.c | 1 - .../third_party/ffmpeg/libavcodec/sipr.h | 3 - .../third_party/ffmpeg/libavcodec/smacker.c | 12 +- .../third_party/ffmpeg/libavcodec/smcenc.c | 5 +- .../third_party/ffmpeg/libavcodec/snow.c | 94 +- .../third_party/ffmpeg/libavcodec/snow.h | 287 +--- .../third_party/ffmpeg/libavcodec/snow_dwt.h | 40 + .../third_party/ffmpeg/libavcodec/snowdec.c | 168 +- .../third_party/ffmpeg/libavcodec/snowenc.c | 558 ++++--- .../ffmpeg/libavcodec/speedhqdec.c | 14 +- .../third_party/ffmpeg/libavcodec/svq1dec.c | 23 +- .../third_party/ffmpeg/libavcodec/svq1enc.c | 3 +- .../third_party/ffmpeg/libavcodec/tak.c | 4 +- .../third_party/ffmpeg/libavcodec/tak.h | 5 +- .../ffmpeg/libavcodec/tests/.gitignore | 6 +- .../ffmpeg/libavcodec/tests/av1_levels.c | 126 ++ .../ffmpeg/libavcodec/tests/codec_desc.c | 2 +- .../third_party/ffmpeg/libavcodec/tests/dct.c | 2 + .../ffmpeg/libavcodec/tests/h264_levels.c | 6 +- .../ffmpeg/libavcodec/tests/motion.c | 1 + .../third_party/ffmpeg/libavcodec/thread.h | 11 +- .../ffmpeg/libavcodec/threadframe.h | 2 - .../third_party/ffmpeg/libavcodec/tiff.c | 6 +- .../ffmpeg/libavcodec/trace_headers_bsf.c | 2 + .../ffmpeg/libavcodec/truemotion2.c | 5 +- .../third_party/ffmpeg/libavcodec/tscc2.c | 4 +- .../third_party/ffmpeg/libavcodec/tta.c | 11 +- .../third_party/ffmpeg/libavcodec/ttadata.c | 3 +- .../third_party/ffmpeg/libavcodec/ttadsp.c | 3 +- .../third_party/ffmpeg/libavcodec/ttmlenc.c | 2 +- .../third_party/ffmpeg/libavcodec/utils.c | 88 +- .../third_party/ffmpeg/libavcodec/utvideo.h | 34 +- .../ffmpeg/libavcodec/utvideodec.c | 127 +- .../ffmpeg/libavcodec/utvideoenc.c | 18 +- .../third_party/ffmpeg/libavcodec/v210dec.c | 9 +- .../ffmpeg/libavcodec/v4l2_context.c | 8 +- .../ffmpeg/libavcodec/v4l2_m2m_enc.c | 36 +- .../third_party/ffmpeg/libavcodec/vaapi_av1.c | 13 +- .../ffmpeg/libavcodec/vaapi_decode.c | 5 +- .../ffmpeg/libavcodec/vaapi_encode.c | 402 +++-- .../ffmpeg/libavcodec/vaapi_encode.h | 43 +- .../ffmpeg/libavcodec/vaapi_encode_av1.c | 951 +++++++++++ .../ffmpeg/libavcodec/vaapi_encode_h264.c | 162 +- .../ffmpeg/libavcodec/vaapi_encode_h265.c | 114 +- .../ffmpeg/libavcodec/vaapi_encode_mjpeg.c | 10 +- .../ffmpeg/libavcodec/vaapi_encode_mpeg2.c | 22 +- .../ffmpeg/libavcodec/vaapi_encode_vp8.c | 8 +- .../ffmpeg/libavcodec/vaapi_encode_vp9.c | 36 +- .../ffmpeg/libavcodec/vaapi_h264.c | 12 +- .../ffmpeg/libavcodec/vaapi_hevc.c | 30 +- .../ffmpeg/libavcodec/vaapi_mjpeg.c | 12 +- .../ffmpeg/libavcodec/vaapi_mpeg2.c | 12 +- .../ffmpeg/libavcodec/vaapi_mpeg4.c | 22 +- .../third_party/ffmpeg/libavcodec/vaapi_vc1.c | 23 +- .../third_party/ffmpeg/libavcodec/vaapi_vp8.c | 12 +- .../third_party/ffmpeg/libavcodec/vaapi_vp9.c | 12 +- .../third_party/ffmpeg/libavcodec/vc1dec.c | 124 +- .../third_party/ffmpeg/libavcodec/vdpau.c | 5 +- .../third_party/ffmpeg/libavcodec/vdpau_av1.c | 18 +- .../ffmpeg/libavcodec/vdpau_h264.c | 34 +- .../ffmpeg/libavcodec/vdpau_hevc.c | 20 +- .../ffmpeg/libavcodec/vdpau_mpeg12.c | 26 +- .../ffmpeg/libavcodec/vdpau_mpeg4.c | 18 +- .../third_party/ffmpeg/libavcodec/vdpau_vc1.c | 28 +- .../third_party/ffmpeg/libavcodec/vdpau_vp9.c | 21 +- .../third_party/ffmpeg/libavcodec/version.h | 2 +- .../ffmpeg/libavcodec/version_major.h | 3 + .../ffmpeg/libavcodec/videotoolbox.c | 71 +- .../ffmpeg/libavcodec/videotoolbox_vp9.c | 11 +- .../ffmpeg/libavcodec/videotoolboxenc.c | 315 ++-- .../third_party/ffmpeg/libavcodec/vlc.c | 198 ++- .../third_party/ffmpeg/libavcodec/vlc.h | 142 +- .../third_party/ffmpeg/libavcodec/vmdvideo.c | 3 +- .../third_party/ffmpeg/libavcodec/vmixdec.c | 57 +- .../third_party/ffmpeg/libavcodec/vorbis.c | 8 +- .../third_party/ffmpeg/libavcodec/vorbis.h | 4 +- .../third_party/ffmpeg/libavcodec/vorbisdec.c | 6 +- .../third_party/ffmpeg/libavcodec/vp3.c | 352 ++-- .../third_party/ffmpeg/libavcodec/vp56.c | 6 +- .../third_party/ffmpeg/libavcodec/vp6.c | 8 +- .../third_party/ffmpeg/libavcodec/vp8.c | 30 +- .../third_party/ffmpeg/libavcodec/vp9.c | 32 +- .../third_party/ffmpeg/libavcodec/vqcdec.c | 2 +- .../ffmpeg/libavcodec/vulkan_av1.c | 38 +- .../ffmpeg/libavcodec/vulkan_decode.c | 68 +- .../ffmpeg/libavcodec/vulkan_decode.h | 17 +- .../ffmpeg/libavcodec/vulkan_h264.c | 58 +- .../ffmpeg/libavcodec/vulkan_hevc.c | 171 +- .../ffmpeg/libavcodec/vulkan_video.c | 45 + .../ffmpeg/libavcodec/vulkan_video.h | 7 + .../ffmpeg/libavcodec/vvc_mp4toannexb_bsf.c | 4 +- .../ffmpeg/libavcodec/vvc_parser.c | 4 +- .../third_party/ffmpeg/libavcodec/wavarc.c | 122 +- .../third_party/ffmpeg/libavcodec/wavpack.c | 148 +- .../ffmpeg/libavcodec/wavpackenc.c | 11 +- .../third_party/ffmpeg/libavcodec/webp.c | 8 +- .../third_party/ffmpeg/libavcodec/wma.c | 8 +- .../third_party/ffmpeg/libavcodec/wmadec.c | 4 +- .../third_party/ffmpeg/libavcodec/wmaprodec.c | 14 +- .../third_party/ffmpeg/libavcodec/wmavoice.c | 100 +- .../third_party/ffmpeg/libavcodec/wnv1.c | 4 +- .../ffmpeg/libavcodec/x86/Makefile | 8 +- .../ffmpeg/libavcodec/x86/hpeldsp.asm | 77 + .../ffmpeg/libavcodec/x86/hpeldsp.h | 4 - .../ffmpeg/libavcodec/x86/hpeldsp_init.c | 14 +- .../ffmpeg/libavcodec/x86/idctdsp_init.c | 2 + .../ffmpeg/libavcodec/x86/mpegaudiodsp.c | 6 + .../libavcodec/x86/mpegvideoenc_template.c | 3 +- .../ffmpeg/libavcodec/x86/proresdsp_init.c | 4 +- .../ffmpeg/libavcodec/x86/snowdsp.c | 1 - .../third_party/ffmpeg/libavcodec/xan.c | 3 +- .../third_party/ffmpeg/libavcodec/xvididct.c | 26 +- .../third_party/ffmpeg/libavcodec/ylc.c | 6 +- .../third_party/ffmpeg/libavcodec/yuv4enc.c | 21 +- .../third_party/ffmpeg/libavcodec/zerocodec.c | 3 +- .../third_party/ffmpeg/libavutil/Makefile | 4 + .../autorename_libavutil_aarch64_cpu.c | 2 + .../third_party/ffmpeg/libavutil/audio_fifo.c | 9 +- .../third_party/ffmpeg/libavutil/audio_fifo.h | 9 +- .../third_party/ffmpeg/libavutil/avstring.c | 1 - .../third_party/ffmpeg/libavutil/avstring.h | 3 +- .../third_party/ffmpeg/libavutil/avutil.h | 6 +- .../third_party/ffmpeg/libavutil/bprint.c | 7 +- .../third_party/ffmpeg/libavutil/bprint.h | 3 + .../ffmpeg/libavutil/channel_layout.c | 12 +- .../ffmpeg/libavutil/channel_layout.h | 16 +- .../third_party/ffmpeg/libavutil/common.h | 1 + .../third_party/ffmpeg/libavutil/dict.c | 4 +- .../third_party/ffmpeg/libavutil/emms.h | 66 + .../ffmpeg/libavutil/encryption_info.c | 2 + .../third_party/ffmpeg/libavutil/executor.c | 201 +++ .../third_party/ffmpeg/libavutil/executor.h | 67 + .../third_party/ffmpeg/libavutil/fifo.c | 5 +- .../third_party/ffmpeg/libavutil/fifo.h | 4 +- .../third_party/ffmpeg/libavutil/file.c | 1 + .../third_party/ffmpeg/libavutil/frame.c | 8 +- .../third_party/ffmpeg/libavutil/frame.h | 10 + .../third_party/ffmpeg/libavutil/hash.c | 2 + .../third_party/ffmpeg/libavutil/hmac.c | 1 + .../third_party/ffmpeg/libavutil/hwcontext.c | 6 +- .../ffmpeg/libavutil/hwcontext_cuda.c | 30 +- .../ffmpeg/libavutil/hwcontext_cuda.h | 5 + .../ffmpeg/libavutil/hwcontext_d3d11va.c | 8 +- .../ffmpeg/libavutil/hwcontext_dxva2.c | 4 +- .../ffmpeg/libavutil/hwcontext_qsv.c | 2 +- .../ffmpeg/libavutil/hwcontext_vaapi.c | 3 + .../ffmpeg/libavutil/hwcontext_vulkan.c | 71 +- .../third_party/ffmpeg/libavutil/imgutils.c | 14 +- .../third_party/ffmpeg/libavutil/imgutils.h | 26 +- .../third_party/ffmpeg/libavutil/internal.h | 8 - .../ffmpeg/libavutil/intreadwrite.h | 4 +- .../third_party/ffmpeg/libavutil/md5.c | 2 + .../third_party/ffmpeg/libavutil/mem.h | 4 +- .../third_party/ffmpeg/libavutil/murmur3.c | 1 + .../third_party/ffmpeg/libavutil/pixdesc.c | 28 + .../third_party/ffmpeg/libavutil/pixfmt.h | 4 + .../ffmpeg/libavutil/riscv/bswap_rvb.S | 65 + .../ffmpeg/libavutil/riscv/float_dsp_rvv.S | 70 +- .../ffmpeg/libavutil/riscv/timer.h | 13 +- .../third_party/ffmpeg/libavutil/samplefmt.c | 4 +- .../third_party/ffmpeg/libavutil/samplefmt.h | 4 +- .../third_party/ffmpeg/libavutil/spherical.c | 1 + .../ffmpeg/libavutil/tests/channel_layout.c | 128 +- .../third_party/ffmpeg/libavutil/tests/lzo.c | 2 + .../ffmpeg/libavutil/tests/murmur3.c | 3 + .../ffmpeg/libavutil/tests/pixdesc.c | 1 + .../third_party/ffmpeg/libavutil/thread.h | 19 + .../ffmpeg/libavutil/threadmessage.c | 3 + .../third_party/ffmpeg/libavutil/timer.h | 4 +- .../third_party/ffmpeg/libavutil/timestamp.h | 2 +- arm/android/third_party/ffmpeg/libavutil/tx.c | 28 +- arm/android/third_party/ffmpeg/libavutil/tx.h | 34 + .../third_party/ffmpeg/libavutil/tx_priv.h | 1 + .../ffmpeg/libavutil/tx_template.c | 318 +++- .../third_party/ffmpeg/libavutil/version.h | 2 +- .../third_party/ffmpeg/libavutil/video_hint.c | 81 + .../third_party/ffmpeg/libavutil/video_hint.h | 107 ++ .../third_party/ffmpeg/libavutil/vulkan.c | 27 +- .../third_party/ffmpeg/libavutil/vulkan.h | 4 + .../ffmpeg/libavutil/vulkan_functions.h | 2 + .../ffmpeg/libavutil/vulkan_loader.h | 1 + .../ffmpeg/libavutil/wchar_filename.h | 3 +- .../config/Chrome/android/arm-neon/config.h | 10 +- .../android/arm-neon/config_components.h | 15 +- .../android/arm-neon/libavutil/ffversion.h | 2 +- .../config/Chrome/android/arm64/config.h | 10 +- .../Chrome/android/arm64/config_components.h | 15 +- .../android/arm64/libavutil/ffversion.h | 2 +- .../config/Chrome/android/ia32/config.h | 12 +- .../Chrome/android/ia32/config_components.h | 15 +- .../Chrome/android/ia32/libavutil/ffversion.h | 2 +- .../config/Chrome/android/x64/config.asm | 6 +- .../config/Chrome/android/x64/config.h | 10 +- .../Chrome/android/x64/config_components.h | 15 +- .../Chrome/android/x64/libavutil/ffversion.h | 2 +- .../chromium/config/Chrome/ios/arm64/config.h | 10 +- .../Chrome/ios/arm64/config_components.h | 15 +- .../Chrome/ios/arm64/libavutil/ffversion.h | 2 +- .../chromium/config/Chrome/ios/x64/config.asm | 6 +- .../chromium/config/Chrome/ios/x64/config.h | 10 +- .../config/Chrome/ios/x64/config_components.h | 15 +- .../Chrome/ios/x64/libavutil/ffversion.h | 2 +- .../config/Chrome/linux-noasm/x64/config.h | 12 +- .../linux-noasm/x64/config_components.h | 15 +- .../linux-noasm/x64/libavutil/ffversion.h | 2 +- .../config/Chrome/linux/arm-neon/config.h | 10 +- .../Chrome/linux/arm-neon/config_components.h | 15 +- .../linux/arm-neon/libavutil/ffversion.h | 2 +- .../chromium/config/Chrome/linux/arm/config.h | 10 +- .../Chrome/linux/arm/config_components.h | 15 +- .../Chrome/linux/arm/libavutil/ffversion.h | 2 +- .../config/Chrome/linux/arm64/config.h | 10 +- .../Chrome/linux/arm64/config_components.h | 15 +- .../Chrome/linux/arm64/libavutil/ffversion.h | 2 +- .../config/Chrome/linux/ia32/config.asm | 8 +- .../config/Chrome/linux/ia32/config.h | 12 +- .../Chrome/linux/ia32/config_components.h | 15 +- .../Chrome/linux/ia32/libavutil/ffversion.h | 2 +- .../config/Chrome/linux/x64/config.asm | 6 +- .../chromium/config/Chrome/linux/x64/config.h | 10 +- .../Chrome/linux/x64/config_components.h | 15 +- .../Chrome/linux/x64/libavutil/ffversion.h | 2 +- .../chromium/config/Chrome/mac/arm64/config.h | 10 +- .../Chrome/mac/arm64/config_components.h | 15 +- .../Chrome/mac/arm64/libavutil/ffversion.h | 2 +- .../chromium/config/Chrome/mac/x64/config.asm | 6 +- .../chromium/config/Chrome/mac/x64/config.h | 10 +- .../config/Chrome/mac/x64/config_components.h | 15 +- .../Chrome/mac/x64/libavutil/ffversion.h | 2 +- .../chromium/config/Chrome/win/arm64/config.h | 10 +- .../Chrome/win/arm64/config_components.h | 15 +- .../Chrome/win/arm64/libavutil/ffversion.h | 2 +- .../config/Chrome/win/ia32/config.asm | 8 +- .../chromium/config/Chrome/win/ia32/config.h | 12 +- .../Chrome/win/ia32/config_components.h | 15 +- .../Chrome/win/ia32/libavutil/ffversion.h | 2 +- .../chromium/config/Chrome/win/x64/config.asm | 6 +- .../chromium/config/Chrome/win/x64/config.h | 10 +- .../config/Chrome/win/x64/config_components.h | 15 +- .../Chrome/win/x64/libavutil/ffversion.h | 2 +- .../config/ChromeOS/linux-noasm/x64/config.h | 12 +- .../linux-noasm/x64/config_components.h | 15 +- .../linux-noasm/x64/libavutil/ffversion.h | 2 +- .../config/ChromeOS/linux/arm-neon/config.h | 10 +- .../linux/arm-neon/config_components.h | 15 +- .../linux/arm-neon/libavutil/ffversion.h | 2 +- .../config/ChromeOS/linux/arm/config.h | 10 +- .../ChromeOS/linux/arm/config_components.h | 15 +- .../ChromeOS/linux/arm/libavutil/ffversion.h | 2 +- .../config/ChromeOS/linux/arm64/config.h | 10 +- .../ChromeOS/linux/arm64/config_components.h | 15 +- .../linux/arm64/libavutil/ffversion.h | 2 +- .../config/ChromeOS/linux/ia32/config.asm | 8 +- .../config/ChromeOS/linux/ia32/config.h | 12 +- .../ChromeOS/linux/ia32/config_components.h | 15 +- .../ChromeOS/linux/ia32/libavutil/ffversion.h | 2 +- .../config/ChromeOS/linux/x64/config.asm | 6 +- .../config/ChromeOS/linux/x64/config.h | 10 +- .../ChromeOS/linux/x64/config_components.h | 15 +- .../ChromeOS/linux/x64/libavutil/ffversion.h | 2 +- .../config/Chromium/android/arm-neon/config.h | 10 +- .../android/arm-neon/config_components.h | 15 +- .../android/arm-neon/libavutil/ffversion.h | 2 +- .../config/Chromium/android/arm64/config.h | 10 +- .../android/arm64/config_components.h | 15 +- .../android/arm64/libavutil/ffversion.h | 2 +- .../config/Chromium/android/ia32/config.h | 12 +- .../Chromium/android/ia32/config_components.h | 15 +- .../android/ia32/libavutil/ffversion.h | 2 +- .../config/Chromium/android/x64/config.asm | 6 +- .../config/Chromium/android/x64/config.h | 10 +- .../Chromium/android/x64/config_components.h | 15 +- .../android/x64/libavutil/ffversion.h | 2 +- .../config/Chromium/ios/arm64/config.h | 10 +- .../Chromium/ios/arm64/config_components.h | 15 +- .../Chromium/ios/arm64/libavutil/ffversion.h | 2 +- .../config/Chromium/ios/x64/config.asm | 6 +- .../chromium/config/Chromium/ios/x64/config.h | 10 +- .../Chromium/ios/x64/config_components.h | 15 +- .../Chromium/ios/x64/libavutil/ffversion.h | 2 +- .../config/Chromium/linux-noasm/x64/config.h | 12 +- .../linux-noasm/x64/config_components.h | 15 +- .../linux-noasm/x64/libavutil/ffversion.h | 2 +- .../config/Chromium/linux/arm-neon/config.h | 10 +- .../linux/arm-neon/config_components.h | 15 +- .../linux/arm-neon/libavutil/ffversion.h | 2 +- .../config/Chromium/linux/arm/config.h | 10 +- .../Chromium/linux/arm/config_components.h | 15 +- .../Chromium/linux/arm/libavutil/ffversion.h | 2 +- .../config/Chromium/linux/arm64/config.h | 10 +- .../Chromium/linux/arm64/config_components.h | 15 +- .../linux/arm64/libavutil/ffversion.h | 2 +- .../config/Chromium/linux/ia32/config.asm | 8 +- .../config/Chromium/linux/ia32/config.h | 12 +- .../Chromium/linux/ia32/config_components.h | 15 +- .../Chromium/linux/ia32/libavutil/ffversion.h | 2 +- .../config/Chromium/linux/x64/config.asm | 6 +- .../config/Chromium/linux/x64/config.h | 10 +- .../Chromium/linux/x64/config_components.h | 15 +- .../Chromium/linux/x64/libavutil/ffversion.h | 2 +- .../config/Chromium/mac/arm64/config.h | 10 +- .../Chromium/mac/arm64/config_components.h | 15 +- .../Chromium/mac/arm64/libavutil/ffversion.h | 2 +- .../config/Chromium/mac/x64/config.asm | 6 +- .../chromium/config/Chromium/mac/x64/config.h | 10 +- .../Chromium/mac/x64/config_components.h | 15 +- .../Chromium/mac/x64/libavutil/ffversion.h | 2 +- .../config/Chromium/win/arm64/config.h | 10 +- .../Chromium/win/arm64/config_components.h | 15 +- .../Chromium/win/arm64/libavutil/ffversion.h | 2 +- .../config/Chromium/win/ia32/config.asm | 8 +- .../config/Chromium/win/ia32/config.h | 12 +- .../Chromium/win/ia32/config_components.h | 15 +- .../Chromium/win/ia32/libavutil/ffversion.h | 2 +- .../config/Chromium/win/x64/config.asm | 6 +- .../chromium/config/Chromium/win/x64/config.h | 10 +- .../Chromium/win/x64/config_components.h | 15 +- .../Chromium/win/x64/libavutil/ffversion.h | 2 +- .../third_party/ffmpeg/chromium/ffmpeg.sigs | 1 + .../ffmpeg/chromium/patches/README | 192 +-- .../chromium/patches/config_flag_changes.txt | 23 + .../ffmpeg/chromium/scripts/build_ffmpeg.py | 4 +- .../third_party/ffmpeg/ffmpeg_generated.gni | 151 +- arm/raspi/third_party/ffmpeg/libavcodec/4xm.c | 10 +- .../third_party/ffmpeg/libavcodec/8bps.c | 72 +- .../third_party/ffmpeg/libavcodec/Makefile | 31 +- .../ffmpeg/libavcodec/aacdec_template.c | 26 +- .../third_party/ffmpeg/libavcodec/aacenc.c | 14 +- .../ffmpeg/libavcodec/aacenc_ltp.c | 4 +- .../ffmpeg/libavcodec/aacenc_pred.c | 2 +- .../ffmpeg/libavcodec/aacenc_tns.c | 2 +- .../third_party/ffmpeg/libavcodec/aacenctab.h | 8 +- .../ffmpeg/libavcodec/aacps_common.c | 2 +- .../third_party/ffmpeg/libavcodec/aacsbr.h | 2 +- .../ffmpeg/libavcodec/aacsbr_template.c | 2 +- .../ffmpeg/libavcodec/aacsbrdata.h | 266 --- .../third_party/ffmpeg/libavcodec/aactab.c | 4 +- .../ffmpeg/libavcodec/aarch64/Makefile | 3 - .../libavcodec/aarch64/hevcdsp_epel_neon.S | 621 ++++++- .../libavcodec/aarch64/hevcdsp_idct_neon.S | 8 +- .../libavcodec/aarch64/hevcdsp_init_aarch64.c | 20 + .../libavcodec/aarch64/hevcdsp_qpel_neon.S | 588 +++++++ .../libavcodec/aarch64/synth_filter_init.c | 7 - .../libavcodec/aarch64/synth_filter_neon.S | 2 - .../third_party/ffmpeg/libavcodec/ac3dec.c | 4 +- .../third_party/ffmpeg/libavcodec/ac3enc.c | 1 + .../ffmpeg/libavcodec/ac3enc_fixed.c | 2 +- .../ffmpeg/libavcodec/ac3enc_float.c | 2 +- arm/raspi/third_party/ffmpeg/libavcodec/adx.h | 4 +- .../ffmpeg/libavcodec/adx_parser.c | 10 + .../third_party/ffmpeg/libavcodec/adxdec.c | 2 +- arm/raspi/third_party/ffmpeg/libavcodec/agm.c | 11 +- .../third_party/ffmpeg/libavcodec/alac.c | 54 +- .../third_party/ffmpeg/libavcodec/allcodecs.c | 2 + .../ffmpeg/libavcodec/alpha/idctdsp_alpha.c | 1 + .../third_party/ffmpeg/libavcodec/amfenc.c | 8 +- .../ffmpeg/libavcodec/amfenc_av1.c | 4 +- .../ffmpeg/libavcodec/amfenc_h264.c | 12 +- .../ffmpeg/libavcodec/amfenc_hevc.c | 4 +- .../third_party/ffmpeg/libavcodec/apedec.c | 134 +- .../third_party/ffmpeg/libavcodec/arbc.c | 3 +- .../ffmpeg/libavcodec/arm/Makefile | 7 - .../libavcodec/arm/synth_filter_init_arm.c | 1 - .../third_party/ffmpeg/libavcodec/asvdec.c | 10 +- .../third_party/ffmpeg/libavcodec/asvenc.c | 1 - .../third_party/ffmpeg/libavcodec/atrac3.c | 4 +- .../ffmpeg/libavcodec/atrac3plus.c | 4 +- .../third_party/ffmpeg/libavcodec/atrac9dec.c | 4 +- .../ffmpeg/libavcodec/audiotoolboxenc.c | 25 +- arm/raspi/third_party/ffmpeg/libavcodec/av1.h | 7 + .../ffmpeg/libavcodec/av1_levels.c | 92 ++ .../ffmpeg/libavcodec/av1_levels.h | 58 + .../third_party/ffmpeg/libavcodec/av1dec.c | 93 +- .../third_party/ffmpeg/libavcodec/avcodec.c | 9 + .../third_party/ffmpeg/libavcodec/avcodec.h | 167 +- .../third_party/ffmpeg/libavcodec/avfft.c | 195 ++- .../third_party/ffmpeg/libavcodec/avfft.h | 31 + .../third_party/ffmpeg/libavcodec/avpacket.c | 1 + .../third_party/ffmpeg/libavcodec/bgmc.c | 4 +- .../third_party/ffmpeg/libavcodec/bgmc.h | 3 +- .../third_party/ffmpeg/libavcodec/bink.c | 8 +- .../third_party/ffmpeg/libavcodec/bitstream.h | 2 + .../ffmpeg/libavcodec/bitstream_template.h | 31 +- .../third_party/ffmpeg/libavcodec/bonk.c | 2 +- .../third_party/ffmpeg/libavcodec/cavsdec.c | 1 + arm/raspi/third_party/ffmpeg/libavcodec/cbs.c | 155 +- arm/raspi/third_party/ffmpeg/libavcodec/cbs.h | 88 +- .../third_party/ffmpeg/libavcodec/cbs_av1.c | 273 ++- .../third_party/ffmpeg/libavcodec/cbs_av1.h | 4 + .../libavcodec/cbs_av1_syntax_template.c | 16 +- .../third_party/ffmpeg/libavcodec/cbs_bsf.c | 5 + .../third_party/ffmpeg/libavcodec/cbs_h2645.c | 153 +- .../third_party/ffmpeg/libavcodec/cbs_h266.h | 7 + .../libavcodec/cbs_h266_syntax_template.c | 312 ++-- .../ffmpeg/libavcodec/cbs_internal.h | 96 +- .../third_party/ffmpeg/libavcodec/cbs_mpeg2.c | 15 +- .../third_party/ffmpeg/libavcodec/cbs_vp9.c | 122 +- .../ffmpeg/libavcodec/cdgraphics.c | 37 +- .../third_party/ffmpeg/libavcodec/cdxl.c | 5 +- .../third_party/ffmpeg/libavcodec/celp_math.h | 2 +- .../third_party/ffmpeg/libavcodec/cfhddata.c | 4 +- .../ffmpeg/libavcodec/clearvideo.c | 12 +- .../third_party/ffmpeg/libavcodec/cllc.c | 14 +- .../third_party/ffmpeg/libavcodec/codec.h | 2 +- .../ffmpeg/libavcodec/codec_desc.c | 7 + .../ffmpeg/libavcodec/codec_desc.h | 2 +- .../third_party/ffmpeg/libavcodec/codec_id.h | 1 + .../third_party/ffmpeg/libavcodec/codec_par.c | 6 +- .../third_party/ffmpeg/libavcodec/codec_par.h | 10 +- .../third_party/ffmpeg/libavcodec/cook.c | 8 +- .../third_party/ffmpeg/libavcodec/cscd.c | 7 +- .../third_party/ffmpeg/libavcodec/cuviddec.c | 7 +- .../third_party/ffmpeg/libavcodec/dca_core.c | 9 +- .../third_party/ffmpeg/libavcodec/dca_lbr.c | 2 +- .../ffmpeg/libavcodec/dca_parser.c | 16 +- .../third_party/ffmpeg/libavcodec/dca_xll.c | 6 +- .../third_party/ffmpeg/libavcodec/dcadec.c | 9 +- .../third_party/ffmpeg/libavcodec/dcahuff.c | 8 +- arm/raspi/third_party/ffmpeg/libavcodec/dct.h | 34 +- .../third_party/ffmpeg/libavcodec/decode.c | 72 +- .../third_party/ffmpeg/libavcodec/decode.h | 17 +- .../third_party/ffmpeg/libavcodec/defs.h | 143 ++ .../third_party/ffmpeg/libavcodec/dirac.c | 3 + .../third_party/ffmpeg/libavcodec/dirac.h | 6 +- .../third_party/ffmpeg/libavcodec/dirac_dwt.c | 1 + .../third_party/ffmpeg/libavcodec/dnxhddata.c | 14 +- .../third_party/ffmpeg/libavcodec/dnxhddec.c | 44 +- .../third_party/ffmpeg/libavcodec/dnxhdenc.c | 36 +- .../third_party/ffmpeg/libavcodec/dolby_e.c | 4 +- .../third_party/ffmpeg/libavcodec/dvdec.c | 5 +- .../third_party/ffmpeg/libavcodec/dvenc.c | 1 + arm/raspi/third_party/ffmpeg/libavcodec/dxa.c | 7 +- .../third_party/ffmpeg/libavcodec/dxva2.c | 38 +- .../third_party/ffmpeg/libavcodec/dxva2_av1.c | 31 +- .../ffmpeg/libavcodec/dxva2_h264.c | 31 +- .../ffmpeg/libavcodec/dxva2_hevc.c | 31 +- .../ffmpeg/libavcodec/dxva2_mpeg2.c | 31 +- .../third_party/ffmpeg/libavcodec/dxva2_vc1.c | 61 +- .../third_party/ffmpeg/libavcodec/dxva2_vp9.c | 31 +- .../third_party/ffmpeg/libavcodec/eacmv.c | 5 +- .../third_party/ffmpeg/libavcodec/eamad.c | 3 +- .../third_party/ffmpeg/libavcodec/eatgv.c | 3 +- .../third_party/ffmpeg/libavcodec/encode.c | 33 + .../third_party/ffmpeg/libavcodec/encode.h | 5 + .../ffmpeg/libavcodec/error_resilience.c | 15 +- .../ffmpeg/libavcodec/error_resilience.h | 12 +- .../third_party/ffmpeg/libavcodec/escape124.c | 7 +- arm/raspi/third_party/ffmpeg/libavcodec/evc.h | 2 +- .../ffmpeg/libavcodec/evc_frame_merge_bsf.c | 3 +- .../third_party/ffmpeg/libavcodec/evc_parse.c | 1 - .../third_party/ffmpeg/libavcodec/evc_parse.h | 1 - .../ffmpeg/libavcodec/evc_parser.c | 2 +- .../third_party/ffmpeg/libavcodec/evc_ps.c | 62 +- arm/raspi/third_party/ffmpeg/libavcodec/exr.c | 14 +- .../ffmpeg/libavcodec/extract_extradata_bsf.c | 47 +- .../third_party/ffmpeg/libavcodec/faandct.c | 1 + .../third_party/ffmpeg/libavcodec/faanidct.c | 1 + .../third_party/ffmpeg/libavcodec/faxcompr.c | 6 +- .../third_party/ffmpeg/libavcodec/fdctdsp.c | 1 - .../third_party/ffmpeg/libavcodec/fdctdsp.h | 19 +- .../third_party/ffmpeg/libavcodec/ffjni.c | 1 + .../third_party/ffmpeg/libavcodec/fflcms2.c | 51 + .../third_party/ffmpeg/libavcodec/fflcms2.h | 7 + .../third_party/ffmpeg/libavcodec/ffv1dec.c | 40 +- .../third_party/ffmpeg/libavcodec/ffv1enc.c | 9 +- .../third_party/ffmpeg/libavcodec/flac.c | 18 +- .../ffmpeg/libavcodec/flac_parse.h | 4 +- .../third_party/ffmpeg/libavcodec/flacdec.c | 12 +- .../third_party/ffmpeg/libavcodec/flicvideo.c | 280 +++- .../third_party/ffmpeg/libavcodec/fraps.c | 9 +- .../third_party/ffmpeg/libavcodec/g2meet.c | 4 +- .../third_party/ffmpeg/libavcodec/g722dsp.c | 2 + .../third_party/ffmpeg/libavcodec/g722dsp.h | 1 + .../ffmpeg/libavcodec/g729postfilter.c | 4 +- .../third_party/ffmpeg/libavcodec/get_bits.h | 50 +- arm/raspi/third_party/ffmpeg/libavcodec/gif.c | 3 +- .../third_party/ffmpeg/libavcodec/gifdec.c | 85 +- .../third_party/ffmpeg/libavcodec/h261dec.c | 8 +- .../third_party/ffmpeg/libavcodec/h263dec.c | 11 +- .../third_party/ffmpeg/libavcodec/h2645_sei.c | 112 ++ .../third_party/ffmpeg/libavcodec/h2645_sei.h | 16 + .../ffmpeg/libavcodec/h264_cavlc.c | 32 +- .../third_party/ffmpeg/libavcodec/h264_mb.c | 1 + .../ffmpeg/libavcodec/h264_metadata_bsf.c | 3 +- .../ffmpeg/libavcodec/h264_mvpred.h | 132 ++ .../ffmpeg/libavcodec/h264_parse.c | 14 +- .../ffmpeg/libavcodec/h264_picture.c | 13 +- .../ffmpeg/libavcodec/h264_slice.c | 74 +- .../third_party/ffmpeg/libavcodec/h264dec.c | 64 +- .../third_party/ffmpeg/libavcodec/h264dec.h | 136 +- .../ffmpeg/libavcodec/h266_metadata_bsf.c | 2 +- .../third_party/ffmpeg/libavcodec/h274.c | 32 +- .../third_party/ffmpeg/libavcodec/h274.h | 15 + .../third_party/ffmpeg/libavcodec/hcadec.c | 205 ++- .../third_party/ffmpeg/libavcodec/hevc_ps.c | 21 +- .../third_party/ffmpeg/libavcodec/hevc_refs.c | 14 +- .../third_party/ffmpeg/libavcodec/hevc_sei.c | 50 - .../third_party/ffmpeg/libavcodec/hevc_sei.h | 16 - .../third_party/ffmpeg/libavcodec/hevcdec.c | 152 +- .../third_party/ffmpeg/libavcodec/hevcdec.h | 2 + .../ffmpeg/libavcodec/hevcpred_template.c | 11 +- .../third_party/ffmpeg/libavcodec/hq_hqa.c | 4 +- .../ffmpeg/libavcodec/hq_hqadata.c | 4 +- arm/raspi/third_party/ffmpeg/libavcodec/hqx.c | 4 +- .../third_party/ffmpeg/libavcodec/hqxvlc.c | 4 +- .../third_party/ffmpeg/libavcodec/huffman.c | 2 +- .../ffmpeg/libavcodec/huffyuvdec.c | 24 +- .../ffmpeg/libavcodec/huffyuvenc.c | 1 + .../ffmpeg/libavcodec/hwaccel_internal.h | 179 ++ .../third_party/ffmpeg/libavcodec/hwaccels.h | 128 +- .../third_party/ffmpeg/libavcodec/hwconfig.h | 7 +- .../third_party/ffmpeg/libavcodec/idctdsp.h | 21 +- .../third_party/ffmpeg/libavcodec/iirfilter.c | 4 + arm/raspi/third_party/ffmpeg/libavcodec/imc.c | 6 +- .../third_party/ffmpeg/libavcodec/imm4.c | 11 +- .../third_party/ffmpeg/libavcodec/indeo2.c | 4 +- .../third_party/ffmpeg/libavcodec/internal.h | 26 - .../ffmpeg/libavcodec/interplayvideo.c | 3 +- .../third_party/ffmpeg/libavcodec/intrax8.c | 4 +- .../ffmpeg/libavcodec/ituh263dec.c | 14 +- arm/raspi/third_party/ffmpeg/libavcodec/ivi.c | 12 +- .../third_party/ffmpeg/libavcodec/jfdctfst.c | 2 +- .../ffmpeg/libavcodec/jfdctint_template.c | 2 +- arm/raspi/third_party/ffmpeg/libavcodec/jni.c | 4 +- .../ffmpeg/libavcodec/jpeg2000dec.c | 14 +- .../ffmpeg/libavcodec/jpeg2000htdec.c | 28 +- .../third_party/ffmpeg/libavcodec/jpegls.c | 1 + .../third_party/ffmpeg/libavcodec/jpegxl.h | 94 ++ .../ffmpeg/libavcodec/jpegxl_parse.c | 520 ++++++ .../ffmpeg/libavcodec/jpegxl_parse.h | 72 + .../ffmpeg/libavcodec/jpegxl_parser.c | 1472 +++++++++++++++++ .../third_party/ffmpeg/libavcodec/kbdwin.c | 24 +- .../third_party/ffmpeg/libavcodec/kbdwin.h | 10 +- .../third_party/ffmpeg/libavcodec/lagarith.c | 68 +- .../ffmpeg/libavcodec/lagarithrac.h | 3 +- .../third_party/ffmpeg/libavcodec/lcldec.c | 11 +- .../third_party/ffmpeg/libavcodec/libaomdec.c | 18 +- .../third_party/ffmpeg/libavcodec/libaomenc.c | 19 +- .../ffmpeg/libavcodec/libaribb24.c | 55 +- .../ffmpeg/libavcodec/libaribcaption.c | 12 +- .../ffmpeg/libavcodec/libfdk-aacenc.c | 28 +- .../third_party/ffmpeg/libavcodec/libjxldec.c | 41 +- .../ffmpeg/libavcodec/libkvazaar.c | 6 +- .../ffmpeg/libavcodec/libopenh264dec.c | 3 +- .../ffmpeg/libavcodec/libopenh264enc.c | 40 +- .../third_party/ffmpeg/libavcodec/libsvtav1.c | 14 +- .../third_party/ffmpeg/libavcodec/libvpxdec.c | 24 +- .../third_party/ffmpeg/libavcodec/libvpxenc.c | 7 +- .../third_party/ffmpeg/libavcodec/libx264.c | 106 +- .../third_party/ffmpeg/libavcodec/libx265.c | 2 +- .../third_party/ffmpeg/libavcodec/magicyuv.c | 93 +- .../ffmpeg/libavcodec/magicyuvenc.c | 154 +- .../ffmpeg/libavcodec/mediacodec_wrapper.c | 76 +- .../ffmpeg/libavcodec/mediacodecenc.c | 35 +- .../third_party/ffmpeg/libavcodec/mfenc.c | 4 +- .../third_party/ffmpeg/libavcodec/mimic.c | 2 +- .../ffmpeg/libavcodec/mips/Makefile | 1 - .../third_party/ffmpeg/libavcodec/mjpegdec.c | 35 +- .../ffmpeg/libavcodec/mjpegdec_common.c | 2 +- .../third_party/ffmpeg/libavcodec/mlpdec.c | 6 +- .../third_party/ffmpeg/libavcodec/mlpenc.c | 54 +- .../third_party/ffmpeg/libavcodec/mmaldec.c | 4 +- .../third_party/ffmpeg/libavcodec/mobiclip.c | 8 +- .../ffmpeg/libavcodec/motionpixels.c | 4 +- arm/raspi/third_party/ffmpeg/libavcodec/mpc.c | 2 +- .../third_party/ffmpeg/libavcodec/mpc7.c | 10 +- .../third_party/ffmpeg/libavcodec/mpc8.c | 4 +- .../third_party/ffmpeg/libavcodec/mpeg12.c | 16 +- .../third_party/ffmpeg/libavcodec/mpeg12dec.c | 35 +- .../third_party/ffmpeg/libavcodec/mpeg12enc.c | 16 +- .../ffmpeg/libavcodec/mpeg4videodec.c | 31 +- .../ffmpeg/libavcodec/mpeg4videoenc.c | 4 +- .../ffmpeg/libavcodec/mpegaudiodec_common.c | 8 +- .../ffmpeg/libavcodec/mpegaudiodsp.c | 6 +- .../ffmpeg/libavcodec/mpegpicture.c | 15 +- .../third_party/ffmpeg/libavcodec/mpegutils.c | 1 + .../ffmpeg/libavcodec/mpegvideo_dec.c | 57 +- .../ffmpeg/libavcodec/mpegvideo_enc.c | 4 +- .../ffmpeg/libavcodec/mpegvideo_parser.c | 66 +- .../ffmpeg/libavcodec/msmpeg4_vc1_data.c | 10 +- .../ffmpeg/libavcodec/msmpeg4dec.c | 22 +- .../ffmpeg/libavcodec/msmpeg4enc.c | 3 +- .../third_party/ffmpeg/libavcodec/mss2.c | 9 +- .../third_party/ffmpeg/libavcodec/mss4.c | 4 +- .../third_party/ffmpeg/libavcodec/mv30.c | 5 +- .../third_party/ffmpeg/libavcodec/mvha.c | 6 +- .../third_party/ffmpeg/libavcodec/mwsc.c | 3 +- .../third_party/ffmpeg/libavcodec/notchlc.c | 5 +- arm/raspi/third_party/ffmpeg/libavcodec/nuv.c | 4 +- .../third_party/ffmpeg/libavcodec/nvdec_av1.c | 11 +- .../ffmpeg/libavcodec/nvdec_h264.c | 11 +- .../ffmpeg/libavcodec/nvdec_hevc.c | 11 +- .../ffmpeg/libavcodec/nvdec_mjpeg.c | 11 +- .../ffmpeg/libavcodec/nvdec_mpeg12.c | 21 +- .../ffmpeg/libavcodec/nvdec_mpeg4.c | 11 +- .../third_party/ffmpeg/libavcodec/nvdec_vc1.c | 21 +- .../third_party/ffmpeg/libavcodec/nvdec_vp8.c | 11 +- .../third_party/ffmpeg/libavcodec/nvdec_vp9.c | 11 +- .../third_party/ffmpeg/libavcodec/nvenc.c | 53 +- .../third_party/ffmpeg/libavcodec/nvenc.h | 1 + .../ffmpeg/libavcodec/nvenc_h264.c | 2 + .../ffmpeg/libavcodec/nvenc_hevc.c | 4 +- arm/raspi/third_party/ffmpeg/libavcodec/omx.c | 19 +- .../third_party/ffmpeg/libavcodec/on2avc.c | 42 +- .../ffmpeg/libavcodec/options_table.h | 8 +- .../third_party/ffmpeg/libavcodec/opus_silk.c | 10 +- .../third_party/ffmpeg/libavcodec/opus_silk.h | 3 +- arm/raspi/third_party/ffmpeg/libavcodec/osq.c | 481 ++++++ .../third_party/ffmpeg/libavcodec/parsers.c | 4 +- arm/raspi/third_party/ffmpeg/libavcodec/pcm.c | 3 +- arm/raspi/third_party/ffmpeg/libavcodec/pcx.c | 3 +- .../third_party/ffmpeg/libavcodec/pdvdec.c | 3 +- .../third_party/ffmpeg/libavcodec/photocd.c | 6 +- .../third_party/ffmpeg/libavcodec/pngenc.c | 3 +- .../third_party/ffmpeg/libavcodec/pnmdec.c | 2 +- .../ffmpeg/libavcodec/ppc/Makefile | 3 - .../ffmpeg/libavcodec/ppc/fdctdsp.c | 1 + .../ffmpeg/libavcodec/ppc/idctdsp.c | 1 + .../libavcodec/ppc/mpegaudiodsp_altivec.c | 2 + .../third_party/ffmpeg/libavcodec/profiles.c | 240 +-- .../third_party/ffmpeg/libavcodec/profiles.h | 46 +- .../third_party/ffmpeg/libavcodec/proresdec.h | 5 + .../ffmpeg/libavcodec/proresdec2.c | 26 +- .../third_party/ffmpeg/libavcodec/proresdsp.c | 8 +- .../third_party/ffmpeg/libavcodec/proresdsp.h | 5 +- .../ffmpeg/libavcodec/proresenc_anatoliy.c | 75 +- .../ffmpeg/libavcodec/pthread_frame.c | 75 +- .../ffmpeg/libavcodec/qdm2_tablegen.h | 4 +- .../third_party/ffmpeg/libavcodec/qdmc.c | 4 +- .../third_party/ffmpeg/libavcodec/qpeg.c | 3 +- .../third_party/ffmpeg/libavcodec/qsvenc.c | 12 +- .../ffmpeg/libavcodec/qsvenc_hevc.c | 2 +- .../third_party/ffmpeg/libavcodec/qtrleenc.c | 3 +- .../third_party/ffmpeg/libavcodec/ralf.c | 14 +- .../third_party/ffmpeg/libavcodec/rasc.c | 10 +- .../ffmpeg/libavcodec/ratecontrol.c | 1 + arm/raspi/third_party/ffmpeg/libavcodec/raw.c | 2 + .../ffmpeg/libavcodec/riscv/Makefile | 2 + .../ffmpeg/libavcodec/riscv/aacpsdsp_rvv.S | 64 +- .../ffmpeg/libavcodec/riscv/audiodsp_rvv.S | 4 +- .../ffmpeg/libavcodec/riscv/bswapdsp_rvb.S | 43 +- .../ffmpeg/libavcodec/riscv/fmtconvert_rvv.S | 2 +- .../ffmpeg/libavcodec/riscv/g722dsp_init.c | 40 + .../ffmpeg/libavcodec/riscv/g722dsp_rvv.S | 66 + .../libavcodec/riscv/h264_chroma_init_riscv.c | 8 + .../ffmpeg/libavcodec/riscv/h264_mc_chroma.S | 237 ++- arm/raspi/third_party/ffmpeg/libavcodec/rka.c | 54 +- arm/raspi/third_party/ffmpeg/libavcodec/rl.c | 4 +- arm/raspi/third_party/ffmpeg/libavcodec/rl.h | 2 +- .../third_party/ffmpeg/libavcodec/roqvideo.c | 4 +- .../third_party/ffmpeg/libavcodec/roqvideo.h | 4 +- .../ffmpeg/libavcodec/roqvideodec.c | 8 +- .../ffmpeg/libavcodec/roqvideoenc.c | 8 +- .../third_party/ffmpeg/libavcodec/rpzaenc.c | 33 +- .../third_party/ffmpeg/libavcodec/rtjpeg.c | 2 +- .../third_party/ffmpeg/libavcodec/rtjpeg.h | 4 +- .../third_party/ffmpeg/libavcodec/rtv1.c | 8 +- .../third_party/ffmpeg/libavcodec/rv10.c | 8 +- .../third_party/ffmpeg/libavcodec/rv34.c | 10 +- .../ffmpeg/libavcodec/rv34_parser.c | 19 +- .../third_party/ffmpeg/libavcodec/rv40.c | 8 +- .../third_party/ffmpeg/libavcodec/sbcenc.c | 5 +- .../ffmpeg/libavcodec/sbrdsp_template.c | 267 +++ arm/raspi/third_party/ffmpeg/libavcodec/sga.c | 7 +- .../ffmpeg/libavcodec/sheervideo.c | 8 +- .../third_party/ffmpeg/libavcodec/shorten.c | 2 +- .../third_party/ffmpeg/libavcodec/sipr.c | 1 - .../third_party/ffmpeg/libavcodec/sipr.h | 3 - .../third_party/ffmpeg/libavcodec/smacker.c | 12 +- .../third_party/ffmpeg/libavcodec/smcenc.c | 5 +- .../third_party/ffmpeg/libavcodec/snow.c | 94 +- .../third_party/ffmpeg/libavcodec/snow.h | 287 +--- .../third_party/ffmpeg/libavcodec/snow_dwt.h | 40 + .../third_party/ffmpeg/libavcodec/snowdec.c | 168 +- .../third_party/ffmpeg/libavcodec/snowenc.c | 558 ++++--- .../ffmpeg/libavcodec/speedhqdec.c | 14 +- .../third_party/ffmpeg/libavcodec/svq1dec.c | 23 +- .../third_party/ffmpeg/libavcodec/svq1enc.c | 3 +- arm/raspi/third_party/ffmpeg/libavcodec/tak.c | 4 +- arm/raspi/third_party/ffmpeg/libavcodec/tak.h | 5 +- .../ffmpeg/libavcodec/tests/.gitignore | 6 +- .../ffmpeg/libavcodec/tests/av1_levels.c | 126 ++ .../ffmpeg/libavcodec/tests/codec_desc.c | 2 +- .../third_party/ffmpeg/libavcodec/tests/dct.c | 2 + .../ffmpeg/libavcodec/tests/h264_levels.c | 6 +- .../ffmpeg/libavcodec/tests/motion.c | 1 + .../third_party/ffmpeg/libavcodec/thread.h | 11 +- .../ffmpeg/libavcodec/threadframe.h | 2 - .../third_party/ffmpeg/libavcodec/tiff.c | 6 +- .../ffmpeg/libavcodec/trace_headers_bsf.c | 2 + .../ffmpeg/libavcodec/truemotion2.c | 5 +- .../third_party/ffmpeg/libavcodec/tscc2.c | 4 +- arm/raspi/third_party/ffmpeg/libavcodec/tta.c | 11 +- .../third_party/ffmpeg/libavcodec/ttadata.c | 3 +- .../third_party/ffmpeg/libavcodec/ttadsp.c | 3 +- .../third_party/ffmpeg/libavcodec/ttmlenc.c | 2 +- .../third_party/ffmpeg/libavcodec/utils.c | 88 +- .../third_party/ffmpeg/libavcodec/utvideo.h | 34 +- .../ffmpeg/libavcodec/utvideodec.c | 127 +- .../ffmpeg/libavcodec/utvideoenc.c | 18 +- .../third_party/ffmpeg/libavcodec/v210dec.c | 9 +- .../ffmpeg/libavcodec/v4l2_context.c | 8 +- .../ffmpeg/libavcodec/v4l2_m2m_enc.c | 36 +- .../third_party/ffmpeg/libavcodec/vaapi_av1.c | 13 +- .../ffmpeg/libavcodec/vaapi_decode.c | 5 +- .../ffmpeg/libavcodec/vaapi_encode.c | 402 +++-- .../ffmpeg/libavcodec/vaapi_encode.h | 43 +- .../ffmpeg/libavcodec/vaapi_encode_av1.c | 951 +++++++++++ .../ffmpeg/libavcodec/vaapi_encode_h264.c | 162 +- .../ffmpeg/libavcodec/vaapi_encode_h265.c | 114 +- .../ffmpeg/libavcodec/vaapi_encode_mjpeg.c | 10 +- .../ffmpeg/libavcodec/vaapi_encode_mpeg2.c | 22 +- .../ffmpeg/libavcodec/vaapi_encode_vp8.c | 8 +- .../ffmpeg/libavcodec/vaapi_encode_vp9.c | 36 +- .../ffmpeg/libavcodec/vaapi_h264.c | 12 +- .../ffmpeg/libavcodec/vaapi_hevc.c | 30 +- .../ffmpeg/libavcodec/vaapi_mjpeg.c | 12 +- .../ffmpeg/libavcodec/vaapi_mpeg2.c | 12 +- .../ffmpeg/libavcodec/vaapi_mpeg4.c | 22 +- .../third_party/ffmpeg/libavcodec/vaapi_vc1.c | 23 +- .../third_party/ffmpeg/libavcodec/vaapi_vp8.c | 12 +- .../third_party/ffmpeg/libavcodec/vaapi_vp9.c | 12 +- .../third_party/ffmpeg/libavcodec/vc1dec.c | 124 +- .../third_party/ffmpeg/libavcodec/vdpau.c | 5 +- .../third_party/ffmpeg/libavcodec/vdpau_av1.c | 18 +- .../ffmpeg/libavcodec/vdpau_h264.c | 34 +- .../ffmpeg/libavcodec/vdpau_hevc.c | 20 +- .../ffmpeg/libavcodec/vdpau_mpeg12.c | 26 +- .../ffmpeg/libavcodec/vdpau_mpeg4.c | 18 +- .../third_party/ffmpeg/libavcodec/vdpau_vc1.c | 28 +- .../third_party/ffmpeg/libavcodec/vdpau_vp9.c | 21 +- .../third_party/ffmpeg/libavcodec/version.h | 2 +- .../ffmpeg/libavcodec/version_major.h | 3 + .../ffmpeg/libavcodec/videotoolbox.c | 71 +- .../ffmpeg/libavcodec/videotoolbox_vp9.c | 11 +- .../ffmpeg/libavcodec/videotoolboxenc.c | 315 ++-- arm/raspi/third_party/ffmpeg/libavcodec/vlc.c | 198 ++- arm/raspi/third_party/ffmpeg/libavcodec/vlc.h | 142 +- .../third_party/ffmpeg/libavcodec/vmdvideo.c | 3 +- .../third_party/ffmpeg/libavcodec/vmixdec.c | 57 +- .../third_party/ffmpeg/libavcodec/vorbis.c | 8 +- .../third_party/ffmpeg/libavcodec/vorbis.h | 4 +- .../third_party/ffmpeg/libavcodec/vorbisdec.c | 6 +- arm/raspi/third_party/ffmpeg/libavcodec/vp3.c | 352 ++-- .../third_party/ffmpeg/libavcodec/vp56.c | 6 +- arm/raspi/third_party/ffmpeg/libavcodec/vp6.c | 8 +- arm/raspi/third_party/ffmpeg/libavcodec/vp8.c | 30 +- arm/raspi/third_party/ffmpeg/libavcodec/vp9.c | 32 +- .../third_party/ffmpeg/libavcodec/vqcdec.c | 2 +- .../ffmpeg/libavcodec/vulkan_av1.c | 38 +- .../ffmpeg/libavcodec/vulkan_decode.c | 68 +- .../ffmpeg/libavcodec/vulkan_decode.h | 17 +- .../ffmpeg/libavcodec/vulkan_h264.c | 58 +- .../ffmpeg/libavcodec/vulkan_hevc.c | 171 +- .../ffmpeg/libavcodec/vulkan_video.c | 45 + .../ffmpeg/libavcodec/vulkan_video.h | 7 + .../ffmpeg/libavcodec/vvc_mp4toannexb_bsf.c | 4 +- .../ffmpeg/libavcodec/vvc_parser.c | 4 +- .../third_party/ffmpeg/libavcodec/wavarc.c | 122 +- .../third_party/ffmpeg/libavcodec/wavpack.c | 148 +- .../ffmpeg/libavcodec/wavpackenc.c | 11 +- .../third_party/ffmpeg/libavcodec/webp.c | 8 +- arm/raspi/third_party/ffmpeg/libavcodec/wma.c | 8 +- .../third_party/ffmpeg/libavcodec/wmadec.c | 4 +- .../third_party/ffmpeg/libavcodec/wmaprodec.c | 14 +- .../third_party/ffmpeg/libavcodec/wmavoice.c | 100 +- .../third_party/ffmpeg/libavcodec/wnv1.c | 4 +- .../ffmpeg/libavcodec/x86/Makefile | 8 +- .../ffmpeg/libavcodec/x86/hpeldsp.asm | 77 + .../ffmpeg/libavcodec/x86/hpeldsp.h | 4 - .../ffmpeg/libavcodec/x86/hpeldsp_init.c | 14 +- .../ffmpeg/libavcodec/x86/idctdsp_init.c | 2 + .../ffmpeg/libavcodec/x86/mpegaudiodsp.c | 6 + .../libavcodec/x86/mpegvideoenc_template.c | 3 +- .../ffmpeg/libavcodec/x86/proresdsp_init.c | 4 +- .../ffmpeg/libavcodec/x86/snowdsp.c | 1 - arm/raspi/third_party/ffmpeg/libavcodec/xan.c | 3 +- .../third_party/ffmpeg/libavcodec/xvididct.c | 26 +- arm/raspi/third_party/ffmpeg/libavcodec/ylc.c | 6 +- .../third_party/ffmpeg/libavcodec/yuv4enc.c | 21 +- .../third_party/ffmpeg/libavcodec/zerocodec.c | 3 +- .../third_party/ffmpeg/libavutil/Makefile | 4 + .../autorename_libavutil_aarch64_cpu.c | 2 + .../third_party/ffmpeg/libavutil/audio_fifo.c | 9 +- .../third_party/ffmpeg/libavutil/audio_fifo.h | 9 +- .../third_party/ffmpeg/libavutil/avstring.c | 1 - .../third_party/ffmpeg/libavutil/avstring.h | 3 +- .../third_party/ffmpeg/libavutil/avutil.h | 6 +- .../third_party/ffmpeg/libavutil/bprint.c | 7 +- .../third_party/ffmpeg/libavutil/bprint.h | 3 + .../ffmpeg/libavutil/channel_layout.c | 12 +- .../ffmpeg/libavutil/channel_layout.h | 16 +- .../third_party/ffmpeg/libavutil/common.h | 1 + arm/raspi/third_party/ffmpeg/libavutil/dict.c | 4 +- arm/raspi/third_party/ffmpeg/libavutil/emms.h | 66 + .../ffmpeg/libavutil/encryption_info.c | 2 + .../third_party/ffmpeg/libavutil/executor.c | 201 +++ .../third_party/ffmpeg/libavutil/executor.h | 67 + arm/raspi/third_party/ffmpeg/libavutil/fifo.c | 5 +- arm/raspi/third_party/ffmpeg/libavutil/fifo.h | 4 +- arm/raspi/third_party/ffmpeg/libavutil/file.c | 1 + .../third_party/ffmpeg/libavutil/frame.c | 8 +- .../third_party/ffmpeg/libavutil/frame.h | 10 + arm/raspi/third_party/ffmpeg/libavutil/hash.c | 2 + arm/raspi/third_party/ffmpeg/libavutil/hmac.c | 1 + .../third_party/ffmpeg/libavutil/hwcontext.c | 6 +- .../ffmpeg/libavutil/hwcontext_cuda.c | 30 +- .../ffmpeg/libavutil/hwcontext_cuda.h | 5 + .../ffmpeg/libavutil/hwcontext_d3d11va.c | 8 +- .../ffmpeg/libavutil/hwcontext_dxva2.c | 4 +- .../ffmpeg/libavutil/hwcontext_qsv.c | 2 +- .../ffmpeg/libavutil/hwcontext_vaapi.c | 3 + .../ffmpeg/libavutil/hwcontext_vulkan.c | 71 +- .../third_party/ffmpeg/libavutil/imgutils.c | 14 +- .../third_party/ffmpeg/libavutil/imgutils.h | 26 +- .../third_party/ffmpeg/libavutil/internal.h | 8 - .../ffmpeg/libavutil/intreadwrite.h | 4 +- arm/raspi/third_party/ffmpeg/libavutil/md5.c | 2 + arm/raspi/third_party/ffmpeg/libavutil/mem.h | 4 +- .../third_party/ffmpeg/libavutil/murmur3.c | 1 + .../third_party/ffmpeg/libavutil/pixdesc.c | 28 + .../third_party/ffmpeg/libavutil/pixfmt.h | 4 + .../ffmpeg/libavutil/riscv/bswap_rvb.S | 65 + .../ffmpeg/libavutil/riscv/float_dsp_rvv.S | 70 +- .../ffmpeg/libavutil/riscv/timer.h | 13 +- .../third_party/ffmpeg/libavutil/samplefmt.c | 4 +- .../third_party/ffmpeg/libavutil/samplefmt.h | 4 +- .../third_party/ffmpeg/libavutil/spherical.c | 1 + .../ffmpeg/libavutil/tests/channel_layout.c | 128 +- .../third_party/ffmpeg/libavutil/tests/lzo.c | 2 + .../ffmpeg/libavutil/tests/murmur3.c | 3 + .../ffmpeg/libavutil/tests/pixdesc.c | 1 + .../third_party/ffmpeg/libavutil/thread.h | 19 + .../ffmpeg/libavutil/threadmessage.c | 3 + .../third_party/ffmpeg/libavutil/timer.h | 4 +- .../third_party/ffmpeg/libavutil/timestamp.h | 2 +- arm/raspi/third_party/ffmpeg/libavutil/tx.c | 28 +- arm/raspi/third_party/ffmpeg/libavutil/tx.h | 34 + .../third_party/ffmpeg/libavutil/tx_priv.h | 1 + .../ffmpeg/libavutil/tx_template.c | 318 +++- .../third_party/ffmpeg/libavutil/version.h | 2 +- .../third_party/ffmpeg/libavutil/video_hint.c | 81 + .../third_party/ffmpeg/libavutil/video_hint.h | 107 ++ .../third_party/ffmpeg/libavutil/vulkan.c | 27 +- .../third_party/ffmpeg/libavutil/vulkan.h | 4 + .../ffmpeg/libavutil/vulkan_functions.h | 2 + .../ffmpeg/libavutil/vulkan_loader.h | 1 + .../ffmpeg/libavutil/wchar_filename.h | 3 +- infra/THORIUM_DEV_BOOKMARKS.html | 356 ++-- infra/portable/THORIUM_SHELL.BAT | 2 +- other/add-hevc-ffmpeg-decoder-parser.patch | 488 +++--- src/chrome/browser/thorium_flag_entries.h | 5 + .../config/Chrome/android/arm-neon/config.h | 10 +- .../android/arm-neon/config_components.h | 15 +- .../android/arm-neon/libavutil/ffversion.h | 2 +- .../config/Chrome/android/arm64/config.h | 10 +- .../Chrome/android/arm64/config_components.h | 15 +- .../android/arm64/libavutil/ffversion.h | 2 +- .../config/Chrome/android/ia32/config.h | 12 +- .../Chrome/android/ia32/config_components.h | 15 +- .../Chrome/android/ia32/libavutil/ffversion.h | 2 +- .../config/Chrome/android/x64/config.asm | 6 +- .../config/Chrome/android/x64/config.h | 10 +- .../Chrome/android/x64/config_components.h | 15 +- .../Chrome/android/x64/libavutil/ffversion.h | 2 +- .../chromium/config/Chrome/ios/arm64/config.h | 10 +- .../Chrome/ios/arm64/config_components.h | 15 +- .../Chrome/ios/arm64/libavutil/ffversion.h | 2 +- .../chromium/config/Chrome/ios/x64/config.asm | 6 +- .../chromium/config/Chrome/ios/x64/config.h | 10 +- .../config/Chrome/ios/x64/config_components.h | 15 +- .../Chrome/ios/x64/libavutil/ffversion.h | 2 +- .../config/Chrome/linux-noasm/x64/config.h | 12 +- .../linux-noasm/x64/config_components.h | 15 +- .../linux-noasm/x64/libavutil/ffversion.h | 2 +- .../config/Chrome/linux/arm-neon/config.h | 10 +- .../Chrome/linux/arm-neon/config_components.h | 15 +- .../linux/arm-neon/libavutil/ffversion.h | 2 +- .../chromium/config/Chrome/linux/arm/config.h | 10 +- .../Chrome/linux/arm/config_components.h | 15 +- .../Chrome/linux/arm/libavutil/ffversion.h | 2 +- .../config/Chrome/linux/arm64/config.h | 10 +- .../Chrome/linux/arm64/config_components.h | 15 +- .../Chrome/linux/arm64/libavutil/ffversion.h | 2 +- .../config/Chrome/linux/ia32/config.asm | 8 +- .../config/Chrome/linux/ia32/config.h | 12 +- .../Chrome/linux/ia32/config_components.h | 15 +- .../Chrome/linux/ia32/libavutil/ffversion.h | 2 +- .../config/Chrome/linux/x64/config.asm | 16 +- .../chromium/config/Chrome/linux/x64/config.h | 12 +- .../Chrome/linux/x64/config_components.h | 35 +- .../Chrome/linux/x64/libavcodec/codec_list.c | 3 - .../Chrome/linux/x64/libavcodec/parser_list.c | 1 - .../linux/x64/libavformat/demuxer_list.c | 2 - .../Chrome/linux/x64/libavutil/ffversion.h | 2 +- .../chromium/config/Chrome/mac/arm64/config.h | 10 +- .../Chrome/mac/arm64/config_components.h | 15 +- .../Chrome/mac/arm64/libavutil/ffversion.h | 2 +- .../chromium/config/Chrome/mac/x64/config.asm | 10 +- .../chromium/config/Chrome/mac/x64/config.h | 12 +- .../config/Chrome/mac/x64/config_components.h | 35 +- .../Chrome/mac/x64/libavcodec/codec_list.c | 3 - .../Chrome/mac/x64/libavcodec/parser_list.c | 1 - .../Chrome/mac/x64/libavformat/demuxer_list.c | 2 - .../Chrome/mac/x64/libavutil/ffversion.h | 2 +- .../chromium/config/Chrome/win/arm64/config.h | 10 +- .../Chrome/win/arm64/config_components.h | 15 +- .../Chrome/win/arm64/libavutil/ffversion.h | 2 +- .../config/Chrome/win/ia32/config.asm | 8 +- .../chromium/config/Chrome/win/ia32/config.h | 12 +- .../Chrome/win/ia32/config_components.h | 15 +- .../Chrome/win/ia32/libavutil/ffversion.h | 2 +- .../chromium/config/Chrome/win/x64/config.asm | 10 +- .../chromium/config/Chrome/win/x64/config.h | 12 +- .../config/Chrome/win/x64/config_components.h | 35 +- .../Chrome/win/x64/libavcodec/codec_list.c | 3 - .../Chrome/win/x64/libavcodec/parser_list.c | 1 - .../Chrome/win/x64/libavformat/demuxer_list.c | 2 - .../Chrome/win/x64/libavutil/ffversion.h | 2 +- .../config/ChromeOS/linux-noasm/x64/config.h | 12 +- .../linux-noasm/x64/config_components.h | 15 +- .../linux-noasm/x64/libavutil/ffversion.h | 2 +- .../config/ChromeOS/linux/arm-neon/config.h | 10 +- .../linux/arm-neon/config_components.h | 15 +- .../linux/arm-neon/libavutil/ffversion.h | 2 +- .../config/ChromeOS/linux/arm/config.h | 10 +- .../ChromeOS/linux/arm/config_components.h | 15 +- .../ChromeOS/linux/arm/libavutil/ffversion.h | 2 +- .../config/ChromeOS/linux/arm64/config.h | 10 +- .../ChromeOS/linux/arm64/config_components.h | 15 +- .../linux/arm64/libavutil/ffversion.h | 2 +- .../config/ChromeOS/linux/ia32/config.asm | 8 +- .../config/ChromeOS/linux/ia32/config.h | 12 +- .../ChromeOS/linux/ia32/config_components.h | 15 +- .../ChromeOS/linux/ia32/libavutil/ffversion.h | 2 +- .../config/ChromeOS/linux/x64/config.asm | 6 +- .../config/ChromeOS/linux/x64/config.h | 10 +- .../ChromeOS/linux/x64/config_components.h | 15 +- .../ChromeOS/linux/x64/libavutil/ffversion.h | 2 +- .../config/Chromium/android/arm-neon/config.h | 10 +- .../android/arm-neon/config_components.h | 15 +- .../android/arm-neon/libavutil/ffversion.h | 2 +- .../config/Chromium/android/arm64/config.h | 10 +- .../android/arm64/config_components.h | 15 +- .../android/arm64/libavutil/ffversion.h | 2 +- .../config/Chromium/android/ia32/config.h | 12 +- .../Chromium/android/ia32/config_components.h | 15 +- .../android/ia32/libavutil/ffversion.h | 2 +- .../config/Chromium/android/x64/config.asm | 6 +- .../config/Chromium/android/x64/config.h | 10 +- .../Chromium/android/x64/config_components.h | 15 +- .../android/x64/libavutil/ffversion.h | 2 +- .../config/Chromium/ios/arm64/config.h | 10 +- .../Chromium/ios/arm64/config_components.h | 15 +- .../Chromium/ios/arm64/libavutil/ffversion.h | 2 +- .../config/Chromium/ios/x64/config.asm | 6 +- .../chromium/config/Chromium/ios/x64/config.h | 10 +- .../Chromium/ios/x64/config_components.h | 15 +- .../Chromium/ios/x64/libavutil/ffversion.h | 2 +- .../config/Chromium/linux-noasm/x64/config.h | 12 +- .../linux-noasm/x64/config_components.h | 15 +- .../linux-noasm/x64/libavutil/ffversion.h | 2 +- .../config/Chromium/linux/arm-neon/config.h | 10 +- .../linux/arm-neon/config_components.h | 15 +- .../linux/arm-neon/libavutil/ffversion.h | 2 +- .../config/Chromium/linux/arm/config.h | 10 +- .../Chromium/linux/arm/config_components.h | 15 +- .../Chromium/linux/arm/libavutil/ffversion.h | 2 +- .../config/Chromium/linux/arm64/config.h | 10 +- .../Chromium/linux/arm64/config_components.h | 15 +- .../linux/arm64/libavutil/ffversion.h | 2 +- .../config/Chromium/linux/ia32/config.asm | 8 +- .../config/Chromium/linux/ia32/config.h | 12 +- .../Chromium/linux/ia32/config_components.h | 15 +- .../Chromium/linux/ia32/libavutil/ffversion.h | 2 +- .../config/Chromium/linux/x64/config.asm | 6 +- .../config/Chromium/linux/x64/config.h | 10 +- .../Chromium/linux/x64/config_components.h | 15 +- .../Chromium/linux/x64/libavutil/ffversion.h | 2 +- .../config/Chromium/mac/arm64/config.h | 10 +- .../Chromium/mac/arm64/config_components.h | 15 +- .../Chromium/mac/arm64/libavutil/ffversion.h | 2 +- .../config/Chromium/mac/x64/config.asm | 6 +- .../chromium/config/Chromium/mac/x64/config.h | 10 +- .../Chromium/mac/x64/config_components.h | 15 +- .../Chromium/mac/x64/libavutil/ffversion.h | 2 +- .../config/Chromium/win/arm64/config.h | 10 +- .../Chromium/win/arm64/config_components.h | 15 +- .../Chromium/win/arm64/libavutil/ffversion.h | 2 +- .../config/Chromium/win/ia32/config.asm | 8 +- .../config/Chromium/win/ia32/config.h | 12 +- .../Chromium/win/ia32/config_components.h | 15 +- .../Chromium/win/ia32/libavutil/ffversion.h | 2 +- .../config/Chromium/win/x64/config.asm | 6 +- .../chromium/config/Chromium/win/x64/config.h | 10 +- .../Chromium/win/x64/config_components.h | 15 +- .../Chromium/win/x64/libavutil/ffversion.h | 2 +- src/third_party/ffmpeg/chromium/ffmpeg.sigs | 1 + .../ffmpeg/chromium/patches/README | 192 +-- .../chromium/patches/config_flag_changes.txt | 23 + .../ffmpeg/chromium/scripts/build_ffmpeg.py | 6 +- src/third_party/ffmpeg/ffmpeg_generated.gni | 171 +- src/third_party/ffmpeg/ffmpeg_options.gni | 4 +- src/third_party/ffmpeg/libavcodec/4xm.c | 10 +- src/third_party/ffmpeg/libavcodec/8bps.c | 72 +- src/third_party/ffmpeg/libavcodec/Makefile | 31 +- .../ffmpeg/libavcodec/aacdec_template.c | 26 +- src/third_party/ffmpeg/libavcodec/aacenc.c | 14 +- .../ffmpeg/libavcodec/aacenc_ltp.c | 4 +- .../ffmpeg/libavcodec/aacenc_pred.c | 2 +- .../ffmpeg/libavcodec/aacenc_tns.c | 2 +- src/third_party/ffmpeg/libavcodec/aacenctab.h | 8 +- .../ffmpeg/libavcodec/aacps_common.c | 2 +- src/third_party/ffmpeg/libavcodec/aacsbr.h | 2 +- .../ffmpeg/libavcodec/aacsbr_template.c | 2 +- .../ffmpeg/libavcodec/aacsbrdata.h | 266 --- src/third_party/ffmpeg/libavcodec/aactab.c | 4 +- .../ffmpeg/libavcodec/aarch64/Makefile | 3 - .../libavcodec/aarch64/hevcdsp_epel_neon.S | 621 ++++++- .../libavcodec/aarch64/hevcdsp_idct_neon.S | 8 +- .../libavcodec/aarch64/hevcdsp_init_aarch64.c | 20 + .../libavcodec/aarch64/hevcdsp_qpel_neon.S | 588 +++++++ .../libavcodec/aarch64/synth_filter_init.c | 7 - .../libavcodec/aarch64/synth_filter_neon.S | 2 - src/third_party/ffmpeg/libavcodec/ac3dec.c | 4 +- src/third_party/ffmpeg/libavcodec/ac3enc.c | 1 + .../ffmpeg/libavcodec/ac3enc_fixed.c | 2 +- .../ffmpeg/libavcodec/ac3enc_float.c | 2 +- src/third_party/ffmpeg/libavcodec/adx.h | 4 +- .../ffmpeg/libavcodec/adx_parser.c | 10 + src/third_party/ffmpeg/libavcodec/adxdec.c | 2 +- src/third_party/ffmpeg/libavcodec/agm.c | 11 +- src/third_party/ffmpeg/libavcodec/alac.c | 54 +- src/third_party/ffmpeg/libavcodec/allcodecs.c | 2 + .../ffmpeg/libavcodec/alpha/idctdsp_alpha.c | 1 + src/third_party/ffmpeg/libavcodec/amfenc.c | 8 +- .../ffmpeg/libavcodec/amfenc_av1.c | 4 +- .../ffmpeg/libavcodec/amfenc_h264.c | 12 +- .../ffmpeg/libavcodec/amfenc_hevc.c | 4 +- src/third_party/ffmpeg/libavcodec/apedec.c | 134 +- src/third_party/ffmpeg/libavcodec/arbc.c | 3 +- .../ffmpeg/libavcodec/arm/Makefile | 7 - .../libavcodec/arm/synth_filter_init_arm.c | 1 - src/third_party/ffmpeg/libavcodec/asvdec.c | 10 +- src/third_party/ffmpeg/libavcodec/asvenc.c | 1 - src/third_party/ffmpeg/libavcodec/atrac3.c | 4 +- .../ffmpeg/libavcodec/atrac3plus.c | 4 +- src/third_party/ffmpeg/libavcodec/atrac9dec.c | 4 +- .../ffmpeg/libavcodec/audiotoolboxenc.c | 25 +- src/third_party/ffmpeg/libavcodec/av1.h | 7 + .../ffmpeg/libavcodec/av1_levels.c | 92 ++ .../ffmpeg/libavcodec/av1_levels.h | 58 + src/third_party/ffmpeg/libavcodec/av1dec.c | 93 +- src/third_party/ffmpeg/libavcodec/avcodec.c | 9 + src/third_party/ffmpeg/libavcodec/avcodec.h | 167 +- src/third_party/ffmpeg/libavcodec/avfft.c | 195 ++- src/third_party/ffmpeg/libavcodec/avfft.h | 31 + src/third_party/ffmpeg/libavcodec/avpacket.c | 1 + src/third_party/ffmpeg/libavcodec/bgmc.c | 4 +- src/third_party/ffmpeg/libavcodec/bgmc.h | 3 +- src/third_party/ffmpeg/libavcodec/bink.c | 8 +- src/third_party/ffmpeg/libavcodec/bitstream.h | 2 + .../ffmpeg/libavcodec/bitstream_template.h | 31 +- src/third_party/ffmpeg/libavcodec/bonk.c | 2 +- src/third_party/ffmpeg/libavcodec/cavsdec.c | 1 + src/third_party/ffmpeg/libavcodec/cbs.c | 155 +- src/third_party/ffmpeg/libavcodec/cbs.h | 88 +- src/third_party/ffmpeg/libavcodec/cbs_av1.c | 273 ++- src/third_party/ffmpeg/libavcodec/cbs_av1.h | 4 + .../libavcodec/cbs_av1_syntax_template.c | 16 +- src/third_party/ffmpeg/libavcodec/cbs_bsf.c | 5 + src/third_party/ffmpeg/libavcodec/cbs_h2645.c | 153 +- src/third_party/ffmpeg/libavcodec/cbs_h266.h | 7 + .../libavcodec/cbs_h266_syntax_template.c | 312 ++-- .../ffmpeg/libavcodec/cbs_internal.h | 96 +- src/third_party/ffmpeg/libavcodec/cbs_mpeg2.c | 15 +- src/third_party/ffmpeg/libavcodec/cbs_vp9.c | 122 +- .../ffmpeg/libavcodec/cdgraphics.c | 37 +- src/third_party/ffmpeg/libavcodec/cdxl.c | 5 +- src/third_party/ffmpeg/libavcodec/celp_math.h | 2 +- src/third_party/ffmpeg/libavcodec/cfhddata.c | 4 +- .../ffmpeg/libavcodec/clearvideo.c | 12 +- src/third_party/ffmpeg/libavcodec/cllc.c | 14 +- src/third_party/ffmpeg/libavcodec/codec.h | 2 +- .../ffmpeg/libavcodec/codec_desc.c | 7 + .../ffmpeg/libavcodec/codec_desc.h | 2 +- src/third_party/ffmpeg/libavcodec/codec_id.h | 1 + src/third_party/ffmpeg/libavcodec/codec_par.c | 6 +- src/third_party/ffmpeg/libavcodec/codec_par.h | 10 +- src/third_party/ffmpeg/libavcodec/cook.c | 8 +- src/third_party/ffmpeg/libavcodec/cscd.c | 7 +- src/third_party/ffmpeg/libavcodec/cuviddec.c | 7 +- src/third_party/ffmpeg/libavcodec/dca_core.c | 9 +- src/third_party/ffmpeg/libavcodec/dca_lbr.c | 2 +- .../ffmpeg/libavcodec/dca_parser.c | 16 +- src/third_party/ffmpeg/libavcodec/dca_xll.c | 6 +- src/third_party/ffmpeg/libavcodec/dcadec.c | 9 +- src/third_party/ffmpeg/libavcodec/dcahuff.c | 8 +- src/third_party/ffmpeg/libavcodec/dct.h | 34 +- src/third_party/ffmpeg/libavcodec/decode.c | 72 +- src/third_party/ffmpeg/libavcodec/decode.h | 17 +- src/third_party/ffmpeg/libavcodec/defs.h | 143 ++ src/third_party/ffmpeg/libavcodec/dirac.c | 3 + src/third_party/ffmpeg/libavcodec/dirac.h | 6 +- src/third_party/ffmpeg/libavcodec/dirac_dwt.c | 1 + src/third_party/ffmpeg/libavcodec/dnxhddata.c | 14 +- src/third_party/ffmpeg/libavcodec/dnxhddec.c | 44 +- src/third_party/ffmpeg/libavcodec/dnxhdenc.c | 36 +- src/third_party/ffmpeg/libavcodec/dolby_e.c | 4 +- src/third_party/ffmpeg/libavcodec/dvdec.c | 5 +- src/third_party/ffmpeg/libavcodec/dvenc.c | 1 + src/third_party/ffmpeg/libavcodec/dxa.c | 7 +- src/third_party/ffmpeg/libavcodec/dxva2.c | 38 +- src/third_party/ffmpeg/libavcodec/dxva2_av1.c | 31 +- .../ffmpeg/libavcodec/dxva2_h264.c | 31 +- .../ffmpeg/libavcodec/dxva2_hevc.c | 31 +- .../ffmpeg/libavcodec/dxva2_mpeg2.c | 31 +- src/third_party/ffmpeg/libavcodec/dxva2_vc1.c | 61 +- src/third_party/ffmpeg/libavcodec/dxva2_vp9.c | 31 +- src/third_party/ffmpeg/libavcodec/eacmv.c | 5 +- src/third_party/ffmpeg/libavcodec/eamad.c | 3 +- src/third_party/ffmpeg/libavcodec/eatgv.c | 3 +- src/third_party/ffmpeg/libavcodec/encode.c | 33 + src/third_party/ffmpeg/libavcodec/encode.h | 5 + .../ffmpeg/libavcodec/error_resilience.c | 15 +- .../ffmpeg/libavcodec/error_resilience.h | 12 +- src/third_party/ffmpeg/libavcodec/escape124.c | 7 +- src/third_party/ffmpeg/libavcodec/evc.h | 2 +- .../ffmpeg/libavcodec/evc_frame_merge_bsf.c | 3 +- src/third_party/ffmpeg/libavcodec/evc_parse.c | 1 - src/third_party/ffmpeg/libavcodec/evc_parse.h | 1 - .../ffmpeg/libavcodec/evc_parser.c | 2 +- src/third_party/ffmpeg/libavcodec/evc_ps.c | 62 +- src/third_party/ffmpeg/libavcodec/exr.c | 14 +- .../ffmpeg/libavcodec/extract_extradata_bsf.c | 47 +- src/third_party/ffmpeg/libavcodec/faandct.c | 1 + src/third_party/ffmpeg/libavcodec/faanidct.c | 1 + src/third_party/ffmpeg/libavcodec/faxcompr.c | 6 +- src/third_party/ffmpeg/libavcodec/fdctdsp.c | 1 - src/third_party/ffmpeg/libavcodec/fdctdsp.h | 19 +- src/third_party/ffmpeg/libavcodec/ffjni.c | 1 + src/third_party/ffmpeg/libavcodec/fflcms2.c | 51 + src/third_party/ffmpeg/libavcodec/fflcms2.h | 7 + src/third_party/ffmpeg/libavcodec/ffv1dec.c | 40 +- src/third_party/ffmpeg/libavcodec/ffv1enc.c | 9 +- src/third_party/ffmpeg/libavcodec/flac.c | 18 +- .../ffmpeg/libavcodec/flac_parse.h | 4 +- src/third_party/ffmpeg/libavcodec/flacdec.c | 12 +- src/third_party/ffmpeg/libavcodec/flicvideo.c | 280 +++- src/third_party/ffmpeg/libavcodec/fraps.c | 9 +- src/third_party/ffmpeg/libavcodec/g2meet.c | 4 +- src/third_party/ffmpeg/libavcodec/g722dsp.c | 2 + src/third_party/ffmpeg/libavcodec/g722dsp.h | 1 + .../ffmpeg/libavcodec/g729postfilter.c | 4 +- src/third_party/ffmpeg/libavcodec/get_bits.h | 50 +- src/third_party/ffmpeg/libavcodec/gif.c | 3 +- src/third_party/ffmpeg/libavcodec/gifdec.c | 85 +- src/third_party/ffmpeg/libavcodec/h261dec.c | 8 +- src/third_party/ffmpeg/libavcodec/h263dec.c | 11 +- src/third_party/ffmpeg/libavcodec/h2645_sei.c | 112 ++ src/third_party/ffmpeg/libavcodec/h2645_sei.h | 16 + .../ffmpeg/libavcodec/h264_cavlc.c | 32 +- src/third_party/ffmpeg/libavcodec/h264_mb.c | 1 + .../ffmpeg/libavcodec/h264_metadata_bsf.c | 3 +- .../ffmpeg/libavcodec/h264_mvpred.h | 132 ++ .../ffmpeg/libavcodec/h264_parse.c | 14 +- .../ffmpeg/libavcodec/h264_picture.c | 13 +- .../ffmpeg/libavcodec/h264_slice.c | 74 +- src/third_party/ffmpeg/libavcodec/h264dec.c | 64 +- src/third_party/ffmpeg/libavcodec/h264dec.h | 136 +- .../ffmpeg/libavcodec/h266_metadata_bsf.c | 2 +- src/third_party/ffmpeg/libavcodec/h274.c | 32 +- src/third_party/ffmpeg/libavcodec/h274.h | 15 + src/third_party/ffmpeg/libavcodec/hcadec.c | 205 ++- src/third_party/ffmpeg/libavcodec/hevc_ps.c | 21 +- src/third_party/ffmpeg/libavcodec/hevc_refs.c | 14 +- src/third_party/ffmpeg/libavcodec/hevc_sei.c | 50 - src/third_party/ffmpeg/libavcodec/hevc_sei.h | 16 - src/third_party/ffmpeg/libavcodec/hevcdec.c | 152 +- src/third_party/ffmpeg/libavcodec/hevcdec.h | 2 + .../ffmpeg/libavcodec/hevcpred_template.c | 11 +- src/third_party/ffmpeg/libavcodec/hq_hqa.c | 4 +- .../ffmpeg/libavcodec/hq_hqadata.c | 4 +- src/third_party/ffmpeg/libavcodec/hqx.c | 4 +- src/third_party/ffmpeg/libavcodec/hqxvlc.c | 4 +- src/third_party/ffmpeg/libavcodec/huffman.c | 2 +- .../ffmpeg/libavcodec/huffyuvdec.c | 24 +- .../ffmpeg/libavcodec/huffyuvenc.c | 1 + .../ffmpeg/libavcodec/hwaccel_internal.h | 179 ++ src/third_party/ffmpeg/libavcodec/hwaccels.h | 128 +- src/third_party/ffmpeg/libavcodec/hwconfig.h | 7 +- src/third_party/ffmpeg/libavcodec/idctdsp.h | 21 +- src/third_party/ffmpeg/libavcodec/iirfilter.c | 4 + src/third_party/ffmpeg/libavcodec/imc.c | 6 +- src/third_party/ffmpeg/libavcodec/imm4.c | 11 +- src/third_party/ffmpeg/libavcodec/indeo2.c | 4 +- src/third_party/ffmpeg/libavcodec/internal.h | 26 - .../ffmpeg/libavcodec/interplayvideo.c | 3 +- src/third_party/ffmpeg/libavcodec/intrax8.c | 4 +- .../ffmpeg/libavcodec/ituh263dec.c | 14 +- src/third_party/ffmpeg/libavcodec/ivi.c | 12 +- src/third_party/ffmpeg/libavcodec/jfdctfst.c | 2 +- .../ffmpeg/libavcodec/jfdctint_template.c | 2 +- src/third_party/ffmpeg/libavcodec/jni.c | 4 +- .../ffmpeg/libavcodec/jpeg2000dec.c | 14 +- .../ffmpeg/libavcodec/jpeg2000htdec.c | 28 +- src/third_party/ffmpeg/libavcodec/jpegls.c | 1 + src/third_party/ffmpeg/libavcodec/jpegxl.h | 94 ++ .../ffmpeg/libavcodec/jpegxl_parse.c | 520 ++++++ .../ffmpeg/libavcodec/jpegxl_parse.h | 72 + .../ffmpeg/libavcodec/jpegxl_parser.c | 1472 +++++++++++++++++ src/third_party/ffmpeg/libavcodec/kbdwin.c | 24 +- src/third_party/ffmpeg/libavcodec/kbdwin.h | 10 +- src/third_party/ffmpeg/libavcodec/lagarith.c | 68 +- .../ffmpeg/libavcodec/lagarithrac.h | 3 +- src/third_party/ffmpeg/libavcodec/lcldec.c | 11 +- src/third_party/ffmpeg/libavcodec/libaomdec.c | 18 +- src/third_party/ffmpeg/libavcodec/libaomenc.c | 19 +- .../ffmpeg/libavcodec/libaribb24.c | 55 +- .../ffmpeg/libavcodec/libaribcaption.c | 12 +- .../ffmpeg/libavcodec/libfdk-aacenc.c | 28 +- src/third_party/ffmpeg/libavcodec/libjxldec.c | 41 +- .../ffmpeg/libavcodec/libkvazaar.c | 6 +- .../ffmpeg/libavcodec/libopenh264dec.c | 3 +- .../ffmpeg/libavcodec/libopenh264enc.c | 40 +- src/third_party/ffmpeg/libavcodec/libsvtav1.c | 14 +- src/third_party/ffmpeg/libavcodec/libvpxdec.c | 24 +- src/third_party/ffmpeg/libavcodec/libvpxenc.c | 7 +- src/third_party/ffmpeg/libavcodec/libx264.c | 106 +- src/third_party/ffmpeg/libavcodec/libx265.c | 2 +- src/third_party/ffmpeg/libavcodec/magicyuv.c | 93 +- .../ffmpeg/libavcodec/magicyuvenc.c | 154 +- .../ffmpeg/libavcodec/mediacodec_wrapper.c | 76 +- .../ffmpeg/libavcodec/mediacodecenc.c | 35 +- src/third_party/ffmpeg/libavcodec/mfenc.c | 4 +- src/third_party/ffmpeg/libavcodec/mimic.c | 2 +- .../ffmpeg/libavcodec/mips/Makefile | 1 - src/third_party/ffmpeg/libavcodec/mjpegdec.c | 35 +- .../ffmpeg/libavcodec/mjpegdec_common.c | 2 +- src/third_party/ffmpeg/libavcodec/mlpdec.c | 6 +- src/third_party/ffmpeg/libavcodec/mlpenc.c | 54 +- src/third_party/ffmpeg/libavcodec/mmaldec.c | 4 +- src/third_party/ffmpeg/libavcodec/mobiclip.c | 8 +- .../ffmpeg/libavcodec/motionpixels.c | 4 +- src/third_party/ffmpeg/libavcodec/mpc.c | 2 +- src/third_party/ffmpeg/libavcodec/mpc7.c | 10 +- src/third_party/ffmpeg/libavcodec/mpc8.c | 4 +- src/third_party/ffmpeg/libavcodec/mpeg12.c | 16 +- src/third_party/ffmpeg/libavcodec/mpeg12dec.c | 35 +- src/third_party/ffmpeg/libavcodec/mpeg12enc.c | 16 +- .../ffmpeg/libavcodec/mpeg4videodec.c | 31 +- .../ffmpeg/libavcodec/mpeg4videoenc.c | 4 +- .../ffmpeg/libavcodec/mpegaudiodec_common.c | 8 +- .../ffmpeg/libavcodec/mpegaudiodsp.c | 6 +- .../ffmpeg/libavcodec/mpegpicture.c | 15 +- src/third_party/ffmpeg/libavcodec/mpegutils.c | 1 + .../ffmpeg/libavcodec/mpegvideo_dec.c | 57 +- .../ffmpeg/libavcodec/mpegvideo_enc.c | 4 +- .../ffmpeg/libavcodec/mpegvideo_parser.c | 66 +- .../ffmpeg/libavcodec/msmpeg4_vc1_data.c | 10 +- .../ffmpeg/libavcodec/msmpeg4dec.c | 22 +- .../ffmpeg/libavcodec/msmpeg4enc.c | 3 +- src/third_party/ffmpeg/libavcodec/mss2.c | 9 +- src/third_party/ffmpeg/libavcodec/mss4.c | 4 +- src/third_party/ffmpeg/libavcodec/mv30.c | 5 +- src/third_party/ffmpeg/libavcodec/mvha.c | 6 +- src/third_party/ffmpeg/libavcodec/mwsc.c | 3 +- src/third_party/ffmpeg/libavcodec/notchlc.c | 5 +- src/third_party/ffmpeg/libavcodec/nuv.c | 4 +- src/third_party/ffmpeg/libavcodec/nvdec_av1.c | 11 +- .../ffmpeg/libavcodec/nvdec_h264.c | 11 +- .../ffmpeg/libavcodec/nvdec_hevc.c | 11 +- .../ffmpeg/libavcodec/nvdec_mjpeg.c | 11 +- .../ffmpeg/libavcodec/nvdec_mpeg12.c | 21 +- .../ffmpeg/libavcodec/nvdec_mpeg4.c | 11 +- src/third_party/ffmpeg/libavcodec/nvdec_vc1.c | 21 +- src/third_party/ffmpeg/libavcodec/nvdec_vp8.c | 11 +- src/third_party/ffmpeg/libavcodec/nvdec_vp9.c | 11 +- src/third_party/ffmpeg/libavcodec/nvenc.c | 53 +- src/third_party/ffmpeg/libavcodec/nvenc.h | 1 + .../ffmpeg/libavcodec/nvenc_h264.c | 2 + .../ffmpeg/libavcodec/nvenc_hevc.c | 4 +- src/third_party/ffmpeg/libavcodec/omx.c | 19 +- src/third_party/ffmpeg/libavcodec/on2avc.c | 42 +- .../ffmpeg/libavcodec/options_table.h | 8 +- src/third_party/ffmpeg/libavcodec/opus_silk.c | 10 +- src/third_party/ffmpeg/libavcodec/opus_silk.h | 3 +- src/third_party/ffmpeg/libavcodec/osq.c | 481 ++++++ src/third_party/ffmpeg/libavcodec/parsers.c | 4 +- src/third_party/ffmpeg/libavcodec/pcm.c | 3 +- src/third_party/ffmpeg/libavcodec/pcx.c | 3 +- src/third_party/ffmpeg/libavcodec/pdvdec.c | 3 +- src/third_party/ffmpeg/libavcodec/photocd.c | 6 +- src/third_party/ffmpeg/libavcodec/pngenc.c | 3 +- src/third_party/ffmpeg/libavcodec/pnmdec.c | 2 +- .../ffmpeg/libavcodec/ppc/Makefile | 3 - .../ffmpeg/libavcodec/ppc/fdctdsp.c | 1 + .../ffmpeg/libavcodec/ppc/idctdsp.c | 1 + .../libavcodec/ppc/mpegaudiodsp_altivec.c | 2 + src/third_party/ffmpeg/libavcodec/profiles.c | 240 +-- src/third_party/ffmpeg/libavcodec/profiles.h | 46 +- src/third_party/ffmpeg/libavcodec/proresdec.h | 5 + .../ffmpeg/libavcodec/proresdec2.c | 26 +- src/third_party/ffmpeg/libavcodec/proresdsp.c | 8 +- src/third_party/ffmpeg/libavcodec/proresdsp.h | 5 +- .../ffmpeg/libavcodec/proresenc_anatoliy.c | 75 +- .../ffmpeg/libavcodec/pthread_frame.c | 75 +- .../ffmpeg/libavcodec/qdm2_tablegen.h | 4 +- src/third_party/ffmpeg/libavcodec/qdmc.c | 4 +- src/third_party/ffmpeg/libavcodec/qpeg.c | 3 +- src/third_party/ffmpeg/libavcodec/qsvenc.c | 12 +- .../ffmpeg/libavcodec/qsvenc_hevc.c | 2 +- src/third_party/ffmpeg/libavcodec/qtrleenc.c | 3 +- src/third_party/ffmpeg/libavcodec/ralf.c | 14 +- src/third_party/ffmpeg/libavcodec/rasc.c | 10 +- .../ffmpeg/libavcodec/ratecontrol.c | 1 + src/third_party/ffmpeg/libavcodec/raw.c | 2 + .../ffmpeg/libavcodec/riscv/Makefile | 2 + .../ffmpeg/libavcodec/riscv/aacpsdsp_rvv.S | 64 +- .../ffmpeg/libavcodec/riscv/audiodsp_rvv.S | 4 +- .../ffmpeg/libavcodec/riscv/bswapdsp_rvb.S | 43 +- .../ffmpeg/libavcodec/riscv/fmtconvert_rvv.S | 2 +- .../ffmpeg/libavcodec/riscv/g722dsp_init.c | 40 + .../ffmpeg/libavcodec/riscv/g722dsp_rvv.S | 66 + .../libavcodec/riscv/h264_chroma_init_riscv.c | 8 + .../ffmpeg/libavcodec/riscv/h264_mc_chroma.S | 237 ++- src/third_party/ffmpeg/libavcodec/rka.c | 54 +- src/third_party/ffmpeg/libavcodec/rl.c | 4 +- src/third_party/ffmpeg/libavcodec/rl.h | 2 +- src/third_party/ffmpeg/libavcodec/roqvideo.c | 4 +- src/third_party/ffmpeg/libavcodec/roqvideo.h | 4 +- .../ffmpeg/libavcodec/roqvideodec.c | 8 +- .../ffmpeg/libavcodec/roqvideoenc.c | 8 +- src/third_party/ffmpeg/libavcodec/rpzaenc.c | 33 +- src/third_party/ffmpeg/libavcodec/rtjpeg.c | 2 +- src/third_party/ffmpeg/libavcodec/rtjpeg.h | 4 +- src/third_party/ffmpeg/libavcodec/rtv1.c | 8 +- src/third_party/ffmpeg/libavcodec/rv10.c | 8 +- src/third_party/ffmpeg/libavcodec/rv34.c | 10 +- .../ffmpeg/libavcodec/rv34_parser.c | 19 +- src/third_party/ffmpeg/libavcodec/rv40.c | 8 +- src/third_party/ffmpeg/libavcodec/sbcenc.c | 5 +- .../ffmpeg/libavcodec/sbrdsp_template.c | 267 +++ src/third_party/ffmpeg/libavcodec/sga.c | 7 +- .../ffmpeg/libavcodec/sheervideo.c | 8 +- src/third_party/ffmpeg/libavcodec/shorten.c | 2 +- src/third_party/ffmpeg/libavcodec/sipr.c | 1 - src/third_party/ffmpeg/libavcodec/sipr.h | 3 - src/third_party/ffmpeg/libavcodec/smacker.c | 12 +- src/third_party/ffmpeg/libavcodec/smcenc.c | 5 +- src/third_party/ffmpeg/libavcodec/snow.c | 94 +- src/third_party/ffmpeg/libavcodec/snow.h | 287 +--- src/third_party/ffmpeg/libavcodec/snow_dwt.h | 40 + src/third_party/ffmpeg/libavcodec/snowdec.c | 168 +- src/third_party/ffmpeg/libavcodec/snowenc.c | 558 ++++--- .../ffmpeg/libavcodec/speedhqdec.c | 14 +- src/third_party/ffmpeg/libavcodec/svq1dec.c | 23 +- src/third_party/ffmpeg/libavcodec/svq1enc.c | 3 +- src/third_party/ffmpeg/libavcodec/tak.c | 4 +- src/third_party/ffmpeg/libavcodec/tak.h | 5 +- .../ffmpeg/libavcodec/tests/.gitignore | 6 +- .../ffmpeg/libavcodec/tests/av1_levels.c | 126 ++ .../ffmpeg/libavcodec/tests/codec_desc.c | 2 +- src/third_party/ffmpeg/libavcodec/tests/dct.c | 2 + .../ffmpeg/libavcodec/tests/h264_levels.c | 6 +- .../ffmpeg/libavcodec/tests/motion.c | 1 + src/third_party/ffmpeg/libavcodec/thread.h | 11 +- .../ffmpeg/libavcodec/threadframe.h | 2 - src/third_party/ffmpeg/libavcodec/tiff.c | 6 +- .../ffmpeg/libavcodec/trace_headers_bsf.c | 2 + .../ffmpeg/libavcodec/truemotion2.c | 5 +- src/third_party/ffmpeg/libavcodec/tscc2.c | 4 +- src/third_party/ffmpeg/libavcodec/tta.c | 11 +- src/third_party/ffmpeg/libavcodec/ttadata.c | 3 +- src/third_party/ffmpeg/libavcodec/ttadsp.c | 3 +- src/third_party/ffmpeg/libavcodec/ttmlenc.c | 2 +- src/third_party/ffmpeg/libavcodec/utils.c | 88 +- src/third_party/ffmpeg/libavcodec/utvideo.h | 34 +- .../ffmpeg/libavcodec/utvideodec.c | 127 +- .../ffmpeg/libavcodec/utvideoenc.c | 18 +- src/third_party/ffmpeg/libavcodec/v210dec.c | 9 +- .../ffmpeg/libavcodec/v4l2_context.c | 8 +- .../ffmpeg/libavcodec/v4l2_m2m_enc.c | 36 +- src/third_party/ffmpeg/libavcodec/vaapi_av1.c | 13 +- .../ffmpeg/libavcodec/vaapi_decode.c | 5 +- .../ffmpeg/libavcodec/vaapi_encode.c | 402 +++-- .../ffmpeg/libavcodec/vaapi_encode.h | 43 +- .../ffmpeg/libavcodec/vaapi_encode_av1.c | 951 +++++++++++ .../ffmpeg/libavcodec/vaapi_encode_h264.c | 162 +- .../ffmpeg/libavcodec/vaapi_encode_h265.c | 114 +- .../ffmpeg/libavcodec/vaapi_encode_mjpeg.c | 10 +- .../ffmpeg/libavcodec/vaapi_encode_mpeg2.c | 22 +- .../ffmpeg/libavcodec/vaapi_encode_vp8.c | 8 +- .../ffmpeg/libavcodec/vaapi_encode_vp9.c | 36 +- .../ffmpeg/libavcodec/vaapi_h264.c | 12 +- .../ffmpeg/libavcodec/vaapi_hevc.c | 30 +- .../ffmpeg/libavcodec/vaapi_mjpeg.c | 12 +- .../ffmpeg/libavcodec/vaapi_mpeg2.c | 12 +- .../ffmpeg/libavcodec/vaapi_mpeg4.c | 22 +- src/third_party/ffmpeg/libavcodec/vaapi_vc1.c | 23 +- src/third_party/ffmpeg/libavcodec/vaapi_vp8.c | 12 +- src/third_party/ffmpeg/libavcodec/vaapi_vp9.c | 12 +- src/third_party/ffmpeg/libavcodec/vc1dec.c | 124 +- src/third_party/ffmpeg/libavcodec/vdpau.c | 5 +- src/third_party/ffmpeg/libavcodec/vdpau_av1.c | 18 +- .../ffmpeg/libavcodec/vdpau_h264.c | 34 +- .../ffmpeg/libavcodec/vdpau_hevc.c | 20 +- .../ffmpeg/libavcodec/vdpau_mpeg12.c | 26 +- .../ffmpeg/libavcodec/vdpau_mpeg4.c | 18 +- src/third_party/ffmpeg/libavcodec/vdpau_vc1.c | 28 +- src/third_party/ffmpeg/libavcodec/vdpau_vp9.c | 21 +- src/third_party/ffmpeg/libavcodec/version.h | 2 +- .../ffmpeg/libavcodec/version_major.h | 3 + .../ffmpeg/libavcodec/videotoolbox.c | 71 +- .../ffmpeg/libavcodec/videotoolbox_vp9.c | 11 +- .../ffmpeg/libavcodec/videotoolboxenc.c | 315 ++-- src/third_party/ffmpeg/libavcodec/vlc.c | 198 ++- src/third_party/ffmpeg/libavcodec/vlc.h | 142 +- src/third_party/ffmpeg/libavcodec/vmdvideo.c | 3 +- src/third_party/ffmpeg/libavcodec/vmixdec.c | 57 +- src/third_party/ffmpeg/libavcodec/vorbis.c | 8 +- src/third_party/ffmpeg/libavcodec/vorbis.h | 4 +- src/third_party/ffmpeg/libavcodec/vorbisdec.c | 6 +- src/third_party/ffmpeg/libavcodec/vp3.c | 352 ++-- src/third_party/ffmpeg/libavcodec/vp56.c | 6 +- src/third_party/ffmpeg/libavcodec/vp6.c | 8 +- src/third_party/ffmpeg/libavcodec/vp8.c | 30 +- src/third_party/ffmpeg/libavcodec/vp9.c | 32 +- src/third_party/ffmpeg/libavcodec/vqcdec.c | 2 +- .../ffmpeg/libavcodec/vulkan_av1.c | 38 +- .../ffmpeg/libavcodec/vulkan_decode.c | 68 +- .../ffmpeg/libavcodec/vulkan_decode.h | 17 +- .../ffmpeg/libavcodec/vulkan_h264.c | 58 +- .../ffmpeg/libavcodec/vulkan_hevc.c | 171 +- .../ffmpeg/libavcodec/vulkan_video.c | 45 + .../ffmpeg/libavcodec/vulkan_video.h | 7 + .../ffmpeg/libavcodec/vvc_mp4toannexb_bsf.c | 4 +- .../ffmpeg/libavcodec/vvc_parser.c | 4 +- src/third_party/ffmpeg/libavcodec/wavarc.c | 122 +- src/third_party/ffmpeg/libavcodec/wavpack.c | 148 +- .../ffmpeg/libavcodec/wavpackenc.c | 11 +- src/third_party/ffmpeg/libavcodec/webp.c | 8 +- src/third_party/ffmpeg/libavcodec/wma.c | 8 +- src/third_party/ffmpeg/libavcodec/wmadec.c | 4 +- src/third_party/ffmpeg/libavcodec/wmaprodec.c | 14 +- src/third_party/ffmpeg/libavcodec/wmavoice.c | 100 +- src/third_party/ffmpeg/libavcodec/wnv1.c | 4 +- .../ffmpeg/libavcodec/x86/Makefile | 8 +- .../ffmpeg/libavcodec/x86/hpeldsp.asm | 77 + .../ffmpeg/libavcodec/x86/hpeldsp.h | 4 - .../ffmpeg/libavcodec/x86/hpeldsp_init.c | 14 +- .../ffmpeg/libavcodec/x86/idctdsp_init.c | 2 + .../ffmpeg/libavcodec/x86/mpegaudiodsp.c | 6 + .../libavcodec/x86/mpegvideoenc_template.c | 3 +- .../ffmpeg/libavcodec/x86/proresdsp_init.c | 4 +- .../ffmpeg/libavcodec/x86/snowdsp.c | 1 - src/third_party/ffmpeg/libavcodec/xan.c | 3 +- src/third_party/ffmpeg/libavcodec/xvididct.c | 26 +- src/third_party/ffmpeg/libavcodec/ylc.c | 6 +- src/third_party/ffmpeg/libavcodec/yuv4enc.c | 21 +- src/third_party/ffmpeg/libavcodec/zerocodec.c | 3 +- src/third_party/ffmpeg/libavutil/Makefile | 4 + .../autorename_libavutil_aarch64_cpu.c | 2 + src/third_party/ffmpeg/libavutil/audio_fifo.c | 9 +- src/third_party/ffmpeg/libavutil/audio_fifo.h | 9 +- src/third_party/ffmpeg/libavutil/avstring.c | 1 - src/third_party/ffmpeg/libavutil/avstring.h | 3 +- src/third_party/ffmpeg/libavutil/avutil.h | 6 +- src/third_party/ffmpeg/libavutil/bprint.c | 7 +- src/third_party/ffmpeg/libavutil/bprint.h | 3 + .../ffmpeg/libavutil/channel_layout.c | 12 +- .../ffmpeg/libavutil/channel_layout.h | 16 +- src/third_party/ffmpeg/libavutil/common.h | 1 + src/third_party/ffmpeg/libavutil/dict.c | 4 +- src/third_party/ffmpeg/libavutil/emms.h | 66 + .../ffmpeg/libavutil/encryption_info.c | 2 + src/third_party/ffmpeg/libavutil/executor.c | 201 +++ src/third_party/ffmpeg/libavutil/executor.h | 67 + src/third_party/ffmpeg/libavutil/fifo.c | 5 +- src/third_party/ffmpeg/libavutil/fifo.h | 4 +- src/third_party/ffmpeg/libavutil/file.c | 1 + src/third_party/ffmpeg/libavutil/frame.c | 8 +- src/third_party/ffmpeg/libavutil/frame.h | 10 + src/third_party/ffmpeg/libavutil/hash.c | 2 + src/third_party/ffmpeg/libavutil/hmac.c | 1 + src/third_party/ffmpeg/libavutil/hwcontext.c | 6 +- .../ffmpeg/libavutil/hwcontext_cuda.c | 30 +- .../ffmpeg/libavutil/hwcontext_cuda.h | 5 + .../ffmpeg/libavutil/hwcontext_d3d11va.c | 8 +- .../ffmpeg/libavutil/hwcontext_dxva2.c | 4 +- .../ffmpeg/libavutil/hwcontext_qsv.c | 2 +- .../ffmpeg/libavutil/hwcontext_vaapi.c | 3 + .../ffmpeg/libavutil/hwcontext_vulkan.c | 71 +- src/third_party/ffmpeg/libavutil/imgutils.c | 14 +- src/third_party/ffmpeg/libavutil/imgutils.h | 26 +- src/third_party/ffmpeg/libavutil/internal.h | 8 - .../ffmpeg/libavutil/intreadwrite.h | 4 +- src/third_party/ffmpeg/libavutil/md5.c | 2 + src/third_party/ffmpeg/libavutil/mem.h | 4 +- src/third_party/ffmpeg/libavutil/murmur3.c | 1 + src/third_party/ffmpeg/libavutil/pixdesc.c | 28 + src/third_party/ffmpeg/libavutil/pixfmt.h | 4 + .../ffmpeg/libavutil/riscv/bswap_rvb.S | 65 + .../ffmpeg/libavutil/riscv/float_dsp_rvv.S | 70 +- .../ffmpeg/libavutil/riscv/timer.h | 13 +- src/third_party/ffmpeg/libavutil/samplefmt.c | 4 +- src/third_party/ffmpeg/libavutil/samplefmt.h | 4 +- src/third_party/ffmpeg/libavutil/spherical.c | 1 + .../ffmpeg/libavutil/tests/channel_layout.c | 128 +- src/third_party/ffmpeg/libavutil/tests/lzo.c | 2 + .../ffmpeg/libavutil/tests/murmur3.c | 3 + .../ffmpeg/libavutil/tests/pixdesc.c | 1 + src/third_party/ffmpeg/libavutil/thread.h | 19 + .../ffmpeg/libavutil/threadmessage.c | 3 + src/third_party/ffmpeg/libavutil/timer.h | 4 +- src/third_party/ffmpeg/libavutil/timestamp.h | 2 +- src/third_party/ffmpeg/libavutil/tx.c | 28 +- src/third_party/ffmpeg/libavutil/tx.h | 34 + src/third_party/ffmpeg/libavutil/tx_priv.h | 1 + .../ffmpeg/libavutil/tx_template.c | 318 +++- src/third_party/ffmpeg/libavutil/version.h | 2 +- src/third_party/ffmpeg/libavutil/video_hint.c | 81 + src/third_party/ffmpeg/libavutil/video_hint.h | 107 ++ src/third_party/ffmpeg/libavutil/vulkan.c | 27 +- src/third_party/ffmpeg/libavutil/vulkan.h | 4 + .../ffmpeg/libavutil/vulkan_functions.h | 2 + .../ffmpeg/libavutil/vulkan_loader.h | 1 + .../ffmpeg/libavutil/wchar_filename.h | 3 +- 2013 files changed, 46339 insertions(+), 21564 deletions(-) mode change 100755 => 100644 arm/android/third_party/ffmpeg/chromium/ffmpeg.sigs create mode 100644 arm/android/third_party/ffmpeg/libavcodec/av1_levels.c create mode 100644 arm/android/third_party/ffmpeg/libavcodec/av1_levels.h create mode 100644 arm/android/third_party/ffmpeg/libavcodec/hwaccel_internal.h create mode 100644 arm/android/third_party/ffmpeg/libavcodec/jpegxl.h create mode 100644 arm/android/third_party/ffmpeg/libavcodec/jpegxl_parse.c create mode 100644 arm/android/third_party/ffmpeg/libavcodec/jpegxl_parse.h create mode 100644 arm/android/third_party/ffmpeg/libavcodec/jpegxl_parser.c create mode 100644 arm/android/third_party/ffmpeg/libavcodec/osq.c create mode 100644 arm/android/third_party/ffmpeg/libavcodec/riscv/g722dsp_init.c create mode 100644 arm/android/third_party/ffmpeg/libavcodec/riscv/g722dsp_rvv.S create mode 100644 arm/android/third_party/ffmpeg/libavcodec/tests/av1_levels.c create mode 100644 arm/android/third_party/ffmpeg/libavcodec/vaapi_encode_av1.c create mode 100644 arm/android/third_party/ffmpeg/libavutil/aarch64/autorename_libavutil_aarch64_cpu.c create mode 100644 arm/android/third_party/ffmpeg/libavutil/emms.h create mode 100644 arm/android/third_party/ffmpeg/libavutil/executor.c create mode 100644 arm/android/third_party/ffmpeg/libavutil/executor.h create mode 100644 arm/android/third_party/ffmpeg/libavutil/riscv/bswap_rvb.S create mode 100644 arm/android/third_party/ffmpeg/libavutil/video_hint.c create mode 100644 arm/android/third_party/ffmpeg/libavutil/video_hint.h mode change 100755 => 100644 arm/raspi/third_party/ffmpeg/chromium/ffmpeg.sigs create mode 100644 arm/raspi/third_party/ffmpeg/libavcodec/av1_levels.c create mode 100644 arm/raspi/third_party/ffmpeg/libavcodec/av1_levels.h create mode 100644 arm/raspi/third_party/ffmpeg/libavcodec/hwaccel_internal.h create mode 100644 arm/raspi/third_party/ffmpeg/libavcodec/jpegxl.h create mode 100644 arm/raspi/third_party/ffmpeg/libavcodec/jpegxl_parse.c create mode 100644 arm/raspi/third_party/ffmpeg/libavcodec/jpegxl_parse.h create mode 100644 arm/raspi/third_party/ffmpeg/libavcodec/jpegxl_parser.c create mode 100644 arm/raspi/third_party/ffmpeg/libavcodec/osq.c create mode 100644 arm/raspi/third_party/ffmpeg/libavcodec/riscv/g722dsp_init.c create mode 100644 arm/raspi/third_party/ffmpeg/libavcodec/riscv/g722dsp_rvv.S create mode 100644 arm/raspi/third_party/ffmpeg/libavcodec/tests/av1_levels.c create mode 100644 arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode_av1.c create mode 100644 arm/raspi/third_party/ffmpeg/libavutil/aarch64/autorename_libavutil_aarch64_cpu.c create mode 100644 arm/raspi/third_party/ffmpeg/libavutil/emms.h create mode 100644 arm/raspi/third_party/ffmpeg/libavutil/executor.c create mode 100644 arm/raspi/third_party/ffmpeg/libavutil/executor.h create mode 100644 arm/raspi/third_party/ffmpeg/libavutil/riscv/bswap_rvb.S create mode 100644 arm/raspi/third_party/ffmpeg/libavutil/video_hint.c create mode 100644 arm/raspi/third_party/ffmpeg/libavutil/video_hint.h mode change 100755 => 100644 src/third_party/ffmpeg/chromium/ffmpeg.sigs create mode 100644 src/third_party/ffmpeg/libavcodec/av1_levels.c create mode 100644 src/third_party/ffmpeg/libavcodec/av1_levels.h create mode 100644 src/third_party/ffmpeg/libavcodec/hwaccel_internal.h create mode 100644 src/third_party/ffmpeg/libavcodec/jpegxl.h create mode 100644 src/third_party/ffmpeg/libavcodec/jpegxl_parse.c create mode 100644 src/third_party/ffmpeg/libavcodec/jpegxl_parse.h create mode 100644 src/third_party/ffmpeg/libavcodec/jpegxl_parser.c create mode 100644 src/third_party/ffmpeg/libavcodec/osq.c create mode 100644 src/third_party/ffmpeg/libavcodec/riscv/g722dsp_init.c create mode 100644 src/third_party/ffmpeg/libavcodec/riscv/g722dsp_rvv.S create mode 100644 src/third_party/ffmpeg/libavcodec/tests/av1_levels.c create mode 100644 src/third_party/ffmpeg/libavcodec/vaapi_encode_av1.c create mode 100644 src/third_party/ffmpeg/libavutil/aarch64/autorename_libavutil_aarch64_cpu.c create mode 100644 src/third_party/ffmpeg/libavutil/emms.h create mode 100644 src/third_party/ffmpeg/libavutil/executor.c create mode 100644 src/third_party/ffmpeg/libavutil/executor.h create mode 100644 src/third_party/ffmpeg/libavutil/riscv/bswap_rvb.S create mode 100644 src/third_party/ffmpeg/libavutil/video_hint.c create mode 100644 src/third_party/ffmpeg/libavutil/video_hint.h diff --git a/TODO.md b/TODO.md index d02f2ce4..8341e218 100644 --- a/TODO.md +++ b/TODO.md @@ -43,3 +43,5 @@ Thorium Remote Desktop > Chrome Remote Desktop ThoriumOS Flex > ThoriumOS made possible by Thorium > Chromium Experiments > Thorium Experiments + +Make download warning blocker actually work diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/config.h index 73bca51c..d759f81d 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/arm-linux-androideabi --extra-cflags='--target=arm-linux-androideabi24' --extra-ldflags='--target=arm-linux-androideabi24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/arm-linux-androideabi --extra-ldflags='--gcc-toolchain=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-neon --extra-cflags='-mtune=generic-armv7-a' --extra-cflags='-mfloat-abi=softfp' --extra-cflags='-mfpu=neon' --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/arm-linux-androideabi --extra-cflags='--target=arm-linux-androideabi24' --extra-ldflags='--target=arm-linux-androideabi24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/arm-linux-androideabi --extra-ldflags='--gcc-toolchain=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-neon --extra-cflags='-mtune=generic-armv7-a' --extra-cflags='-mfloat-abi=softfp' --extra-cflags='-mfpu=neon' --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME android #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/config_components.h index 7e09d5f5..941ec3c9 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/arm64/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/arm64/config.h index eadd0284..c32cd7b0 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/arm64/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/aarch64-linux-android --extra-cflags='--target=aarch64-linux-android24' --extra-ldflags='--target=aarch64-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/aarch64-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/aarch64-linux-android --extra-cflags='--target=aarch64-linux-android24' --extra-ldflags='--target=aarch64-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/aarch64-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME android #define av_restrict restrict #define EXTERN_PREFIX "" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/arm64/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/arm64/config_components.h index 7e09d5f5..941ec3c9 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/arm64/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/arm64/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/arm64/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config.h index 12e20871..8f7c6ee4 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/i686-linux-android --extra-cflags='--target=i686-linux-android24' --extra-ldflags='--target=i686-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/i686-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --disable-x86asm --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/i686-linux-android --extra-cflags='--target=i686-linux-android24' --extra-ldflags='--target=i686-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/i686-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --disable-x86asm --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME android #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -199,7 +198,7 @@ #define HAVE_ALIGNED_STACK 1 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CLZ 1 -#define HAVE_FAST_CMOV 0 +#define HAVE_FAST_CMOV 1 #define HAVE_FAST_FLOAT16 0 #define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 1 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config_components.h index 7e09d5f5..941ec3c9 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/ia32/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/ia32/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/ia32/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/ia32/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.asm b/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.asm index ed8bef71..7edacd19 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.asm +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.h index 3ba83b04..0989111b 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/x86_64-linux-android --extra-cflags='--target=x86_64-linux-android24' --extra-ldflags='--target=x86_64-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/x86_64-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=x86_64 --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/x86_64-linux-android --extra-cflags='--target=x86_64-linux-android24' --extra-ldflags='--target=x86_64-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/x86_64-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=x86_64 --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME android #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/x64/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/x64/config_components.h index 7e09d5f5..941ec3c9 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/x64/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/x64/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/x64/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/android/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/config.h index 664b1ffa..3c712fdc 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/17/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/18/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME darwin #define av_restrict restrict #define EXTERN_PREFIX "_" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/config_components.h index 1beef521..cc7e540c 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config.asm b/arm/android/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config.asm index d9bdaeec..152bc873 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config.asm +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config.h index bb6d3694..5b648b58 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=x86_64-apple-macosx' --extra-cflags=-F/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/17/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags='-arch x86_64' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=x86_64-apple-macosx' --extra-cflags=-F/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/18/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags='-arch x86_64' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME darwin #define av_restrict restrict #define EXTERN_PREFIX "_" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config_components.h index 1beef521..cc7e540c 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/ios/x64/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/ios/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/ios/x64/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/ios/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config.h index bc2366cd..9ca5c18b 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --disable-asm --disable-inline-asm --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --disable-asm --disable-inline-asm --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -199,7 +198,7 @@ #define HAVE_ALIGNED_STACK 0 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CLZ 0 -#define HAVE_FAST_CMOV 0 +#define HAVE_FAST_CMOV 1 #define HAVE_FAST_FLOAT16 0 #define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 0 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 0 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config_components.h index 1beef521..cc7e540c 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/config.h index 071fa318..a0823f87 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/config_components.h index 1beef521..cc7e540c 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm/config.h index 67803303..e3b65757 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm/config_components.h index 1beef521..cc7e540c 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/config.h index 6a8dd2d0..d886390f 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --target-os=linux --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_arm64-sysroot --disable-dotprod --disable-i8mm --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --target-os=linux --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_arm64-sysroot --disable-dotprod --disable-i8mm --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/config_components.h index 1beef521..cc7e540c 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.asm b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.asm index abcd3716..baff8fea 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.asm +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.asm @@ -23,7 +23,6 @@ %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 @@ -183,7 +182,7 @@ %define HAVE_ALIGNED_STACK 1 %define HAVE_FAST_64BIT 0 %define HAVE_FAST_CLZ 1 -%define HAVE_FAST_CMOV 0 +%define HAVE_FAST_CMOV 1 %define HAVE_FAST_FLOAT16 0 %define HAVE_LOCAL_ALIGNED 1 %define HAVE_SIMD_ALIGN_16 1 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.h index 72032e42..ae062a84 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -199,7 +198,7 @@ #define HAVE_ALIGNED_STACK 1 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CLZ 1 -#define HAVE_FAST_CMOV 0 +#define HAVE_FAST_CMOV 1 #define HAVE_FAST_FLOAT16 0 #define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 1 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config_components.h index 1beef521..cc7e540c 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.asm b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.asm index 169bd144..f58c6865 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.asm +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.h index bca1d896..39f07d51 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config_components.h index 1beef521..cc7e540c 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/config.h index 664b1ffa..3c712fdc 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/17/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/18/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME darwin #define av_restrict restrict #define EXTERN_PREFIX "_" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/config_components.h index 1beef521..cc7e540c 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.asm b/arm/android/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.asm index d9bdaeec..152bc873 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.asm +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.h index bb6d3694..5b648b58 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=x86_64-apple-macosx' --extra-cflags=-F/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/17/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags='-arch x86_64' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=x86_64-apple-macosx' --extra-cflags=-F/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/18/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags='-arch x86_64' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME darwin #define av_restrict restrict #define EXTERN_PREFIX "_" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config_components.h index 1beef521..cc7e540c 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/arm64/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/arm64/config.h index 3da64dbb..90d0307a 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/arm64/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --arch=aarch64 --as=clang-cl --extra-cflags='--target=arm64-windows' --extra-cflags=/winsysroot/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --arch=aarch64 --as=clang-cl --extra-cflags='--target=arm64-windows' --extra-cflags=/winsysroot/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME win32 #define av_restrict restrict #define EXTERN_PREFIX "" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/arm64/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/arm64/config_components.h index 1beef521..cc7e540c 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/arm64/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/arm64/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/arm64/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.asm b/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.asm index a8c3c0bc..cd5eb2d6 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.asm +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.asm @@ -23,7 +23,6 @@ %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 @@ -183,7 +182,7 @@ %define HAVE_ALIGNED_STACK 0 %define HAVE_FAST_64BIT 0 %define HAVE_FAST_CLZ 1 -%define HAVE_FAST_CMOV 0 +%define HAVE_FAST_CMOV 1 %define HAVE_FAST_FLOAT16 0 %define HAVE_LOCAL_ALIGNED 1 %define HAVE_SIMD_ALIGN_16 1 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.h index 2ea7098e..b7124eda 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=-m32 --extra-cflags=/winsysroot/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=-m32 --extra-cflags=/winsysroot/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME win32 #define av_restrict restrict #define EXTERN_PREFIX "_" @@ -39,7 +39,6 @@ #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 @@ -199,7 +198,7 @@ #define HAVE_ALIGNED_STACK 0 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CLZ 1 -#define HAVE_FAST_CMOV 0 +#define HAVE_FAST_CMOV 1 #define HAVE_FAST_FLOAT16 0 #define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 1 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config_components.h index 1beef521..cc7e540c 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/ia32/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/ia32/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/ia32/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/ia32/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.asm b/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.asm index 2254be52..372d47a4 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.asm +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.h index f2c5b858..e0837dae 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/ffmpeg/chromium/include/win --target-os=win64 --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=/winsysroot/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/ffmpeg/chromium/include/win --target-os=win64 --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=/winsysroot/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME win64 #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/x64/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/x64/config_components.h index 1beef521..cc7e540c 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/x64/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/config.h b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/config.h index be6511a4..85c83de3 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --disable-asm --disable-inline-asm --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --disable-asm --disable-inline-asm --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -199,7 +198,7 @@ #define HAVE_ALIGNED_STACK 0 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CLZ 0 -#define HAVE_FAST_CMOV 0 +#define HAVE_FAST_CMOV 1 #define HAVE_FAST_FLOAT16 0 #define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 0 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 1 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 0 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/config_components.h index 7fc07790..2ea71092 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/config.h b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/config.h index 2404da38..fe463009 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 1 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/config_components.h index 7fc07790..2ea71092 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/config.h b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/config.h index c997835d..6d4b09c7 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 1 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/config_components.h index 7fc07790..2ea71092 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/config.h b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/config.h index 30baaf7a..307c7597 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --target-os=linux --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_arm64-sysroot --disable-dotprod --disable-i8mm --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --target-os=linux --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_arm64-sysroot --disable-dotprod --disable-i8mm --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 1 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/config_components.h index 7fc07790..2ea71092 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.asm b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.asm index 81e9a599..1cf35ddc 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.asm +++ b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.asm @@ -23,7 +23,6 @@ %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 @@ -183,7 +182,7 @@ %define HAVE_ALIGNED_STACK 1 %define HAVE_FAST_64BIT 0 %define HAVE_FAST_CLZ 1 -%define HAVE_FAST_CMOV 0 +%define HAVE_FAST_CMOV 1 %define HAVE_FAST_FLOAT16 0 %define HAVE_LOCAL_ALIGNED 1 %define HAVE_SIMD_ALIGN_16 1 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 1 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.h b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.h index 6c1e5ed6..ba317e7c 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -199,7 +198,7 @@ #define HAVE_ALIGNED_STACK 1 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CLZ 1 -#define HAVE_FAST_CMOV 0 +#define HAVE_FAST_CMOV 1 #define HAVE_FAST_FLOAT16 0 #define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 1 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 1 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config_components.h index 7fc07790..2ea71092 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.asm b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.asm index e9fe6fa8..3d71bee0 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.asm +++ b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 1 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.h b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.h index 415f4c51..5b8e1a46 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 1 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config_components.h index 7fc07790..2ea71092 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/config.h index d8d80900..fc761975 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/arm-linux-androideabi --extra-cflags='--target=arm-linux-androideabi24' --extra-ldflags='--target=arm-linux-androideabi24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/arm-linux-androideabi --extra-ldflags='--gcc-toolchain=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-neon --extra-cflags='-mtune=generic-armv7-a' --extra-cflags='-mfloat-abi=softfp' --extra-cflags='-mfpu=neon'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/arm-linux-androideabi --extra-cflags='--target=arm-linux-androideabi24' --extra-ldflags='--target=arm-linux-androideabi24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/arm-linux-androideabi --extra-ldflags='--gcc-toolchain=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-neon --extra-cflags='-mtune=generic-armv7-a' --extra-cflags='-mfloat-abi=softfp' --extra-cflags='-mfpu=neon'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME android #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/config_components.h index 01c9180a..0f131a30 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/arm64/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/arm64/config.h index 85ab27b0..0d51c602 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/arm64/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/aarch64-linux-android --extra-cflags='--target=aarch64-linux-android24' --extra-ldflags='--target=aarch64-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/aarch64-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/aarch64-linux-android --extra-cflags='--target=aarch64-linux-android24' --extra-ldflags='--target=aarch64-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/aarch64-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME android #define av_restrict restrict #define EXTERN_PREFIX "" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/arm64/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/arm64/config_components.h index 01c9180a..0f131a30 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/arm64/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/arm64/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/arm64/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config.h index dc245d96..2905f63e 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/i686-linux-android --extra-cflags='--target=i686-linux-android24' --extra-ldflags='--target=i686-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/i686-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --disable-x86asm" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/i686-linux-android --extra-cflags='--target=i686-linux-android24' --extra-ldflags='--target=i686-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/i686-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --disable-x86asm" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME android #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -199,7 +198,7 @@ #define HAVE_ALIGNED_STACK 1 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CLZ 1 -#define HAVE_FAST_CMOV 0 +#define HAVE_FAST_CMOV 1 #define HAVE_FAST_FLOAT16 0 #define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 1 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config_components.h index 01c9180a..0f131a30 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/ia32/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/ia32/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/ia32/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/ia32/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.asm b/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.asm index d89a8d7d..af65909a 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.asm +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.h index af721ef9..9cabe944 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/x86_64-linux-android --extra-cflags='--target=x86_64-linux-android24' --extra-ldflags='--target=x86_64-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/x86_64-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=x86_64" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/x86_64-linux-android --extra-cflags='--target=x86_64-linux-android24' --extra-ldflags='--target=x86_64-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/x86_64-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=x86_64" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME android #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/x64/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/x64/config_components.h index 01c9180a..0f131a30 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/x64/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/x64/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/x64/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/android/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/config.h index 55412afe..fedc0bd5 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/17/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/18/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME darwin #define av_restrict restrict #define EXTERN_PREFIX "_" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/config_components.h index 21fcd6e8..9989b924 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config.asm b/arm/android/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config.asm index a853fb10..c34ea5ab 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config.asm +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config.h index c727314c..d7d2b758 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=x86_64-apple-macosx' --extra-cflags=-F/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/17/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags='-arch x86_64'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=x86_64-apple-macosx' --extra-cflags=-F/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/18/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags='-arch x86_64'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME darwin #define av_restrict restrict #define EXTERN_PREFIX "_" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config_components.h index 21fcd6e8..9989b924 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/ios/x64/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/ios/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/ios/x64/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/ios/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config.h index 36752bea..586e2b23 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --disable-asm --disable-inline-asm --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --disable-asm --disable-inline-asm --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -199,7 +198,7 @@ #define HAVE_ALIGNED_STACK 0 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CLZ 0 -#define HAVE_FAST_CMOV 0 +#define HAVE_FAST_CMOV 1 #define HAVE_FAST_FLOAT16 0 #define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 0 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 0 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config_components.h index 21fcd6e8..9989b924 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/config.h index 624d983f..427fb37e 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/config_components.h index 21fcd6e8..9989b924 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm/config.h index a6977743..b8228ab7 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm/config_components.h index 21fcd6e8..9989b924 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/config.h index 258b87bb..4cbed2de 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --target-os=linux --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_arm64-sysroot --disable-dotprod --disable-i8mm --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --target-os=linux --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_arm64-sysroot --disable-dotprod --disable-i8mm --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/config_components.h index 21fcd6e8..9989b924 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.asm b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.asm index 1721ad67..6247ebfb 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.asm +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.asm @@ -23,7 +23,6 @@ %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 @@ -183,7 +182,7 @@ %define HAVE_ALIGNED_STACK 1 %define HAVE_FAST_64BIT 0 %define HAVE_FAST_CLZ 1 -%define HAVE_FAST_CMOV 0 +%define HAVE_FAST_CMOV 1 %define HAVE_FAST_FLOAT16 0 %define HAVE_LOCAL_ALIGNED 1 %define HAVE_SIMD_ALIGN_16 1 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.h index 9e273d18..fee5bc9a 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -199,7 +198,7 @@ #define HAVE_ALIGNED_STACK 1 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CLZ 1 -#define HAVE_FAST_CMOV 0 +#define HAVE_FAST_CMOV 1 #define HAVE_FAST_FLOAT16 0 #define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 1 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config_components.h index 21fcd6e8..9989b924 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.asm b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.asm index 1c5a80d7..761a2ada 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.asm +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.h index 50800252..b2d24a08 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config_components.h index 21fcd6e8..9989b924 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/x64/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/x64/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/linux/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/config.h index 55412afe..fedc0bd5 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/17/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/18/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME darwin #define av_restrict restrict #define EXTERN_PREFIX "_" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/config_components.h index 21fcd6e8..9989b924 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.asm b/arm/android/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.asm index a853fb10..c34ea5ab 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.asm +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.h index c727314c..d7d2b758 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=x86_64-apple-macosx' --extra-cflags=-F/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/17/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags='-arch x86_64'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=x86_64-apple-macosx' --extra-cflags=-F/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/18/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags='-arch x86_64'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME darwin #define av_restrict restrict #define EXTERN_PREFIX "_" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config_components.h index 21fcd6e8..9989b924 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/mac/x64/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/mac/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/mac/x64/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/mac/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/arm64/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/arm64/config.h index 08830eb2..3602e2a6 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/arm64/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --arch=aarch64 --as=clang-cl --extra-cflags='--target=arm64-windows' --extra-cflags=/winsysroot/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --arch=aarch64 --as=clang-cl --extra-cflags='--target=arm64-windows' --extra-cflags=/winsysroot/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME win32 #define av_restrict restrict #define EXTERN_PREFIX "" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/arm64/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/arm64/config_components.h index 21fcd6e8..9989b924 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/arm64/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/arm64/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/arm64/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.asm b/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.asm index 287b6e96..4493c7fa 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.asm +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.asm @@ -23,7 +23,6 @@ %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 @@ -183,7 +182,7 @@ %define HAVE_ALIGNED_STACK 0 %define HAVE_FAST_64BIT 0 %define HAVE_FAST_CLZ 1 -%define HAVE_FAST_CMOV 0 +%define HAVE_FAST_CMOV 1 %define HAVE_FAST_FLOAT16 0 %define HAVE_LOCAL_ALIGNED 1 %define HAVE_SIMD_ALIGN_16 1 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.h index 6e0f6dd3..b4ad6928 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=-m32 --extra-cflags=/winsysroot/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=-m32 --extra-cflags=/winsysroot/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME win32 #define av_restrict restrict #define EXTERN_PREFIX "_" @@ -39,7 +39,6 @@ #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 @@ -199,7 +198,7 @@ #define HAVE_ALIGNED_STACK 0 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CLZ 1 -#define HAVE_FAST_CMOV 0 +#define HAVE_FAST_CMOV 1 #define HAVE_FAST_FLOAT16 0 #define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 1 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config_components.h index 21fcd6e8..9989b924 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/ia32/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/ia32/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/ia32/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/ia32/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.asm b/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.asm index 7e139c1d..386586e3 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.asm +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.h index e3f13d40..cf328480 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/ffmpeg/chromium/include/win --target-os=win64 --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=/winsysroot/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/ffmpeg/chromium/include/win --target-os=win64 --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=/winsysroot/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME win64 #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/x64/config_components.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/x64/config_components.h index 21fcd6e8..9989b924 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/x64/config_components.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/x64/libavutil/ffversion.h b/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/x64/libavutil/ffversion.h +++ b/arm/android/third_party/ffmpeg/chromium/config/Chromium/win/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/android/third_party/ffmpeg/chromium/ffmpeg.sigs b/arm/android/third_party/ffmpeg/chromium/ffmpeg.sigs old mode 100755 new mode 100644 index 83c90539..4286e63a --- a/arm/android/third_party/ffmpeg/chromium/ffmpeg.sigs +++ b/arm/android/third_party/ffmpeg/chromium/ffmpeg.sigs @@ -66,6 +66,7 @@ void *av_buffer_get_opaque(const AVBufferRef *buf); int av_get_cpu_flags(void); void av_force_cpu_flags(int flags); void av_max_alloc(size_t max); +char *av_strdup(const char *s); int av_strerror(int errnum, char *errbuf, size_t errbuf_size); AVFrame *av_frame_clone(const AVFrame *src); void av_frame_unref(AVFrame *frame); diff --git a/arm/android/third_party/ffmpeg/chromium/patches/README b/arm/android/third_party/ffmpeg/chromium/patches/README index ebc9c346..85ad6f19 100644 --- a/arm/android/third_party/ffmpeg/chromium/patches/README +++ b/arm/android/third_party/ffmpeg/chromium/patches/README @@ -3,112 +3,6 @@ --------------------------------------------------------------------- ------------------------------------------------------------------- -commit 35a9efdd9ee40dff4a5e45f0039328cd893c1264 -Author: Dale Curtis -Date: Fri Feb 3 16:12:21 2012 -0800 - - Remove old patches, apply existing patches. - - Deleted, since from upstream: - deleted: from_upstream/36_theora_flush.patch - deleted: from_upstream/38_webm_cues_before_first_cluster.patch - deleted: from_upstream/51_vp3_coefficient_overflow.patch - - Deleted, since non-working according to rbultje: - deleted: to_upstream/15_webp_ffmpeg.patch - - Deleted, since get_bits upstreamed: - deleted: ugly/07_get_bits_overrun.patch - deleted: ugly/08_enforce_theora_oob.patch - deleted: ugly/09_enforce_vorbis_oob_divzero.patch - deleted: ugly/10_aac_oob_read.patch - deleted: ugly/30_enforce_mp3_oob.patch - - Deleted, since upstreamed: - deleted: to_upstream/14_vp8_encode_options.patch - deleted: to_upstream/34_ogg_memcpy.patch - deleted: to_upstream/37_VP8_armv6_optimizations.patch - deleted: to_upstream/39_VP8_fix_oob_read_writes.patch - deleted: to_upstream/40_MKV_fix_oob_write.patch - deleted: to_upstream/42_vp8_fix_segmentation_maps.patch - deleted: to_upstream/43_mkv_seekahead_revalidate.patch - deleted: to_upstream/44_vorbis_oob_read.patch - deleted: to_upstream/45_mkv_fix_segmap_cache_overflow.patch - deleted: to_upstream/46_vp3_fix_double_free_invalid_read.patch - deleted: to_upstream/47_vp3_fix_infloop_and_memleak.patch - deleted: to_upstream/48_vorbis_residue_buffer.patch - deleted: to_upstream/49_vorbis_buffer_defense.patch - deleted: to_upstream/50_vp8_fix_frame_size_changes.patch - deleted: to_upstream/52_vorbis_fix_floor1_vector_int_overflow.patch - - Deleted, for now, but will be fixed w/ merge: - modified: ugly/31_remove_attribute_deprecated.patch - - Not applied, since no longer necessary (will be deleted after testing): - skipped: to_upstream/01_static_pthread_O2.patch - - Also disables unchecked bitstream reading per rbultje. - - BUG=none - TEST=ffmpeg_regression_tests - -Affects: - libavformat/matroskadec.c - ------------------------------------------------------------------- -commit 87b9d8e5781b28ae6f27b454605d8dbdf325d7e9 -Merge: 3a9bce0eec c39916bc2f -Author: Dale Curtis -Date: Mon Oct 1 10:30:25 2012 -0700 - - FFmpeg merge for M24. - - Merges FFmpeg from c39916bc2f43eed86f9822b7d6802b8a4f2a86c8 - - Conflicts: - libavcodec/vorbisdec.c - libavformat/matroskadec.c - libavformat/mov.c - libavformat/oggdec.c - -Affects: - libavformat/matroskadec.c - ------------------------------------------------------------------- -commit 67a3d8459c78a653192631c84611cf300c0c9b19 -Merge: 82ae69cc47 d91388367f -Author: Dale Curtis -Date: Mon Dec 3 14:22:52 2012 -0800 - - Merge FFmpeg from upstream for M25. - - Merged from d91388367fa64b98a09b45e2b7fb8435a62b7609. - - Conflicts: - configure - libavcodec/aacdec.c - libavcodec/ac3tab.h - libavcodec/dca.h - libavcodec/dnxhddata.h - libavcodec/mjpeg.h - libavcodec/mpeg4audio.h - libavcodec/mpegaudiodata.h - libavcodec/raw.h - libavformat/matroskadec.c - libavformat/mp3dec.c - libavutil/aes.h - libavutil/common.h - libavutil/intmath.h - libavutil/md5.h - libavutil/pixdesc.h - libavutil/sha.h - libavutil/tree.h - library.mak - -Affects: - libavformat/matroskadec.c - ------------------------------------------------------------------ commit 3a43b481b78e54009e293c6c6172fc6c68990d8c Author: Will Harris @@ -126,23 +20,6 @@ Date: Wed Jan 21 20:33:15 2015 -0800 Affects: libavutil/mem.c ------------------------------------------------------------------- -commit 967e4da013f8997d4cc34f1008f082a9c55e191f -Author: Dan Sanders -Date: Thu Jan 29 14:10:48 2015 -0800 - - Update patches and configs for M42. - - - Adds ffversion.h. - - Fixes to build with win8.1 SDK and for linux-noasm. - - Removed ugly patches and replaced with descriptions; - the patches were not being kept up to date. - - Change-Id: Ie0eab2bf3ab6c52cd088e54172792175ab7cb2de - -Affects: - libavformat/matroskadec.c - ------------------------------------------------------------------ commit f3299330654ac1b40c50b3cbcae619f42eb7d838 Author: Scott Graham @@ -246,27 +123,6 @@ Date: Fri Oct 21 15:49:44 2016 -0700 Affects: configure ------------------------------------------------------------------- -commit e4decbe7fd3f49d90f296e83bcbf2beb8edf202a -Merge: b4d337e668 134233972e -Author: Matt Wolenetz -Date: Tue Oct 25 14:31:38 2016 -0700 - - Merge FFmpeg for M56. - - Conflicts: - .gitignore - configure - libavcodec/h264.c - libavcodec/h264_parser.c - libavformat/matroskadec.c - libavformat/mov.c - libavformat/movenc.c - libavformat/utils.c - -Affects: - libavformat/matroskadec.c - ------------------------------------------------------------------ commit b281073a7b1ccff67b2cd8ec636facceeeb82327 Author: Matt Wolenetz @@ -433,19 +289,6 @@ Affects: libavutil/log.c libavutil/log.h ------------------------------------------------------------------- -commit 4a74bbe9c6a37e7cadd7fa3b4e9fb943b57e3f00 -Merge: bb424af97f 6a50a8f340 -Author: Dale Curtis -Date: Fri Nov 3 12:06:55 2017 -0700 - - Merge remote-tracking branch 'upstream/master' into merge-m64 - - Synced from upstream/6a50a8f340161a0b65feb3537591b0381a6a6b38 - -Affects: - configure - ------------------------------------------------------------------ commit 76b57e9f808de42f6f1bb7df97531aa4b5cb7bb0 Author: Dale Curtis @@ -608,21 +451,6 @@ Date: Thu Nov 8 10:55:58 2018 -0800 Affects: libavutil/x86/x86inc.asm ------------------------------------------------------------------- -commit d7ba23c23434eb938c6fcae4fe77ca1e2a2fbeff -Author: liberato@chromium.org -Date: Thu Aug 22 10:52:09 2019 -0700 - - Fail matroska parsing with an error rather than assert. - - Bug: 995706 - Change-Id: I6f9865e0fdf44def6cc40e369954e66a7e0ad1d1 - Reviewed-on: https://chromium-review.googlesource.com/c/chromium/third_party/ffmpeg/+/1765951 - Reviewed-by: Matthew Wolenetz - -Affects: - libavformat/matroskadec.c - ------------------------------------------------------------------ commit 6a44f89787a6103bf85825aac5b7bcfdba0dde5f Merge: c5003c8e13 acbd950ed2 @@ -849,7 +677,6 @@ Affects: libavcodec/mpeg4video_parser.c libavcodec/smacker.c libavcodec/utvideodec.c - libavformat/matroskadec.c ------------------------------------------------------------------ commit 1bc7749f096fc98032fc3206217b4fc47047258f @@ -954,17 +781,18 @@ Affects: libavutil/frame.h ------------------------------------------------------------------ -commit 881c5c3f6412020c37e97e178e0f5da9ddd2ae90 -Author: Frank Liberato -Date: Thu Jun 1 18:20:23 2023 +0000 +commit 125536d78f103ff44efeb26c4d7c98413a5a618f +Merge: 0d75f366d5 9240035c0e +Author: John Rummell +Date: Wed Oct 4 10:12:40 2023 -0700 - FFMpeg roll for M116 + Merge remote-tracking branch 'upstream/master' into sushi-2023-10-04-10-06-42 - Bug: 1449369 - Change-Id: Icb1bf9347dcf6ec71e61f552ab060cd8ba7504d2 - Reviewed-on: https://chromium-review.googlesource.com/c/chromium/third_party/ffmpeg/+/4581055 - Reviewed-by: Thomas Guilbert + Conflicts: + both modified: configure + both modified: libavformat/matroskadec.c + deleted by us: libavutil/macos_kperf.c Affects: - libavcodec/vp8data.c + configure diff --git a/arm/android/third_party/ffmpeg/chromium/patches/config_flag_changes.txt b/arm/android/third_party/ffmpeg/chromium/patches/config_flag_changes.txt index e69de29b..f3061930 100644 --- a/arm/android/third_party/ffmpeg/chromium/patches/config_flag_changes.txt +++ b/arm/android/third_party/ffmpeg/chromium/patches/config_flag_changes.txt @@ -0,0 +1,23 @@ ++ CONFIG_APSNR_FILTER 0 ++ CONFIG_ASISDR_FILTER 0 ++ CONFIG_AV1_VAAPI_ENCODER 0 ++ CONFIG_JPEGXL_PARSER 0 ++ CONFIG_LIBVMAF_CUDA_FILTER 0 ++ CONFIG_MPEG2_NVDEC_HWACCEL 0 ++ CONFIG_OSQ_DECODER 0 ++ CONFIG_OSQ_DEMUXER 0 ++ CONFIG_RV34_PARSER 0 ++ CONFIG_SCALE_VT_FILTER 0 ++ CONFIG_TRANSPOSE_VT_FILTER 0 ++ CONFIG_USM_DEMUXER 0 ++ HAVE_FAST_CMOV 1 ++ HAVE_OPENVINO2 0 +- ARCH_TOMI 0 +- CONFIG_DCT 1 +- CONFIG_FFT 1 +- CONFIG_MDCT 0 +- CONFIG_MPEG2_NVDEC_HWACCEL 0 +- CONFIG_RDFT 1 +- CONFIG_RV30_PARSER 0 +- CONFIG_RV40_PARSER 0 +- HAVE_FAST_CMOV 0 diff --git a/arm/android/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py b/arm/android/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py index a3118ef8..de2ec4f7 100755 --- a/arm/android/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py +++ b/arm/android/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py @@ -26,7 +26,7 @@ ROBO_CONFIGURATION = config.RoboConfiguration() FFMPEG_DIR = ROBO_CONFIGURATION.ffmpeg_home() CHROMIUM_ROOT_DIR = ROBO_CONFIGURATION.chrome_src() NDK_ROOT_DIR = os.path.abspath( - os.path.join(CHROMIUM_ROOT_DIR, 'third_party', 'android_toolchain')) + os.path.join(CHROMIUM_ROOT_DIR, 'third_party', 'android_toolchain', 'ndk')) # Token to indicate that a build has completed successfully, so that we can # skip it with `--fast`. SUCCESS_TOKEN = 'THIS_BUILD_WORKED' @@ -683,8 +683,6 @@ def ConfigureAndBuild(target_arch, target_os, host_os, host_arch, parallel_jobs, '--enable-avcodec', '--enable-avformat', '--enable-avutil', - '--enable-fft', - '--enable-rdft', '--enable-static', '--enable-libopus', diff --git a/arm/android/third_party/ffmpeg/ffmpeg_generated.gni b/arm/android/third_party/ffmpeg/ffmpeg_generated.gni index 375489c1..05965c3a 100644 --- a/arm/android/third_party/ffmpeg/ffmpeg_generated.gni +++ b/arm/android/third_party/ffmpeg/ffmpeg_generated.gni @@ -33,16 +33,12 @@ if ((is_android && current_cpu == "arm" && arm_use_neon) || (is_android && curre "libavcodec/codec_desc.c", "libavcodec/codec_par.c", "libavcodec/d3d11va.c", - "libavcodec/dct.c", "libavcodec/dct32_fixed.c", "libavcodec/dct32_float.c", "libavcodec/decode.c", "libavcodec/dirac.c", "libavcodec/dv_profile.c", "libavcodec/encode.c", - "libavcodec/fft_fixed_32.c", - "libavcodec/fft_float.c", - "libavcodec/fft_init_table.c", "libavcodec/flac.c", "libavcodec/flac_parser.c", "libavcodec/flacdata.c", @@ -80,7 +76,6 @@ if ((is_android && current_cpu == "arm" && arm_use_neon) || (is_android && curre "libavcodec/pthread_slice.c", "libavcodec/qsv_api.c", "libavcodec/raw.c", - "libavcodec/rdft.c", "libavcodec/to_upper4.c", "libavcodec/utils.c", "libavcodec/version.c", @@ -166,6 +161,7 @@ if ((is_android && current_cpu == "arm" && arm_use_neon) || (is_android && curre "libavutil/encryption_info.c", "libavutil/error.c", "libavutil/eval.c", + "libavutil/executor.c", "libavutil/fifo.c", "libavutil/file_open.c", "libavutil/film_grain_params.c", @@ -204,6 +200,7 @@ if ((is_android && current_cpu == "arm" && arm_use_neon) || (is_android && curre "libavutil/tx.c", "libavutil/uuid.c", "libavutil/video_enc_params.c", + "libavutil/video_hint.c", ] } @@ -293,28 +290,6 @@ if ((current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (current_cpu == " ] } -if ((is_apple && current_cpu == "x64") || (is_win && current_cpu == "x64") || (is_win && current_cpu == "x86") || (use_linux_config && current_cpu == "x64") || (use_linux_config && current_cpu == "x86")) { - ffmpeg_c_sources += [ - "libavcodec/x86/autorename_libavcodec_x86_videodsp_init.c", - "libavcodec/x86/h264_intrapred_init.c", - "libavcodec/x86/hpeldsp_init.c", - "libavcodec/x86/hpeldsp_vp3_init.c", - "libavcodec/x86/vp3dsp_init.c", - "libavcodec/x86/vp8dsp_init.c", - ] - ffmpeg_asm_sources += [ - "libavcodec/x86/autorename_libavcodec_x86_hpeldsp.asm", - "libavcodec/x86/autorename_libavcodec_x86_videodsp.asm", - "libavcodec/x86/autorename_libavcodec_x86_vp3dsp.asm", - "libavcodec/x86/autorename_libavcodec_x86_vp8dsp.asm", - "libavcodec/x86/fpel.asm", - "libavcodec/x86/h264_intrapred.asm", - "libavcodec/x86/h264_intrapred_10bit.asm", - "libavcodec/x86/hpeldsp_vp3.asm", - "libavcodec/x86/vp8dsp_loopfilter.asm", - ] -} - if ((use_linux_config && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "ChromeOS") || (use_linux_config && current_cpu == "arm" && ffmpeg_branding == "ChromeOS")) { ffmpeg_c_sources += [ "libavcodec/arm/blockdsp_init_arm.c", @@ -379,6 +354,26 @@ if ((use_linux_config && current_cpu == "x64" && ffmpeg_branding == "ChromeOS") ] } +if ((is_apple && current_cpu == "x64") || (is_win && current_cpu == "x64") || (is_win && current_cpu == "x86") || (use_linux_config && current_cpu == "x64") || (use_linux_config && current_cpu == "x86")) { + ffmpeg_c_sources += [ + "libavcodec/x86/autorename_libavcodec_x86_videodsp_init.c", + "libavcodec/x86/h264_intrapred_init.c", + "libavcodec/x86/hpeldsp_init.c", + "libavcodec/x86/vp3dsp_init.c", + "libavcodec/x86/vp8dsp_init.c", + ] + ffmpeg_asm_sources += [ + "libavcodec/x86/autorename_libavcodec_x86_hpeldsp.asm", + "libavcodec/x86/autorename_libavcodec_x86_videodsp.asm", + "libavcodec/x86/autorename_libavcodec_x86_vp3dsp.asm", + "libavcodec/x86/autorename_libavcodec_x86_vp8dsp.asm", + "libavcodec/x86/fpel.asm", + "libavcodec/x86/h264_intrapred.asm", + "libavcodec/x86/h264_intrapred_10bit.asm", + "libavcodec/x86/vp8dsp_loopfilter.asm", + ] +} + if ((use_linux_config && current_cpu == "arm" && arm_use_neon) || (use_linux_config && current_cpu == "arm")) { ffmpeg_c_sources += [ "libavcodec/arm/h264pred_init_arm.c", @@ -399,44 +394,6 @@ if ((use_linux_config && current_cpu == "arm" && arm_use_neon) || (use_linux_con ] } -if ((is_android && current_cpu == "x64") || (is_apple && current_cpu == "x64") || (is_win && current_cpu == "x64") || (is_win && current_cpu == "x86") || (use_linux_config && current_cpu == "x64") || (use_linux_config && current_cpu == "x86")) { - ffmpeg_c_sources += [ - "libavutil/x86/autorename_libavutil_x86_tx_float_init.c", - ] - ffmpeg_asm_sources += [ - "libavcodec/x86/dct32.asm", - "libavcodec/x86/fft.asm", - "libavcodec/x86/flacdsp.asm", - "libavcodec/x86/imdct36.asm", - "libavcodec/x86/vorbisdsp.asm", - "libavutil/x86/cpuid.asm", - "libavutil/x86/fixed_dsp.asm", - "libavutil/x86/float_dsp.asm", - "libavutil/x86/imgutils.asm", - "libavutil/x86/lls.asm", - "libavutil/x86/tx_float.asm", - ] -} - -if ((is_android && current_cpu == "arm" && arm_use_neon) || (use_linux_config && current_cpu == "arm" && arm_use_neon) || (use_linux_config && current_cpu == "arm")) { - ffmpeg_c_sources += [ - "libavcodec/arm/fft_init_arm.c", - "libavcodec/arm/flacdsp_init_arm.c", - "libavcodec/arm/mpegaudiodsp_init_arm.c", - "libavcodec/arm/rdft_init_arm.c", - "libavcodec/arm/vorbisdsp_init_arm.c", - "libavutil/arm/autorename_libavutil_arm_cpu.c", - "libavutil/arm/float_dsp_init_arm.c", - "libavutil/arm/float_dsp_init_vfp.c", - ] - ffmpeg_gas_sources += [ - "libavcodec/arm/fft_vfp.S", - "libavcodec/arm/flacdsp_arm.S", - "libavcodec/arm/mpegaudiodsp_fixed_armv6.S", - "libavutil/arm/float_dsp_vfp.S", - ] -} - if ((is_apple) || (is_win) || (use_linux_config)) { ffmpeg_c_sources += [ "libavcodec/autorename_libavcodec_videodsp.c", @@ -454,12 +411,28 @@ if ((is_apple) || (is_win) || (use_linux_config)) { ] } +if ((is_android && current_cpu == "x64") || (is_apple && current_cpu == "x64") || (is_win && current_cpu == "x64") || (is_win && current_cpu == "x86") || (use_linux_config && current_cpu == "x64") || (use_linux_config && current_cpu == "x86")) { + ffmpeg_c_sources += [ + "libavutil/x86/autorename_libavutil_x86_tx_float_init.c", + ] + ffmpeg_asm_sources += [ + "libavcodec/x86/dct32.asm", + "libavcodec/x86/flacdsp.asm", + "libavcodec/x86/imdct36.asm", + "libavcodec/x86/vorbisdsp.asm", + "libavutil/x86/cpuid.asm", + "libavutil/x86/fixed_dsp.asm", + "libavutil/x86/float_dsp.asm", + "libavutil/x86/imgutils.asm", + "libavutil/x86/lls.asm", + "libavutil/x86/tx_float.asm", + ] +} + if ((is_android && current_cpu == "x64") || (is_android && current_cpu == "x86") || (is_apple && current_cpu == "x64") || (is_win && current_cpu == "x64") || (is_win && current_cpu == "x86") || (use_linux_config && current_cpu == "x64") || (use_linux_config && current_cpu == "x86")) { ffmpeg_c_sources += [ "libavcodec/x86/autorename_libavcodec_x86_vorbisdsp_init.c", "libavcodec/x86/constants.c", - "libavcodec/x86/dct_init.c", - "libavcodec/x86/fft_init.c", "libavcodec/x86/flacdsp_init.c", "libavcodec/x86/mpegaudiodsp.c", "libavutil/x86/autorename_libavutil_x86_cpu.c", @@ -472,15 +445,13 @@ if ((is_android && current_cpu == "x64") || (is_android && current_cpu == "x86") if ((is_android && current_cpu == "arm64") || (is_apple && current_cpu == "arm64") || (is_win && current_cpu == "arm64") || (use_linux_config && current_cpu == "arm64")) { ffmpeg_c_sources += [ - "libavcodec/aarch64/fft_init_aarch64.c", "libavcodec/aarch64/mpegaudiodsp_init.c", "libavcodec/aarch64/vorbisdsp_init.c", - "libavutil/aarch64/cpu.c", + "libavutil/aarch64/autorename_libavutil_aarch64_cpu.c", "libavutil/aarch64/float_dsp_init.c", "libavutil/aarch64/tx_float_init.c", ] ffmpeg_gas_sources += [ - "libavcodec/aarch64/autorename_libavcodec_aarch64_fft_neon.S", "libavcodec/aarch64/autorename_libavcodec_aarch64_vorbisdsp_neon.S", "libavcodec/aarch64/mpegaudiodsp_neon.S", "libavutil/aarch64/autorename_libavutil_aarch64_float_dsp_neon.S", @@ -488,6 +459,22 @@ if ((is_android && current_cpu == "arm64") || (is_apple && current_cpu == "arm64 ] } +if ((is_android && current_cpu == "arm" && arm_use_neon) || (use_linux_config && current_cpu == "arm" && arm_use_neon) || (use_linux_config && current_cpu == "arm")) { + ffmpeg_c_sources += [ + "libavcodec/arm/flacdsp_init_arm.c", + "libavcodec/arm/mpegaudiodsp_init_arm.c", + "libavcodec/arm/vorbisdsp_init_arm.c", + "libavutil/arm/cpu.c", + "libavutil/arm/float_dsp_init_arm.c", + "libavutil/arm/float_dsp_init_vfp.c", + ] + ffmpeg_gas_sources += [ + "libavcodec/arm/flacdsp_arm.S", + "libavcodec/arm/mpegaudiodsp_fixed_armv6.S", + "libavutil/arm/float_dsp_vfp.S", + ] +} + if ((is_apple && current_cpu == "arm64") || (is_win && current_cpu == "arm64") || (use_linux_config && current_cpu == "arm64")) { ffmpeg_c_sources += [ "libavcodec/aarch64/h264pred_init.c", @@ -543,18 +530,6 @@ if (use_linux_config && current_cpu == "arm" && arm_use_neon) { ] } -if ((is_android && current_cpu == "arm" && arm_use_neon) || (use_linux_config && current_cpu == "arm" && arm_use_neon)) { - ffmpeg_c_sources += [ - "libavutil/arm/float_dsp_init_neon.c", - ] - ffmpeg_gas_sources += [ - "libavcodec/arm/fft_neon.S", - "libavcodec/arm/rdft_neon.S", - "libavcodec/arm/vorbisdsp_neon.S", - "libavutil/arm/float_dsp_neon.S", - ] -} - if (use_linux_config && current_cpu == "arm64" && ffmpeg_branding == "ChromeOS") { ffmpeg_c_sources += [ "libavcodec/aarch64/idctdsp_init_aarch64.c", @@ -598,6 +573,16 @@ if ((current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (use_linux_config ] } +if ((is_android && current_cpu == "arm" && arm_use_neon) || (use_linux_config && current_cpu == "arm" && arm_use_neon)) { + ffmpeg_c_sources += [ + "libavutil/arm/float_dsp_init_neon.c", + ] + ffmpeg_gas_sources += [ + "libavcodec/arm/vorbisdsp_neon.S", + "libavutil/arm/float_dsp_neon.S", + ] +} + if ((current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (use_linux_config && current_cpu == "x64" && ffmpeg_branding == "ChromeOS") || (use_linux_config && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (use_linux_config && current_cpu == "x86" && ffmpeg_branding == "ChromeOS")) { ffmpeg_c_sources += [ "libavcodec/x86/aacpsdsp_init.c", diff --git a/arm/android/third_party/ffmpeg/libavcodec/4xm.c b/arm/android/third_party/ffmpeg/libavcodec/4xm.c index 411e50da..c3e3a45d 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/4xm.c +++ b/arm/android/third_party/ffmpeg/libavcodec/4xm.c @@ -257,10 +257,10 @@ static av_cold void init_vlcs(void) for (j = 0; j < 4; j++) { block_type_vlc[i][j].table = table[i][j]; block_type_vlc[i][j].table_allocated = 32; - init_vlc(&block_type_vlc[i][j], BLOCK_TYPE_VLC_BITS, 7, + vlc_init(&block_type_vlc[i][j], BLOCK_TYPE_VLC_BITS, 7, &block_type_tab[i][j][0][1], 2, 1, &block_type_tab[i][j][0][0], 2, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); } } } @@ -706,8 +706,8 @@ static const uint8_t *read_huffman_tables(FourXContext *f, len_tab[j] = len; } - ff_free_vlc(&f->pre_vlc); - if (init_vlc(&f->pre_vlc, ACDC_VLC_BITS, 257, len_tab, 1, 1, + ff_vlc_free(&f->pre_vlc); + if (vlc_init(&f->pre_vlc, ACDC_VLC_BITS, 257, len_tab, 1, 1, bits_tab, 4, 4, 0)) return NULL; @@ -985,7 +985,7 @@ static av_cold int decode_end(AVCodecContext *avctx) av_freep(&f->cfrm[i].data); f->cfrm[i].allocated_size = 0; } - ff_free_vlc(&f->pre_vlc); + ff_vlc_free(&f->pre_vlc); return 0; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/8bps.c b/arm/android/third_party/ffmpeg/libavcodec/8bps.c index af98f62f..0becaa93 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/8bps.c +++ b/arm/android/third_party/ffmpeg/libavcodec/8bps.c @@ -26,27 +26,23 @@ * http://www.pcisys.net/~melanson/codecs/ * * Supports: PAL8 (RGB 8bpp, paletted) - * : BGR24 (RGB 24bpp) (can also output it as RGB32) - * : RGB32 (RGB 32bpp, 4th plane is alpha) + * : GBRP (RGB 24bpp) + * : GBRAP (RGB 32bpp, 4th plane is alpha) */ #include -#include "libavutil/bswap.h" +#include "libavutil/intreadwrite.h" #include "libavutil/internal.h" #include "avcodec.h" #include "codec_internal.h" #include "decode.h" - -static const enum AVPixelFormat pixfmt_rgb24[] = { - AV_PIX_FMT_BGR24, AV_PIX_FMT_0RGB32, AV_PIX_FMT_NONE }; - typedef struct EightBpsContext { AVCodecContext *avctx; - unsigned char planes; - unsigned char planemap[4]; + uint8_t planes; + uint8_t planemap[4]; } EightBpsContext; static int decode_frame(AVCodecContext *avctx, AVFrame *frame, @@ -55,15 +51,14 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; EightBpsContext * const c = avctx->priv_data; - const unsigned char *encoded = buf; - unsigned char *pixptr, *pixptr_end; + const uint8_t *encoded = buf; + uint8_t *pixptr, *pixptr_end; unsigned int height = avctx->height; // Real image height unsigned int dlen, p, row; - const unsigned char *lp, *dp, *ep; - unsigned char count; - unsigned int px_inc; - unsigned int planes = c->planes; - unsigned char *planemap = c->planemap; + const uint8_t *lp, *dp, *ep; + uint8_t count; + const uint8_t *planemap = c->planemap; + unsigned int planes = c->planes; int ret; if (buf_size < planes * height * 2) @@ -77,19 +72,18 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, /* Set data pointer after line lengths */ dp = encoded + planes * (height << 1); - px_inc = planes + (avctx->pix_fmt == AV_PIX_FMT_0RGB32); - for (p = 0; p < planes; p++) { + const int pi = planemap[p]; /* Lines length pointer for this plane */ lp = encoded + p * (height << 1); /* Decode a plane */ for (row = 0; row < height; row++) { - pixptr = frame->data[0] + row * frame->linesize[0] + planemap[p]; - pixptr_end = pixptr + frame->linesize[0]; + pixptr = frame->data[pi] + row * frame->linesize[pi]; + pixptr_end = pixptr + frame->linesize[pi]; if (ep - lp < row * 2 + 2) return AVERROR_INVALIDDATA; - dlen = av_be2ne16(*(const unsigned short *)(lp + row * 2)); + dlen = AV_RB16(lp + row * 2); /* Decode a row of this plane */ while (dlen > 0) { if (ep - dp <= 1) @@ -97,22 +91,19 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, if ((count = *dp++) <= 127) { count++; dlen -= count + 1; - if (pixptr_end - pixptr < count * px_inc) + if (pixptr_end - pixptr < count) break; if (ep - dp < count) return AVERROR_INVALIDDATA; - while (count--) { - *pixptr = *dp++; - pixptr += px_inc; - } + memcpy(pixptr, dp, count); + pixptr += count; + dp += count; } else { count = 257 - count; - if (pixptr_end - pixptr < count * px_inc) + if (pixptr_end - pixptr < count) break; - while (count--) { - *pixptr = *dp; - pixptr += px_inc; - } + memset(pixptr, dp[0], count); + pixptr += count; dp++; dlen -= 2; } @@ -150,16 +141,15 @@ static av_cold int decode_init(AVCodecContext *avctx) c->planemap[0] = 0; // 1st plane is palette indexes break; case 24: - avctx->pix_fmt = ff_get_format(avctx, pixfmt_rgb24); + avctx->pix_fmt = AV_PIX_FMT_GBRP; c->planes = 3; c->planemap[0] = 2; // 1st plane is red - c->planemap[1] = 1; // 2nd plane is green - c->planemap[2] = 0; // 3rd plane is blue + c->planemap[1] = 0; // 2nd plane is green + c->planemap[2] = 1; // 3rd plane is blue break; case 32: - avctx->pix_fmt = AV_PIX_FMT_RGB32; + avctx->pix_fmt = AV_PIX_FMT_GBRAP; c->planes = 4; - /* handle planemap setup later for decoding rgb24 data as rbg32 */ break; default: av_log(avctx, AV_LOG_ERROR, "Error: Unsupported color depth: %u.\n", @@ -167,11 +157,11 @@ static av_cold int decode_init(AVCodecContext *avctx) return AVERROR_INVALIDDATA; } - if (avctx->pix_fmt == AV_PIX_FMT_RGB32) { - c->planemap[0] = HAVE_BIGENDIAN ? 1 : 2; // 1st plane is red - c->planemap[1] = HAVE_BIGENDIAN ? 2 : 1; // 2nd plane is green - c->planemap[2] = HAVE_BIGENDIAN ? 3 : 0; // 3rd plane is blue - c->planemap[3] = HAVE_BIGENDIAN ? 0 : 3; // 4th plane is alpha + if (avctx->pix_fmt == AV_PIX_FMT_GBRAP) { + c->planemap[0] = 2; // 1st plane is red + c->planemap[1] = 0; // 2nd plane is green + c->planemap[2] = 1; // 3rd plane is blue + c->planemap[3] = 3; // 4th plane is alpha } return 0; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/Makefile b/arm/android/third_party/ffmpeg/libavcodec/Makefile index 1b0226c0..42af4e49 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/Makefile +++ b/arm/android/third_party/ffmpeg/libavcodec/Makefile @@ -32,6 +32,7 @@ OBJS = ac3_parser.o \ allcodecs.o \ avcodec.o \ avdct.o \ + avfft.o \ avpacket.o \ bitstream.o \ bitstream_filters.o \ @@ -81,7 +82,6 @@ OBJS-$(CONFIG_CBS_JPEG) += cbs_jpeg.o OBJS-$(CONFIG_CBS_MPEG2) += cbs_mpeg2.o OBJS-$(CONFIG_CBS_VP9) += cbs_vp9.o OBJS-$(CONFIG_CRYSTALHD) += crystalhd.o -OBJS-$(CONFIG_DCT) += dct.o dct32_fixed.o dct32_float.o OBJS-$(CONFIG_DEFLATE_WRAPPER) += zlib_wrapper.o OBJS-$(CONFIG_DOVI_RPU) += dovi_rpu.o OBJS-$(CONFIG_ERROR_RESILIENCE) += error_resilience.o @@ -90,9 +90,6 @@ OBJS-$(CONFIG_EXIF) += exif.o tiff_common.o OBJS-$(CONFIG_FAANDCT) += faandct.o OBJS-$(CONFIG_FAANIDCT) += faanidct.o OBJS-$(CONFIG_FDCTDSP) += fdctdsp.o jfdctfst.o jfdctint.o -FFT-OBJS-$(CONFIG_HARDCODED_TABLES) += cos_tables.o -OBJS-$(CONFIG_FFT) += avfft.o fft_float.o fft_fixed_32.o \ - fft_init_table.o $(FFT-OBJS-yes) OBJS-$(CONFIG_FMTCONVERT) += fmtconvert.o OBJS-$(CONFIG_GOLOMB) += golomb.o OBJS-$(CONFIG_H263DSP) += h263dsp.o @@ -125,7 +122,6 @@ OBJS-$(CONFIG_LLVIDENCDSP) += lossless_videoencdsp.o OBJS-$(CONFIG_LPC) += lpc.o OBJS-$(CONFIG_LSP) += lsp.o OBJS-$(CONFIG_LZF) += lzf.o -OBJS-$(CONFIG_MDCT) += mdct_float.o mdct_fixed_32.o OBJS-$(CONFIG_ME_CMP) += me_cmp.o OBJS-$(CONFIG_MEDIACODEC) += mediacodecdec_common.o mediacodec_surface.o mediacodec_wrapper.o mediacodec_sw_buffer.o OBJS-$(CONFIG_MPEG_ER) += mpeg_er.o @@ -134,7 +130,8 @@ OBJS-$(CONFIG_MPEGAUDIO) += mpegaudio.o mpegaudiodec_common.o \ OBJS-$(CONFIG_MPEGAUDIODSP) += mpegaudiodsp.o \ mpegaudiodsp_data.o \ mpegaudiodsp_fixed.o \ - mpegaudiodsp_float.o + mpegaudiodsp_float.o \ + dct32_fixed.o dct32_float.o OBJS-$(CONFIG_MPEGAUDIOHEADER) += mpegaudiodecheader.o mpegaudiotabs.o OBJS-$(CONFIG_MPEG4AUDIO) += mpeg4audio.o mpeg4audio_sample_rates.o OBJS-$(CONFIG_MPEGVIDEO) += mpegvideo.o rl.o \ @@ -156,7 +153,6 @@ OBJS-$(CONFIG_QSV) += qsv.o OBJS-$(CONFIG_QSVDEC) += qsvdec.o OBJS-$(CONFIG_QSVENC) += qsvenc.o OBJS-$(CONFIG_RANGECODER) += rangecoder.o -OBJS-$(CONFIG_RDFT) += rdft.o OBJS-$(CONFIG_RV34DSP) += rv34dsp.o OBJS-$(CONFIG_SINEWIN) += sinewin.o OBJS-$(CONFIG_SNAPPY) += snappy.o @@ -258,6 +254,7 @@ OBJS-$(CONFIG_AV1_MEDIACODEC_DECODER) += mediacodecdec.o OBJS-$(CONFIG_AV1_MEDIACODEC_ENCODER) += mediacodecenc.o OBJS-$(CONFIG_AV1_NVENC_ENCODER) += nvenc_av1.o nvenc.o OBJS-$(CONFIG_AV1_QSV_ENCODER) += qsvenc_av1.o +OBJS-$(CONFIG_AV1_VAAPI_ENCODER) += vaapi_encode_av1.o av1_levels.o OBJS-$(CONFIG_AVRN_DECODER) += avrndec.o OBJS-$(CONFIG_AVRP_DECODER) += r210dec.o OBJS-$(CONFIG_AVRP_ENCODER) += r210enc.o @@ -579,6 +576,7 @@ OBJS-$(CONFIG_OPUS_DECODER) += opusdec.o opusdec_celt.o opus_celt.o \ opusdsp.o opus_parse.o opus_rc.o OBJS-$(CONFIG_OPUS_ENCODER) += opusenc.o opusenc_psy.o opus_celt.o \ opus_pvq.o opus_rc.o opustab.o +OBJS-$(CONFIG_OSQ_DECODER) += osq.o OBJS-$(CONFIG_PAF_AUDIO_DECODER) += pafaudio.o OBJS-$(CONFIG_PAF_VIDEO_DECODER) += pafvideo.o OBJS-$(CONFIG_PAM_DECODER) += pnmdec.o pnm.o @@ -1056,6 +1054,8 @@ STLIBOBJS-$(CONFIG_AVFORMAT) += to_upper4.o STLIBOBJS-$(CONFIG_ISO_MEDIA) += mpegaudiotabs.o STLIBOBJS-$(CONFIG_FLV_MUXER) += mpeg4audio_sample_rates.o STLIBOBJS-$(CONFIG_HLS_DEMUXER) += ac3_channel_layout_tab.o +STLIBOBJS-$(CONFIG_IMAGE_JPEGXL_PIPE_DEMUXER) += jpegxl_parse.o +STLIBOBJS-$(CONFIG_JPEGXL_ANIM_DEMUXER) += jpegxl_parse.o STLIBOBJS-$(CONFIG_MATROSKA_DEMUXER) += mpeg4audio_sample_rates.o STLIBOBJS-$(CONFIG_MOV_DEMUXER) += ac3_channel_layout_tab.o STLIBOBJS-$(CONFIG_MXF_MUXER) += golomb.o @@ -1185,6 +1185,7 @@ OBJS-$(CONFIG_HEVC_PARSER) += hevc_parser.o hevc_data.o OBJS-$(CONFIG_HDR_PARSER) += hdr_parser.o OBJS-$(CONFIG_IPU_PARSER) += ipu_parser.o OBJS-$(CONFIG_JPEG2000_PARSER) += jpeg2000_parser.o +OBJS-$(CONFIG_JPEGXL_PARSER) += jpegxl_parser.o jpegxl_parse.o OBJS-$(CONFIG_MISC4_PARSER) += misc4_parser.o OBJS-$(CONFIG_MJPEG_PARSER) += mjpeg_parser.o OBJS-$(CONFIG_MLP_PARSER) += mlp_parse.o mlp_parser.o mlp.o @@ -1199,8 +1200,7 @@ OBJS-$(CONFIG_OPUS_PARSER) += opus_parser.o opus_parse.o \ OBJS-$(CONFIG_PNG_PARSER) += png_parser.o OBJS-$(CONFIG_PNM_PARSER) += pnm_parser.o pnm.o OBJS-$(CONFIG_QOI_PARSER) += qoi_parser.o -OBJS-$(CONFIG_RV30_PARSER) += rv34_parser.o -OBJS-$(CONFIG_RV40_PARSER) += rv34_parser.o +OBJS-$(CONFIG_RV34_PARSER) += rv34_parser.o OBJS-$(CONFIG_SBC_PARSER) += sbc_parser.o OBJS-$(CONFIG_SIPR_PARSER) += sipr_parser.o OBJS-$(CONFIG_TAK_PARSER) += tak_parser.o tak.o @@ -1283,6 +1283,7 @@ SKIPHEADERS += %_tablegen.h \ aacenc_quantization.h \ aacenc_quantization_misc.h \ bitstream_template.h \ + vulkan_video_codec_av1std.h \ $(ARCH)/vpx_arith.h \ SKIPHEADERS-$(CONFIG_AMF) += amfenc.h @@ -1304,7 +1305,7 @@ SKIPHEADERS-$(CONFIG_XVMC) += xvmc.h SKIPHEADERS-$(CONFIG_VAAPI) += vaapi_decode.h vaapi_hevc.h vaapi_encode.h SKIPHEADERS-$(CONFIG_VDPAU) += vdpau.h vdpau_internal.h SKIPHEADERS-$(CONFIG_VIDEOTOOLBOX) += videotoolbox.h vt_internal.h -SKIPHEADERS-$(CONFIG_VULKAN) += vulkan.h vulkan_video.h vulkan_decode.h vulkan_video_codec_av1std.h vulkan_video_codec_av1std_decode.h +SKIPHEADERS-$(CONFIG_VULKAN) += vulkan.h vulkan_video.h vulkan_decode.h vulkan_video_codec_av1std_decode.h SKIPHEADERS-$(CONFIG_V4L2_M2M) += v4l2_buffers.h v4l2_context.h v4l2_m2m.h SKIPHEADERS-$(CONFIG_ZLIB) += zlib_wrapper.h @@ -1318,9 +1319,8 @@ TESTPROGS = avcodec \ jpeg2000dwt \ mathops \ +TESTPROGS-$(CONFIG_AV1_VAAPI_ENCODER) += av1_levels TESTPROGS-$(CONFIG_CABAC) += cabac -TESTPROGS-$(CONFIG_DCT) += avfft -TESTPROGS-$(CONFIG_FFT) += fft fft-fixed32 TESTPROGS-$(CONFIG_GOLOMB) += golomb TESTPROGS-$(CONFIG_IDCTDSP) += dct TESTPROGS-$(CONFIG_IIRFILTER) += iirfilter @@ -1340,7 +1340,6 @@ HOSTPROGS = aacps_tablegen \ aacps_fixed_tablegen \ cbrt_tablegen \ cbrt_fixed_tablegen \ - cos_tablegen \ dv_tablegen \ motionpixels_tablegen \ mpegaudio_tablegen \ @@ -1355,12 +1354,6 @@ CLEANFILES = *_tables.c *_tables.h *_tablegen$(HOSTEXESUF) $(SUBDIR)tests/dct$(EXESUF): $(SUBDIR)dctref.o $(SUBDIR)aandcttab.o $(SUBDIR)dv_tablegen$(HOSTEXESUF): $(SUBDIR)dvdata_host.o -TRIG_TABLES = cos cos_fixed sin -TRIG_TABLES := $(TRIG_TABLES:%=$(SUBDIR)%_tables.c) - -$(TRIG_TABLES): $(SUBDIR)%_tables.c: $(SUBDIR)cos_tablegen$(HOSTEXESUF) - $(M)./$< $* > $@ - ifdef CONFIG_SMALL $(SUBDIR)%_tablegen$(HOSTEXESUF): HOSTCFLAGS += -DCONFIG_SMALL=1 else diff --git a/arm/android/third_party/ffmpeg/libavcodec/aacdec_template.c b/arm/android/third_party/ffmpeg/libavcodec/aacdec_template.c index 444dc4fa..954399f8 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/aacdec_template.c +++ b/arm/android/third_party/ffmpeg/libavcodec/aacdec_template.c @@ -1133,14 +1133,14 @@ static av_cold void aac_static_table_init(void) for (unsigned i = 0, offset = 0; i < 11; i++) { vlc_spectral[i].table = &vlc_buf[offset]; vlc_spectral[i].table_allocated = FF_ARRAY_ELEMS(vlc_buf) - offset; - ff_init_vlc_sparse(&vlc_spectral[i], 8, ff_aac_spectral_sizes[i], + ff_vlc_init_sparse(&vlc_spectral[i], 8, ff_aac_spectral_sizes[i], ff_aac_spectral_bits[i], sizeof(ff_aac_spectral_bits[i][0]), sizeof(ff_aac_spectral_bits[i][0]), ff_aac_spectral_codes[i], sizeof(ff_aac_spectral_codes[i][0]), sizeof(ff_aac_spectral_codes[i][0]), ff_aac_codebook_vector_idx[i], sizeof(ff_aac_codebook_vector_idx[i][0]), sizeof(ff_aac_codebook_vector_idx[i][0]), - INIT_VLC_STATIC_OVERLONG); + VLC_INIT_STATIC_OVERLONG); offset += vlc_spectral[i].table_size; } @@ -1148,7 +1148,7 @@ static av_cold void aac_static_table_init(void) ff_aac_tableinit(); - INIT_VLC_STATIC(&vlc_scalefactors, 7, + VLC_INIT_STATIC(&vlc_scalefactors, 7, FF_ARRAY_ELEMS(ff_aac_scalefactor_code), ff_aac_scalefactor_bits, sizeof(ff_aac_scalefactor_bits[0]), @@ -1159,8 +1159,8 @@ static av_cold void aac_static_table_init(void) 352); // window initialization - AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(aac_kbd_long_960), 4.0, 960); - AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(aac_kbd_short_120), 6.0, 120); + AAC_RENAME(avpriv_kbd_window_init)(AAC_RENAME(aac_kbd_long_960), 4.0, 960); + AAC_RENAME(avpriv_kbd_window_init)(AAC_RENAME(aac_kbd_short_120), 6.0, 120); #if !USE_FIXED AAC_RENAME(ff_sine_window_init)(AAC_RENAME(sine_960), 960); @@ -1168,8 +1168,8 @@ static av_cold void aac_static_table_init(void) AAC_RENAME(ff_init_ff_sine_windows)(9); ff_aac_float_common_init(); #else - AAC_RENAME(ff_kbd_window_init)(AAC_RENAME2(aac_kbd_long_1024), 4.0, 1024); - AAC_RENAME(ff_kbd_window_init)(AAC_RENAME2(aac_kbd_short_128), 6.0, 128); + AAC_RENAME(avpriv_kbd_window_init)(AAC_RENAME2(aac_kbd_long_1024), 4.0, 1024); + AAC_RENAME(avpriv_kbd_window_init)(AAC_RENAME2(aac_kbd_short_128), 6.0, 128); init_sine_windows_fixed(); #endif @@ -2486,12 +2486,12 @@ static int decode_extension_payload(AACContext *ac, GetBitContext *gb, int cnt, ac->avctx->ch_layout.nb_channels == 1) { ac->oc[1].m4ac.sbr = 1; ac->oc[1].m4ac.ps = 1; - ac->avctx->profile = FF_PROFILE_AAC_HE_V2; + ac->avctx->profile = AV_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; + ac->avctx->profile = AV_PROFILE_AAC_HE; } res = AAC_RENAME(ff_decode_sbr_extension)(ac, &che->sbr, gb, crc_flag, cnt, elem_type); if (ac->oc[1].m4ac.ps == 1 && !ac->warned_he_aac_mono) { @@ -2856,8 +2856,8 @@ static void imdct_and_windowing_eld(AACContext *ac, SingleChannelElement *sce) ac->mdct512_fn(ac->mdct512, buf, in, sizeof(INTFLOAT)); for (i = 0; i < n; i+=2) { - buf[i + 0] = -(USE_FIXED + 1)*buf[i + 0]; - buf[i + 1] = (USE_FIXED + 1)*buf[i + 1]; + buf[i + 0] = -(UINTFLOAT)(USE_FIXED + 1)*buf[i + 0]; + buf[i + 1] = (UINTFLOAT)(USE_FIXED + 1)*buf[i + 1]; } // 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 @@ -3080,7 +3080,7 @@ static int aac_decode_er_frame(AVCodecContext *avctx, void *data, if ((err = frame_configure_elements(avctx)) < 0) return err; - // The FF_PROFILE_AAC_* defines are all object_type - 1 + // The AV_PROFILE_AAC_* defines are all object_type - 1 // This may lead to an undefined profile being signaled ac->avctx->profile = aot - 1; @@ -3163,7 +3163,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, AVFrame *frame, if ((err = frame_configure_elements(avctx)) < 0) goto fail; - // The FF_PROFILE_AAC_* defines are all object_type - 1 + // The AV_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; diff --git a/arm/android/third_party/ffmpeg/libavcodec/aacenc.c b/arm/android/third_party/ffmpeg/libavcodec/aacenc.c index f48f0570..2a34685a 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/aacenc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/aacenc.c @@ -1307,13 +1307,13 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) avctx->bit_rate); /* Profile and option setting */ - avctx->profile = avctx->profile == FF_PROFILE_UNKNOWN ? FF_PROFILE_AAC_LOW : + avctx->profile = avctx->profile == AV_PROFILE_UNKNOWN ? AV_PROFILE_AAC_LOW : avctx->profile; for (i = 0; i < FF_ARRAY_ELEMS(aacenc_profiles); i++) if (avctx->profile == aacenc_profiles[i]) break; - if (avctx->profile == FF_PROFILE_MPEG2_AAC_LOW) { - avctx->profile = FF_PROFILE_AAC_LOW; + if (avctx->profile == AV_PROFILE_MPEG2_AAC_LOW) { + avctx->profile = AV_PROFILE_AAC_LOW; ERROR_IF(s->options.pred, "Main prediction unavailable in the \"mpeg2_aac_low\" profile\n"); ERROR_IF(s->options.ltp, @@ -1321,22 +1321,22 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) WARN_IF(s->options.pns, "PNS unavailable in the \"mpeg2_aac_low\" profile, turning off\n"); s->options.pns = 0; - } else if (avctx->profile == FF_PROFILE_AAC_LTP) { + } else if (avctx->profile == AV_PROFILE_AAC_LTP) { s->options.ltp = 1; ERROR_IF(s->options.pred, "Main prediction unavailable in the \"aac_ltp\" profile\n"); - } else if (avctx->profile == FF_PROFILE_AAC_MAIN) { + } else if (avctx->profile == AV_PROFILE_AAC_MAIN) { s->options.pred = 1; ERROR_IF(s->options.ltp, "LTP prediction unavailable in the \"aac_main\" profile\n"); } else if (s->options.ltp) { - avctx->profile = FF_PROFILE_AAC_LTP; + avctx->profile = AV_PROFILE_AAC_LTP; WARN_IF(1, "Chainging profile to \"aac_ltp\"\n"); ERROR_IF(s->options.pred, "Main prediction unavailable in the \"aac_ltp\" profile\n"); } else if (s->options.pred) { - avctx->profile = FF_PROFILE_AAC_MAIN; + avctx->profile = AV_PROFILE_AAC_MAIN; WARN_IF(1, "Chainging profile to \"aac_main\"\n"); ERROR_IF(s->options.ltp, diff --git a/arm/android/third_party/ffmpeg/libavcodec/aacenc_ltp.c b/arm/android/third_party/ffmpeg/libavcodec/aacenc_ltp.c index f7fb85bb..f3075f0e 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/aacenc_ltp.c +++ b/arm/android/third_party/ffmpeg/libavcodec/aacenc_ltp.c @@ -37,7 +37,7 @@ void ff_aac_encode_ltp_info(AACEncContext *s, SingleChannelElement *sce, { int i; IndividualChannelStream *ics = &sce->ics; - if (s->profile != FF_PROFILE_AAC_LTP || !ics->predictor_present) + if (s->profile != AV_PROFILE_AAC_LTP || !ics->predictor_present) return; if (common_window) put_bits(&s->pb, 1, 0); @@ -119,7 +119,7 @@ void ff_aac_update_ltp(AACEncContext *s, SingleChannelElement *sce) float *pred_signal = &sce->ltp_state[0]; const float *samples = &s->planar_samples[s->cur_channel][1024]; - if (s->profile != FF_PROFILE_AAC_LTP) + if (s->profile != AV_PROFILE_AAC_LTP) return; /* Calculate lag */ diff --git a/arm/android/third_party/ffmpeg/libavcodec/aacenc_pred.c b/arm/android/third_party/ffmpeg/libavcodec/aacenc_pred.c index 447444cb..f87fcd5a 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/aacenc_pred.c +++ b/arm/android/third_party/ffmpeg/libavcodec/aacenc_pred.c @@ -335,7 +335,7 @@ void ff_aac_encode_main_pred(AACEncContext *s, SingleChannelElement *sce) IndividualChannelStream *ics = &sce->ics; const int pmax = FFMIN(ics->max_sfb, ff_aac_pred_sfb_max[s->samplerate_index]); - if (s->profile != FF_PROFILE_AAC_MAIN || + if (s->profile != AV_PROFILE_AAC_MAIN || !ics->predictor_present) return; diff --git a/arm/android/third_party/ffmpeg/libavcodec/aacenc_tns.c b/arm/android/third_party/ffmpeg/libavcodec/aacenc_tns.c index 195ff5e2..8dc6dfcf 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/aacenc_tns.c +++ b/arm/android/third_party/ffmpeg/libavcodec/aacenc_tns.c @@ -167,7 +167,7 @@ void ff_aac_search_for_tns(AACEncContext *s, SingleChannelElement *sce) const int c_bits = is8 ? TNS_Q_BITS_IS8 == 4 : TNS_Q_BITS == 4; const int sfb_start = av_clip(tns_min_sfb[is8][s->samplerate_index], 0, mmm); const int sfb_end = av_clip(sce->ics.num_swb, 0, mmm); - const int order = is8 ? 7 : s->profile == FF_PROFILE_AAC_LOW ? 12 : TNS_MAX_ORDER; + const int order = is8 ? 7 : s->profile == AV_PROFILE_AAC_LOW ? 12 : TNS_MAX_ORDER; const int slant = sce->ics.window_sequence[0] == LONG_STOP_SEQUENCE ? 1 : sce->ics.window_sequence[0] == LONG_START_SEQUENCE ? 0 : 2; const int sfb_len = sfb_end - sfb_start; diff --git a/arm/android/third_party/ffmpeg/libavcodec/aacenctab.h b/arm/android/third_party/ffmpeg/libavcodec/aacenctab.h index 2d966219..20e47ea9 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/aacenctab.h +++ b/arm/android/third_party/ffmpeg/libavcodec/aacenctab.h @@ -124,10 +124,10 @@ static const unsigned char aac_maxval_cb[] = { }; static const int aacenc_profiles[] = { - FF_PROFILE_AAC_MAIN, - FF_PROFILE_AAC_LOW, - FF_PROFILE_AAC_LTP, - FF_PROFILE_MPEG2_AAC_LOW, + AV_PROFILE_AAC_MAIN, + AV_PROFILE_AAC_LOW, + AV_PROFILE_AAC_LTP, + AV_PROFILE_MPEG2_AAC_LOW, }; #endif /* AVCODEC_AACENCTAB_H */ diff --git a/arm/android/third_party/ffmpeg/libavcodec/aacps_common.c b/arm/android/third_party/ffmpeg/libavcodec/aacps_common.c index c388d5b9..bee07b5f 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/aacps_common.c +++ b/arm/android/third_party/ffmpeg/libavcodec/aacps_common.c @@ -290,7 +290,7 @@ err: } #define PS_INIT_VLC_STATIC(num, nb_bits, size) \ - INIT_VLC_STATIC(&vlc_ps[num], nb_bits, ps_tmp[num].table_size / ps_tmp[num].elem_size, \ + VLC_INIT_STATIC(&vlc_ps[num], nb_bits, ps_tmp[num].table_size / ps_tmp[num].elem_size, \ ps_tmp[num].ps_bits, 1, 1, \ ps_tmp[num].ps_codes, ps_tmp[num].elem_size, ps_tmp[num].elem_size, \ size); diff --git a/arm/android/third_party/ffmpeg/libavcodec/aacsbr.h b/arm/android/third_party/ffmpeg/libavcodec/aacsbr.h index d70b19e1..09f9eb1d 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/aacsbr.h +++ b/arm/android/third_party/ffmpeg/libavcodec/aacsbr.h @@ -70,7 +70,7 @@ 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, \ + VLC_INIT_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) diff --git a/arm/android/third_party/ffmpeg/libavcodec/aacsbr_template.c b/arm/android/third_party/ffmpeg/libavcodec/aacsbr_template.c index cdca402f..b33ffd42 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/aacsbr_template.c +++ b/arm/android/third_party/ffmpeg/libavcodec/aacsbr_template.c @@ -973,7 +973,7 @@ static void read_sbr_extension(AACContext *ac, SpectralBandReplication *sbr, *num_bits_left = 0; } else { *num_bits_left -= ff_ps_read_data(ac->avctx, gb, &sbr->ps.common, *num_bits_left); - ac->avctx->profile = FF_PROFILE_AAC_HE_V2; + ac->avctx->profile = AV_PROFILE_AAC_HE_V2; // ensure the warning is not printed if PS extension is present ac->warned_he_aac_mono = 1; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/aacsbrdata.h b/arm/android/third_party/ffmpeg/libavcodec/aacsbrdata.h index 7bb45b22..af86af01 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/aacsbrdata.h +++ b/arm/android/third_party/ffmpeg/libavcodec/aacsbrdata.h @@ -29,7 +29,6 @@ #define AVCODEC_AACSBRDATA_H #include -#include "libavutil/attributes_internal.h" #include "libavutil/mem_internal.h" #include "aac_defines.h" @@ -268,271 +267,6 @@ static const int8_t sbr_offset[6][16] = { {-2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20, 24}, // 64000 Hz < fs_sbr }; -/* First eight entries repeated at end to simplify SIMD implementations. */ -const attribute_visibility_hidden 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 -{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)}, -}; - ///< window coefficients for analysis/synthesis QMF banks static DECLARE_ALIGNED(32, INTFLOAT, sbr_qmf_window_ds)[320]; /* This table contains redundancy: It is symmetric about the entry #320 diff --git a/arm/android/third_party/ffmpeg/libavcodec/aactab.c b/arm/android/third_party/ffmpeg/libavcodec/aactab.c index 0f4941d5..d0006eac 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/aactab.c +++ b/arm/android/third_party/ffmpeg/libavcodec/aactab.c @@ -48,8 +48,8 @@ DECLARE_ALIGNED(32, float, ff_aac_kbd_short_128)[128]; static av_cold void aac_float_common_init(void) { - ff_kbd_window_init(ff_aac_kbd_long_1024, 4.0, 1024); - ff_kbd_window_init(ff_aac_kbd_short_128, 6.0, 128); + avpriv_kbd_window_init(ff_aac_kbd_long_1024, 4.0, 1024); + avpriv_kbd_window_init(ff_aac_kbd_short_128, 6.0, 128); ff_init_ff_sine_windows(10); ff_init_ff_sine_windows(7); } diff --git a/arm/android/third_party/ffmpeg/libavcodec/aarch64/Makefile b/arm/android/third_party/ffmpeg/libavcodec/aarch64/Makefile index cb428b49..beb6a02f 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/aarch64/Makefile +++ b/arm/android/third_party/ffmpeg/libavcodec/aarch64/Makefile @@ -1,5 +1,4 @@ # subsystems -OBJS-$(CONFIG_FFT) += aarch64/fft_init_aarch64.o OBJS-$(CONFIG_FMTCONVERT) += aarch64/fmtconvert_init.o OBJS-$(CONFIG_H264CHROMA) += aarch64/h264chroma_init_aarch64.o OBJS-$(CONFIG_H264DSP) += aarch64/h264dsp_init_aarch64.o @@ -36,7 +35,6 @@ ARMV8-OBJS-$(CONFIG_VIDEODSP) += aarch64/videodsp.o # subsystems NEON-OBJS-$(CONFIG_AAC_DECODER) += aarch64/sbrdsp_neon.o -NEON-OBJS-$(CONFIG_FFT) += aarch64/fft_neon.o NEON-OBJS-$(CONFIG_FMTCONVERT) += aarch64/fmtconvert_neon.o NEON-OBJS-$(CONFIG_H264CHROMA) += aarch64/h264cmc_neon.o NEON-OBJS-$(CONFIG_H264DSP) += aarch64/h264dsp_neon.o \ @@ -47,7 +45,6 @@ NEON-OBJS-$(CONFIG_H264QPEL) += aarch64/h264qpel_neon.o \ NEON-OBJS-$(CONFIG_HPELDSP) += aarch64/hpeldsp_neon.o NEON-OBJS-$(CONFIG_IDCTDSP) += aarch64/idctdsp_neon.o \ aarch64/simple_idct_neon.o -NEON-OBJS-$(CONFIG_MDCT) += aarch64/mdct_neon.o NEON-OBJS-$(CONFIG_ME_CMP) += aarch64/me_cmp_neon.o NEON-OBJS-$(CONFIG_MPEGAUDIODSP) += aarch64/mpegaudiodsp_neon.o NEON-OBJS-$(CONFIG_PIXBLOCKDSP) += aarch64/pixblockdsp_neon.o diff --git a/arm/android/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_epel_neon.S b/arm/android/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_epel_neon.S index a8d69463..edaf39ed 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_epel_neon.S +++ b/arm/android/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_epel_neon.S @@ -32,6 +32,312 @@ const epel_filters, align=4 .byte -2, 10, 58, -2 endconst +const epel_filters_abs, align=4 + .byte 0, 0, 0, 0 + .byte 2, 58, 10, 2 + .byte 4, 54, 16, 2 + .byte 6, 46, 28, 4 + .byte 4, 36, 36, 4 + .byte 4, 28, 46, 6 + .byte 2, 16, 54, 4 + .byte 2, 10, 58, 2 +endconst + + +.macro load_epel_filterb freg, xreg + movrel \xreg, epel_filters_abs + add \xreg, \xreg, \freg, lsl #2 + ld4r {v0.16b, v1.16b, v2.16b, v3.16b}, [\xreg] // filter +.endm + +.macro calc_epelb dst, src0, src1, src2, src3 + umull \dst\().8h, \src1\().8b, v1.8b + umlsl \dst\().8h, \src0\().8b, v0.8b + umlal \dst\().8h, \src2\().8b, v2.8b + umlsl \dst\().8h, \src3\().8b, v3.8b +.endm + +.macro calc_epelb2 dst, src0, src1, src2, src3 + umull2 \dst\().8h, \src1\().16b, v1.16b + umlsl2 \dst\().8h, \src0\().16b, v0.16b + umlal2 \dst\().8h, \src2\().16b, v2.16b + umlsl2 \dst\().8h, \src3\().16b, v3.16b +.endm + +.macro load_epel_filterh freg, xreg + movrel \xreg, epel_filters + add \xreg, \xreg, \freg, lsl #2 + ld1 {v0.8b}, [\xreg] + sxtl v0.8h, v0.8b +.endm + +.macro calc_epelh dst, src0, src1, src2, src3 + smull \dst\().4s, \src0\().4h, v0.h[0] + smlal \dst\().4s, \src1\().4h, v0.h[1] + smlal \dst\().4s, \src2\().4h, v0.h[2] + smlal \dst\().4s, \src3\().4h, v0.h[3] + sqshrn \dst\().4h, \dst\().4s, #6 +.endm + +.macro calc_epelh2 dst, tmp, src0, src1, src2, src3 + smull2 \tmp\().4s, \src0\().8h, v0.h[0] + smlal2 \tmp\().4s, \src1\().8h, v0.h[1] + smlal2 \tmp\().4s, \src2\().8h, v0.h[2] + smlal2 \tmp\().4s, \src3\().8h, v0.h[3] + sqshrn2 \dst\().8h, \tmp\().4s, #6 +.endm + +.macro calc_all4 + calc v16, v17, v18, v19 + b.eq 2f + calc v17, v18, v19, v16 + b.eq 2f + calc v18, v19, v16, v17 + b.eq 2f + calc v19, v16, v17, v18 + b.ne 1b +.endm + +.macro calc_all8 + calc v16, v17, v18, v19, v20, v21, v22, v23 + b.eq 2f + calc v18, v19, v20, v21, v22, v23, v16, v17 + b.eq 2f + calc v20, v21, v22, v23, v16, v17, v18, v19 + b.eq 2f + calc v22, v23, v16, v17, v18, v19, v20, v21 + b.ne 1b +.endm + +.macro calc_all12 + calc v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27 + b.eq 2f + calc v19, v20, v21, v22, v23, v24, v25, v26, v27, v16, v17, v18 + b.eq 2f + calc v22, v23, v24, v25, v26, v27, v16, v17, v18, v19, v20, v21 + b.eq 2f + calc v25, v26, v27, v16, v17, v18, v19, v20, v21, v22, v23, v24 + b.ne 1b +.endm + +.macro calc_all16 + calc v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31 + b.eq 2f + calc v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v16, v17, v18, v19 + b.eq 2f + calc v24, v25, v26, v27, v28, v29, v30, v31, v16, v17, v18, v19, v20, v21, v22, v23 + b.eq 2f + calc v28, v29, v30, v31, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27 + b.ne 1b +.endm + +function ff_hevc_put_hevc_epel_uni_v4_8_neon, export=1 + load_epel_filterb x6, x5 + sub x2, x2, x3 + ld1 {v16.s}[0], [x2], x3 + ld1 {v17.s}[0], [x2], x3 + ld1 {v18.s}[0], [x2], x3 +.macro calc src0, src1, src2, src3 + ld1 {\src3\().s}[0], [x2], x3 + calc_epelb v4, \src0, \src1, \src2, \src3 + sqrshrun v4.8b, v4.8h, #6 + subs w4, w4, #1 + st1 {v4.s}[0], [x0], x1 +.endm +1: calc_all4 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_v6_8_neon, export=1 + load_epel_filterb x6, x5 + sub x2, x2, x3 + sub x1, x1, #4 + ld1 {v16.8b}, [x2], x3 + ld1 {v17.8b}, [x2], x3 + ld1 {v18.8b}, [x2], x3 +.macro calc src0, src1, src2, src3 + ld1 {\src3\().8b}, [x2], x3 + calc_epelb v4, \src0, \src1, \src2, \src3 + sqrshrun v4.8b, v4.8h, #6 + st1 {v4.s}[0], [x0], #4 + subs w4, w4, #1 + st1 {v4.h}[2], [x0], x1 +.endm +1: calc_all4 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_v8_8_neon, export=1 + load_epel_filterb x6, x5 + sub x2, x2, x3 + ld1 {v16.8b}, [x2], x3 + ld1 {v17.8b}, [x2], x3 + ld1 {v18.8b}, [x2], x3 +.macro calc src0, src1, src2, src3 + ld1 {\src3\().8b}, [x2], x3 + calc_epelb v4, \src0, \src1, \src2, \src3 + sqrshrun v4.8b, v4.8h, #6 + subs w4, w4, #1 + st1 {v4.8b}, [x0], x1 +.endm +1: calc_all4 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_v12_8_neon, export=1 + load_epel_filterb x6, x5 + sub x2, x2, x3 + sub x1, x1, #8 + ld1 {v16.16b}, [x2], x3 + ld1 {v17.16b}, [x2], x3 + ld1 {v18.16b}, [x2], x3 +.macro calc src0, src1, src2, src3 + ld1 {\src3\().16b}, [x2], x3 + calc_epelb v4, \src0, \src1, \src2, \src3 + calc_epelb2 v5, \src0, \src1, \src2, \src3 + sqrshrun v4.8b, v4.8h, #6 + sqrshrun2 v4.16b, v5.8h, #6 + subs w4, w4, #1 + st1 {v4.8b}, [x0], #8 + st1 {v4.s}[2], [x0], x1 +.endm +1: calc_all4 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_v16_8_neon, export=1 + load_epel_filterb x6, x5 + sub x2, x2, x3 + ld1 {v16.16b}, [x2], x3 + ld1 {v17.16b}, [x2], x3 + ld1 {v18.16b}, [x2], x3 +.macro calc src0, src1, src2, src3 + ld1 {\src3\().16b}, [x2], x3 + calc_epelb v4, \src0, \src1, \src2, \src3 + calc_epelb2 v5, \src0, \src1, \src2, \src3 + sqrshrun v4.8b, v4.8h, #6 + sqrshrun2 v4.16b, v5.8h, #6 + subs w4, w4, #1 + st1 {v4.16b}, [x0], x1 +.endm +1: calc_all4 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_v24_8_neon, export=1 + load_epel_filterb x6, x5 + sub x2, x2, x3 + ld1 {v16.8b, v17.8b, v18.8b}, [x2], x3 + ld1 {v19.8b, v20.8b, v21.8b}, [x2], x3 + ld1 {v22.8b, v23.8b, v24.8b}, [x2], x3 +.macro calc src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10, src11 + ld1 {\src9\().8b, \src10\().8b, \src11\().8b}, [x2], x3 + calc_epelb v4, \src0, \src3, \src6, \src9 + calc_epelb v5, \src1, \src4, \src7, \src10 + calc_epelb v6, \src2, \src5, \src8, \src11 + sqrshrun v4.8b, v4.8h, #6 + sqrshrun v5.8b, v5.8h, #6 + sqrshrun v6.8b, v6.8h, #6 + subs w4, w4, #1 + st1 {v4.8b-v6.8b}, [x0], x1 +.endm +1: calc_all12 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_v32_8_neon, export=1 + load_epel_filterb x6, x5 + sub x2, x2, x3 + ld1 {v16.16b, v17.16b}, [x2], x3 + ld1 {v18.16b, v19.16b}, [x2], x3 + ld1 {v20.16b, v21.16b}, [x2], x3 +.macro calc src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\src6\().16b, \src7\().16b}, [x2], x3 + calc_epelb v4, \src0, \src2, \src4, \src6 + calc_epelb2 v5, \src0, \src2, \src4, \src6 + calc_epelb v6, \src1, \src3, \src5, \src7 + calc_epelb2 v7, \src1, \src3, \src5, \src7 + sqrshrun v4.8b, v4.8h, #6 + sqrshrun2 v4.16b, v5.8h, #6 + sqrshrun v5.8b, v6.8h, #6 + sqrshrun2 v5.16b, v7.8h, #6 + subs w4, w4, #1 + st1 {v4.16b, v5.16b}, [x0], x1 +.endm +1: calc_all8 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_v48_8_neon, export=1 + load_epel_filterb x6, x5 + sub x2, x2, x3 + ld1 {v16.16b, v17.16b, v18.16b}, [x2], x3 + ld1 {v19.16b, v20.16b, v21.16b}, [x2], x3 + ld1 {v22.16b, v23.16b, v24.16b}, [x2], x3 +.macro calc src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10, src11 + ld1 {\src9\().16b, \src10\().16b, \src11\().16b}, [x2], x3 + calc_epelb v4, \src0, \src3, \src6, \src9 + calc_epelb2 v5, \src0, \src3, \src6, \src9 + calc_epelb v6, \src1, \src4, \src7, \src10 + calc_epelb2 v7, \src1, \src4, \src7, \src10 + calc_epelb v28, \src2, \src5, \src8, \src11 + calc_epelb2 v29, \src2, \src5, \src8, \src11 + sqrshrun v4.8b, v4.8h, #6 + sqrshrun2 v4.16b, v5.8h, #6 + sqrshrun v5.8b, v6.8h, #6 + sqrshrun2 v5.16b, v7.8h, #6 + sqrshrun v6.8b, v28.8h, #6 + sqrshrun2 v6.16b, v29.8h, #6 + subs w4, w4, #1 + st1 {v4.16b, v5.16b, v6.16b}, [x0], x1 +.endm +1: calc_all12 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_v64_8_neon, export=1 + load_epel_filterb x6, x5 + sub sp, sp, #32 + st1 {v8.8b-v11.8b}, [sp] + sub x2, x2, x3 + ld1 {v16.16b, v17.16b, v18.16b, v19.16b}, [x2], x3 + ld1 {v20.16b, v21.16b, v22.16b, v23.16b}, [x2], x3 + ld1 {v24.16b, v25.16b, v26.16b, v27.16b}, [x2], x3 +.macro calc src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10, src11, src12, src13, src14, src15 + ld1 {\src12\().16b, \src13\().16b, \src14\().16b, \src15\().16b}, [x2], x3 + calc_epelb v10, \src3, \src7, \src11, \src15 + calc_epelb2 v11, \src3, \src7, \src11, \src15 + calc_epelb v4, \src0, \src4, \src8, \src12 + calc_epelb2 v5, \src0, \src4, \src8, \src12 + calc_epelb v6, \src1, \src5, \src9, \src13 + calc_epelb2 v7, \src1, \src5, \src9, \src13 + calc_epelb v8, \src2, \src6, \src10, \src14 + calc_epelb2 v9, \src2, \src6, \src10, \src14 + sqrshrun v4.8b, v4.8h, #6 + sqrshrun2 v4.16b, v5.8h, #6 + sqrshrun v5.8b, v6.8h, #6 + sqrshrun2 v5.16b, v7.8h, #6 + sqrshrun v6.8b, v8.8h, #6 + sqrshrun2 v6.16b, v9.8h, #6 + sqrshrun v7.8b, v10.8h, #6 + sqrshrun2 v7.16b, v11.8h, #6 + subs w4, w4, #1 + st1 {v4.16b, v5.16b, v6.16b, v7.16b}, [x0], x1 +.endm +1: calc_all16 +.purgem calc +2: ld1 {v8.8b-v11.8b}, [sp], #32 + ret +endfunc + #if HAVE_I8MM .macro EPEL_H_HEADER @@ -376,6 +682,300 @@ function ff_hevc_put_hevc_epel_h64_8_neon_i8mm, export=1 ret endfunc +function ff_hevc_put_hevc_epel_uni_hv4_8_neon_i8mm, export=1 + add w10, w4, #3 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + str x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + add x0, sp, #48 + sub x1, x2, x3 + mov x2, x3 + add w3, w4, #3 + mov x4, x5 + bl X(ff_hevc_put_hevc_epel_h4_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldr x30, [sp], #48 + load_epel_filterh x6, x5 + mov x10, #(MAX_PB_SIZE * 2) + ld1 {v16.4h}, [sp], x10 + ld1 {v17.4h}, [sp], x10 + ld1 {v18.4h}, [sp], x10 +.macro calc src0, src1, src2, src3 + ld1 {\src3\().4h}, [sp], x10 + calc_epelh v4, \src0, \src1, \src2, \src3 + sqrshrun v4.8b, v4.8h, #6 + subs w4, w4, #1 + st1 {v4.s}[0], [x0], x1 +.endm +1: calc_all4 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_hv6_8_neon_i8mm, export=1 + add w10, w4, #3 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + str x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + add x0, sp, #48 + sub x1, x2, x3 + mov x2, x3 + add w3, w4, #3 + mov x4, x5 + bl X(ff_hevc_put_hevc_epel_h6_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldr x30, [sp], #48 + load_epel_filterh x6, x5 + sub x1, x1, #4 + mov x10, #(MAX_PB_SIZE * 2) + ld1 {v16.8h}, [sp], x10 + ld1 {v17.8h}, [sp], x10 + ld1 {v18.8h}, [sp], x10 +.macro calc src0, src1, src2, src3 + ld1 {\src3\().8h}, [sp], x10 + calc_epelh v4, \src0, \src1, \src2, \src3 + calc_epelh2 v4, v5, \src0, \src1, \src2, \src3 + sqrshrun v4.8b, v4.8h, #6 + st1 {v4.s}[0], [x0], #4 + subs w4, w4, #1 + st1 {v4.h}[2], [x0], x1 +.endm +1: calc_all4 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_hv8_8_neon_i8mm, export=1 + add w10, w4, #3 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + str x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + add x0, sp, #48 + sub x1, x2, x3 + mov x2, x3 + add w3, w4, #3 + mov x4, x5 + bl X(ff_hevc_put_hevc_epel_h8_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldr x30, [sp], #48 + load_epel_filterh x6, x5 + mov x10, #(MAX_PB_SIZE * 2) + ld1 {v16.8h}, [sp], x10 + ld1 {v17.8h}, [sp], x10 + ld1 {v18.8h}, [sp], x10 +.macro calc src0, src1, src2, src3 + ld1 {\src3\().8h}, [sp], x10 + calc_epelh v4, \src0, \src1, \src2, \src3 + calc_epelh2 v4, v5, \src0, \src1, \src2, \src3 + sqrshrun v4.8b, v4.8h, #6 + subs w4, w4, #1 + st1 {v4.8b}, [x0], x1 +.endm +1: calc_all4 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_hv12_8_neon_i8mm, export=1 + add w10, w4, #3 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + str x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + add x0, sp, #48 + sub x1, x2, x3 + mov x2, x3 + add w3, w4, #3 + mov x4, x5 + bl X(ff_hevc_put_hevc_epel_h12_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldr x30, [sp], #48 + load_epel_filterh x6, x5 + sub x1, x1, #8 + mov x10, #(MAX_PB_SIZE * 2) + ld1 {v16.8h, v17.8h}, [sp], x10 + ld1 {v18.8h, v19.8h}, [sp], x10 + ld1 {v20.8h, v21.8h}, [sp], x10 +.macro calc src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\src6\().8h, \src7\().8h}, [sp], x10 + calc_epelh v4, \src0, \src2, \src4, \src6 + calc_epelh2 v4, v5, \src0, \src2, \src4, \src6 + calc_epelh v5, \src1, \src3, \src5, \src7 + sqrshrun v4.8b, v4.8h, #6 + sqrshrun2 v4.16b, v5.8h, #6 + st1 {v4.8b}, [x0], #8 + st1 {v4.s}[2], [x0], x1 + subs w4, w4, #1 +.endm +1: calc_all8 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_hv16_8_neon_i8mm, export=1 + add w10, w4, #3 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + str x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + add x0, sp, #48 + sub x1, x2, x3 + mov x2, x3 + add w3, w4, #3 + mov x4, x5 + bl X(ff_hevc_put_hevc_epel_h16_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldr x30, [sp], #48 + load_epel_filterh x6, x5 + mov x10, #(MAX_PB_SIZE * 2) + ld1 {v16.8h, v17.8h}, [sp], x10 + ld1 {v18.8h, v19.8h}, [sp], x10 + ld1 {v20.8h, v21.8h}, [sp], x10 +.macro calc src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\src6\().8h, \src7\().8h}, [sp], x10 + calc_epelh v4, \src0, \src2, \src4, \src6 + calc_epelh2 v4, v5, \src0, \src2, \src4, \src6 + calc_epelh v5, \src1, \src3, \src5, \src7 + calc_epelh2 v5, v6, \src1, \src3, \src5, \src7 + sqrshrun v4.8b, v4.8h, #6 + sqrshrun2 v4.16b, v5.8h, #6 + subs w4, w4, #1 + st1 {v4.16b}, [x0], x1 +.endm +1: calc_all8 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_hv24_8_neon_i8mm, export=1 + add w10, w4, #3 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + str x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + add x0, sp, #48 + sub x1, x2, x3 + mov x2, x3 + add w3, w4, #3 + mov x4, x5 + bl X(ff_hevc_put_hevc_epel_h24_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldr x30, [sp], #48 + load_epel_filterh x6, x5 + mov x10, #(MAX_PB_SIZE * 2) + ld1 {v16.8h, v17.8h, v18.8h}, [sp], x10 + ld1 {v19.8h, v20.8h, v21.8h}, [sp], x10 + ld1 {v22.8h, v23.8h, v24.8h}, [sp], x10 +.macro calc src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10, src11 + ld1 {\src9\().8h, \src10\().8h, \src11\().8h}, [sp], x10 + calc_epelh v4, \src0, \src3, \src6, \src9 + calc_epelh2 v4, v5, \src0, \src3, \src6, \src9 + calc_epelh v5, \src1, \src4, \src7, \src10 + calc_epelh2 v5, v6, \src1, \src4, \src7, \src10 + calc_epelh v6, \src2, \src5, \src8, \src11 + calc_epelh2 v6, v7, \src2, \src5, \src8, \src11 + sqrshrun v4.8b, v4.8h, #6 + sqrshrun v5.8b, v5.8h, #6 + sqrshrun v6.8b, v6.8h, #6 + subs w4, w4, #1 + st1 {v4.8b, v5.8b, v6.8b}, [x0], x1 +.endm +1: calc_all12 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_hv32_8_neon_i8mm, export=1 + stp x5, x6, [sp, #-64]! + stp x3, x4, [sp, #16] + stp x1, x2, [sp, #32] + stp x0, x30, [sp, #48] + mov x7, #16 + bl X(ff_hevc_put_hevc_epel_uni_hv16_8_neon_i8mm) + ldp x5, x6, [sp] + ldp x3, x4, [sp, #16] + ldp x1, x2, [sp, #32] + ldr x0, [sp, #48] + add x0, x0, #16 + add x2, x2, #16 + mov x7, #16 + bl X(ff_hevc_put_hevc_epel_uni_hv16_8_neon_i8mm) + ldr x30, [sp, #56] + add sp, sp, #64 + ret +endfunc + +function ff_hevc_put_hevc_epel_uni_hv48_8_neon_i8mm, export=1 + stp x5, x6, [sp, #-64]! + stp x3, x4, [sp, #16] + stp x1, x2, [sp, #32] + stp x0, x30, [sp, #48] + mov x7, #24 + bl X(ff_hevc_put_hevc_epel_uni_hv24_8_neon_i8mm) + ldp x5, x6, [sp] + ldp x3, x4, [sp, #16] + ldp x1, x2, [sp, #32] + ldr x0, [sp, #48] + add x0, x0, #24 + add x2, x2, #24 + mov x7, #24 + bl X(ff_hevc_put_hevc_epel_uni_hv24_8_neon_i8mm) + ldr x30, [sp, #56] + add sp, sp, #64 + ret +endfunc + +function ff_hevc_put_hevc_epel_uni_hv64_8_neon_i8mm, export=1 + stp x5, x6, [sp, #-64]! + stp x3, x4, [sp, #16] + stp x1, x2, [sp, #32] + stp x0, x30, [sp, #48] + mov x7, #16 + bl X(ff_hevc_put_hevc_epel_uni_hv16_8_neon_i8mm) + ldp x5, x6, [sp] + ldp x3, x4, [sp, #16] + ldp x1, x2, [sp, #32] + ldr x0, [sp, #48] + add x0, x0, #16 + add x2, x2, #16 + mov x7, #16 + bl X(ff_hevc_put_hevc_epel_uni_hv16_8_neon_i8mm) + ldp x5, x6, [sp] + ldp x3, x4, [sp, #16] + ldp x1, x2, [sp, #32] + ldr x0, [sp, #48] + add x0, x0, #32 + add x2, x2, #32 + mov x7, #16 + bl X(ff_hevc_put_hevc_epel_uni_hv16_8_neon_i8mm) + ldp x5, x6, [sp] + ldp x3, x4, [sp, #16] + ldp x1, x2, [sp, #32] + ldr x0, [sp, #48] + add x0, x0, #48 + add x2, x2, #48 + mov x7, #16 + bl X(ff_hevc_put_hevc_epel_uni_hv16_8_neon_i8mm) + ldr x30, [sp, #56] + add sp, sp, #64 + ret +endfunc + .macro EPEL_UNI_W_H_HEADER ldr x12, [sp] sub x2, x2, #1 @@ -818,28 +1418,7 @@ endfunc sqxtn2 v6.8h, v31.4s .endm -.macro calc_epelh dst, src0, src1, src2, src3 - smull \dst\().4s, \src0\().4h, v0.h[0] - smlal \dst\().4s, \src1\().4h, v0.h[1] - smlal \dst\().4s, \src2\().4h, v0.h[2] - smlal \dst\().4s, \src3\().4h, v0.h[3] - sqshrn \dst\().4h, \dst\().4s, #6 -.endm -.macro calc_epelh2 dst, tmp, src0, src1, src2, src3 - smull2 \tmp\().4s, \src0\().8h, v0.h[0] - smlal2 \tmp\().4s, \src1\().8h, v0.h[1] - smlal2 \tmp\().4s, \src2\().8h, v0.h[2] - smlal2 \tmp\().4s, \src3\().8h, v0.h[3] - sqshrn2 \dst\().8h, \tmp\().4s, #6 -.endm - -.macro load_epel_filterh freg, xreg - movrel \xreg, epel_filters - add \xreg, \xreg, \freg, lsl #2 - ld1 {v0.8b}, [\xreg] - sxtl v0.8h, v0.8b -.endm function ff_hevc_put_hevc_epel_uni_w_hv4_8_neon_i8mm, export=1 epel_uni_w_hv_start diff --git a/arm/android/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_idct_neon.S b/arm/android/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_idct_neon.S index b7f23386..ba8a1eba 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_idct_neon.S +++ b/arm/android/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_idct_neon.S @@ -617,8 +617,7 @@ function ff_hevc_idct_16x16_\bitdepth\()_neon, export=1 add sp, sp, #640 - mov x30, x15 - ret + ret x15 endfunc .endm @@ -791,7 +790,7 @@ function func_tr_32x4_\name add x3, x11, #(32 + 3 * 64) scale_store \shift - br x10 + ret x10 endfunc .endm @@ -814,8 +813,7 @@ function ff_hevc_idct_32x32_\bitdepth\()_neon, export=1 .endr add sp, sp, #2432 - mov x30, x15 - ret + ret x15 endfunc .endm diff --git a/arm/android/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_init_aarch64.c b/arm/android/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_init_aarch64.c index e125b0cf..782cf802 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_init_aarch64.c +++ b/arm/android/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_init_aarch64.c @@ -161,6 +161,14 @@ NEON8_FNPROTO(pel_uni_w_pixels, (uint8_t *_dst, ptrdiff_t _dststride, int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width),); +NEON8_FNPROTO(epel_uni_v, (uint8_t *dst, ptrdiff_t dststride, + const uint8_t *src, ptrdiff_t srcstride, + int height, intptr_t mx, intptr_t my, int width),); + +NEON8_FNPROTO(epel_uni_hv, (uint8_t *dst, ptrdiff_t _dststride, + const uint8_t *src, ptrdiff_t srcstride, + int height, intptr_t mx, intptr_t my, int width), _i8mm); + NEON8_FNPROTO(epel_uni_w_v, (uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, int height, int denom, int wx, int ox, @@ -184,6 +192,14 @@ NEON8_FNPROTO(qpel_h, (int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width), _i8mm); +NEON8_FNPROTO(qpel_uni_v, (uint8_t *dst, ptrdiff_t dststride, + const uint8_t *src, ptrdiff_t srcstride, + int height, intptr_t mx, intptr_t my, int width),); + +NEON8_FNPROTO(qpel_uni_hv, (uint8_t *dst, ptrdiff_t dststride, + const uint8_t *src, ptrdiff_t srcstride, + int height, intptr_t mx, intptr_t my, int width), _i8mm); + NEON8_FNPROTO(qpel_uni_w_h, (uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, int height, int denom, int wx, int ox, @@ -285,7 +301,9 @@ av_cold void ff_hevc_dsp_init_aarch64(HEVCDSPContext *c, const int bit_depth) c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_qpel_bi_h16_8_neon; NEON8_FNASSIGN(c->put_hevc_epel_uni, 0, 0, pel_uni_pixels,); + NEON8_FNASSIGN(c->put_hevc_epel_uni, 1, 0, epel_uni_v,); NEON8_FNASSIGN(c->put_hevc_qpel_uni, 0, 0, pel_uni_pixels,); + NEON8_FNASSIGN(c->put_hevc_qpel_uni, 1, 0, qpel_uni_v,); NEON8_FNASSIGN(c->put_hevc_epel_uni_w, 0, 0, pel_uni_w_pixels,); NEON8_FNASSIGN(c->put_hevc_qpel_uni_w, 0, 0, pel_uni_w_pixels,); NEON8_FNASSIGN(c->put_hevc_epel_uni_w, 1, 0, epel_uni_w_v,); @@ -293,8 +311,10 @@ av_cold void ff_hevc_dsp_init_aarch64(HEVCDSPContext *c, const int bit_depth) if (have_i8mm(cpu_flags)) { NEON8_FNASSIGN(c->put_hevc_epel, 0, 1, epel_h, _i8mm); + NEON8_FNASSIGN(c->put_hevc_epel_uni, 1, 1, epel_uni_hv, _i8mm); NEON8_FNASSIGN(c->put_hevc_epel_uni_w, 0, 1, epel_uni_w_h ,_i8mm); NEON8_FNASSIGN(c->put_hevc_qpel, 0, 1, qpel_h, _i8mm); + NEON8_FNASSIGN(c->put_hevc_qpel_uni, 1, 1, qpel_uni_hv, _i8mm); NEON8_FNASSIGN(c->put_hevc_qpel_uni_w, 0, 1, qpel_uni_w_h, _i8mm); NEON8_FNASSIGN(c->put_hevc_epel_uni_w, 1, 1, epel_uni_w_hv, _i8mm); NEON8_FNASSIGN_PARTIAL_5(c->put_hevc_qpel_uni_w, 1, 1, qpel_uni_w_hv, _i8mm); diff --git a/arm/android/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_qpel_neon.S b/arm/android/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_qpel_neon.S index e38dff96..1212eae6 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_qpel_neon.S +++ b/arm/android/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_qpel_neon.S @@ -44,6 +44,74 @@ endconst sxtl v0.8h, v0.8b .endm +.macro load_qpel_filterb freg, xreg + movrel \xreg, qpel_filters_abs + add \xreg, \xreg, \freg, lsl #3 + ld4r {v0.16b, v1.16b, v2.16b, v3.16b}, [\xreg], #4 + ld4r {v4.16b, v5.16b, v6.16b, v7.16b}, [\xreg] +.endm + +.macro calc_qpelb dst, src0, src1, src2, src3, src4, src5, src6, src7 + umull \dst\().8h, \src1\().8b, v1.8b + umlsl \dst\().8h, \src0\().8b, v0.8b + umlsl \dst\().8h, \src2\().8b, v2.8b + umlal \dst\().8h, \src3\().8b, v3.8b + umlal \dst\().8h, \src4\().8b, v4.8b + umlsl \dst\().8h, \src5\().8b, v5.8b + umlal \dst\().8h, \src6\().8b, v6.8b + umlsl \dst\().8h, \src7\().8b, v7.8b +.endm + +.macro calc_qpelb2 dst, src0, src1, src2, src3, src4, src5, src6, src7 + umull2 \dst\().8h, \src1\().16b, v1.16b + umlsl2 \dst\().8h, \src0\().16b, v0.16b + umlsl2 \dst\().8h, \src2\().16b, v2.16b + umlal2 \dst\().8h, \src3\().16b, v3.16b + umlal2 \dst\().8h, \src4\().16b, v4.16b + umlsl2 \dst\().8h, \src5\().16b, v5.16b + umlal2 \dst\().8h, \src6\().16b, v6.16b + umlsl2 \dst\().8h, \src7\().16b, v7.16b +.endm + +.macro load_qpel_filterh freg, xreg + movrel \xreg, qpel_filters + add \xreg, \xreg, \freg, lsl #3 + ld1 {v0.8b}, [\xreg] + sxtl v0.8h, v0.8b +.endm + +.macro calc_qpelh dst, src0, src1, src2, src3, src4, src5, src6, src7, op, shift=6 + smull \dst\().4s, \src0\().4h, v0.h[0] + smlal \dst\().4s, \src1\().4h, v0.h[1] + smlal \dst\().4s, \src2\().4h, v0.h[2] + smlal \dst\().4s, \src3\().4h, v0.h[3] + smlal \dst\().4s, \src4\().4h, v0.h[4] + smlal \dst\().4s, \src5\().4h, v0.h[5] + smlal \dst\().4s, \src6\().4h, v0.h[6] + smlal \dst\().4s, \src7\().4h, v0.h[7] +.ifc \op, sshr + sshr \dst\().4s, \dst\().4s, \shift +.else + \op \dst\().4h, \dst\().4s, \shift +.endif +.endm + +.macro calc_qpelh2 dst, dstt, src0, src1, src2, src3, src4, src5, src6, src7, op, shift=6 + smull2 \dstt\().4s, \src0\().8h, v0.h[0] + smlal2 \dstt\().4s, \src1\().8h, v0.h[1] + smlal2 \dstt\().4s, \src2\().8h, v0.h[2] + smlal2 \dstt\().4s, \src3\().8h, v0.h[3] + smlal2 \dstt\().4s, \src4\().8h, v0.h[4] + smlal2 \dstt\().4s, \src5\().8h, v0.h[5] + smlal2 \dstt\().4s, \src6\().8h, v0.h[6] + smlal2 \dstt\().4s, \src7\().8h, v0.h[7] +.ifc \op, sshr + sshr \dst\().4s, \dstt\().4s, \shift +.else + \op \dst\().8h, \dstt\().4s, \shift +.endif +.endm + .macro put_hevc type .ifc \type, qpel // void put_hevc_qpel_h(int16_t *dst, @@ -595,6 +663,198 @@ function ff_hevc_put_hevc_pel_uni_pixels64_8_neon, export=1 ret endfunc +.macro calc_all + calc v23, v16, v17, v18, v19, v20, v21, v22, v23 + b.eq 2f + calc v16, v17, v18, v19, v20, v21, v22, v23, v16 + b.eq 2f + calc v17, v18, v19, v20, v21, v22, v23, v16, v17 + b.eq 2f + calc v18, v19, v20, v21, v22, v23, v16, v17, v18 + b.eq 2f + calc v19, v20, v21, v22, v23, v16, v17, v18, v19 + b.eq 2f + calc v20, v21, v22, v23, v16, v17, v18, v19, v20 + b.eq 2f + calc v21, v22, v23, v16, v17, v18, v19, v20, v21 + b.eq 2f + calc v22, v23, v16, v17, v18, v19, v20, v21, v22 + b.hi 1b +.endm + +function ff_hevc_put_hevc_qpel_uni_v4_8_neon, export=1 + load_qpel_filterb x6, x5 + sub x2, x2, x3, lsl #1 + sub x2, x2, x3 + ldr s16, [x2] + ldr s17, [x2, x3] + add x2, x2, x3, lsl #1 + ldr s18, [x2] + ldr s19, [x2, x3] + add x2, x2, x3, lsl #1 + ldr s20, [x2] + ldr s21, [x2, x3] + add x2, x2, x3, lsl #1 + ldr s22, [x2] + add x2, x2, x3 +.macro calc tmp, src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\tmp\().s}[0], [x2], x3 + calc_qpelb v24, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7 + sqrshrun v24.8b, v24.8h, #6 + subs w4, w4, #1 + st1 {v24.s}[0], [x0], x1 +.endm +1: calc_all +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_v6_8_neon, export=1 + load_qpel_filterb x6, x5 + sub x2, x2, x3, lsl #1 + sub x1, x1, #4 + sub x2, x2, x3 + ldr d16, [x2] + ldr d17, [x2, x3] + add x2, x2, x3, lsl #1 + ldr d18, [x2] + ldr d19, [x2, x3] + add x2, x2, x3, lsl #1 + ldr d20, [x2] + ldr d21, [x2, x3] + add x2, x2, x3, lsl #1 + ldr d22, [x2] + add x2, x2, x3 +.macro calc tmp, src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\tmp\().8b}, [x2], x3 + calc_qpelb v24, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7 + sqrshrun v24.8b, v24.8h, #6 + st1 {v24.s}[0], [x0], #4 + subs w4, w4, #1 + st1 {v24.h}[2], [x0], x1 +.endm +1: calc_all +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_v8_8_neon, export=1 + load_qpel_filterb x6, x5 + sub x2, x2, x3, lsl #1 + sub x2, x2, x3 + ldr d16, [x2] + ldr d17, [x2, x3] + add x2, x2, x3, lsl #1 + ldr d18, [x2] + ldr d19, [x2, x3] + add x2, x2, x3, lsl #1 + ldr d20, [x2] + ldr d21, [x2, x3] + add x2, x2, x3, lsl #1 + ldr d22, [x2] + add x2, x2, x3 +.macro calc tmp, src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\tmp\().8b}, [x2], x3 + calc_qpelb v24, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7 + sqrshrun v24.8b, v24.8h, #6 + subs w4, w4, #1 + st1 {v24.8b}, [x0], x1 +.endm +1: calc_all +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_v12_8_neon, export=1 + load_qpel_filterb x6, x5 + sub x2, x2, x3, lsl #1 + sub x1, x1, #8 + sub x2, x2, x3 +0: mov x8, x2 // src + mov w11, w4 // height + mov x10, x0 // dst + ldr q16, [x8] + ldr q17, [x8, x3] + add x8, x8, x3, lsl #1 + ldr q18, [x8] + ldr q19, [x8, x3] + add x8, x8, x3, lsl #1 + ldr q20, [x8] + ldr q21, [x8, x3] + add x8, x8, x3, lsl #1 + ldr q22, [x8] + add x8, x8, x3 +.macro calc tmp, src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\tmp\().16b}, [x8], x3 + calc_qpelb v24, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7 + calc_qpelb2 v25, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7 + sqrshrun v24.8b, v24.8h, #6 + sqrshrun2 v24.16b, v25.8h, #6 + st1 {v24.8b}, [x10], #8 + subs x11, x11, #1 + st1 {v24.s}[2], [x10], x1 +.endm +1: calc_all +.purgem calc +2: add x0, x0, #12 + add x2, x2, #12 + subs w7, w7, #12 + b.ne 0b + ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_v16_8_neon, export=1 + load_qpel_filterb x6, x5 + sub x2, x2, x3, lsl #1 + sub x2, x2, x3 +0: mov x8, x2 // src + mov w11, w4 // height + mov x10, x0 // dst + ldr q16, [x8] + ldr q17, [x8, x3] + add x8, x8, x3, lsl #1 + ldr q18, [x8] + ldr q19, [x8, x3] + add x8, x8, x3, lsl #1 + ldr q20, [x8] + ldr q21, [x8, x3] + add x8, x8, x3, lsl #1 + ldr q22, [x8] + add x8, x8, x3 +.macro calc tmp, src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\tmp\().16b}, [x8], x3 + calc_qpelb v24, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7 + calc_qpelb2 v25, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7 + sqrshrun v24.8b, v24.8h, #6 + sqrshrun2 v24.16b, v25.8h, #6 + subs x11, x11, #1 + st1 {v24.16b}, [x10], x1 +.endm +1: calc_all +.purgem calc +2: add x0, x0, #16 + add x2, x2, #16 + subs w7, w7, #16 + b.ne 0b + ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_v24_8_neon, export=1 + b X(ff_hevc_put_hevc_qpel_uni_v12_8_neon) +endfunc + +function ff_hevc_put_hevc_qpel_uni_v32_8_neon, export=1 + b X(ff_hevc_put_hevc_qpel_uni_v16_8_neon) +endfunc + +function ff_hevc_put_hevc_qpel_uni_v48_8_neon, export=1 + b X(ff_hevc_put_hevc_qpel_uni_v16_8_neon) +endfunc + +function ff_hevc_put_hevc_qpel_uni_v64_8_neon, export=1 + b X(ff_hevc_put_hevc_qpel_uni_v16_8_neon) +endfunc + function ff_hevc_put_hevc_pel_uni_w_pixels4_8_neon, export=1 mov w10, #-6 sub w10, w10, w5 @@ -1298,6 +1558,334 @@ function ff_hevc_put_hevc_qpel_uni_w_v64_8_neon, export=1 endfunc #if HAVE_I8MM + +.macro calc_all2 + calc v30, v31, v16, v18, v20, v22, v24, v26, v28, v30, v17, v19, v21, v23, v25, v27, v29, v31 + b.eq 2f + calc v16, v17, v18, v20, v22, v24, v26, v28, v30, v16, v19, v21, v23, v25, v27, v29, v31, v17 + b.eq 2f + calc v18, v19, v20, v22, v24, v26, v28, v30, v16, v18, v21, v23, v25, v27, v29, v31, v17, v19 + b.eq 2f + calc v20, v21, v22, v24, v26, v28, v30, v16, v18, v20, v23, v25, v27, v29, v31, v17, v19, v21 + b.eq 2f + calc v22, v23, v24, v26, v28, v30, v16, v18, v20, v22, v25, v27, v29, v31, v17, v19, v21, v23 + b.eq 2f + calc v24, v25, v26, v28, v30, v16, v18, v20, v22, v24, v27, v29, v31, v17, v19, v21, v23, v25 + b.eq 2f + calc v26, v27, v28, v30, v16, v18, v20, v22, v24, v26, v29, v31, v17, v19, v21, v23, v25, v27 + b.eq 2f + calc v28, v29, v30, v16, v18, v20, v22, v24, v26, v28, v31, v17, v19, v21, v23, v25, v27, v29 + b.hi 1b +.endm + +function ff_hevc_put_hevc_qpel_uni_hv4_8_neon_i8mm, export=1 + add w10, w4, #7 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + str x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + sub x1, x2, x3, lsl #1 + sub x1, x1, x3 + add x0, sp, #48 + mov x2, x3 + add x3, x4, #7 + mov x4, x5 + bl X(ff_hevc_put_hevc_qpel_h4_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldr x30, [sp], #48 + mov x9, #(MAX_PB_SIZE * 2) + load_qpel_filterh x6, x5 + ldr d16, [sp] + ldr d17, [sp, x9] + add sp, sp, x9, lsl #1 + ldr d18, [sp] + ldr d19, [sp, x9] + add sp, sp, x9, lsl #1 + ldr d20, [sp] + ldr d21, [sp, x9] + add sp, sp, x9, lsl #1 + ldr d22, [sp] + add sp, sp, x9 +.macro calc tmp, src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\tmp\().4h}, [sp], x9 + calc_qpelh v1, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sqrshrn, #12 + sqxtun v1.8b, v1.8h + subs w4, w4, #1 + st1 {v1.s}[0], [x0], x1 +.endm +1: calc_all +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_hv6_8_neon_i8mm, export=1 + add w10, w4, #7 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + str x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + sub x1, x2, x3, lsl #1 + sub x1, x1, x3 + add x0, sp, #48 + mov x2, x3 + add w3, w4, #7 + mov x4, x5 + bl X(ff_hevc_put_hevc_qpel_h6_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldr x30, [sp], #48 + mov x9, #(MAX_PB_SIZE * 2) + load_qpel_filterh x6, x5 + sub x1, x1, #4 + ldr q16, [sp] + ldr q17, [sp, x9] + add sp, sp, x9, lsl #1 + ldr q18, [sp] + ldr q19, [sp, x9] + add sp, sp, x9, lsl #1 + ldr q20, [sp] + ldr q21, [sp, x9] + add sp, sp, x9, lsl #1 + ldr q22, [sp] + add sp, sp, x9 +.macro calc tmp, src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\tmp\().8h}, [sp], x9 + calc_qpelh v1, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sqrshrn, #12 + calc_qpelh2 v1, v2, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sqrshrn2, #12 + sqxtun v1.8b, v1.8h + st1 {v1.s}[0], [x0], #4 + subs w4, w4, #1 + st1 {v1.h}[2], [x0], x1 +.endm +1: calc_all +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_hv8_8_neon_i8mm, export=1 + add w10, w4, #7 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + str x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + sub x1, x2, x3, lsl #1 + sub x1, x1, x3 + add x0, sp, #48 + mov x2, x3 + add w3, w4, #7 + mov x4, x5 + bl X(ff_hevc_put_hevc_qpel_h8_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldr x30, [sp], #48 + mov x9, #(MAX_PB_SIZE * 2) + load_qpel_filterh x6, x5 + ldr q16, [sp] + ldr q17, [sp, x9] + add sp, sp, x9, lsl #1 + ldr q18, [sp] + ldr q19, [sp, x9] + add sp, sp, x9, lsl #1 + ldr q20, [sp] + ldr q21, [sp, x9] + add sp, sp, x9, lsl #1 + ldr q22, [sp] + add sp, sp, x9 +.macro calc tmp, src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\tmp\().8h}, [sp], x9 + calc_qpelh v1, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sqrshrn, #12 + calc_qpelh2 v1, v2, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sqrshrn2, #12 + sqxtun v1.8b, v1.8h + subs w4, w4, #1 + st1 {v1.8b}, [x0], x1 +.endm +1: calc_all +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_hv12_8_neon_i8mm, export=1 + add w10, w4, #7 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + stp x7, x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + sub x1, x2, x3, lsl #1 + sub x1, x1, x3 + mov x2, x3 + add x0, sp, #48 + add w3, w4, #7 + mov x4, x5 + bl X(ff_hevc_put_hevc_qpel_h12_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldp x7, x30, [sp], #48 + mov x9, #(MAX_PB_SIZE * 2) + load_qpel_filterh x6, x5 + sub x1, x1, #8 + ld1 {v16.8h, v17.8h}, [sp], x9 + ld1 {v18.8h, v19.8h}, [sp], x9 + ld1 {v20.8h, v21.8h}, [sp], x9 + ld1 {v22.8h, v23.8h}, [sp], x9 + ld1 {v24.8h, v25.8h}, [sp], x9 + ld1 {v26.8h, v27.8h}, [sp], x9 + ld1 {v28.8h, v29.8h}, [sp], x9 +.macro calc tmp0, tmp1, src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10, src11, src12, src13, src14, src15 + ld1 {\tmp0\().8h, \tmp1\().8h}, [sp], x9 + calc_qpelh v1, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sqrshrn, #12 + calc_qpelh2 v1, v2, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sqrshrn2, #12 + calc_qpelh v2, \src8, \src9, \src10, \src11, \src12, \src13, \src14, \src15, sqrshrn, #12 + sqxtun v1.8b, v1.8h + sqxtun2 v1.16b, v2.8h + st1 {v1.8b}, [x0], #8 + subs w4, w4, #1 + st1 {v1.s}[2], [x0], x1 +.endm +1: calc_all2 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_hv16_8_neon_i8mm, export=1 + add w10, w4, #7 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + stp x7, x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + add x0, sp, #48 + sub x1, x2, x3, lsl #1 + sub x1, x1, x3 + mov x2, x3 + add w3, w4, #7 + mov x4, x5 + bl X(ff_hevc_put_hevc_qpel_h16_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldp x7, x30, [sp], #48 +.Lqpel_uni_hv16_loop: + mov x9, #(MAX_PB_SIZE * 2) + load_qpel_filterh x6, x5 + sub w12, w9, w7, lsl #1 +0: mov x8, sp // src + ld1 {v16.8h, v17.8h}, [x8], x9 + mov w11, w4 // height + ld1 {v18.8h, v19.8h}, [x8], x9 + mov x10, x0 // dst + ld1 {v20.8h, v21.8h}, [x8], x9 + ld1 {v22.8h, v23.8h}, [x8], x9 + ld1 {v24.8h, v25.8h}, [x8], x9 + ld1 {v26.8h, v27.8h}, [x8], x9 + ld1 {v28.8h, v29.8h}, [x8], x9 +.macro calc tmp0, tmp1, src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10, src11, src12, src13, src14, src15 + ld1 {\tmp0\().8h, \tmp1\().8h}, [x8], x9 + calc_qpelh v1, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sqrshrn, #12 + calc_qpelh2 v1, v2, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sqrshrn2, #12 + calc_qpelh v2, \src8, \src9, \src10, \src11, \src12, \src13, \src14, \src15, sqrshrn, #12 + calc_qpelh2 v2, v3, \src8, \src9, \src10, \src11, \src12, \src13, \src14, \src15, sqrshrn2, #12 + sqxtun v1.8b, v1.8h + subs x11, x11, #1 + sqxtun2 v1.16b, v2.8h + st1 {v1.16b}, [x10], x1 +.endm +1: calc_all2 +.purgem calc +2: add x0, x0, #16 + add sp, sp, #32 + subs w7, w7, #16 + b.ne 0b + add w10, w4, #6 + add sp, sp, x12 // discard rest of first line + lsl x10, x10, #7 + add sp, sp, x10 // tmp_array without first line + ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_hv24_8_neon_i8mm, export=1 + stp x4, x5, [sp, #-64]! + stp x2, x3, [sp, #16] + stp x0, x1, [sp, #32] + stp x6, x30, [sp, #48] + mov x7, #16 + bl X(ff_hevc_put_hevc_qpel_uni_hv16_8_neon_i8mm) + ldp x2, x3, [sp, #16] + add x2, x2, #16 + ldp x0, x1, [sp, #32] + ldp x4, x5, [sp], #48 + mov x7, #8 + add x0, x0, #16 + ldr x6, [sp] + bl X(ff_hevc_put_hevc_qpel_uni_hv8_8_neon_i8mm) + ldr x30, [sp, #8] + add sp, sp, #16 + ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_hv32_8_neon_i8mm, export=1 + add w10, w4, #7 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + stp x7, x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + sub x1, x2, x3, lsl #1 + add x0, sp, #48 + sub x1, x1, x3 + mov x2, x3 + add w3, w4, #7 + mov x4, x5 + bl X(ff_hevc_put_hevc_qpel_h32_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldp x7, x30, [sp], #48 + b .Lqpel_uni_hv16_loop +endfunc + +function ff_hevc_put_hevc_qpel_uni_hv48_8_neon_i8mm, export=1 + add w10, w4, #7 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + stp x7, x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + sub x1, x2, x3, lsl #1 + sub x1, x1, x3 + mov x2, x3 + add x0, sp, #48 + add w3, w4, #7 + mov x4, x5 + bl X(ff_hevc_put_hevc_qpel_h48_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldp x7, x30, [sp], #48 + b .Lqpel_uni_hv16_loop +endfunc + +function ff_hevc_put_hevc_qpel_uni_hv64_8_neon_i8mm, export=1 + add w10, w4, #7 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + stp x7, x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + add x0, sp, #48 + sub x1, x2, x3, lsl #1 + mov x2, x3 + sub x1, x1, x3 + add w3, w4, #7 + mov x4, x5 + bl X(ff_hevc_put_hevc_qpel_h64_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldp x7, x30, [sp], #48 + b .Lqpel_uni_hv16_loop +endfunc + .macro QPEL_UNI_W_H_HEADER ldr x12, [sp] sub x2, x2, #3 diff --git a/arm/android/third_party/ffmpeg/libavcodec/aarch64/synth_filter_init.c b/arm/android/third_party/ffmpeg/libavcodec/aarch64/synth_filter_init.c index 6b6da35b..aea6aaf4 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/aarch64/synth_filter_init.c +++ b/arm/android/third_party/ffmpeg/libavcodec/aarch64/synth_filter_init.c @@ -23,15 +23,8 @@ #include "libavutil/aarch64/cpu.h" #include "libavutil/attributes.h" #include "libavutil/internal.h" -#include "libavcodec/fft.h" #include "libavcodec/synth_filter.h" -#include "asm-offsets.h" - -#if HAVE_NEON -AV_CHECK_OFFSET(FFTContext, imdct_half, IMDCT_HALF); -#endif - void ff_synth_filter_float_neon(AVTXContext *imdct, float *synth_buf_ptr, int *synth_buf_offset, float synth_buf2[32], const float window[512], diff --git a/arm/android/third_party/ffmpeg/libavcodec/aarch64/synth_filter_neon.S b/arm/android/third_party/ffmpeg/libavcodec/aarch64/synth_filter_neon.S index 259fa6e6..63aefcb5 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/aarch64/synth_filter_neon.S +++ b/arm/android/third_party/ffmpeg/libavcodec/aarch64/synth_filter_neon.S @@ -19,8 +19,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "asm-offsets.h" - #include "libavutil/aarch64/asm.S" .macro inner_loop diff --git a/arm/android/third_party/ffmpeg/libavcodec/ac3dec.c b/arm/android/third_party/ffmpeg/libavcodec/ac3dec.c index fc0cbeb4..ee501386 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/ac3dec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/ac3dec.c @@ -228,7 +228,7 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx) if ((ret = av_tx_init(&s->tx_256, &s->tx_fn_256, IMDCT_TYPE, 1, 256, &scale, 0))) return ret; - AC3_RENAME(ff_kbd_window_init)(s->window, 5.0, 256); + AC3_RENAME(avpriv_kbd_window_init)(s->window, 5.0, 256); ff_bswapdsp_init(&s->bdsp); #if (USE_FIXED) @@ -1714,7 +1714,7 @@ skip: if (!err) { avctx->sample_rate = s->sample_rate; avctx->bit_rate = s->bit_rate + s->prev_bit_rate; - avctx->profile = s->eac3_extension_type_a == 1 ? FF_PROFILE_EAC3_DDP_ATMOS : FF_PROFILE_UNKNOWN; + avctx->profile = s->eac3_extension_type_a == 1 ? AV_PROFILE_EAC3_DDP_ATMOS : AV_PROFILE_UNKNOWN; } if (!avctx->sample_rate) { diff --git a/arm/android/third_party/ffmpeg/libavcodec/ac3enc.c b/arm/android/third_party/ffmpeg/libavcodec/ac3enc.c index 3cb4e5f0..56c8d239 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/ac3enc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/ac3enc.c @@ -33,6 +33,7 @@ #include "libavutil/avstring.h" #include "libavutil/channel_layout.h" #include "libavutil/crc.h" +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "libavutil/mem_internal.h" #include "libavutil/opt.h" diff --git a/arm/android/third_party/ffmpeg/libavcodec/ac3enc_fixed.c b/arm/android/third_party/ffmpeg/libavcodec/ac3enc_fixed.c index 88dfd66b..079a43dc 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/ac3enc_fixed.c +++ b/arm/android/third_party/ffmpeg/libavcodec/ac3enc_fixed.c @@ -82,7 +82,7 @@ static av_cold int ac3_fixed_mdct_init(AC3EncodeContext *s) if (!iwin) return AVERROR(ENOMEM); - ff_kbd_window_init(fwin, 5.0, AC3_BLOCK_SIZE); + avpriv_kbd_window_init(fwin, 5.0, AC3_BLOCK_SIZE); for (int i = 0; i < AC3_BLOCK_SIZE; i++) iwin[i] = lrintf(fwin[i] * (1 << 22)); diff --git a/arm/android/third_party/ffmpeg/libavcodec/ac3enc_float.c b/arm/android/third_party/ffmpeg/libavcodec/ac3enc_float.c index ae351a53..9664adbf 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/ac3enc_float.c +++ b/arm/android/third_party/ffmpeg/libavcodec/ac3enc_float.c @@ -92,7 +92,7 @@ static av_cold int ac3_float_mdct_init(AC3EncodeContext *s) return AVERROR(ENOMEM); } - ff_kbd_window_init(window, 5.0, AC3_BLOCK_SIZE); + avpriv_kbd_window_init(window, 5.0, AC3_BLOCK_SIZE); s->mdct_window = window; return av_tx_init(&s->tx, &s->tx_fn, AV_TX_FLOAT_MDCT, 0, diff --git a/arm/android/third_party/ffmpeg/libavcodec/adx.h b/arm/android/third_party/ffmpeg/libavcodec/adx.h index 8d5e0869..60ce07ad 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/adx.h +++ b/arm/android/third_party/ffmpeg/libavcodec/adx.h @@ -35,9 +35,11 @@ typedef struct ADXChannelState { int s1,s2; } ADXChannelState; +#define MAX_CHANNELS 6 + typedef struct ADXContext { int channels; - ADXChannelState prev[2]; + ADXChannelState prev[MAX_CHANNELS]; int header_parsed; int eof; int cutoff; diff --git a/arm/android/third_party/ffmpeg/libavcodec/adx_parser.c b/arm/android/third_party/ffmpeg/libavcodec/adx_parser.c index 52aa14b7..62b4415b 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/adx_parser.c +++ b/arm/android/third_party/ffmpeg/libavcodec/adx_parser.c @@ -73,6 +73,16 @@ static int adx_parse(AVCodecParserContext *s1, s->remaining = 0; } else s->remaining -= buf_size; + } else if (avctx->ch_layout.nb_channels > 0) { + if (!s->block_size) + s->block_size = avctx->ch_layout.nb_channels * BLOCK_SIZE; + if (!s->remaining) + s->remaining = s->block_size; + if (s->remaining <= buf_size) { + next = s->remaining; + s->remaining = 0; + } else + s->remaining -= buf_size; } if (ff_combine_frame(pc, next, &buf, &buf_size) < 0 || !buf_size) { diff --git a/arm/android/third_party/ffmpeg/libavcodec/adxdec.c b/arm/android/third_party/ffmpeg/libavcodec/adxdec.c index 97a7e596..4300dede 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/adxdec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/adxdec.c @@ -70,7 +70,7 @@ static int adx_decode_header(AVCodecContext *avctx, const uint8_t *buf, /* channels */ channels = buf[7]; - if (channels <= 0 || channels > 2) + if (channels <= 0 || channels > MAX_CHANNELS) return AVERROR_INVALIDDATA; if (avctx->ch_layout.nb_channels != channels) { diff --git a/arm/android/third_party/ffmpeg/libavcodec/agm.c b/arm/android/third_party/ffmpeg/libavcodec/agm.c index 55cf0b47..88272cc3 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/agm.c +++ b/arm/android/third_party/ffmpeg/libavcodec/agm.c @@ -1015,12 +1015,12 @@ static int build_huff(const uint8_t *bitlen, VLC *vlc) } } - ff_free_vlc(vlc); - return ff_init_vlc_sparse(vlc, 13, nb_codes, + ff_vlc_free(vlc); + return ff_vlc_init_sparse(vlc, 13, nb_codes, bits, 1, 1, codes, 4, 4, symbols, 1, 1, - INIT_VLC_LE); + VLC_INIT_LE); } static int decode_huffman2(AVCodecContext *avctx, int header, int size) @@ -1203,8 +1203,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, if (ret < 0) return ret; - av_frame_unref(s->prev_frame); - if ((ret = av_frame_ref(s->prev_frame, frame)) < 0) + if ((ret = av_frame_replace(s->prev_frame, frame)) < 0) return ret; frame->crop_top = avctx->coded_height - avctx->height; @@ -1256,7 +1255,7 @@ static av_cold int decode_close(AVCodecContext *avctx) { AGMContext *s = avctx->priv_data; - ff_free_vlc(&s->vlc); + ff_vlc_free(&s->vlc); av_frame_free(&s->prev_frame); av_freep(&s->mvectors); s->mvectors_size = 0; diff --git a/arm/android/third_party/ffmpeg/libavcodec/alac.c b/arm/android/third_party/ffmpeg/libavcodec/alac.c index d10ecba7..538d1e59 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/alac.c +++ b/arm/android/third_party/ffmpeg/libavcodec/alac.c @@ -112,6 +112,7 @@ static inline unsigned int decode_scalar(GetBitContext *gb, int k, int bps) static int rice_decompress(ALACContext *alac, int32_t *output_buffer, int nb_samples, int bps, int rice_history_mult) { + GetBitContext *gb = &alac->gb; int i; unsigned int history = alac->rice_initial_history; int sign_modifier = 0; @@ -120,13 +121,13 @@ static int rice_decompress(ALACContext *alac, int32_t *output_buffer, int k; unsigned int x; - if(get_bits_left(&alac->gb) <= 0) + if (get_bits_left(gb) <= 0) return AVERROR_INVALIDDATA; /* calculate rice param and decode next value */ k = av_log2((history >> 9) + 3); k = FFMIN(k, alac->rice_limit); - x = decode_scalar(&alac->gb, k, bps); + x = decode_scalar(gb, k, bps); x += sign_modifier; sign_modifier = 0; output_buffer[i] = (x >> 1) ^ -(x & 1); @@ -145,7 +146,7 @@ static int rice_decompress(ALACContext *alac, int32_t *output_buffer, /* calculate rice param and decode block size */ k = 7 - av_log2(history) + ((history + 16) >> 6); k = FFMIN(k, alac->rice_limit); - block_size = decode_scalar(&alac->gb, k, 16); + block_size = decode_scalar(gb, k, 16); if (block_size > 0) { if (block_size >= nb_samples - i) { @@ -168,7 +169,7 @@ static int rice_decompress(ALACContext *alac, int32_t *output_buffer, static inline int sign_only(int v) { - return v ? FFSIGN(v) : 0; + return FFDIFFSIGN(v, 0); } static void lpc_prediction(int32_t *error_buffer, uint32_t *buffer_out, @@ -239,16 +240,17 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index, { ALACContext *alac = avctx->priv_data; int has_size, bps, is_compressed, decorr_shift, decorr_left_weight, ret; + GetBitContext *gb = &alac->gb; uint32_t output_samples; int i, ch; - skip_bits(&alac->gb, 4); /* element instance tag */ - skip_bits(&alac->gb, 12); /* unused header bits */ + skip_bits(gb, 4); /* element instance tag */ + skip_bits(gb, 12); /* unused header bits */ /* the number of output samples is stored in the frame */ - has_size = get_bits1(&alac->gb); + has_size = get_bits1(gb); - alac->extra_bits = get_bits(&alac->gb, 2) << 3; + alac->extra_bits = get_bits(gb, 2) << 3; bps = alac->sample_size - alac->extra_bits + channels - 1; if (bps > 32) { avpriv_report_missing_feature(avctx, "bps %d", bps); @@ -258,10 +260,10 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index, return AVERROR_INVALIDDATA; /* whether the frame is compressed */ - is_compressed = !get_bits1(&alac->gb); + is_compressed = !get_bits1(gb); if (has_size) - output_samples = get_bits_long(&alac->gb, 32); + output_samples = get_bits_long(gb, 32); else output_samples = alac->max_samples_per_frame; if (!output_samples || output_samples > alac->max_samples_per_frame) { @@ -298,39 +300,40 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index, return AVERROR(ENOSYS); } - decorr_shift = get_bits(&alac->gb, 8); - decorr_left_weight = get_bits(&alac->gb, 8); + decorr_shift = get_bits(gb, 8); + decorr_left_weight = get_bits(gb, 8); if (channels == 2 && decorr_left_weight && decorr_shift > 31) return AVERROR_INVALIDDATA; for (ch = 0; ch < channels; ch++) { - prediction_type[ch] = get_bits(&alac->gb, 4); - lpc_quant[ch] = get_bits(&alac->gb, 4); - rice_history_mult[ch] = get_bits(&alac->gb, 3); - lpc_order[ch] = get_bits(&alac->gb, 5); + prediction_type[ch] = get_bits(gb, 4); + lpc_quant[ch] = get_bits(gb, 4); + rice_history_mult[ch] = get_bits(gb, 3); + lpc_order[ch] = get_bits(gb, 5); if (lpc_order[ch] >= alac->max_samples_per_frame || !lpc_quant[ch]) return AVERROR_INVALIDDATA; /* read the predictor table */ for (i = lpc_order[ch] - 1; i >= 0; i--) - lpc_coefs[ch][i] = get_sbits(&alac->gb, 16); + lpc_coefs[ch][i] = get_sbits(gb, 16); } if (alac->extra_bits) { + const int extra_bits = alac->extra_bits; + if (get_bits_left(gb) < (int64_t)alac->nb_samples * channels * extra_bits) + return AVERROR_INVALIDDATA; for (i = 0; i < alac->nb_samples; i++) { - if(get_bits_left(&alac->gb) <= 0) - return AVERROR_INVALIDDATA; for (ch = 0; ch < channels; ch++) - alac->extra_bits_buffer[ch][i] = get_bits(&alac->gb, alac->extra_bits); + alac->extra_bits_buffer[ch][i] = get_bits(gb, extra_bits); } } for (ch = 0; ch < channels; ch++) { - int ret=rice_decompress(alac, alac->predict_error_buffer[ch], + int ret = rice_decompress(alac, alac->predict_error_buffer[ch], alac->nb_samples, bps, rice_history_mult[ch] * alac->rice_history_mult / 4); - if(ret<0) + if (ret < 0) return ret; /* adaptive FIR filter */ @@ -354,13 +357,14 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index, bps, lpc_coefs[ch], lpc_order[ch], lpc_quant[ch]); } } else { + const int sample_size = alac->sample_size; /* not compressed, easy case */ + if (get_bits_left(gb) < (int64_t)alac->nb_samples * channels * sample_size) + return AVERROR_INVALIDDATA; for (i = 0; i < alac->nb_samples; i++) { - if(get_bits_left(&alac->gb) <= 0) - return AVERROR_INVALIDDATA; for (ch = 0; ch < channels; ch++) { alac->output_samples_buffer[ch][i] = - get_sbits_long(&alac->gb, alac->sample_size); + get_sbits_long(gb, sample_size); } } alac->extra_bits = 0; diff --git a/arm/android/third_party/ffmpeg/libavcodec/allcodecs.c b/arm/android/third_party/ffmpeg/libavcodec/allcodecs.c index 8775d15a..5136a566 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/allcodecs.c +++ b/arm/android/third_party/ffmpeg/libavcodec/allcodecs.c @@ -516,6 +516,7 @@ extern const FFCodec ff_nellymoser_decoder; extern const FFCodec ff_on2avc_decoder; extern const FFCodec ff_opus_encoder; extern const FFCodec ff_opus_decoder; +extern const FFCodec ff_osq_decoder; extern const FFCodec ff_paf_audio_decoder; extern const FFCodec ff_qcelp_decoder; extern const FFCodec ff_qdm2_decoder; @@ -844,6 +845,7 @@ extern const FFCodec ff_av1_nvenc_encoder; extern const FFCodec ff_av1_qsv_decoder; extern const FFCodec ff_av1_qsv_encoder; extern const FFCodec ff_av1_amf_encoder; +extern const FFCodec ff_av1_vaapi_encoder; extern const FFCodec ff_libopenh264_encoder; extern const FFCodec ff_libopenh264_decoder; extern const FFCodec ff_h264_amf_encoder; diff --git a/arm/android/third_party/ffmpeg/libavcodec/alpha/idctdsp_alpha.c b/arm/android/third_party/ffmpeg/libavcodec/alpha/idctdsp_alpha.c index bd438425..ff770c15 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/alpha/idctdsp_alpha.c +++ b/arm/android/third_party/ffmpeg/libavcodec/alpha/idctdsp_alpha.c @@ -19,6 +19,7 @@ */ #include "libavutil/attributes.h" +#include "libavcodec/avcodec.h" #include "libavcodec/idctdsp.h" #include "idctdsp_alpha.h" #include "asm.h" diff --git a/arm/android/third_party/ffmpeg/libavcodec/amfenc.c b/arm/android/third_party/ffmpeg/libavcodec/amfenc.c index cb48f8c2..061859f8 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/amfenc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/amfenc.c @@ -430,9 +430,9 @@ static int amf_copy_surface(AVCodecContext *avctx, const AVFrame *frame, dst_data[i] = plane->pVtbl->GetNative(plane); dst_linesize[i] = plane->pVtbl->GetHPitch(plane); } - av_image_copy(dst_data, dst_linesize, - (const uint8_t**)frame->data, frame->linesize, frame->format, - avctx->width, avctx->height); + av_image_copy2(dst_data, dst_linesize, + frame->data, frame->linesize, frame->format, + avctx->width, avctx->height); return 0; } @@ -720,10 +720,10 @@ int ff_amf_receive_packet(AVCodecContext *avctx, AVPacket *avpkt) if (!avpkt->data && !avpkt->buf) { res_query = ctx->encoder->pVtbl->QueryOutput(ctx->encoder, &data); if (data) { - query_output_data_flag = 1; // copy data to packet AMFBuffer *buffer; AMFGuid guid = IID_AMFBuffer(); + query_output_data_flag = 1; data->pVtbl->QueryInterface(data, &guid, (void**)&buffer); // query for buffer interface ret = amf_copy_buffer(avctx, avpkt, buffer); diff --git a/arm/android/third_party/ffmpeg/libavcodec/amfenc_av1.c b/arm/android/third_party/ffmpeg/libavcodec/amfenc_av1.c index 30c0a9fa..8f13aea2 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/amfenc_av1.c +++ b/arm/android/third_party/ffmpeg/libavcodec/amfenc_av1.c @@ -192,7 +192,7 @@ FF_ENABLE_DEPRECATION_WARNINGS AMF_ASSIGN_PROPERTY_RATE(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_FRAMERATE, framerate); switch (avctx->profile) { - case FF_PROFILE_AV1_MAIN: + case AV_PROFILE_AV1_MAIN: profile = AMF_VIDEO_ENCODER_AV1_PROFILE_MAIN; break; default: @@ -204,7 +204,7 @@ FF_ENABLE_DEPRECATION_WARNINGS AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_PROFILE, profile); profile_level = avctx->level; - if (profile_level == FF_LEVEL_UNKNOWN) { + if (profile_level == AV_LEVEL_UNKNOWN) { profile_level = ctx->level; } if (profile_level != 0) { diff --git a/arm/android/third_party/ffmpeg/libavcodec/amfenc_h264.c b/arm/android/third_party/ffmpeg/libavcodec/amfenc_h264.c index 2380aa4e..bd544d12 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/amfenc_h264.c +++ b/arm/android/third_party/ffmpeg/libavcodec/amfenc_h264.c @@ -223,19 +223,19 @@ FF_ENABLE_DEPRECATION_WARNINGS AMF_ASSIGN_PROPERTY_RATE(res, ctx->encoder, AMF_VIDEO_ENCODER_FRAMERATE, framerate); switch (avctx->profile) { - case FF_PROFILE_H264_BASELINE: + case AV_PROFILE_H264_BASELINE: profile = AMF_VIDEO_ENCODER_PROFILE_BASELINE; break; - case FF_PROFILE_H264_MAIN: + case AV_PROFILE_H264_MAIN: profile = AMF_VIDEO_ENCODER_PROFILE_MAIN; break; - case FF_PROFILE_H264_HIGH: + case AV_PROFILE_H264_HIGH: profile = AMF_VIDEO_ENCODER_PROFILE_HIGH; break; - case FF_PROFILE_H264_CONSTRAINED_BASELINE: + case AV_PROFILE_H264_CONSTRAINED_BASELINE: profile = AMF_VIDEO_ENCODER_PROFILE_CONSTRAINED_BASELINE; break; - case (FF_PROFILE_H264_HIGH | FF_PROFILE_H264_CONSTRAINED): + case (AV_PROFILE_H264_HIGH | AV_PROFILE_H264_CONSTRAINED): profile = AMF_VIDEO_ENCODER_PROFILE_CONSTRAINED_HIGH; break; } @@ -246,7 +246,7 @@ FF_ENABLE_DEPRECATION_WARNINGS AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_PROFILE, profile); profile_level = avctx->level; - if (profile_level == FF_LEVEL_UNKNOWN) { + if (profile_level == AV_LEVEL_UNKNOWN) { profile_level = ctx->level; } if (profile_level != 0) { diff --git a/arm/android/third_party/ffmpeg/libavcodec/amfenc_hevc.c b/arm/android/third_party/ffmpeg/libavcodec/amfenc_hevc.c index dd232cc8..352564a3 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/amfenc_hevc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/amfenc_hevc.c @@ -184,7 +184,7 @@ FF_ENABLE_DEPRECATION_WARNINGS AMF_ASSIGN_PROPERTY_RATE(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_FRAMERATE, framerate); switch (avctx->profile) { - case FF_PROFILE_HEVC_MAIN: + case AV_PROFILE_HEVC_MAIN: profile = AMF_VIDEO_ENCODER_HEVC_PROFILE_MAIN; break; default: @@ -198,7 +198,7 @@ FF_ENABLE_DEPRECATION_WARNINGS AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_TIER, ctx->tier); profile_level = avctx->level; - if (profile_level == FF_LEVEL_UNKNOWN) { + if (profile_level == AV_LEVEL_UNKNOWN) { profile_level = ctx->level; } if (profile_level != 0) { diff --git a/arm/android/third_party/ffmpeg/libavcodec/apedec.c b/arm/android/third_party/ffmpeg/libavcodec/apedec.c index 613c76df..8bfbb75b 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/apedec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/apedec.c @@ -145,8 +145,6 @@ typedef struct APEPredictor64 { uint64_t coeffsA[2][4]; ///< adaption coefficients uint64_t coeffsB[2][5]; ///< adaption coefficients int64_t historybuffer[HISTORY_SIZE + PREDICTOR_SIZE]; - - unsigned int sample_pos; } APEPredictor64; /** Decoder context */ @@ -173,6 +171,9 @@ typedef struct APEContext { int32_t *decoded_buffer; int decoded_size; int32_t *decoded[MAX_CHANNELS]; ///< decoded data for each channel + int32_t *interim_buffer; + int interim_size; + int32_t *interim[MAX_CHANNELS]; ///< decoded data for each channel int blocks_per_loop; ///< maximum number of samples to decode for each call int16_t* filterbuf[APE_FILTER_LEVELS]; ///< filter memory @@ -189,6 +190,7 @@ typedef struct APEContext { const uint8_t *ptr; ///< current position in frame data int error; + int interim_mode; void (*entropy_decode_mono)(struct APEContext *ctx, int blockstodecode); void (*entropy_decode_stereo)(struct APEContext *ctx, int blockstodecode); @@ -225,6 +227,7 @@ static av_cold int ape_decode_close(AVCodecContext *avctx) av_freep(&s->filterbuf[i]); av_freep(&s->decoded_buffer); + av_freep(&s->interim_buffer); av_freep(&s->data); s->decoded_size = s->data_size = 0; @@ -250,12 +253,15 @@ static av_cold int ape_decode_init(AVCodecContext *avctx) switch (s->bps) { case 8: avctx->sample_fmt = AV_SAMPLE_FMT_U8P; + s->interim_mode = 0; break; case 16: avctx->sample_fmt = AV_SAMPLE_FMT_S16P; + s->interim_mode = 0; break; case 24: avctx->sample_fmt = AV_SAMPLE_FMT_S32P; + s->interim_mode = -1; break; default: avpriv_request_sample(avctx, @@ -860,8 +866,6 @@ static void init_predictor_decoder(APEContext *ctx) p64->lastA[0] = p64->lastA[1] = 0; p->sample_pos = 0; - - p64->sample_pos = 0; } /** Get inverse sign of integer (-1 for positive, 1 for negative and 0 for zero) */ @@ -1184,7 +1188,8 @@ static void predictor_decode_mono_3930(APEContext *ctx, int count) static av_always_inline int predictor_update_filter(APEPredictor64 *p, const int decoded, const int filter, const int delayA, const int delayB, - const int adaptA, const int adaptB) + const int adaptA, const int adaptB, + int interim_mode) { int64_t predictionA, predictionB; int32_t sign; @@ -1212,7 +1217,13 @@ static av_always_inline int predictor_update_filter(APEPredictor64 *p, p->buf[delayB - 3] * p->coeffsB[filter][3] + p->buf[delayB - 4] * p->coeffsB[filter][4]; - p->lastA[filter] = decoded + ((int64_t)((uint64_t)predictionA + (predictionB >> 1)) >> 10); + if (interim_mode < 1) { + predictionA = (int32_t)predictionA; + predictionB = (int32_t)predictionB; + p->lastA[filter] = (int32_t)(decoded + (unsigned)((int32_t)(predictionA + (predictionB >> 1)) >> 10)); + } else { + p->lastA[filter] = decoded + ((int64_t)((uint64_t)predictionA + (predictionB >> 1)) >> 10); + } p->filterA[filter] = p->lastA[filter] + ((int64_t)(p->filterA[filter] * 31ULL) >> 5); sign = APESIGN(decoded); @@ -1231,30 +1242,73 @@ static av_always_inline int predictor_update_filter(APEPredictor64 *p, static void predictor_decode_stereo_3950(APEContext *ctx, int count) { - APEPredictor64 *p = &ctx->predictor64; - int32_t *decoded0 = ctx->decoded[0]; - int32_t *decoded1 = ctx->decoded[1]; + APEPredictor64 *p_default = &ctx->predictor64; + APEPredictor64 p_interim; + int lcount = count; + int num_passes = 1; ape_apply_filters(ctx, ctx->decoded[0], ctx->decoded[1], count); + if (ctx->interim_mode == -1) { + p_interim = *p_default; + num_passes ++; + memcpy(ctx->interim[0], ctx->decoded[0], sizeof(*ctx->interim[0])*count); + memcpy(ctx->interim[1], ctx->decoded[1], sizeof(*ctx->interim[1])*count); + } - while (count--) { - /* Predictor Y */ - *decoded0 = predictor_update_filter(p, *decoded0, 0, YDELAYA, YDELAYB, - YADAPTCOEFFSA, YADAPTCOEFFSB); - decoded0++; - *decoded1 = predictor_update_filter(p, *decoded1, 1, XDELAYA, XDELAYB, - XADAPTCOEFFSA, XADAPTCOEFFSB); - decoded1++; + for (int pass = 0; pass < num_passes; pass++) { + int32_t *decoded0, *decoded1; + int interim_mode = ctx->interim_mode > 0 || pass; + APEPredictor64 *p; - /* Combined */ - p->buf++; - - /* Have we filled the history buffer? */ - if (p->buf == p->historybuffer + HISTORY_SIZE) { - memmove(p->historybuffer, p->buf, - PREDICTOR_SIZE * sizeof(*p->historybuffer)); - p->buf = p->historybuffer; + if (pass) { + p = &p_interim; + decoded0 = ctx->interim[0]; + decoded1 = ctx->interim[1]; + } else { + p = p_default; + decoded0 = ctx->decoded[0]; + decoded1 = ctx->decoded[1]; } + p->buf = p->historybuffer; + + count = lcount; + while (count--) { + /* Predictor Y */ + int32_t a0 = predictor_update_filter(p, *decoded0, 0, YDELAYA, YDELAYB, + YADAPTCOEFFSA, YADAPTCOEFFSB, + interim_mode); + int32_t a1 = predictor_update_filter(p, *decoded1, 1, XDELAYA, XDELAYB, + XADAPTCOEFFSA, XADAPTCOEFFSB, + interim_mode); + *decoded0++ = a0; + *decoded1++ = a1; + if (num_passes > 1) { + int32_t left = a1 - (unsigned)(a0 / 2); + int32_t right = left + a0; + + if (FFMAX(FFABS(left), FFABS(right)) > (1<<23)) { + ctx->interim_mode = !interim_mode; + av_log(ctx->avctx, AV_LOG_VERBOSE, "Interim mode: %d\n", ctx->interim_mode); + break; + } + } + + /* Combined */ + p->buf++; + + /* Have we filled the history buffer? */ + if (p->buf == p->historybuffer + HISTORY_SIZE) { + memmove(p->historybuffer, p->buf, + PREDICTOR_SIZE * sizeof(*p->historybuffer)); + p->buf = p->historybuffer; + } + } + } + if (num_passes > 1 && ctx->interim_mode > 0) { + memcpy(ctx->decoded[0], ctx->interim[0], sizeof(*ctx->interim[0])*lcount); + memcpy(ctx->decoded[1], ctx->interim[1], sizeof(*ctx->interim[1])*lcount); + *p_default = p_interim; + p_default->buf = p_default->historybuffer; } } @@ -1585,6 +1639,19 @@ static int ape_decode_frame(AVCodecContext *avctx, AVFrame *frame, s->decoded[0] = s->decoded_buffer; s->decoded[1] = s->decoded_buffer + FFALIGN(blockstodecode, 8); + if (s->interim_mode < 0) { + av_fast_malloc(&s->interim_buffer, &s->interim_size, decoded_buffer_size); + if (!s->interim_buffer) + return AVERROR(ENOMEM); + memset(s->interim_buffer, 0, decoded_buffer_size); + s->interim[0] = s->interim_buffer; + s->interim[1] = s->interim_buffer + FFALIGN(blockstodecode, 8); + } else { + av_freep(&s->interim_buffer); + s->interim_size = 0; + memset(s->interim, 0, sizeof(s->interim)); + } + s->error=0; if ((s->channels == 1) || (s->frameflags & APE_FRAMECODE_PSEUDO_STEREO)) @@ -1625,13 +1692,24 @@ static int ape_decode_frame(AVCodecContext *avctx, AVFrame *frame, s->samples -= blockstodecode; if (avctx->err_recognition & AV_EF_CRCCHECK && - s->fileversion >= 3900 && s->bps < 24) { + s->fileversion >= 3900) { uint32_t crc = s->CRC_state; const AVCRC *crc_tab = av_crc_get_table(AV_CRC_32_IEEE_LE); + int stride = s->bps == 24 ? 4 : (s->bps>>3); + int offset = s->bps == 24; + int bytes = s->bps >> 3; + for (i = 0; i < blockstodecode; i++) { for (ch = 0; ch < s->channels; ch++) { - uint8_t *smp = frame->data[ch] + (i*(s->bps >> 3)); - crc = av_crc(crc_tab, crc, smp, s->bps >> 3); +#if HAVE_BIGENDIAN + uint8_t *smp_native = frame->data[ch] + i*stride; + uint8_t smp[4]; + for(int j = 0; jdata[ch] + i*stride; +#endif + crc = av_crc(crc_tab, crc, smp+offset, bytes); } } diff --git a/arm/android/third_party/ffmpeg/libavcodec/arbc.c b/arm/android/third_party/ffmpeg/libavcodec/arbc.c index 1b349f4d..46b0275e 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/arbc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/arbc.c @@ -166,8 +166,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, prev_pixels -= fill_tile4(avctx, fill, frame); } - av_frame_unref(s->prev_frame); - if ((ret = av_frame_ref(s->prev_frame, frame)) < 0) + if ((ret = av_frame_replace(s->prev_frame, frame)) < 0) return ret; frame->pict_type = prev_pixels <= 0 ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P; diff --git a/arm/android/third_party/ffmpeg/libavcodec/arm/Makefile b/arm/android/third_party/ffmpeg/libavcodec/arm/Makefile index 5d284bdc..becf316e 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/arm/Makefile +++ b/arm/android/third_party/ffmpeg/libavcodec/arm/Makefile @@ -5,7 +5,6 @@ OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_init_arm.o \ arm/ac3dsp_arm.o OBJS-$(CONFIG_AUDIODSP) += arm/audiodsp_init_arm.o OBJS-$(CONFIG_BLOCKDSP) += arm/blockdsp_init_arm.o -OBJS-$(CONFIG_FFT) += arm/fft_init_arm.o OBJS-$(CONFIG_FMTCONVERT) += arm/fmtconvert_init_arm.o OBJS-$(CONFIG_G722DSP) += arm/g722dsp_init_arm.o OBJS-$(CONFIG_H264CHROMA) += arm/h264chroma_init_arm.o @@ -25,7 +24,6 @@ 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_RDFT) += arm/rdft_init_arm.o OBJS-$(CONFIG_RV34DSP) += arm/rv34dsp_init_arm.o OBJS-$(CONFIG_VC1DSP) += arm/vc1dsp_init_arm.o OBJS-$(CONFIG_VIDEODSP) += arm/videodsp_init_arm.o @@ -90,9 +88,7 @@ ARMV6-OBJS-$(CONFIG_TRUEHD_DECODER) += arm/mlpdsp_armv6.o # VFP optimizations # subsystems -VFP-OBJS-$(CONFIG_FFT) += arm/fft_vfp.o VFP-OBJS-$(CONFIG_FMTCONVERT) += arm/fmtconvert_vfp.o -VFP-OBJS-$(CONFIG_MDCT) += arm/mdct_vfp.o # decoders/encoders VFP-OBJS-$(CONFIG_DCA_DECODER) += arm/synth_filter_vfp.o @@ -107,7 +103,6 @@ NEON-OBJS-$(CONFIG_AUDIODSP) += arm/audiodsp_init_neon.o \ arm/int_neon.o NEON-OBJS-$(CONFIG_BLOCKDSP) += arm/blockdsp_init_neon.o \ arm/blockdsp_neon.o -NEON-OBJS-$(CONFIG_FFT) += arm/fft_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 @@ -121,10 +116,8 @@ NEON-OBJS-$(CONFIG_HPELDSP) += arm/hpeldsp_init_neon.o \ NEON-OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_neon.o \ arm/idctdsp_neon.o \ arm/simple_idct_neon.o -NEON-OBJS-$(CONFIG_MDCT) += arm/mdct_neon.o NEON-OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_neon.o NEON-OBJS-$(CONFIG_PIXBLOCKDSP) += arm/pixblockdsp_neon.o -NEON-OBJS-$(CONFIG_RDFT) += arm/rdft_neon.o NEON-OBJS-$(CONFIG_VC1DSP) += arm/vc1dsp_init_neon.o \ arm/vc1dsp_neon.o NEON-OBJS-$(CONFIG_VP3DSP) += arm/vp3dsp_neon.o diff --git a/arm/android/third_party/ffmpeg/libavcodec/arm/synth_filter_init_arm.c b/arm/android/third_party/ffmpeg/libavcodec/arm/synth_filter_init_arm.c index 858c117d..10689b62 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/arm/synth_filter_init_arm.c +++ b/arm/android/third_party/ffmpeg/libavcodec/arm/synth_filter_init_arm.c @@ -23,7 +23,6 @@ #include "libavutil/arm/cpu.h" #include "libavutil/attributes.h" #include "libavutil/internal.h" -#include "libavcodec/fft.h" #include "libavcodec/synth_filter.h" void ff_synth_filter_float_vfp(AVTXContext *imdct, diff --git a/arm/android/third_party/ffmpeg/libavcodec/asvdec.c b/arm/android/third_party/ffmpeg/libavcodec/asvdec.c index 62295b2d..7ad4faeb 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/asvdec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/asvdec.c @@ -67,19 +67,19 @@ typedef struct ASVDecContext { static av_cold void init_vlcs(void) { - INIT_VLC_STATIC(&ccp_vlc, CCP_VLC_BITS, 17, + VLC_INIT_STATIC(&ccp_vlc, CCP_VLC_BITS, 17, &ff_asv_ccp_tab[0][1], 2, 1, &ff_asv_ccp_tab[0][0], 2, 1, 32); - INIT_LE_VLC_STATIC(&dc_ccp_vlc, DC_CCP_VLC_BITS, 8, + VLC_INIT_LE_STATIC(&dc_ccp_vlc, DC_CCP_VLC_BITS, 8, &ff_asv_dc_ccp_tab[0][1], 2, 1, &ff_asv_dc_ccp_tab[0][0], 2, 1, 16); - INIT_LE_VLC_STATIC(&ac_ccp_vlc, AC_CCP_VLC_BITS, 16, + VLC_INIT_LE_STATIC(&ac_ccp_vlc, AC_CCP_VLC_BITS, 16, &ff_asv_ac_ccp_tab[0][1], 2, 1, &ff_asv_ac_ccp_tab[0][0], 2, 1, 64); - INIT_VLC_STATIC(&level_vlc, ASV1_LEVEL_VLC_BITS, 7, + VLC_INIT_STATIC(&level_vlc, ASV1_LEVEL_VLC_BITS, 7, &ff_asv_level_tab[0][1], 2, 1, &ff_asv_level_tab[0][0], 2, 1, 16); - INIT_LE_VLC_STATIC(&asv2_level_vlc, ASV2_LEVEL_VLC_BITS, 63, + VLC_INIT_LE_STATIC(&asv2_level_vlc, ASV2_LEVEL_VLC_BITS, 63, &ff_asv2_level_tab[0][1], 4, 2, &ff_asv2_level_tab[0][0], 4, 2, 1024); } diff --git a/arm/android/third_party/ffmpeg/libavcodec/asvenc.c b/arm/android/third_party/ffmpeg/libavcodec/asvenc.c index 4a14bcf8..50da4673 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/asvenc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/asvenc.c @@ -33,7 +33,6 @@ #include "asv.h" #include "avcodec.h" #include "codec_internal.h" -#include "dct.h" #include "encode.h" #include "fdctdsp.h" #include "mpeg12data.h" diff --git a/arm/android/third_party/ffmpeg/libavcodec/atrac3.c b/arm/android/third_party/ffmpeg/libavcodec/atrac3.c index 5851ee02..fad2299a 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/atrac3.c +++ b/arm/android/third_party/ffmpeg/libavcodec/atrac3.c @@ -863,10 +863,10 @@ static av_cold void atrac3_init_static_data(void) for (i = 0; i < 7; i++) { spectral_coeff_tab[i].table = table; spectral_coeff_tab[i].table_allocated = 256; - ff_init_vlc_from_lengths(&spectral_coeff_tab[i], ATRAC3_VLC_BITS, huff_tab_sizes[i], + ff_vlc_init_from_lengths(&spectral_coeff_tab[i], ATRAC3_VLC_BITS, huff_tab_sizes[i], &hufftabs[0][1], 2, &hufftabs[0][0], 2, 1, - -31, INIT_VLC_USE_NEW_STATIC, NULL); + -31, VLC_INIT_USE_STATIC, NULL); hufftabs += huff_tab_sizes[i]; table += 256; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/atrac3plus.c b/arm/android/third_party/ffmpeg/libavcodec/atrac3plus.c index 5661654c..61753af7 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/atrac3plus.c +++ b/arm/android/third_party/ffmpeg/libavcodec/atrac3plus.c @@ -66,8 +66,8 @@ static av_cold void build_canonical_huff(const uint8_t *cb, const uint8_t **xlat out_vlc->table = &tables_data[*tab_offset]; out_vlc->table_allocated = 1 << max_len; - ff_init_vlc_from_lengths(out_vlc, max_len, index, bits, 1, - *xlat, 1, 1, 0, INIT_VLC_USE_NEW_STATIC, NULL); + ff_vlc_init_from_lengths(out_vlc, max_len, index, bits, 1, + *xlat, 1, 1, 0, VLC_INIT_USE_STATIC, NULL); *tab_offset += 1 << max_len; *xlat += index; diff --git a/arm/android/third_party/ffmpeg/libavcodec/atrac9dec.c b/arm/android/third_party/ffmpeg/libavcodec/atrac9dec.c index 8a694045..d24a8e3f 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/atrac9dec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/atrac9dec.c @@ -849,9 +849,9 @@ static av_cold void atrac9_init_vlc(VLC *vlc, int nb_bits, int nb_codes, vlc->table = &vlc_buf[*buf_offset]; vlc->table_allocated = FF_ARRAY_ELEMS(vlc_buf) - *buf_offset; - ff_init_vlc_from_lengths(vlc, nb_bits, nb_codes, + ff_vlc_init_from_lengths(vlc, nb_bits, nb_codes, &(*tab)[0][1], 2, &(*tab)[0][0], 2, 1, - offset, INIT_VLC_STATIC_OVERLONG, NULL); + offset, VLC_INIT_STATIC_OVERLONG, NULL); *buf_offset += vlc->table_size; *tab += nb_codes; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/audiotoolboxenc.c b/arm/android/third_party/ffmpeg/libavcodec/audiotoolboxenc.c index 46aca4c7..42ab7ae6 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/audiotoolboxenc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/audiotoolboxenc.c @@ -60,17 +60,17 @@ static UInt32 ffat_get_format_id(enum AVCodecID codec, int profile) switch (codec) { case AV_CODEC_ID_AAC: switch (profile) { - case FF_PROFILE_AAC_LOW: + case AV_PROFILE_AAC_LOW: default: return kAudioFormatMPEG4AAC; - case FF_PROFILE_AAC_HE: + case AV_PROFILE_AAC_HE: return kAudioFormatMPEG4AAC_HE; - case FF_PROFILE_AAC_HE_V2: + case AV_PROFILE_AAC_HE_V2: return kAudioFormatMPEG4AAC_HE_V2; - case FF_PROFILE_AAC_LD: + case AV_PROFILE_AAC_LD: return kAudioFormatMPEG4AAC_LD; #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 - case FF_PROFILE_AAC_ELD: + case AV_PROFILE_AAC_ELD: return kAudioFormatMPEG4AAC_ELD; #endif } @@ -483,8 +483,7 @@ static OSStatus ffat_encode_callback(AudioConverterRef converter, UInt32 *nb_pac if (*nb_packets > frame->nb_samples) *nb_packets = frame->nb_samples; - av_frame_unref(at->encoding_frame); - ret = av_frame_ref(at->encoding_frame, frame); + ret = av_frame_replace(at->encoding_frame, frame); if (ret < 0) { *nb_packets = 0; return ret; @@ -586,12 +585,12 @@ static av_cold int ffat_close_encoder(AVCodecContext *avctx) } static const AVProfile aac_profiles[] = { - { FF_PROFILE_AAC_LOW, "LC" }, - { 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 }, + { AV_PROFILE_AAC_LOW, "LC" }, + { AV_PROFILE_AAC_HE, "HE-AAC" }, + { AV_PROFILE_AAC_HE_V2, "HE-AACv2" }, + { AV_PROFILE_AAC_LD, "LD" }, + { AV_PROFILE_AAC_ELD, "ELD" }, + { AV_PROFILE_UNKNOWN }, }; #define AE AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM diff --git a/arm/android/third_party/ffmpeg/libavcodec/av1.h b/arm/android/third_party/ffmpeg/libavcodec/av1.h index 384f7cdd..8704bc41 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/av1.h +++ b/arm/android/third_party/ffmpeg/libavcodec/av1.h @@ -175,6 +175,13 @@ enum { AV1_RESTORE_SWITCHABLE = 3, }; +// TX mode (section 6.8.21) +enum { + AV1_ONLY_4X4 = 0, + AV1_TX_MODE_LARGEST = 1, + AV1_TX_MODE_SELECT = 2, +}; + // Sequence Headers are actually unbounded because one can use // an arbitrary number of leading zeroes when encoding via uvlc. // The following estimate is based around using the lowest number diff --git a/arm/android/third_party/ffmpeg/libavcodec/av1_levels.c b/arm/android/third_party/ffmpeg/libavcodec/av1_levels.c new file mode 100644 index 00000000..19b6ee17 --- /dev/null +++ b/arm/android/third_party/ffmpeg/libavcodec/av1_levels.c @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2023 Intel Corporation + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include "libavutil/macros.h" +#include "av1_levels.h" + +/** ignore entries which named in spec but no details. Like level 2.2 and 7.0. */ +static const AV1LevelDescriptor av1_levels[] = { + // Name MaxVSize MainMbps MaxTiles + // | level_idx | MaxDisplayRate | HighMbps | MaxTileCols + // | | MaxPicSize | | MaxDecodeRate | | MainCR | | + // | | | MaxHSize | | | MaxHeaderRate | | | HighCR| | + // | | | | | | | | | | | | | | + { "2.0", 0, 147456, 2048, 1152, 4423680, 5529600, 150, 1.5, 0, 2, 0, 8, 4 }, + { "2.1", 1, 278784, 2816, 1584, 8363520, 10454400, 150, 3.0, 0, 2, 0, 8, 4 }, + { "3.0", 4, 665856, 4352, 2448, 19975680, 24969600, 150, 6.0, 0, 2, 0, 16, 6 }, + { "3.1", 5, 1065024, 5504, 3096, 31950720, 39938400, 150, 10.0, 0, 2, 0, 16, 6 }, + { "4.0", 8, 2359296, 6144, 3456, 70778880, 77856768, 300, 12.0, 30.0, 4, 4, 32, 8 }, + { "4.1", 9, 2359296, 6144, 3456, 141557760, 155713536, 300, 20.0, 50.0, 4, 4, 32, 8 }, + { "5.0", 12, 8912896, 8192, 4352, 267386880, 273715200, 300, 30.0, 100.0, 6, 4, 64, 8 }, + { "5.1", 13, 8912896, 8192, 4352, 534773760, 547430400, 300, 40.0, 160.0, 8, 4, 64, 8 }, + { "5.2", 14, 8912896, 8192, 4352, 1069547520, 1094860800, 300, 60.0, 240.0, 8, 4, 64, 8 }, + { "5.3", 15, 8912896, 8192, 4352, 1069547520, 1176502272, 300, 60.0, 240.0, 8, 4, 64, 8 }, + { "6.0", 16, 35651584, 16384, 8704, 1069547520, 1176502272, 300, 60.0, 240.0, 8, 4, 128, 16 }, + { "6.1", 17, 35651584, 16384, 8704, 2139095040, 2189721600, 300, 100.0, 480.0, 8, 4, 128, 16 }, + { "6.2", 18, 35651584, 16384, 8704, 4278190080, 4379443200, 300, 160.0, 800.0, 8, 4, 128, 16 }, + { "6.3", 19, 35651584, 16384, 8704, 4278190080, 4706009088, 300, 160.0, 800.0, 8, 4, 128, 16 }, +}; + +const AV1LevelDescriptor *ff_av1_guess_level(int64_t bitrate, + int tier, + int width, + int height, + int tiles, + int tile_cols, + float fps) +{ + int pic_size; + uint64_t display_rate; + float max_br; + + pic_size = width * height; + display_rate = (uint64_t)pic_size * fps; + + for (int i = 0; i < FF_ARRAY_ELEMS(av1_levels); i++) { + const AV1LevelDescriptor *level = &av1_levels[i]; + // Limitation: decode rate, header rate, compress rate, etc. are not considered. + if (pic_size > level->max_pic_size) + continue; + if (width > level->max_h_size) + continue; + if (height > level->max_v_size) + continue; + if (display_rate > level->max_display_rate) + continue; + + if (tier) + max_br = level->high_mbps; + else + max_br = level->main_mbps; + if (!max_br) + continue; + if (bitrate > (int64_t)(1000000.0 * max_br)) + continue; + + if (tiles > level->max_tiles) + continue; + if (tile_cols > level->max_tile_cols) + continue; + return level; + } + + return NULL; +} diff --git a/arm/android/third_party/ffmpeg/libavcodec/av1_levels.h b/arm/android/third_party/ffmpeg/libavcodec/av1_levels.h new file mode 100644 index 00000000..164cb876 --- /dev/null +++ b/arm/android/third_party/ffmpeg/libavcodec/av1_levels.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2023 Intel Corporation + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_AV1_LEVELS_H +#define AVCODEC_AV1_LEVELS_H + +#include + +typedef struct AV1LevelDescriptor { + char name[4]; + uint8_t level_idx; + + uint32_t max_pic_size; + uint32_t max_h_size; + uint32_t max_v_size; + uint64_t max_display_rate; + uint64_t max_decode_rate; + + uint32_t max_header_rate; + float main_mbps; + float high_mbps; + uint32_t main_cr; + uint32_t high_cr; + uint32_t max_tiles; + uint32_t max_tile_cols; +} AV1LevelDescriptor; + +/** + * Guess the level of a stream from some parameters. + * + * Unknown parameters may be zero, in which case they will be ignored. + */ +const AV1LevelDescriptor *ff_av1_guess_level(int64_t bitrate, + int tier, + int width, + int height, + int tile_rows, + int tile_cols, + float fps); + +#endif /* AVCODEC_AV1_LEVELS_H */ diff --git a/arm/android/third_party/ffmpeg/libavcodec/av1dec.c b/arm/android/third_party/ffmpeg/libavcodec/av1dec.c index cc178464..39ccad5b 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/av1dec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/av1dec.c @@ -33,6 +33,7 @@ #include "bytestream.h" #include "codec_internal.h" #include "decode.h" +#include "hwaccel_internal.h" #include "internal.h" #include "hwconfig.h" #include "profiles.h" @@ -439,29 +440,20 @@ static int get_tiles_info(AVCodecContext *avctx, const AV1RawTileGroup *tile_gro } -static int get_pixel_format(AVCodecContext *avctx) +static enum AVPixelFormat get_sw_pixel_format(void *logctx, + const AV1RawSequenceHeader *seq) { - AV1DecContext *s = avctx->priv_data; - const AV1RawSequenceHeader *seq = s->raw_seq; uint8_t bit_depth; - int ret; enum AVPixelFormat pix_fmt = AV_PIX_FMT_NONE; -#define HWACCEL_MAX (CONFIG_AV1_DXVA2_HWACCEL + \ - CONFIG_AV1_D3D11VA_HWACCEL * 2 + \ - CONFIG_AV1_NVDEC_HWACCEL + \ - CONFIG_AV1_VAAPI_HWACCEL + \ - CONFIG_AV1_VDPAU_HWACCEL + \ - CONFIG_AV1_VULKAN_HWACCEL) - enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmtp = pix_fmts; if (seq->seq_profile == 2 && seq->color_config.high_bitdepth) bit_depth = seq->color_config.twelve_bit ? 12 : 10; else if (seq->seq_profile <= 2) bit_depth = seq->color_config.high_bitdepth ? 10 : 8; else { - av_log(avctx, AV_LOG_ERROR, + av_log(logctx, AV_LOG_ERROR, "Unknown AV1 profile %d.\n", seq->seq_profile); - return -1; + return AV_PIX_FMT_NONE; } if (!seq->color_config.mono_chrome) { @@ -475,7 +467,7 @@ static int get_pixel_format(AVCodecContext *avctx) else if (bit_depth == 12) pix_fmt = AV_PIX_FMT_YUV444P12; else - av_log(avctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n"); + av_log(logctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n"); } else if (seq->color_config.subsampling_x == 1 && seq->color_config.subsampling_y == 0) { if (bit_depth == 8) @@ -485,7 +477,7 @@ static int get_pixel_format(AVCodecContext *avctx) else if (bit_depth == 12) pix_fmt = AV_PIX_FMT_YUV422P12; else - av_log(avctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n"); + av_log(logctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n"); } else if (seq->color_config.subsampling_x == 1 && seq->color_config.subsampling_y == 1) { if (bit_depth == 8) @@ -495,7 +487,7 @@ static int get_pixel_format(AVCodecContext *avctx) else if (bit_depth == 12) pix_fmt = AV_PIX_FMT_YUV420P12; else - av_log(avctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n"); + av_log(logctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n"); } } else { if (bit_depth == 8) @@ -505,11 +497,25 @@ static int get_pixel_format(AVCodecContext *avctx) else if (bit_depth == 12) pix_fmt = AV_PIX_FMT_GRAY12; else - av_log(avctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n"); + av_log(logctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n"); } - av_log(avctx, AV_LOG_DEBUG, "AV1 decode get format: %s.\n", - av_get_pix_fmt_name(pix_fmt)); + return pix_fmt; +} + +static int get_pixel_format(AVCodecContext *avctx) +{ + AV1DecContext *s = avctx->priv_data; + const AV1RawSequenceHeader *seq = s->raw_seq; + int ret; + enum AVPixelFormat pix_fmt = get_sw_pixel_format(avctx, seq); +#define HWACCEL_MAX (CONFIG_AV1_DXVA2_HWACCEL + \ + CONFIG_AV1_D3D11VA_HWACCEL * 2 + \ + CONFIG_AV1_NVDEC_HWACCEL + \ + CONFIG_AV1_VAAPI_HWACCEL + \ + CONFIG_AV1_VDPAU_HWACCEL + \ + CONFIG_AV1_VULKAN_HWACCEL) + enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmtp = pix_fmts; if (pix_fmt == AV_PIX_FMT_NONE) return -1; @@ -607,9 +613,7 @@ static int get_pixel_format(AVCodecContext *avctx) *fmtp++ = pix_fmt; *fmtp = AV_PIX_FMT_NONE; - ret = ff_thread_get_format(avctx, pix_fmts); - if (ret < 0) - return ret; + ret = ff_get_format(avctx, pix_fmts); /** * check if the HW accel is inited correctly. If not, return un-implemented. @@ -619,12 +623,16 @@ static int get_pixel_format(AVCodecContext *avctx) if (!avctx->hwaccel) { av_log(avctx, AV_LOG_ERROR, "Your platform doesn't support" " hardware accelerated AV1 decoding.\n"); + avctx->pix_fmt = AV_PIX_FMT_NONE; return AVERROR(ENOSYS); } s->pix_fmt = pix_fmt; avctx->pix_fmt = ret; + av_log(avctx, AV_LOG_DEBUG, "AV1 decode get format: %s.\n", + av_get_pix_fmt_name(avctx->pix_fmt)); + return 0; } @@ -754,7 +762,6 @@ static int set_context_with_sequence(AVCodecContext *avctx, if (ret < 0) return ret; } - avctx->sample_aspect_ratio = (AVRational) { 1, 1 }; if (seq->timing_info_present_flag) avctx->framerate = ff_av1_framerate(1LL + seq->timing_info.num_ticks_per_picture_minus_1, @@ -865,6 +872,8 @@ static av_cold int av1_decode_init(AVCodecContext *avctx) goto end; } + avctx->pix_fmt = get_sw_pixel_format(avctx, seq); + end: ff_cbs_fragment_reset(&s->current_obu); } @@ -907,17 +916,11 @@ static int av1_frame_alloc(AVCodecContext *avctx, AV1Frame *f) break; } - if (avctx->hwaccel) { - const AVHWAccel *hwaccel = avctx->hwaccel; - if (hwaccel->frame_priv_data_size) { - f->hwaccel_priv_buf = ff_hwaccel_frame_priv_alloc(avctx, hwaccel); - if (!f->hwaccel_priv_buf) { - ret = AVERROR(ENOMEM); - goto fail; - } - f->hwaccel_picture_private = f->hwaccel_priv_buf->data; - } - } + ret = ff_hwaccel_frame_priv_alloc(avctx, &f->hwaccel_picture_private, + &f->hwaccel_priv_buf); + if (ret < 0) + goto fail; + return 0; fail: @@ -1239,9 +1242,9 @@ static int av1_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame) } } - if (avctx->hwaccel && avctx->hwaccel->decode_params) { - ret = avctx->hwaccel->decode_params(avctx, unit->type, unit->data, - unit->data_size); + if (FF_HW_HAS_CB(avctx, decode_params)) { + ret = FF_HW_CALL(avctx, decode_params, unit->type, + unit->data, unit->data_size); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "HW accel decode params fail.\n"); s->raw_seq = NULL; @@ -1311,8 +1314,7 @@ static int av1_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame) s->cur_frame.temporal_id = header->temporal_id; if (avctx->hwaccel && s->cur_frame.f->buf[0]) { - ret = avctx->hwaccel->start_frame(avctx, unit->data, - unit->data_size); + ret = FF_HW_CALL(avctx, start_frame, unit->data, unit->data_size); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "HW accel start frame fail.\n"); goto end; @@ -1338,9 +1340,8 @@ static int av1_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame) goto end; if (avctx->hwaccel && s->cur_frame.f->buf[0]) { - ret = avctx->hwaccel->decode_slice(avctx, - raw_tile_group->tile_data.data, - raw_tile_group->tile_data.data_size); + ret = FF_HW_CALL(avctx, decode_slice, raw_tile_group->tile_data.data, + raw_tile_group->tile_data.data_size); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "HW accel decode slice fail.\n"); @@ -1402,7 +1403,7 @@ static int av1_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame) if (raw_tile_group && (s->tile_num == raw_tile_group->tg_end + 1)) { int show_frame = s->raw_frame_header->show_frame; if (avctx->hwaccel && s->cur_frame.f->buf[0]) { - ret = avctx->hwaccel->end_frame(avctx); + ret = FF_HW_SIMPLE_CALL(avctx, end_frame); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "HW accel end frame fail.\n"); goto end; @@ -1498,8 +1499,8 @@ static void av1_decode_flush(AVCodecContext *avctx) ff_cbs_fragment_reset(&s->current_obu); ff_cbs_flush(s->cbc); - if (avctx->hwaccel && avctx->hwaccel->flush) - avctx->hwaccel->flush(avctx); + if (FF_HW_HAS_CB(avctx, flush)) + FF_HW_SIMPLE_CALL(avctx, flush); } #define OFFSET(x) offsetof(AV1DecContext, x) @@ -1526,7 +1527,7 @@ const FFCodec ff_av1_decoder = { .init = av1_decode_init, .close = av1_decode_free, FF_CODEC_RECEIVE_FRAME_CB(av1_receive_frame), - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_AVOID_PROBING, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .flush = av1_decode_flush, .p.profiles = NULL_IF_CONFIG_SMALL(ff_av1_profiles), diff --git a/arm/android/third_party/ffmpeg/libavcodec/avcodec.c b/arm/android/third_party/ffmpeg/libavcodec/avcodec.c index 340abe83..f2dc7b0e 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/avcodec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/avcodec.c @@ -28,6 +28,7 @@ #include "libavutil/avstring.h" #include "libavutil/bprint.h" #include "libavutil/channel_layout.h" +#include "libavutil/emms.h" #include "libavutil/fifo.h" #include "libavutil/imgutils.h" #include "libavutil/mem.h" @@ -36,6 +37,7 @@ #include "avcodec.h" #include "avcodec_internal.h" #include "bsf.h" +#include "codec_desc.h" #include "codec_internal.h" #include "decode.h" #include "encode.h" @@ -44,6 +46,13 @@ #include "internal.h" #include "thread.h" +/** + * Maximum size in bytes of extradata. + * 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) - AV_INPUT_BUFFER_PADDING_SIZE) + int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2), void *arg, int *ret, int count, int size) { size_t i; diff --git a/arm/android/third_party/ffmpeg/libavcodec/avcodec.h b/arm/android/third_party/ffmpeg/libavcodec/avcodec.h index 5d910a69..1b42edbf 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/avcodec.h +++ b/arm/android/third_party/ffmpeg/libavcodec/avcodec.h @@ -31,6 +31,7 @@ #include "libavutil/attributes.h" #include "libavutil/avutil.h" #include "libavutil/buffer.h" +#include "libavutil/channel_layout.h" #include "libavutil/dict.h" #include "libavutil/frame.h" #include "libavutil/log.h" @@ -38,8 +39,6 @@ #include "libavutil/rational.h" #include "codec.h" -#include "codec_desc.h" -#include "codec_par.h" #include "codec_id.h" #include "defs.h" #include "packet.h" @@ -49,8 +48,13 @@ * to avoid unnecessary rebuilds. When included externally, keep including * the full version information. */ #include "version.h" + +#include "codec_desc.h" +#include "codec_par.h" #endif +struct AVCodecParameters; + /** * @defgroup libavc libavcodec * Encoding/Decoding Library @@ -421,8 +425,6 @@ typedef struct RcOverride{ */ #define AV_GET_ENCODE_BUFFER_FLAG_REF (1 << 0) -struct AVCodecInternal; - /** * main external API structure. * New fields can be added to the end with minor version bumps. @@ -1262,7 +1264,7 @@ typedef struct AVCodecContext { /** * decoder bitstream buffer size * - encoding: Set by user. - * - decoding: unused + * - decoding: May be set by libavcodec. */ int rc_buffer_size; @@ -1591,8 +1593,12 @@ typedef struct AVCodecContext { * profile * - encoding: Set by user. * - decoding: Set by libavcodec. + * See the AV_PROFILE_* defines in defs.h. */ int profile; +#if FF_API_FF_PROFILE_LEVEL + /** @deprecated The following defines are deprecated; use AV_PROFILE_* + * in defs.h instead. */ #define FF_PROFILE_UNKNOWN -99 #define FF_PROFILE_RESERVED -100 @@ -1723,14 +1729,20 @@ typedef struct AVCodecContext { #define FF_PROFILE_EVC_BASELINE 0 #define FF_PROFILE_EVC_MAIN 1 +#endif /** * level * - encoding: Set by user. * - decoding: Set by libavcodec. + * See AV_LEVEL_* in defs.h. */ int level; +#if FF_API_FF_PROFILE_LEVEL + /** @deprecated The following define is deprecated; use AV_LEVEL_UNKOWN + * in defs.h instead. */ #define FF_LEVEL_UNKNOWN -99 +#endif /** * Skip loop filtering for selected frames. @@ -1798,9 +1810,9 @@ typedef struct AVCodecContext { enum AVPixelFormat sw_pix_fmt; /** - * Timebase in which pkt_dts/pts and AVPacket.dts/pts are. - * - encoding unused. - * - decoding set by user. + * Timebase in which pkt_dts/pts and AVPacket.dts/pts are expressed. + * - encoding: unused. + * - decoding: set by user. */ AVRational pkt_timebase; @@ -1809,7 +1821,7 @@ typedef struct AVCodecContext { * - encoding: unused. * - decoding: set by libavcodec. */ - const AVCodecDescriptor *codec_descriptor; + const struct AVCodecDescriptor *codec_descriptor; /** * Current statistics for PTS correction. @@ -2148,139 +2160,6 @@ typedef struct AVHWAccel { * see AV_HWACCEL_CODEC_CAP_* */ int capabilities; - - /***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - */ - - /** - * Allocate a custom buffer - */ - int (*alloc_frame)(AVCodecContext *avctx, AVFrame *frame); - - /** - * Called at the beginning of each frame or field picture. - * - * Meaningful frame information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * Note that buf can be NULL along with buf_size set to 0. - * Otherwise, this means the whole frame is available at this point. - * - * @param avctx the codec context - * @param buf the frame data buffer base - * @param buf_size the size of the frame in bytes - * @return zero if successful, a negative value otherwise - */ - int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size); - - /** - * Callback for parameter data (SPS/PPS/VPS etc). - * - * Useful for hardware decoders which keep persistent state about the - * video parameters, and need to receive any changes to update that state. - * - * @param avctx the codec context - * @param type the nal unit type - * @param buf the nal unit data buffer - * @param buf_size the size of the nal unit in bytes - * @return zero if successful, a negative value otherwise - */ - int (*decode_params)(AVCodecContext *avctx, int type, const uint8_t *buf, uint32_t buf_size); - - /** - * Callback for each slice. - * - * Meaningful slice information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * @param avctx the codec context - * @param buf the slice data buffer base - * @param buf_size the size of the slice in bytes - * @return zero if successful, a negative value otherwise - */ - int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size); - - /** - * Called at the end of each frame or field picture. - * - * The whole picture is parsed at this point and can now be sent - * to the hardware accelerator. This function is mandatory. - * - * @param avctx the codec context - * @return zero if successful, a negative value otherwise - */ - int (*end_frame)(AVCodecContext *avctx); - - /** - * Size of per-frame hardware accelerator private data. - * - * Private data is allocated with av_mallocz() before - * AVCodecContext.get_buffer() and deallocated after - * AVCodecContext.release_buffer(). - */ - int frame_priv_data_size; - - /** - * Initialize the hwaccel private data. - * - * This will be called from ff_get_format(), after hwaccel and - * hwaccel_context are set and the hwaccel private data in AVCodecInternal - * is allocated. - */ - int (*init)(AVCodecContext *avctx); - - /** - * Uninitialize the hwaccel private data. - * - * This will be called from get_format() or avcodec_close(), after hwaccel - * and hwaccel_context are already uninitialized. - */ - int (*uninit)(AVCodecContext *avctx); - - /** - * Size of the private data to allocate in - * AVCodecInternal.hwaccel_priv_data. - */ - int priv_data_size; - - /** - * Internal hwaccel capabilities. - */ - int caps_internal; - - /** - * Fill the given hw_frames context with current codec parameters. Called - * from get_format. Refer to avcodec_get_hw_frames_parameters() for - * details. - * - * This CAN be called before AVHWAccel.init is called, and you must assume - * that avctx->hwaccel_priv_data is invalid. - */ - int (*frame_params)(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx); - - /** - * Copy necessary context variables from a previous thread context to the current one. - * For thread-safe hwaccels only. - */ - int (*update_thread_context)(AVCodecContext *dst, const AVCodecContext *src); - - /** - * Callback to free the hwaccel-specific frame data. - * - * @param hwctx a pointer to an AVHWDeviceContext. - * @param data the per-frame hardware accelerator private data to be freed. - */ - void (*free_frame_priv)(void *hwctx, uint8_t *data); - - /** - * Callback to flush the hwaccel state. - */ - void (*flush)(AVCodecContext *avctx); } AVHWAccel; /** @@ -2455,7 +2334,7 @@ const AVClass *avcodec_get_subtitle_rect_class(void); * * @return >= 0 on success, a negative AVERROR code on failure */ -int avcodec_parameters_from_context(AVCodecParameters *par, +int avcodec_parameters_from_context(struct AVCodecParameters *par, const AVCodecContext *codec); /** @@ -2467,7 +2346,7 @@ int avcodec_parameters_from_context(AVCodecParameters *par, * @return >= 0 on success, a negative AVERROR code on failure. */ int avcodec_parameters_to_context(AVCodecContext *codec, - const AVCodecParameters *par); + const struct AVCodecParameters *par); /** * Initialize the AVCodecContext to use the given AVCodec. Prior to using this diff --git a/arm/android/third_party/ffmpeg/libavcodec/avfft.c b/arm/android/third_party/ffmpeg/libavcodec/avfft.c index 2200f377..fb635abf 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/avfft.c +++ b/arm/android/third_party/ffmpeg/libavcodec/avfft.c @@ -16,130 +16,233 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include +#include + #include "libavutil/attributes.h" +#include "libavutil/macros.h" #include "libavutil/mem.h" +#include "libavutil/tx.h" #include "avfft.h" -#include "fft.h" -#include "rdft.h" -#include "dct.h" + +typedef struct AVTXWrapper { + AVTXContext *ctx; + av_tx_fn fn; + + AVTXContext *ctx2; + av_tx_fn fn2; + + ptrdiff_t stride; + int len; + int inv; + + float *tmp; + int out_of_place; +} AVTXWrapper; /* FFT */ FFTContext *av_fft_init(int nbits, int inverse) { - FFTContext *s = av_mallocz(sizeof(*s)); + int ret; + float scale = 1.0f; + AVTXWrapper *s = av_malloc(sizeof(*s)); + if (!s) + return NULL; - if (s && ff_fft_init(s, nbits, inverse)) - av_freep(&s); + ret = av_tx_init(&s->ctx, &s->fn, AV_TX_FLOAT_FFT, inverse, 1 << nbits, + &scale, AV_TX_INPLACE); + if (ret < 0) { + av_free(s); + return NULL; + } - return s; + return (FFTContext *)s; } void av_fft_permute(FFTContext *s, FFTComplex *z) { - s->fft_permute(s, z); + /* Empty */ } void av_fft_calc(FFTContext *s, FFTComplex *z) { - s->fft_calc(s, z); + AVTXWrapper *w = (AVTXWrapper *)s; + w->fn(w->ctx, z, (void *)z, sizeof(AVComplexFloat)); } av_cold void av_fft_end(FFTContext *s) { if (s) { - ff_fft_end(s); - av_free(s); + AVTXWrapper *w = (AVTXWrapper *)s; + av_tx_uninit(&w->ctx); + av_tx_uninit(&w->ctx2); + av_free(w); } } -#if CONFIG_MDCT - FFTContext *av_mdct_init(int nbits, int inverse, double scale) { - FFTContext *s = av_malloc(sizeof(*s)); + int ret; + float scale_f = scale; + AVTXWrapper *s = av_malloc(sizeof(*s)); + if (!s) + return NULL; - if (s && ff_mdct_init(s, nbits, inverse, scale)) - av_freep(&s); + ret = av_tx_init(&s->ctx, &s->fn, AV_TX_FLOAT_MDCT, inverse, 1 << (nbits - 1), &scale_f, 0); + if (ret < 0) { + av_free(s); + return NULL; + } - return s; + if (inverse) { + ret = av_tx_init(&s->ctx2, &s->fn2, AV_TX_FLOAT_MDCT, inverse, 1 << (nbits - 1), + &scale_f, AV_TX_FULL_IMDCT); + if (ret < 0) { + av_tx_uninit(&s->ctx); + av_free(s); + return NULL; + } + } + + return (FFTContext *)s; } void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input) { - s->imdct_calc(s, output, input); + AVTXWrapper *w = (AVTXWrapper *)s; + w->fn2(w->ctx2, output, (void *)input, sizeof(float)); } void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input) { - s->imdct_half(s, output, input); + AVTXWrapper *w = (AVTXWrapper *)s; + w->fn(w->ctx, output, (void *)input, sizeof(float)); } void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input) { - s->mdct_calc(s, output, input); + AVTXWrapper *w = (AVTXWrapper *)s; + w->fn(w->ctx, output, (void *)input, sizeof(float)); } av_cold void av_mdct_end(FFTContext *s) { if (s) { - ff_mdct_end(s); - av_free(s); + AVTXWrapper *w = (AVTXWrapper *)s; + av_tx_uninit(&w->ctx); + av_free(w); } } -#endif /* CONFIG_MDCT */ - -#if CONFIG_RDFT - RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans) { - RDFTContext *s = av_malloc(sizeof(*s)); + int ret; + float scale = trans == IDFT_C2R ? 0.5f : 1.0f; + AVTXWrapper *s; - if (s && ff_rdft_init(s, nbits, trans)) - av_freep(&s); + /* The other 2 modes are unconventional, do not form an orthogonal + * transform, have never been useful, and so they're not implemented. */ + if (trans != IDFT_C2R && trans != DFT_R2C) + return NULL; - return s; + s = av_malloc(sizeof(*s)); + if (!s) + return NULL; + + ret = av_tx_init(&s->ctx, &s->fn, AV_TX_FLOAT_RDFT, trans == IDFT_C2R, + 1 << nbits, &scale, AV_TX_INPLACE); + if (ret < 0) { + av_free(s); + return NULL; + } + + s->stride = (trans == DFT_C2R) ? sizeof(float) : sizeof(AVComplexFloat); + s->len = 1 << nbits; + s->inv = trans == IDFT_C2R; + + return (RDFTContext *)s; } void av_rdft_calc(RDFTContext *s, FFTSample *data) { - s->rdft_calc(s, data); + AVTXWrapper *w = (AVTXWrapper *)s; + if (w->inv) + FFSWAP(float, data[1], data[w->len]); + w->fn(w->ctx, data, (void *)data, w->stride); + if (!w->inv) + FFSWAP(float, data[1], data[w->len]); } av_cold void av_rdft_end(RDFTContext *s) { if (s) { - ff_rdft_end(s); - av_free(s); + AVTXWrapper *w = (AVTXWrapper *)s; + av_tx_uninit(&w->ctx); + av_free(w); } } -#endif /* CONFIG_RDFT */ - -#if CONFIG_DCT - DCTContext *av_dct_init(int nbits, enum DCTTransformType inverse) { - DCTContext *s = av_malloc(sizeof(*s)); + int ret; + const float scale_map[] = { + [DCT_II] = 0.5f, + [DCT_III] = 1.0f / (1 << nbits), + [DCT_I] = 0.5f, + [DST_I] = 2.0f, + }; + static const enum AVTXType type_map[] = { + [DCT_II] = AV_TX_FLOAT_DCT, + [DCT_III] = AV_TX_FLOAT_DCT, + [DCT_I] = AV_TX_FLOAT_DCT_I, + [DST_I] = AV_TX_FLOAT_DST_I, + }; - if (s && ff_dct_init(s, nbits, inverse)) - av_freep(&s); + AVTXWrapper *s = av_malloc(sizeof(*s)); + if (!s) + return NULL; - return s; + s->len = (1 << nbits); + s->out_of_place = (inverse == DCT_I) || (inverse == DST_I); + + ret = av_tx_init(&s->ctx, &s->fn, type_map[inverse], + (inverse == DCT_III), 1 << (nbits - (inverse == DCT_III)), + &scale_map[inverse], s->out_of_place ? 0 : AV_TX_INPLACE); + if (ret < 0) { + av_free(s); + return NULL; + } + + if (s->out_of_place) { + s->tmp = av_malloc((1 << (nbits + 1))*sizeof(float)); + if (!s->tmp) { + av_tx_uninit(&s->ctx); + av_free(s); + return NULL; + } + } + + return (DCTContext *)s; } void av_dct_calc(DCTContext *s, FFTSample *data) { - s->dct_calc(s, data); + AVTXWrapper *w = (AVTXWrapper *)s; + if (w->out_of_place) { + memcpy(w->tmp, data, w->len*sizeof(float)); + w->fn(w->ctx, (void *)data, w->tmp, sizeof(float)); + } else { + w->fn(w->ctx, data, (void *)data, sizeof(float)); + } } av_cold void av_dct_end(DCTContext *s) { if (s) { - ff_dct_end(s); - av_free(s); + AVTXWrapper *w = (AVTXWrapper *)s; + av_tx_uninit(&w->ctx); + av_free(w->tmp); + av_free(w); } } - -#endif /* CONFIG_DCT */ diff --git a/arm/android/third_party/ffmpeg/libavcodec/avfft.h b/arm/android/third_party/ffmpeg/libavcodec/avfft.h index 0c0f9b8d..e3a0da1e 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/avfft.h +++ b/arm/android/third_party/ffmpeg/libavcodec/avfft.h @@ -19,6 +19,10 @@ #ifndef AVCODEC_AVFFT_H #define AVCODEC_AVFFT_H +#include "libavutil/attributes.h" +#include "version_major.h" +#if FF_API_AVFFT + /** * @file * @ingroup lavc_fft @@ -44,26 +48,42 @@ typedef struct FFTContext FFTContext; * Set up a complex FFT. * @param nbits log2 of the length of the input array * @param inverse if 0 perform the forward transform, if 1 perform the inverse + * @deprecated use av_tx_init from libavutil/tx.h with a type of AV_TX_FLOAT_FFT */ +attribute_deprecated FFTContext *av_fft_init(int nbits, int inverse); /** * Do the permutation needed BEFORE calling ff_fft_calc(). + * @deprecated without replacement */ +attribute_deprecated void av_fft_permute(FFTContext *s, FFTComplex *z); /** * Do a complex FFT with the parameters defined in av_fft_init(). The * input data must be permuted before. No 1.0/sqrt(n) normalization is done. + * @deprecated use the av_tx_fn value returned by av_tx_init, which also does permutation */ +attribute_deprecated void av_fft_calc(FFTContext *s, FFTComplex *z); +attribute_deprecated void av_fft_end(FFTContext *s); +/** + * @deprecated use av_tx_init from libavutil/tx.h with a type of AV_TX_FLOAT_MDCT, + * with a flag of AV_TX_FULL_IMDCT for a replacement to av_imdct_calc. + */ +attribute_deprecated FFTContext *av_mdct_init(int nbits, int inverse, double scale); +attribute_deprecated void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input); +attribute_deprecated void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input); +attribute_deprecated void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input); +attribute_deprecated void av_mdct_end(FFTContext *s); /* Real Discrete Fourier Transform */ @@ -81,9 +101,14 @@ typedef struct RDFTContext RDFTContext; * Set up a real FFT. * @param nbits log2 of the length of the input array * @param trans the type of transform + * + * @deprecated use av_tx_init from libavutil/tx.h with a type of AV_TX_FLOAT_RDFT */ +attribute_deprecated RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans); +attribute_deprecated void av_rdft_calc(RDFTContext *s, FFTSample *data); +attribute_deprecated void av_rdft_end(RDFTContext *s); /* Discrete Cosine Transform */ @@ -106,13 +131,19 @@ enum DCTTransformType { * @param type the type of transform * * @note the first element of the input of DST-I is ignored + * + * @deprecated use av_tx_init from libavutil/tx.h with an appropriate type of AV_TX_FLOAT_DCT */ +attribute_deprecated DCTContext *av_dct_init(int nbits, enum DCTTransformType type); +attribute_deprecated void av_dct_calc(DCTContext *s, FFTSample *data); +attribute_deprecated void av_dct_end (DCTContext *s); /** * @} */ +#endif /* FF_API_AVFFT */ #endif /* AVCODEC_AVFFT_H */ diff --git a/arm/android/third_party/ffmpeg/libavcodec/avpacket.c b/arm/android/third_party/ffmpeg/libavcodec/avpacket.c index 5fef65e9..9ec1feb0 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/avpacket.c +++ b/arm/android/third_party/ffmpeg/libavcodec/avpacket.c @@ -22,6 +22,7 @@ #include #include "libavutil/avassert.h" +#include "libavutil/avutil.h" #include "libavutil/intreadwrite.h" #include "libavutil/mathematics.h" #include "libavutil/mem.h" diff --git a/arm/android/third_party/ffmpeg/libavcodec/bgmc.c b/arm/android/third_party/ffmpeg/libavcodec/bgmc.c index 361f7c52..0e41a39e 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/bgmc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/bgmc.c @@ -457,7 +457,7 @@ static uint8_t *bgmc_lut_getp(uint8_t *lut, int *lut_status, int delta) /** Initialize the lookup table arrays */ -av_cold int ff_bgmc_init(AVCodecContext *avctx, +av_cold int ff_bgmc_init(void *logctx, uint8_t **cf_lut, int **cf_lut_status) { *cf_lut = av_malloc(sizeof(**cf_lut) * LUT_BUFF * 16 * LUT_SIZE); @@ -465,7 +465,7 @@ av_cold int ff_bgmc_init(AVCodecContext *avctx, if (!*cf_lut || !*cf_lut_status) { ff_bgmc_end(cf_lut, cf_lut_status); - av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n"); + av_log(logctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n"); return AVERROR(ENOMEM); } else { // initialize lut_status buffer to a value never used to compare against diff --git a/arm/android/third_party/ffmpeg/libavcodec/bgmc.h b/arm/android/third_party/ffmpeg/libavcodec/bgmc.h index 466df31a..81771d4a 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/bgmc.h +++ b/arm/android/third_party/ffmpeg/libavcodec/bgmc.h @@ -30,11 +30,10 @@ #define AVCODEC_BGMC_H -#include "avcodec.h" #include "get_bits.h" -int ff_bgmc_init(AVCodecContext *avctx, uint8_t **cf_lut, int **cf_lut_status); +int ff_bgmc_init(void *logctx, uint8_t **cf_lut, int **cf_lut_status); void ff_bgmc_end(uint8_t **cf_lut, int **cf_lut_status); diff --git a/arm/android/third_party/ffmpeg/libavcodec/bink.c b/arm/android/third_party/ffmpeg/libavcodec/bink.c index e3822d68..804c1419 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/bink.c +++ b/arm/android/third_party/ffmpeg/libavcodec/bink.c @@ -21,6 +21,7 @@ */ #include "libavutil/attributes.h" +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/internal.h" #include "libavutil/mem_internal.h" @@ -1299,8 +1300,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, emms_c(); if (c->version > 'b') { - av_frame_unref(c->last); - if ((ret = av_frame_ref(c->last, frame)) < 0) + if ((ret = av_frame_replace(c->last, frame)) < 0) return ret; } @@ -1318,9 +1318,9 @@ static av_cold void bink_init_vlcs(void) bink_trees[i].table = table + offset; bink_trees[i].table_allocated = 1 << maxbits; offset += bink_trees[i].table_allocated; - init_vlc(&bink_trees[i], maxbits, 16, + vlc_init(&bink_trees[i], maxbits, 16, bink_tree_lens[i], 1, 1, - bink_tree_bits[i], 1, 1, INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE); + bink_tree_bits[i], 1, 1, VLC_INIT_USE_STATIC | VLC_INIT_LE); } } diff --git a/arm/android/third_party/ffmpeg/libavcodec/bitstream.h b/arm/android/third_party/ffmpeg/libavcodec/bitstream.h index b60f0c29..35b7873b 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/bitstream.h +++ b/arm/android/third_party/ffmpeg/libavcodec/bitstream.h @@ -102,6 +102,7 @@ # define bits_decode210 bits_decode210_le # define bits_apply_sign bits_apply_sign_le # define bits_read_vlc bits_read_vlc_le +# define bits_read_vlc_multi bits_read_vlc_multi_le #elif defined(BITS_DEFAULT_BE) @@ -130,6 +131,7 @@ # define bits_decode210 bits_decode210_be # define bits_apply_sign bits_apply_sign_be # define bits_read_vlc bits_read_vlc_be +# define bits_read_vlc_multi bits_read_vlc_multi_be #endif diff --git a/arm/android/third_party/ffmpeg/libavcodec/bitstream_template.h b/arm/android/third_party/ffmpeg/libavcodec/bitstream_template.h index 30bea84a..cf4aeff4 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/bitstream_template.h +++ b/arm/android/third_party/ffmpeg/libavcodec/bitstream_template.h @@ -491,7 +491,7 @@ static inline int BS_FUNC(priv_set_idx)(BSCTX *bc, int code, int *n, /** * Parse a vlc code. * @param bits is the number of bits which will be read at once, must be - * identical to nb_bits in init_vlc() + * identical to nb_bits in vlc_init() * @param max_depth is the number of times bits bits must be read to completely * read the longest vlc code * = (max_vlc_length + bits - 1) / bits @@ -520,6 +520,35 @@ static inline int BS_FUNC(read_vlc)(BSCTX *bc, const VLCElem *table, return code; } +static inline int BS_FUNC(read_vlc_multi)(BSCTX *bc, uint8_t *dst, + const VLC_MULTI_ELEM *const Jtable, + const VLCElem *const table, + const int bits, const int max_depth) +{ + unsigned idx = BS_FUNC(peek)(bc, bits); + int ret, nb_bits, code, n = Jtable[idx].len; + if (Jtable[idx].num) { + AV_COPY64U(dst, Jtable[idx].val); + ret = Jtable[idx].num; + } else { + code = table[idx].sym; + n = table[idx].len; + if (max_depth > 1 && n < 0) { + BS_FUNC(priv_skip_remaining)(bc, bits); + code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); + if (max_depth > 2 && n < 0) { + BS_FUNC(priv_skip_remaining)(bc, nb_bits); + code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); + } + } + AV_WN16(dst, code); + ret = n > 0; + } + BS_FUNC(priv_skip_remaining)(bc, n); + + return ret; +} + #undef BSCTX #undef BS_FUNC #undef BS_JOIN3 diff --git a/arm/android/third_party/ffmpeg/libavcodec/bonk.c b/arm/android/third_party/ffmpeg/libavcodec/bonk.c index fbea91c7..6cd6a0af 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/bonk.c +++ b/arm/android/third_party/ffmpeg/libavcodec/bonk.c @@ -277,7 +277,7 @@ static int predictor_calc_error(int *k, int *state, int order, int error) for (i = order-2; i >= 0; i--, k_ptr--, state_ptr--) { unsigned k_value = *k_ptr, state_value = *state_ptr; - x -= shift_down(k_value * (unsigned)state_value, LATTICE_SHIFT); + x -= (unsigned) shift_down(k_value * (unsigned)state_value, LATTICE_SHIFT); state_ptr[1] = state_value + shift_down(k_value * x, LATTICE_SHIFT); } diff --git a/arm/android/third_party/ffmpeg/libavcodec/cavsdec.c b/arm/android/third_party/ffmpeg/libavcodec/cavsdec.c index 37071dfb..b356da0b 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/cavsdec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/cavsdec.c @@ -26,6 +26,7 @@ */ #include "libavutil/avassert.h" +#include "libavutil/emms.h" #include "avcodec.h" #include "get_bits.h" #include "golomb.h" diff --git a/arm/android/third_party/ffmpeg/libavcodec/cbs.c b/arm/android/third_party/ffmpeg/libavcodec/cbs.c index 13a01bef..daf7f664 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/cbs.c +++ b/arm/android/third_party/ffmpeg/libavcodec/cbs.c @@ -117,8 +117,9 @@ av_cold int ff_cbs_init(CodedBitstreamContext **ctx_ptr, ctx->decompose_unit_types = NULL; - ctx->trace_enable = 0; - ctx->trace_level = AV_LOG_TRACE; + ctx->trace_enable = 0; + ctx->trace_level = AV_LOG_TRACE; + ctx->trace_context = ctx; *ctx_ptr = ctx; return 0; @@ -496,19 +497,27 @@ void ff_cbs_trace_header(CodedBitstreamContext *ctx, av_log(ctx->log_ctx, ctx->trace_level, "%s\n", name); } -void ff_cbs_trace_syntax_element(CodedBitstreamContext *ctx, int position, - const char *str, const int *subscripts, - const char *bits, int64_t value) +void ff_cbs_trace_read_log(void *trace_context, + GetBitContext *gbc, int length, + const char *str, const int *subscripts, + int64_t value) { + CodedBitstreamContext *ctx = trace_context; char name[256]; + char bits[256]; size_t name_len, bits_len; int pad, subs, i, j, k, n; - - if (!ctx->trace_enable) - return; + int position; av_assert0(value >= INT_MIN && value <= UINT32_MAX); + position = get_bits_count(gbc); + + av_assert0(length < 256); + for (i = 0; i < length; i++) + bits[i] = get_bits1(gbc) ? '1' : '0'; + bits[length] = 0; + subs = subscripts ? subscripts[0] : 0; n = 0; for (i = j = 0; str[i];) { @@ -535,7 +544,7 @@ void ff_cbs_trace_syntax_element(CodedBitstreamContext *ctx, int position, av_assert0(n == subs); name_len = strlen(name); - bits_len = strlen(bits); + bits_len = length; if (name_len + bits_len > 60) pad = bits_len + 2; @@ -546,13 +555,47 @@ void ff_cbs_trace_syntax_element(CodedBitstreamContext *ctx, int position, position, name, pad, bits, value); } -int ff_cbs_read_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, - int width, const char *name, - const int *subscripts, uint32_t *write_to, - uint32_t range_min, uint32_t range_max) +void ff_cbs_trace_write_log(void *trace_context, + PutBitContext *pbc, int length, + const char *str, const int *subscripts, + int64_t value) +{ + CodedBitstreamContext *ctx = trace_context; + + // Ensure that the syntax element is written to the output buffer, + // make a GetBitContext pointed at the start position, then call the + // read log function which can read the bits back to log them. + + GetBitContext gbc; + int position; + + if (length > 0) { + PutBitContext flush; + flush = *pbc; + flush_put_bits(&flush); + } + + position = put_bits_count(pbc); + av_assert0(position >= length); + + init_get_bits(&gbc, pbc->buf, position); + + skip_bits_long(&gbc, position - length); + + ff_cbs_trace_read_log(ctx, &gbc, length, str, subscripts, value); +} + +static av_always_inline int cbs_read_unsigned(CodedBitstreamContext *ctx, + GetBitContext *gbc, + int width, const char *name, + const int *subscripts, + uint32_t *write_to, + uint32_t range_min, + uint32_t range_max) { uint32_t value; - int position; + + CBS_TRACE_READ_START(); av_assert0(width > 0 && width <= 32); @@ -562,21 +605,9 @@ int ff_cbs_read_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, return AVERROR_INVALIDDATA; } - if (ctx->trace_enable) - position = get_bits_count(gbc); - value = get_bits_long(gbc, width); - if (ctx->trace_enable) { - char bits[33]; - int i; - for (i = 0; i < width; i++) - bits[i] = value >> (width - i - 1) & 1 ? '1' : '0'; - bits[i] = 0; - - ff_cbs_trace_syntax_element(ctx, position, name, subscripts, - bits, value); - } + CBS_TRACE_READ_END(); if (value < range_min || value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " @@ -589,11 +620,29 @@ int ff_cbs_read_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, return 0; } +int ff_cbs_read_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, + int width, const char *name, + const int *subscripts, uint32_t *write_to, + uint32_t range_min, uint32_t range_max) +{ + return cbs_read_unsigned(ctx, gbc, width, name, subscripts, + write_to, range_min, range_max); +} + +int ff_cbs_read_simple_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, + int width, const char *name, uint32_t *write_to) +{ + return cbs_read_unsigned(ctx, gbc, width, name, NULL, + write_to, 0, UINT32_MAX); +} + int ff_cbs_write_unsigned(CodedBitstreamContext *ctx, PutBitContext *pbc, int width, const char *name, const int *subscripts, uint32_t value, uint32_t range_min, uint32_t range_max) { + CBS_TRACE_WRITE_START(); + av_assert0(width > 0 && width <= 32); if (value < range_min || value > range_max) { @@ -606,32 +655,31 @@ int ff_cbs_write_unsigned(CodedBitstreamContext *ctx, PutBitContext *pbc, if (put_bits_left(pbc) < width) return AVERROR(ENOSPC); - if (ctx->trace_enable) { - char bits[33]; - int i; - for (i = 0; i < width; i++) - bits[i] = value >> (width - i - 1) & 1 ? '1' : '0'; - bits[i] = 0; - - ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), - name, subscripts, bits, value); - } - if (width < 32) put_bits(pbc, width, value); else put_bits32(pbc, value); + CBS_TRACE_WRITE_END(); + return 0; } +int ff_cbs_write_simple_unsigned(CodedBitstreamContext *ctx, PutBitContext *pbc, + int width, const char *name, uint32_t value) +{ + return ff_cbs_write_unsigned(ctx, pbc, width, name, NULL, + value, 0, MAX_UINT_BITS(width)); +} + int ff_cbs_read_signed(CodedBitstreamContext *ctx, GetBitContext *gbc, int width, const char *name, const int *subscripts, int32_t *write_to, int32_t range_min, int32_t range_max) { int32_t value; - int position; + + CBS_TRACE_READ_START(); av_assert0(width > 0 && width <= 32); @@ -641,21 +689,9 @@ int ff_cbs_read_signed(CodedBitstreamContext *ctx, GetBitContext *gbc, return AVERROR_INVALIDDATA; } - if (ctx->trace_enable) - position = get_bits_count(gbc); - value = get_sbits_long(gbc, width); - if (ctx->trace_enable) { - char bits[33]; - int i; - for (i = 0; i < width; i++) - bits[i] = value & (1U << (width - i - 1)) ? '1' : '0'; - bits[i] = 0; - - ff_cbs_trace_syntax_element(ctx, position, name, subscripts, - bits, value); - } + CBS_TRACE_READ_END(); if (value < range_min || value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " @@ -673,6 +709,8 @@ int ff_cbs_write_signed(CodedBitstreamContext *ctx, PutBitContext *pbc, const int *subscripts, int32_t value, int32_t range_min, int32_t range_max) { + CBS_TRACE_WRITE_START(); + av_assert0(width > 0 && width <= 32); if (value < range_min || value > range_max) { @@ -685,22 +723,13 @@ int ff_cbs_write_signed(CodedBitstreamContext *ctx, PutBitContext *pbc, if (put_bits_left(pbc) < width) return AVERROR(ENOSPC); - if (ctx->trace_enable) { - char bits[33]; - int i; - for (i = 0; i < width; i++) - bits[i] = value & (1U << (width - i - 1)) ? '1' : '0'; - bits[i] = 0; - - ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), - name, subscripts, bits, value); - } - if (width < 32) put_sbits(pbc, width, value); else put_bits32(pbc, value); + CBS_TRACE_WRITE_END(); + return 0; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/cbs.h b/arm/android/third_party/ffmpeg/libavcodec/cbs.h index b4131db5..ffb27977 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/cbs.h +++ b/arm/android/third_party/ffmpeg/libavcodec/cbs.h @@ -168,6 +168,51 @@ typedef struct CodedBitstreamFragment { CodedBitstreamUnit *units; } CodedBitstreamFragment; + +struct CodedBitstreamContext; +struct GetBitContext; +struct PutBitContext; + +/** + * Callback type for read tracing. + * + * @param ctx User-set trace context. + * @param gbc A GetBitContext set at the start of the syntax + * element. This is a copy, the callee does not + * need to preserve it. + * @param length Length in bits of the syntax element. + * @param name String name of the syntax elements. + * @param subscripts If the syntax element is an array, a pointer to + * an array of subscripts into the array. + * @param value Parsed value of the syntax element. + */ +typedef void (*CBSTraceReadCallback)(void *trace_context, + struct GetBitContext *gbc, + int start_position, + const char *name, + const int *subscripts, + int64_t value); + +/** + * Callback type for write tracing. + * + * @param ctx User-set trace context. + * @param pbc A PutBitContext set at the end of the syntax + * element. The user must not modify this, but may + * inspect it to determine state. + * @param length Length in bits of the syntax element. + * @param name String name of the syntax elements. + * @param subscripts If the syntax element is an array, a pointer to + * an array of subscripts into the array. + * @param value Written value of the syntax element. + */ +typedef void (*CBSTraceWriteCallback)(void *trace_context, + struct PutBitContext *pbc, + int start_position, + const char *name, + const int *subscripts, + int64_t value); + /** * Context structure for coded bitstream operations. */ @@ -211,11 +256,29 @@ typedef struct CodedBitstreamContext { */ int trace_enable; /** - * Log level to use for trace output. + * Log level to use for default trace output. * * From AV_LOG_*; defaults to AV_LOG_TRACE. */ int trace_level; + /** + * User context pointer to pass to trace callbacks. + */ + void *trace_context; + /** + * Callback for read tracing. + * + * If tracing is enabled then this is called once for each syntax + * element parsed. + */ + CBSTraceReadCallback trace_read_callback; + /** + * Callback for write tracing. + * + * If tracing is enabled then this is called once for each syntax + * element written. + */ + CBSTraceWriteCallback trace_write_callback; /** * Write buffer. Used as intermediate buffer when writing units. @@ -450,4 +513,27 @@ void ff_cbs_discard_units(CodedBitstreamContext *ctx, enum AVDiscard skip, int flags); + +/** + * Helper function for read tracing which formats the syntax element + * and logs the result. + * + * Trace context should be set to the CodedBitstreamContext. + */ +void ff_cbs_trace_read_log(void *trace_context, + struct GetBitContext *gbc, int length, + const char *str, const int *subscripts, + int64_t value); + +/** + * Helper function for write tracing which formats the syntax element + * and logs the result. + * + * Trace context should be set to the CodedBitstreamContext. + */ +void ff_cbs_trace_write_log(void *trace_context, + struct PutBitContext *pbc, int length, + const char *str, const int *subscripts, + int64_t value); + #endif /* AVCODEC_CBS_H */ diff --git a/arm/android/third_party/ffmpeg/libavcodec/cbs_av1.c b/arm/android/third_party/ffmpeg/libavcodec/cbs_av1.c index 8788fee0..ed9a7b80 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/cbs_av1.c +++ b/arm/android/third_party/ffmpeg/libavcodec/cbs_av1.c @@ -20,10 +20,10 @@ #include "libavutil/opt.h" #include "libavutil/pixfmt.h" -#include "avcodec.h" #include "cbs.h" #include "cbs_internal.h" #include "cbs_av1.h" +#include "defs.h" static int cbs_av1_read_uvlc(CodedBitstreamContext *ctx, GetBitContext *gbc, @@ -31,10 +31,8 @@ static int cbs_av1_read_uvlc(CodedBitstreamContext *ctx, GetBitContext *gbc, uint32_t range_min, uint32_t range_max) { uint32_t zeroes, bits_value, value; - int position; - if (ctx->trace_enable) - position = get_bits_count(gbc); + CBS_TRACE_READ_START(); zeroes = 0; while (1) { @@ -50,6 +48,9 @@ static int cbs_av1_read_uvlc(CodedBitstreamContext *ctx, GetBitContext *gbc, } if (zeroes >= 32) { + // Note that the spec allows an arbitrarily large number of + // zero bits followed by a one bit in this case, but the + // libaom implementation does not support it. value = MAX_UINT_BITS(32); } else { if (get_bits_left(gbc) < zeroes) { @@ -62,36 +63,7 @@ static int cbs_av1_read_uvlc(CodedBitstreamContext *ctx, GetBitContext *gbc, value = bits_value + (UINT32_C(1) << zeroes) - 1; } - if (ctx->trace_enable) { - char bits[65]; - int i, j, k; - - if (zeroes >= 32) { - while (zeroes > 32) { - k = FFMIN(zeroes - 32, 32); - for (i = 0; i < k; i++) - bits[i] = '0'; - bits[i] = 0; - ff_cbs_trace_syntax_element(ctx, position, name, - NULL, bits, 0); - zeroes -= k; - position += k; - } - } - - for (i = 0; i < zeroes; i++) - bits[i] = '0'; - bits[i++] = '1'; - - if (zeroes < 32) { - for (j = 0; j < zeroes; j++) - bits[i++] = (bits_value >> (zeroes - j - 1) & 1) ? '1' : '0'; - } - - bits[i] = 0; - ff_cbs_trace_syntax_element(ctx, position, name, - NULL, bits, value); - } + CBS_TRACE_READ_END_NO_SUBSCRIPTS(); if (value < range_min || value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " @@ -109,7 +81,9 @@ static int cbs_av1_write_uvlc(CodedBitstreamContext *ctx, PutBitContext *pbc, uint32_t range_min, uint32_t range_max) { uint32_t v; - int position, zeroes; + int zeroes; + + CBS_TRACE_WRITE_START(); if (value < range_min || value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " @@ -118,28 +92,17 @@ static int cbs_av1_write_uvlc(CodedBitstreamContext *ctx, PutBitContext *pbc, return AVERROR_INVALIDDATA; } - if (ctx->trace_enable) - position = put_bits_count(pbc); - zeroes = av_log2(value + 1); v = value - (1U << zeroes) + 1; + + if (put_bits_left(pbc) < 2 * zeroes + 1) + return AVERROR(ENOSPC); + put_bits(pbc, zeroes, 0); put_bits(pbc, 1, 1); put_bits(pbc, zeroes, v); - if (ctx->trace_enable) { - char bits[65]; - int i, j; - i = 0; - for (j = 0; j < zeroes; j++) - bits[i++] = '0'; - bits[i++] = '1'; - for (j = 0; j < zeroes; j++) - bits[i++] = (v >> (zeroes - j - 1) & 1) ? '1' : '0'; - bits[i++] = 0; - ff_cbs_trace_syntax_element(ctx, position, name, NULL, - bits, value); - } + CBS_TRACE_WRITE_END_NO_SUBSCRIPTS(); return 0; } @@ -148,20 +111,19 @@ static int cbs_av1_read_leb128(CodedBitstreamContext *ctx, GetBitContext *gbc, const char *name, uint64_t *write_to) { uint64_t value; - int position, err, i; + uint32_t byte; + int i; - if (ctx->trace_enable) - position = get_bits_count(gbc); + CBS_TRACE_READ_START(); value = 0; for (i = 0; i < 8; i++) { - int subscript[2] = { 1, i }; - uint32_t byte; - err = ff_cbs_read_unsigned(ctx, gbc, 8, "leb128_byte[i]", subscript, - &byte, 0x00, 0xff); - if (err < 0) - return err; - + if (get_bits_left(gbc) < 8) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid leb128 at " + "%s: bitstream ended.\n", name); + return AVERROR_INVALIDDATA; + } + byte = get_bits(gbc, 8); value |= (uint64_t)(byte & 0x7f) << (i * 7); if (!(byte & 0x80)) break; @@ -170,39 +132,44 @@ static int cbs_av1_read_leb128(CodedBitstreamContext *ctx, GetBitContext *gbc, if (value > UINT32_MAX) return AVERROR_INVALIDDATA; - if (ctx->trace_enable) - ff_cbs_trace_syntax_element(ctx, position, name, NULL, "", value); + CBS_TRACE_READ_END_NO_SUBSCRIPTS(); *write_to = value; return 0; } static int cbs_av1_write_leb128(CodedBitstreamContext *ctx, PutBitContext *pbc, - const char *name, uint64_t value) + const char *name, uint64_t value, int fixed_length) { - int position, err, len, i; + int len, i; uint8_t byte; + CBS_TRACE_WRITE_START(); + len = (av_log2(value) + 7) / 7; - if (ctx->trace_enable) - position = put_bits_count(pbc); + if (fixed_length) { + if (fixed_length < len) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "OBU is too large for " + "fixed length size field (%d > %d).\n", + len, fixed_length); + return AVERROR(EINVAL); + } + len = fixed_length; + } for (i = 0; i < len; i++) { - int subscript[2] = { 1, i }; + if (put_bits_left(pbc) < 8) + return AVERROR(ENOSPC); byte = value >> (7 * i) & 0x7f; if (i < len - 1) byte |= 0x80; - err = ff_cbs_write_unsigned(ctx, pbc, 8, "leb128_byte[i]", subscript, - byte, 0x00, 0xff); - if (err < 0) - return err; + put_bits(pbc, 8, byte); } - if (ctx->trace_enable) - ff_cbs_trace_syntax_element(ctx, position, name, NULL, "", value); + CBS_TRACE_WRITE_END_NO_SUBSCRIPTS(); return 0; } @@ -212,13 +179,12 @@ static int cbs_av1_read_ns(CodedBitstreamContext *ctx, GetBitContext *gbc, const int *subscripts, uint32_t *write_to) { uint32_t m, v, extra_bit, value; - int position, w; + int w; + + CBS_TRACE_READ_START(); av_assert0(n > 0); - if (ctx->trace_enable) - position = get_bits_count(gbc); - w = av_log2(n) + 1; m = (1 << w) - n; @@ -240,18 +206,7 @@ static int cbs_av1_read_ns(CodedBitstreamContext *ctx, GetBitContext *gbc, value = (v << 1) - m + extra_bit; } - if (ctx->trace_enable) { - char bits[33]; - int i; - for (i = 0; i < w - 1; i++) - bits[i] = (v >> i & 1) ? '1' : '0'; - if (v >= m) - bits[i++] = extra_bit ? '1' : '0'; - bits[i] = 0; - - ff_cbs_trace_syntax_element(ctx, position, - name, subscripts, bits, value); - } + CBS_TRACE_READ_END(); *write_to = value; return 0; @@ -262,7 +217,8 @@ static int cbs_av1_write_ns(CodedBitstreamContext *ctx, PutBitContext *pbc, const int *subscripts, uint32_t value) { uint32_t w, m, v, extra_bit; - int position; + + CBS_TRACE_WRITE_START(); if (value > n) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " @@ -271,9 +227,6 @@ static int cbs_av1_write_ns(CodedBitstreamContext *ctx, PutBitContext *pbc, return AVERROR_INVALIDDATA; } - if (ctx->trace_enable) - position = put_bits_count(pbc); - w = av_log2(n) + 1; m = (1 << w) - n; @@ -290,18 +243,7 @@ static int cbs_av1_write_ns(CodedBitstreamContext *ctx, PutBitContext *pbc, put_bits(pbc, 1, extra_bit); } - if (ctx->trace_enable) { - char bits[33]; - int i; - for (i = 0; i < w - 1; i++) - bits[i] = (v >> i & 1) ? '1' : '0'; - if (value >= m) - bits[i++] = extra_bit ? '1' : '0'; - bits[i] = 0; - - ff_cbs_trace_syntax_element(ctx, position, - name, subscripts, bits, value); - } + CBS_TRACE_WRITE_END(); return 0; } @@ -311,33 +253,24 @@ static int cbs_av1_read_increment(CodedBitstreamContext *ctx, GetBitContext *gbc const char *name, uint32_t *write_to) { uint32_t value; - int position, i; - char bits[33]; - av_assert0(range_min <= range_max && range_max - range_min < sizeof(bits) - 1); - if (ctx->trace_enable) - position = get_bits_count(gbc); + CBS_TRACE_READ_START(); - for (i = 0, value = range_min; value < range_max;) { + av_assert0(range_min <= range_max && range_max - range_min < 32); + + for (value = range_min; value < range_max;) { if (get_bits_left(gbc) < 1) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid increment value at " "%s: bitstream ended.\n", name); return AVERROR_INVALIDDATA; } - if (get_bits1(gbc)) { - bits[i++] = '1'; + if (get_bits1(gbc)) ++value; - } else { - bits[i++] = '0'; + else break; - } } - if (ctx->trace_enable) { - bits[i] = 0; - ff_cbs_trace_syntax_element(ctx, position, - name, NULL, bits, value); - } + CBS_TRACE_READ_END_NO_SUBSCRIPTS(); *write_to = value; return 0; @@ -349,6 +282,8 @@ static int cbs_av1_write_increment(CodedBitstreamContext *ctx, PutBitContext *pb { int len; + CBS_TRACE_WRITE_START(); + av_assert0(range_min <= range_max && range_max - range_min < 32); if (value < range_min || value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " @@ -364,23 +299,11 @@ static int cbs_av1_write_increment(CodedBitstreamContext *ctx, PutBitContext *pb if (put_bits_left(pbc) < len) return AVERROR(ENOSPC); - if (ctx->trace_enable) { - char bits[33]; - int i; - for (i = 0; i < len; i++) { - if (range_min + i == value) - bits[i] = '0'; - else - bits[i] = '1'; - } - bits[i] = 0; - ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), - name, NULL, bits, value); - } - if (len > 0) put_bits(pbc, len, (1 << len) - 1 - (value != range_max)); + CBS_TRACE_WRITE_END_NO_SUBSCRIPTS(); + return 0; } @@ -388,12 +311,10 @@ static int cbs_av1_read_subexp(CodedBitstreamContext *ctx, GetBitContext *gbc, uint32_t range_max, const char *name, const int *subscripts, uint32_t *write_to) { - uint32_t value; - int position, err; - uint32_t max_len, len, range_offset, range_bits; + uint32_t value, max_len, len, range_offset, range_bits; + int err; - if (ctx->trace_enable) - position = get_bits_count(gbc); + CBS_TRACE_READ_START(); av_assert0(range_max > 0); max_len = av_log2(range_max - 1) - 3; @@ -412,9 +333,8 @@ static int cbs_av1_read_subexp(CodedBitstreamContext *ctx, GetBitContext *gbc, } if (len < max_len) { - err = ff_cbs_read_unsigned(ctx, gbc, range_bits, - "subexp_bits", NULL, &value, - 0, MAX_UINT_BITS(range_bits)); + err = ff_cbs_read_simple_unsigned(ctx, gbc, range_bits, + "subexp_bits", &value); if (err < 0) return err; @@ -426,9 +346,7 @@ static int cbs_av1_read_subexp(CodedBitstreamContext *ctx, GetBitContext *gbc, } value += range_offset; - if (ctx->trace_enable) - ff_cbs_trace_syntax_element(ctx, position, - name, subscripts, "", value); + CBS_TRACE_READ_END_VALUE_ONLY(); *write_to = value; return err; @@ -438,9 +356,11 @@ static int cbs_av1_write_subexp(CodedBitstreamContext *ctx, PutBitContext *pbc, uint32_t range_max, const char *name, const int *subscripts, uint32_t value) { - int position, err; + int err; uint32_t max_len, len, range_offset, range_bits; + CBS_TRACE_WRITE_START(); + if (value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " "%"PRIu32", but must be in [0,%"PRIu32"].\n", @@ -448,9 +368,6 @@ static int cbs_av1_write_subexp(CodedBitstreamContext *ctx, PutBitContext *pbc, return AVERROR_INVALIDDATA; } - if (ctx->trace_enable) - position = put_bits_count(pbc); - av_assert0(range_max > 0); max_len = av_log2(range_max - 1) - 3; @@ -476,10 +393,9 @@ static int cbs_av1_write_subexp(CodedBitstreamContext *ctx, PutBitContext *pbc, return err; if (len < max_len) { - err = ff_cbs_write_unsigned(ctx, pbc, range_bits, - "subexp_bits", NULL, - value - range_offset, - 0, MAX_UINT_BITS(range_bits)); + err = ff_cbs_write_simple_unsigned(ctx, pbc, range_bits, + "subexp_bits", + value - range_offset); if (err < 0) return err; @@ -491,9 +407,7 @@ static int cbs_av1_write_subexp(CodedBitstreamContext *ctx, PutBitContext *pbc, return err; } - if (ctx->trace_enable) - ff_cbs_trace_syntax_element(ctx, position, - name, subscripts, "", value); + CBS_TRACE_WRITE_END_VALUE_ONLY(); return err; } @@ -546,8 +460,6 @@ static size_t cbs_av1_get_payload_bytes_left(GetBitContext *gbc) #define SUBSCRIPTS(subs, ...) (subs > 0 ? ((int[subs + 1]){ subs, __VA_ARGS__ }) : NULL) -#define fb(width, name) \ - xf(width, name, current->name, 0, MAX_UINT_BITS(width), 0, ) #define fc(width, name, range_min, range_max) \ xf(width, name, current->name, range_min, range_max, 0, ) #define flag(name) fb(1, name) @@ -573,6 +485,13 @@ static size_t cbs_av1_get_payload_bytes_left(GetBitContext *gbc) #define READWRITE read #define RWContext GetBitContext +#define fb(width, name) do { \ + uint32_t value; \ + CHECK(ff_cbs_read_simple_unsigned(ctx, rw, width, \ + #name, &value)); \ + current->name = value; \ + } while (0) + #define xf(width, name, var, range_min, range_max, subs, ...) do { \ uint32_t value; \ CHECK(ff_cbs_read_unsigned(ctx, rw, width, #name, \ @@ -645,6 +564,7 @@ static size_t cbs_av1_get_payload_bytes_left(GetBitContext *gbc) #undef READ #undef READWRITE #undef RWContext +#undef fb #undef xf #undef xsu #undef uvlc @@ -661,6 +581,11 @@ static size_t cbs_av1_get_payload_bytes_left(GetBitContext *gbc) #define READWRITE write #define RWContext PutBitContext +#define fb(width, name) do { \ + CHECK(ff_cbs_write_simple_unsigned(ctx, rw, width, #name, \ + current->name)); \ + } while (0) + #define xf(width, name, var, range_min, range_max, subs, ...) do { \ CHECK(ff_cbs_write_unsigned(ctx, rw, width, #name, \ SUBSCRIPTS(subs, __VA_ARGS__), \ @@ -703,7 +628,7 @@ static size_t cbs_av1_get_payload_bytes_left(GetBitContext *gbc) } while (0) #define leb128(name) do { \ - CHECK(cbs_av1_write_leb128(ctx, rw, #name, current->name)); \ + CHECK(cbs_av1_write_leb128(ctx, rw, #name, current->name, 0)); \ } while (0) #define infer(name, value) do { \ @@ -723,6 +648,7 @@ static size_t cbs_av1_get_payload_bytes_left(GetBitContext *gbc) #undef WRITE #undef READWRITE #undef RWContext +#undef fb #undef xf #undef xsu #undef uvlc @@ -1086,9 +1012,14 @@ static int cbs_av1_write_obu(CodedBitstreamContext *ctx, if (obu->header.obu_has_size_field) { pbc_tmp = *pbc; - // Add space for the size field to fill later. - put_bits32(pbc, 0); - put_bits32(pbc, 0); + if (priv->fixed_obu_size_length) { + for (int i = 0; i < priv->fixed_obu_size_length; i++) + put_bits(pbc, 8, 0); + } else { + // Add space for the size field to fill later. + put_bits32(pbc, 0); + put_bits32(pbc, 0); + } } td = NULL; @@ -1208,7 +1139,8 @@ static int cbs_av1_write_obu(CodedBitstreamContext *ctx, end_pos /= 8; *pbc = pbc_tmp; - err = cbs_av1_write_leb128(ctx, pbc, "obu_size", obu->obu_size); + err = cbs_av1_write_leb128(ctx, pbc, "obu_size", obu->obu_size, + priv->fixed_obu_size_length); if (err < 0) goto error; @@ -1225,8 +1157,13 @@ static int cbs_av1_write_obu(CodedBitstreamContext *ctx, } if (obu->obu_size > 0) { - memmove(pbc->buf + data_pos, - pbc->buf + start_pos, header_size); + if (!priv->fixed_obu_size_length) { + memmove(pbc->buf + data_pos, + pbc->buf + start_pos, header_size); + } else { + // The size was fixed so the following data was + // already written in the correct place. + } skip_put_bytes(pbc, header_size); if (td) { @@ -1345,6 +1282,8 @@ static const CodedBitstreamUnitTypeDescriptor cbs_av1_unit_types[] = { static const AVOption cbs_av1_options[] = { { "operating_point", "Set operating point to select layers to parse from a scalable bitstream", OFFSET(operating_point), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, AV1_MAX_OPERATING_POINTS - 1, 0 }, + { "fixed_obu_size_length", "Set fixed length of the obu_size field", + OFFSET(fixed_obu_size_length), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 8, 0 }, { NULL } }; diff --git a/arm/android/third_party/ffmpeg/libavcodec/cbs_av1.h b/arm/android/third_party/ffmpeg/libavcodec/cbs_av1.h index 64dfdce9..79242571 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/cbs_av1.h +++ b/arm/android/third_party/ffmpeg/libavcodec/cbs_av1.h @@ -467,6 +467,10 @@ typedef struct CodedBitstreamAV1Context { // AVOptions int operating_point; + // When writing, fix the length in bytes of the obu_size field. + // Writing will fail with an error if an OBU larger than can be + // represented by the fixed size is encountered. + int fixed_obu_size_length; } CodedBitstreamAV1Context; diff --git a/arm/android/third_party/ffmpeg/libavcodec/cbs_av1_syntax_template.c b/arm/android/third_party/ffmpeg/libavcodec/cbs_av1_syntax_template.c index a747e177..3be1f2d3 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/cbs_av1_syntax_template.c +++ b/arm/android/third_party/ffmpeg/libavcodec/cbs_av1_syntax_template.c @@ -82,7 +82,7 @@ static int FUNC(color_config)(CodedBitstreamContext *ctx, RWContext *rw, flag(high_bitdepth); - if (seq_profile == FF_PROFILE_AV1_PROFESSIONAL && + if (seq_profile == AV_PROFILE_AV1_PROFESSIONAL && current->high_bitdepth) { flag(twelve_bit); priv->bit_depth = current->twelve_bit ? 12 : 10; @@ -90,7 +90,7 @@ static int FUNC(color_config)(CodedBitstreamContext *ctx, RWContext *rw, priv->bit_depth = current->high_bitdepth ? 10 : 8; } - if (seq_profile == FF_PROFILE_AV1_HIGH) + if (seq_profile == AV_PROFILE_AV1_HIGH) infer(mono_chrome, 0); else flag(mono_chrome); @@ -126,10 +126,10 @@ static int FUNC(color_config)(CodedBitstreamContext *ctx, RWContext *rw, } else { flag(color_range); - if (seq_profile == FF_PROFILE_AV1_MAIN) { + if (seq_profile == AV_PROFILE_AV1_MAIN) { infer(subsampling_x, 1); infer(subsampling_y, 1); - } else if (seq_profile == FF_PROFILE_AV1_HIGH) { + } else if (seq_profile == AV_PROFILE_AV1_HIGH) { infer(subsampling_x, 0); infer(subsampling_y, 0); } else { @@ -190,8 +190,8 @@ static int FUNC(sequence_header_obu)(CodedBitstreamContext *ctx, RWContext *rw, HEADER("Sequence Header"); - fc(3, seq_profile, FF_PROFILE_AV1_MAIN, - FF_PROFILE_AV1_PROFESSIONAL); + fc(3, seq_profile, AV_PROFILE_AV1_MAIN, + AV_PROFILE_AV1_PROFESSIONAL); flag(still_picture); flag(reduced_still_picture_header); @@ -1028,9 +1028,9 @@ static int FUNC(read_tx_mode)(CodedBitstreamContext *ctx, RWContext *rw, int err; if (priv->coded_lossless) - infer(tx_mode, 0); + infer(tx_mode, AV1_ONLY_4X4); else - increment(tx_mode, 1, 2); + increment(tx_mode, AV1_TX_MODE_LARGEST, AV1_TX_MODE_SELECT); return 0; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/cbs_bsf.c b/arm/android/third_party/ffmpeg/libavcodec/cbs_bsf.c index 069f6e99..b2528548 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/cbs_bsf.c +++ b/arm/android/third_party/ffmpeg/libavcodec/cbs_bsf.c @@ -123,6 +123,11 @@ int ff_cbs_bsf_generic_init(AVBSFContext *bsf, const CBSBSFType *type) if (err < 0) return err; + ctx->output->trace_enable = 1; + ctx->output->trace_level = AV_LOG_TRACE; + ctx->output->trace_context = ctx->output; + ctx->output->trace_write_callback = ff_cbs_trace_write_log; + if (bsf->par_in->extradata) { err = ff_cbs_read_extradata(ctx->input, frag, bsf->par_in); if (err < 0) { diff --git a/arm/android/third_party/ffmpeg/libavcodec/cbs_h2645.c b/arm/android/third_party/ffmpeg/libavcodec/cbs_h2645.c index 34c5d1d3..0a1c8ea4 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/cbs_h2645.c +++ b/arm/android/third_party/ffmpeg/libavcodec/cbs_h2645.c @@ -36,41 +36,38 @@ static int cbs_read_ue_golomb(CodedBitstreamContext *ctx, GetBitContext *gbc, uint32_t *write_to, uint32_t range_min, uint32_t range_max) { - uint32_t value; - int position, i, j; - unsigned int k; - char bits[65]; + uint32_t leading_bits, value; + int max_length, leading_zeroes; - position = get_bits_count(gbc); + CBS_TRACE_READ_START(); - for (i = 0; i < 32; i++) { - if (get_bits_left(gbc) < i + 1) { + max_length = FFMIN(get_bits_left(gbc), 32); + + leading_bits = show_bits_long(gbc, max_length); + if (leading_bits == 0) { + if (max_length >= 32) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid ue-golomb code at " + "%s: more than 31 zeroes.\n", name); + return AVERROR_INVALIDDATA; + } else { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid ue-golomb code at " "%s: bitstream ended.\n", name); return AVERROR_INVALIDDATA; } - k = get_bits1(gbc); - bits[i] = k ? '1' : '0'; - if (k) - break; } - if (i >= 32) { + + leading_zeroes = max_length - 1 - av_log2(leading_bits); + skip_bits_long(gbc, leading_zeroes); + + if (get_bits_left(gbc) < leading_zeroes + 1) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid ue-golomb code at " - "%s: more than 31 zeroes.\n", name); + "%s: bitstream ended.\n", name); return AVERROR_INVALIDDATA; } - value = 1; - for (j = 0; j < i; j++) { - k = get_bits1(gbc); - bits[i + j + 1] = k ? '1' : '0'; - value = value << 1 | k; - } - bits[i + j + 1] = 0; - --value; - if (ctx->trace_enable) - ff_cbs_trace_syntax_element(ctx, position, name, subscripts, - bits, value); + value = get_bits_long(gbc, leading_zeroes + 1) - 1; + + CBS_TRACE_READ_END(); if (value < range_min || value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " @@ -88,45 +85,44 @@ static int cbs_read_se_golomb(CodedBitstreamContext *ctx, GetBitContext *gbc, int32_t *write_to, int32_t range_min, int32_t range_max) { + uint32_t leading_bits, unsigned_value; + int max_length, leading_zeroes; int32_t value; - int position, i, j; - unsigned int k; - uint32_t v; - char bits[65]; - position = get_bits_count(gbc); + CBS_TRACE_READ_START(); - for (i = 0; i < 32; i++) { - if (get_bits_left(gbc) < i + 1) { + max_length = FFMIN(get_bits_left(gbc), 32); + + leading_bits = show_bits_long(gbc, max_length); + if (leading_bits == 0) { + if (max_length >= 32) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid se-golomb code at " + "%s: more than 31 zeroes.\n", name); + return AVERROR_INVALIDDATA; + } else { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid se-golomb code at " "%s: bitstream ended.\n", name); return AVERROR_INVALIDDATA; } - k = get_bits1(gbc); - bits[i] = k ? '1' : '0'; - if (k) - break; } - if (i >= 32) { + + leading_zeroes = max_length - 1 - av_log2(leading_bits); + skip_bits_long(gbc, leading_zeroes); + + if (get_bits_left(gbc) < leading_zeroes + 1) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid se-golomb code at " - "%s: more than 31 zeroes.\n", name); + "%s: bitstream ended.\n", name); return AVERROR_INVALIDDATA; } - v = 1; - for (j = 0; j < i; j++) { - k = get_bits1(gbc); - bits[i + j + 1] = k ? '1' : '0'; - v = v << 1 | k; - } - bits[i + j + 1] = 0; - if (v & 1) - value = -(int32_t)(v / 2); - else - value = v / 2; - if (ctx->trace_enable) - ff_cbs_trace_syntax_element(ctx, position, name, subscripts, - bits, value); + unsigned_value = get_bits_long(gbc, leading_zeroes + 1); + + if (unsigned_value & 1) + value = -(int32_t)(unsigned_value / 2); + else + value = unsigned_value / 2; + + CBS_TRACE_READ_END(); if (value < range_min || value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " @@ -146,6 +142,8 @@ static int cbs_write_ue_golomb(CodedBitstreamContext *ctx, PutBitContext *pbc, { int len; + CBS_TRACE_WRITE_START(); + if (value < range_min || value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " "%"PRIu32", but must be in [%"PRIu32",%"PRIu32"].\n", @@ -158,27 +156,14 @@ static int cbs_write_ue_golomb(CodedBitstreamContext *ctx, PutBitContext *pbc, if (put_bits_left(pbc) < 2 * len + 1) return AVERROR(ENOSPC); - if (ctx->trace_enable) { - char bits[65]; - int i; - - for (i = 0; i < len; i++) - bits[i] = '0'; - bits[len] = '1'; - for (i = 0; i < len; i++) - bits[len + i + 1] = (value + 1) >> (len - i - 1) & 1 ? '1' : '0'; - bits[len + len + 1] = 0; - - ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), - name, subscripts, bits, value); - } - put_bits(pbc, len, 0); if (len + 1 < 32) put_bits(pbc, len + 1, value + 1); else put_bits32(pbc, value + 1); + CBS_TRACE_WRITE_END(); + return 0; } @@ -190,6 +175,8 @@ static int cbs_write_se_golomb(CodedBitstreamContext *ctx, PutBitContext *pbc, int len; uint32_t uvalue; + CBS_TRACE_WRITE_START(); + if (value < range_min || value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " "%"PRId32", but must be in [%"PRId32",%"PRId32"].\n", @@ -209,27 +196,14 @@ static int cbs_write_se_golomb(CodedBitstreamContext *ctx, PutBitContext *pbc, if (put_bits_left(pbc) < 2 * len + 1) return AVERROR(ENOSPC); - if (ctx->trace_enable) { - char bits[65]; - int i; - - for (i = 0; i < len; i++) - bits[i] = '0'; - bits[len] = '1'; - for (i = 0; i < len; i++) - bits[len + i + 1] = (uvalue + 1) >> (len - i - 1) & 1 ? '1' : '0'; - bits[len + len + 1] = 0; - - ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), - name, subscripts, bits, value); - } - put_bits(pbc, len, 0); if (len + 1 < 32) put_bits(pbc, len + 1, uvalue + 1); else put_bits32(pbc, uvalue + 1); + CBS_TRACE_WRITE_END(); + return 0; } @@ -264,8 +238,6 @@ static int cbs_h265_payload_extension_present(GetBitContext *gbc, uint32_t paylo #define u(width, name, range_min, range_max) \ xu(width, name, current->name, range_min, range_max, 0, ) -#define ub(width, name) \ - xu(width, name, current->name, 0, MAX_UINT_BITS(width), 0, ) #define flag(name) ub(1, name) #define ue(name, range_min, range_max) \ xue(name, current->name, range_min, range_max, 0, ) @@ -301,6 +273,12 @@ static int cbs_h265_payload_extension_present(GetBitContext *gbc, uint32_t paylo #define READWRITE read #define RWContext GetBitContext +#define ub(width, name) do { \ + uint32_t value; \ + CHECK(ff_cbs_read_simple_unsigned(ctx, rw, width, #name, \ + &value)); \ + current->name = value; \ + } while (0) #define xu(width, name, var, range_min, range_max, subs, ...) do { \ uint32_t value; \ CHECK(ff_cbs_read_unsigned(ctx, rw, width, #name, \ @@ -379,6 +357,7 @@ static int cbs_h2645_read_more_rbsp_data(GetBitContext *gbc) #undef READ #undef READWRITE #undef RWContext +#undef ub #undef xu #undef xi #undef xue @@ -394,6 +373,11 @@ static int cbs_h2645_read_more_rbsp_data(GetBitContext *gbc) #define READWRITE write #define RWContext PutBitContext +#define ub(width, name) do { \ + uint32_t value = current->name; \ + CHECK(ff_cbs_write_simple_unsigned(ctx, rw, width, #name, \ + value)); \ + } while (0) #define xu(width, name, var, range_min, range_max, subs, ...) do { \ uint32_t value = var; \ CHECK(ff_cbs_write_unsigned(ctx, rw, width, #name, \ @@ -461,6 +445,7 @@ static int cbs_h2645_read_more_rbsp_data(GetBitContext *gbc) #undef WRITE #undef READWRITE #undef RWContext +#undef ub #undef xu #undef xi #undef xue @@ -695,7 +680,7 @@ static int cbs_h2645_split_fragment(CodedBitstreamContext *ctx, int nal_unit_type = bytestream2_get_byte(&gbc) & 0x1f; unsigned int num_nalus = 1; if(nal_unit_type != VVC_DCI_NUT && nal_unit_type != VVC_OPI_NUT) - num_nalus = bytestream2_get_be16u(&gbc); + num_nalus = bytestream2_get_be16(&gbc); start = bytestream2_tell(&gbc); for(i = 0; i < num_nalus; i++) { diff --git a/arm/android/third_party/ffmpeg/libavcodec/cbs_h266.h b/arm/android/third_party/ffmpeg/libavcodec/cbs_h266.h index 0196f46b..3a6f6d96 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/cbs_h266.h +++ b/arm/android/third_party/ffmpeg/libavcodec/cbs_h266.h @@ -666,6 +666,9 @@ typedef struct H266RawPredWeightTable { int8_t luma_offset_l1[15]; int8_t delta_chroma_weight_l1[15][2]; int16_t delta_chroma_offset_l1[15][2]; + + uint8_t num_weights_l0; ///< NumWeightsL0 + uint8_t num_weights_l1; ///< NumWeightsL1 } H266RawPredWeightTable; typedef struct H266RawPictureHeader { @@ -828,6 +831,10 @@ typedef struct H266RawSliceHeader { uint8_t sh_entry_offset_len_minus1; uint32_t sh_entry_point_offset_minus1[VVC_MAX_ENTRY_POINTS]; + // derived values + uint32_t num_entry_points; ///< NumEntryPoints + uint8_t num_ref_idx_active[2]; ///< NumRefIdxActive[] + } H266RawSliceHeader; typedef struct H266RawSlice { diff --git a/arm/android/third_party/ffmpeg/libavcodec/cbs_h266_syntax_template.c b/arm/android/third_party/ffmpeg/libavcodec/cbs_h266_syntax_template.c index dce0216f..aecc4d79 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/cbs_h266_syntax_template.c +++ b/arm/android/third_party/ffmpeg/libavcodec/cbs_h266_syntax_template.c @@ -891,6 +891,8 @@ static int FUNC(vps) (CodedBitstreamContext *ctx, RWContext *rw, } } } + if (!num_output_layers_in_ols[i]) + return AVERROR_INVALIDDATA; } for (i = 1; i < total_num_olss; i++) { int num_layers_in_ols = 0; @@ -1140,6 +1142,8 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw, if (current->sps_num_subpics_minus1 > 0) { int wlen = av_ceil_log2(tmp_width_val); int hlen = av_ceil_log2(tmp_height_val); + infer(sps_subpic_ctu_top_left_x[0], 0); + infer(sps_subpic_ctu_top_left_y[0], 0); if (current->sps_pic_width_max_in_luma_samples > ctb_size_y) ubs(wlen, sps_subpic_width_minus1[0], 1, 0); else @@ -1147,7 +1151,7 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw, if (current->sps_pic_height_max_in_luma_samples > ctb_size_y) ubs(hlen, sps_subpic_height_minus1[0], 1, 0); else - infer(sps_subpic_height_minus1[0], tmp_height_val); + infer(sps_subpic_height_minus1[0], tmp_height_val - 1); if (!current->sps_independent_subpics_flag) { flags(sps_subpic_treated_as_pic_flag[0], 1, 0); flags(sps_loop_filter_across_subpic_enabled_flag[0], 1, 0); @@ -1187,6 +1191,12 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw, } else { int num_subpic_cols = tmp_width_val / (current->sps_subpic_width_minus1[0] + 1); + if (tmp_width_val % (current->sps_subpic_width_minus1[0] + 1) || + tmp_height_val % (current->sps_subpic_width_minus1[0] + 1) || + current->sps_num_subpics_minus1 != + (num_subpic_cols * tmp_height_val / + (current->sps_subpic_height_minus1[0] + 1) - 1)) + return AVERROR_INVALIDDATA; infer(sps_subpic_ctu_top_left_x[i], (i % num_subpic_cols) * (current->sps_subpic_width_minus1[0] + 1)); @@ -1976,6 +1986,7 @@ static int FUNC(pps) (CodedBitstreamContext *ctx, RWContext *rw, 0, current->row_height_val[tile_y] - 1, 1, i); if (current->pps_num_exp_slices_in_tile[i] == 0) { num_slices_in_tile = 1; + current->slice_height_in_ctus[i] = current->row_height_val[tile_y]; slice_top_left_ctu_x[i] = ctu_x; slice_top_left_ctu_y[i] = ctu_y; } else { @@ -2498,7 +2509,6 @@ static int FUNC(pred_weight_table) (CodedBitstreamContext *ctx, RWContext *rw, H266RawPredWeightTable *current) { int err, i, j; - uint8_t num_weights_l0, num_weights_l1; ue(luma_log2_weight_denom, 0, 7); if (sps->sps_chroma_format_idc != 0) { se(delta_chroma_log2_weight_denom, @@ -2507,21 +2517,21 @@ static int FUNC(pred_weight_table) (CodedBitstreamContext *ctx, RWContext *rw, } else { infer(delta_chroma_log2_weight_denom, 0); } - if (pps->pps_wp_info_in_ph_flag) + if (pps->pps_wp_info_in_ph_flag) { ue(num_l0_weights, 0, FFMIN(15, ref_lists->rpl_ref_list[0].num_ref_entries)); - else - infer(num_l0_weights, 0); - num_weights_l0 = pps->pps_wp_info_in_ph_flag ? - current->num_l0_weights : num_ref_idx_active[0]; - for (i = 0; i < num_weights_l0; i++) { + infer(num_weights_l0, current->num_l0_weights); + } else { + infer(num_weights_l0, num_ref_idx_active[0]); + } + for (i = 0; i < current->num_weights_l0; i++) { flags(luma_weight_l0_flag[i], 1, i); } if (sps->sps_chroma_format_idc != 0) { - for (i = 0; i < num_weights_l0; i++) + for (i = 0; i < current->num_weights_l0; i++) flags(chroma_weight_l0_flag[i], 1, i); } - for (i = 0; i < num_weights_l0; i++) { + for (i = 0; i < current->num_weights_l0; i++) { if (current->luma_weight_l0_flag[i]) { ses(delta_luma_weight_l0[i], -128, 127, 1, i); ses(luma_offset_l0[i], -128, 127, 1, i); @@ -2537,28 +2547,26 @@ static int FUNC(pred_weight_table) (CodedBitstreamContext *ctx, RWContext *rw, } } - if (pps->pps_weighted_bipred_flag && pps->pps_wp_info_in_ph_flag && + if (pps->pps_weighted_bipred_flag && ref_lists->rpl_ref_list[1].num_ref_entries > 0) { - ue(num_l1_weights, 0, - FFMIN(15, ref_lists->rpl_ref_list[1].num_ref_entries)); - } - if (!pps->pps_weighted_bipred_flag || - (pps->pps_wp_info_in_ph_flag && - ref_lists->rpl_ref_list[1].num_ref_entries == 0)) { - num_weights_l1 = 0; - } else if (pps->pps_wp_info_in_ph_flag) { - num_weights_l1 = current->num_l1_weights; + if (pps->pps_wp_info_in_ph_flag) { + ue(num_l1_weights, 0, + FFMIN(15, ref_lists->rpl_ref_list[1].num_ref_entries)); + infer(num_weights_l1, current->num_l1_weights); + } else { + infer(num_weights_l1, num_ref_idx_active[1]); + } } else { - num_weights_l1 = num_ref_idx_active[1]; + infer(num_weights_l1, 0); } - for (i = 0; i < num_weights_l1; i++) + for (i = 0; i < current->num_weights_l1; i++) flags(luma_weight_l1_flag[i], 1, i); if (sps->sps_chroma_format_idc != 0) { - for (i = 0; i < num_weights_l1; i++) + for (i = 0; i < current->num_weights_l1; i++) flags(chroma_weight_l1_flag[i], 1, i); } - for (i = 0; i < num_weights_l1; i++) { + for (i = 0; i < current->num_weights_l1; i++) { if (current->luma_weight_l1_flag[i]) { ses(delta_luma_weight_l1[i], -128, 127, 1, i); ses(luma_offset_l1[i], -128, 127, 1, i); @@ -2930,20 +2938,14 @@ static int FUNC(picture_header) (CodedBitstreamContext *ctx, RWContext *rw, infer(ph_sao_chroma_enabled_flag, 0); } - if (pps->pps_dbf_info_in_ph_flag) { + if (pps->pps_dbf_info_in_ph_flag) flag(ph_deblocking_params_present_flag); - if (current->ph_deblocking_params_present_flag) { - if (!pps->pps_deblocking_filter_disabled_flag) { - flag(ph_deblocking_filter_disabled_flag); - } else { - if (pps->pps_deblocking_filter_disabled_flag && - current->ph_deblocking_params_present_flag) { - infer(ph_deblocking_filter_disabled_flag, 0); - } else { - infer(ph_deblocking_filter_disabled_flag, - pps->pps_deblocking_filter_disabled_flag); - } - } + else + infer(ph_deblocking_params_present_flag, 0); + + if (current->ph_deblocking_params_present_flag) { + if (!pps->pps_deblocking_filter_disabled_flag) { + flag(ph_deblocking_filter_disabled_flag); if (!current->ph_deblocking_filter_disabled_flag) { se(ph_luma_beta_offset_div2, -12, 12); se(ph_luma_tc_offset_div2, -12, 12); @@ -2962,25 +2964,19 @@ static int FUNC(picture_header) (CodedBitstreamContext *ctx, RWContext *rw, infer(ph_cr_tc_offset_div2, current->ph_luma_tc_offset_div2); } - } else { - infer(ph_luma_beta_offset_div2, pps->pps_luma_beta_offset_div2); - infer(ph_luma_tc_offset_div2, pps->pps_luma_tc_offset_div2); - if (pps->pps_chroma_tool_offsets_present_flag) { - infer(ph_cb_beta_offset_div2, pps->pps_cb_beta_offset_div2); - infer(ph_cb_tc_offset_div2, pps->pps_cb_tc_offset_div2); - infer(ph_cr_beta_offset_div2, pps->pps_cr_beta_offset_div2); - infer(ph_cr_tc_offset_div2, pps->pps_cr_tc_offset_div2); - } else { - infer(ph_cb_beta_offset_div2, - current->ph_luma_beta_offset_div2); - infer(ph_cb_tc_offset_div2, - current->ph_luma_tc_offset_div2); - infer(ph_cr_beta_offset_div2, - current->ph_luma_beta_offset_div2); - infer(ph_cr_tc_offset_div2, - current->ph_luma_tc_offset_div2); - } } + } else { + infer(ph_deblocking_filter_disabled_flag, 0); + } + } else { + infer(ph_deblocking_filter_disabled_flag, pps->pps_deblocking_filter_disabled_flag); + if (!current->ph_deblocking_filter_disabled_flag) { + infer(ph_luma_beta_offset_div2, pps->pps_luma_beta_offset_div2); + infer(ph_luma_tc_offset_div2, pps->pps_luma_tc_offset_div2); + infer(ph_cb_beta_offset_div2, pps->pps_cb_beta_offset_div2); + infer(ph_cb_tc_offset_div2, pps->pps_cb_tc_offset_div2); + infer(ph_cr_beta_offset_div2, pps->pps_cr_beta_offset_div2); + infer(ph_cr_tc_offset_div2, pps->pps_cr_tc_offset_div2); } } @@ -3103,57 +3099,74 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, if (nal_unit_type == VVC_IDR_W_RADL || nal_unit_type == VVC_IDR_N_LP || nal_unit_type == VVC_CRA_NUT || nal_unit_type == VVC_GDR_NUT) flag(sh_no_output_of_prior_pics_flag); - if (sps->sps_alf_enabled_flag && !pps->pps_alf_info_in_ph_flag) { - flag(sh_alf_enabled_flag); - if (current->sh_alf_enabled_flag) { - ub(3, sh_num_alf_aps_ids_luma); - for (i = 0; i < current->sh_num_alf_aps_ids_luma; i++) - ubs(3, sh_alf_aps_id_luma[i], 1, i); - if (sps->sps_chroma_format_idc != 0) { - flag(sh_alf_cb_enabled_flag); - flag(sh_alf_cr_enabled_flag); - } else { + + if (sps->sps_alf_enabled_flag) { + if (!pps->pps_alf_info_in_ph_flag) { + flag(sh_alf_enabled_flag); + if (current->sh_alf_enabled_flag) { + ub(3, sh_num_alf_aps_ids_luma); + for (i = 0; i < current->sh_num_alf_aps_ids_luma; i++) + ubs(3, sh_alf_aps_id_luma[i], 1, i); + + if (sps->sps_chroma_format_idc != 0) { + flag(sh_alf_cb_enabled_flag); + flag(sh_alf_cr_enabled_flag); + } + if (current->sh_alf_cb_enabled_flag || + current->sh_alf_cr_enabled_flag) { + ub(3, sh_alf_aps_id_chroma); + } + + if (sps->sps_ccalf_enabled_flag) { + flag(sh_alf_cc_cb_enabled_flag); + if (current->sh_alf_cc_cb_enabled_flag) + ub(3, sh_alf_cc_cb_aps_id); + + flag(sh_alf_cc_cr_enabled_flag); + if (current->sh_alf_cc_cr_enabled_flag) + ub(3, sh_alf_cc_cr_aps_id); + } + } + } else { + infer(sh_alf_enabled_flag, ph->ph_alf_enabled_flag); + if (current->sh_alf_enabled_flag) { + infer(sh_num_alf_aps_ids_luma, ph->ph_num_alf_aps_ids_luma); + for (i = 0; i < current->sh_num_alf_aps_ids_luma; i++) + infer(sh_alf_aps_id_luma[i], ph->ph_alf_aps_id_luma[i]); + infer(sh_alf_cb_enabled_flag, ph->ph_alf_cb_enabled_flag); infer(sh_alf_cr_enabled_flag, ph->ph_alf_cr_enabled_flag); - } - if (current->sh_alf_cb_enabled_flag || - current->sh_alf_cr_enabled_flag) - ub(3, sh_alf_aps_id_chroma); - else - infer(sh_alf_aps_id_chroma, ph->ph_alf_aps_id_chroma); - if (sps->sps_ccalf_enabled_flag) { - flag(sh_alf_cc_cb_enabled_flag); - if (current->sh_alf_cc_cb_enabled_flag) - ub(3, sh_alf_cc_cb_aps_id); - else - infer(sh_alf_cc_cb_aps_id, ph->ph_alf_cc_cb_aps_id); - flag(sh_alf_cc_cr_enabled_flag); - if (current->sh_alf_cc_cr_enabled_flag) - ub(3, sh_alf_cc_cr_aps_id); - else - infer(sh_alf_cc_cr_aps_id, ph->ph_alf_cc_cr_aps_id); - } else { - infer(sh_alf_cc_cb_enabled_flag, ph->ph_alf_cc_cb_enabled_flag); - infer(sh_alf_cc_cr_enabled_flag, ph->ph_alf_cc_cr_enabled_flag); - infer(sh_alf_cc_cb_aps_id, ph->ph_alf_cc_cb_aps_id); - infer(sh_alf_cc_cr_aps_id, ph->ph_alf_cc_cr_aps_id); + if (current->sh_alf_cb_enabled_flag ||current->sh_alf_cr_enabled_flag) + infer(sh_alf_aps_id_chroma, ph->ph_alf_aps_id_chroma); + + if (sps->sps_ccalf_enabled_flag) { + infer(sh_alf_cc_cb_enabled_flag, ph->ph_alf_cc_cb_enabled_flag); + if (current->sh_alf_cc_cb_enabled_flag) + infer(sh_alf_cc_cb_aps_id, ph->ph_alf_cc_cb_aps_id); + + infer(sh_alf_cc_cr_enabled_flag, ph->ph_alf_cc_cr_enabled_flag); + if (current->sh_alf_cc_cr_enabled_flag) + infer(sh_alf_cc_cr_aps_id, ph->ph_alf_cc_cr_aps_id); + } } } - } else { - infer(sh_alf_enabled_flag, 0); } - if (ph->ph_lmcs_enabled_flag && - !current->sh_picture_header_in_slice_header_flag) - flag(sh_lmcs_used_flag); - else - infer(sh_lmcs_used_flag, 0); + if (current->sh_picture_header_in_slice_header_flag) { + infer(sh_lmcs_used_flag, ph->ph_lmcs_enabled_flag); + infer(sh_explicit_scaling_list_used_flag, + ph->ph_explicit_scaling_list_enabled_flag); + } else { + if (ph->ph_lmcs_enabled_flag) + flag(sh_lmcs_used_flag); + else + infer(sh_lmcs_used_flag, 0); - if (ph->ph_explicit_scaling_list_enabled_flag && - !current->sh_picture_header_in_slice_header_flag) - flag(sh_explicit_scaling_list_used_flag); - else - infer(sh_explicit_scaling_list_used_flag, 0); + if (ph->ph_explicit_scaling_list_enabled_flag) + flag(sh_explicit_scaling_list_used_flag); + else + infer(sh_explicit_scaling_list_used_flag, 0); + } if (!pps->pps_rpl_info_in_ph_flag && ((nal_unit_type != VVC_IDR_W_RADL && @@ -3180,53 +3193,51 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, } else { infer(sh_num_ref_idx_active_override_flag, 1); } + + for (i = 0; i < 2; i++) { + if (current->sh_slice_type == VVC_SLICE_TYPE_B || + (current->sh_slice_type == VVC_SLICE_TYPE_P && i == 0)) { + if (current->sh_num_ref_idx_active_override_flag) { + current->num_ref_idx_active[i] = current->sh_num_ref_idx_active_minus1[i] + 1; + } else { + current->num_ref_idx_active[i] = + FFMIN(ref_pic_lists->rpl_ref_list[i].num_ref_entries, + pps->pps_num_ref_idx_default_active_minus1[i] + 1); + } + } else { + current->num_ref_idx_active[i] = 0; + } + } + if (current->sh_slice_type != VVC_SLICE_TYPE_I) { if (pps->pps_cabac_init_present_flag) flag(sh_cabac_init_flag); else infer(sh_cabac_init_flag, 0); if (ph->ph_temporal_mvp_enabled_flag && !pps->pps_rpl_info_in_ph_flag) { - uint8_t num_ref_idx_active[2]; - for (i = 0; i < 2; i++) { - if (current->sh_slice_type == VVC_SLICE_TYPE_B || - (current->sh_slice_type == VVC_SLICE_TYPE_P && i == 0)) { - if (current->sh_num_ref_idx_active_override_flag) { - num_ref_idx_active[i] = - current->sh_num_ref_idx_active_minus1[i] + 1; - } else { - num_ref_idx_active[i] = - FFMIN(ref_pic_lists->rpl_ref_list[i].num_ref_entries, - pps->pps_num_ref_idx_default_active_minus1[i] + 1); - } - } else { - num_ref_idx_active[i] = 0; - } - } - if (current->sh_slice_type == VVC_SLICE_TYPE_B) flag(sh_collocated_from_l0_flag); else infer(sh_collocated_from_l0_flag, 1); if ((current->sh_collocated_from_l0_flag && - num_ref_idx_active[0] > 1) || + current->num_ref_idx_active[0] > 1) || (!current->sh_collocated_from_l0_flag && - num_ref_idx_active[1] > 1)) { + current->num_ref_idx_active[1] > 1)) { unsigned int idx = current->sh_collocated_from_l0_flag ? 0 : 1; - ue(sh_collocated_ref_idx, 0, num_ref_idx_active[idx] - 1); + ue(sh_collocated_ref_idx, 0, current->num_ref_idx_active[idx] - 1); } else { infer(sh_collocated_ref_idx, 0); } - if (!pps->pps_wp_info_in_ph_flag && - ((pps->pps_weighted_pred_flag && - current->sh_slice_type == VVC_SLICE_TYPE_P) || - (pps->pps_weighted_bipred_flag && - current->sh_slice_type == VVC_SLICE_TYPE_B))) { - CHECK(FUNC(pred_weight_table) (ctx, rw, sps, pps, ref_pic_lists, - num_ref_idx_active, - ¤t->sh_pred_weight_table)); - } } - + if (!pps->pps_wp_info_in_ph_flag && + ((pps->pps_weighted_pred_flag && + current->sh_slice_type == VVC_SLICE_TYPE_P) || + (pps->pps_weighted_bipred_flag && + current->sh_slice_type == VVC_SLICE_TYPE_B))) { + CHECK(FUNC(pred_weight_table) (ctx, rw, sps, pps, ref_pic_lists, + current->num_ref_idx_active, + ¤t->sh_pred_weight_table)); + } } qp_bd_offset = 6 * sps->sps_bitdepth_minus8; if (!pps->pps_qp_delta_info_in_ph_flag) @@ -3296,9 +3307,7 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, if (!pps->pps_deblocking_filter_disabled_flag) flag(sh_deblocking_filter_disabled_flag); else - infer(sh_deblocking_filter_disabled_flag, - !(pps->pps_deblocking_filter_disabled_flag && - current->sh_deblocking_params_present_flag)); + infer(sh_deblocking_filter_disabled_flag, 0); if (!current->sh_deblocking_filter_disabled_flag) { se(sh_luma_beta_offset_div2, -12, 12); se(sh_luma_tc_offset_div2, -12, 12); @@ -3315,22 +3324,16 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, current->sh_luma_beta_offset_div2); infer(sh_cr_tc_offset_div2, current->sh_luma_tc_offset_div2); } - } else { + } + } else { + infer(sh_deblocking_filter_disabled_flag, ph->ph_deblocking_filter_disabled_flag); + if (!current->sh_deblocking_filter_disabled_flag) { infer(sh_luma_beta_offset_div2, ph->ph_luma_beta_offset_div2); infer(sh_luma_tc_offset_div2, ph->ph_luma_tc_offset_div2); - if (pps->pps_chroma_tool_offsets_present_flag) { - infer(sh_cb_beta_offset_div2, ph->ph_cb_beta_offset_div2); - infer(sh_cb_tc_offset_div2, ph->ph_cb_tc_offset_div2); - infer(sh_cr_beta_offset_div2, ph->ph_cr_beta_offset_div2); - infer(sh_cr_tc_offset_div2, ph->ph_cr_beta_offset_div2); - } else { - infer(sh_cb_beta_offset_div2, - current->sh_luma_beta_offset_div2); - infer(sh_cb_tc_offset_div2, current->sh_luma_tc_offset_div2); - infer(sh_cr_beta_offset_div2, - current->sh_luma_beta_offset_div2); - infer(sh_cr_tc_offset_div2, current->sh_luma_tc_offset_div2); - } + infer(sh_cb_beta_offset_div2, ph->ph_cb_beta_offset_div2); + infer(sh_cb_tc_offset_div2, ph->ph_cb_tc_offset_div2); + infer(sh_cr_beta_offset_div2, ph->ph_cr_beta_offset_div2); + infer(sh_cr_tc_offset_div2, ph->ph_cr_tc_offset_div2); } } @@ -3368,8 +3371,9 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, for (i = 0; i < current->sh_slice_header_extension_length; i++) us(8, sh_slice_header_extension_data_byte[i], 0x00, 0xff, 1, i); } + + current->num_entry_points = 0; if (sps->sps_entry_point_offsets_present_flag) { - int num_entry_points = 0; uint8_t entropy_sync = sps->sps_entropy_coding_sync_enabled_flag; int height; if (pps->pps_rect_slice_flag) { @@ -3386,7 +3390,7 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, else height = pps->pps_slice_height_in_tiles_minus1[slice_idx] + 1; - num_entry_points = width_in_tiles * height; + current->num_entry_points = width_in_tiles * height; } else { int tile_idx; int tile_y; @@ -3396,18 +3400,18 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, current->sh_num_tiles_in_slice_minus1; tile_idx++) { tile_y = tile_idx / pps->num_tile_rows; height = pps->row_height_val[tile_y]; - num_entry_points += (entropy_sync ? height : 1); + current->num_entry_points += (entropy_sync ? height : 1); } } - num_entry_points--; - if (num_entry_points > VVC_MAX_ENTRY_POINTS) { + current->num_entry_points--; + if (current->num_entry_points > VVC_MAX_ENTRY_POINTS) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Too many entry points: " - "%" PRIu16 ".\n", num_entry_points); + "%" PRIu16 ".\n", current->num_entry_points); return AVERROR_PATCHWELCOME; } - if (num_entry_points > 0) { + if (current->num_entry_points > 0) { ue(sh_entry_offset_len_minus1, 0, 31); - for (i = 0; i < num_entry_points; i++) { + for (i = 0; i < current->num_entry_points; i++) { ubs(current->sh_entry_offset_len_minus1 + 1, sh_entry_point_offset_minus1[i], 1, i); } diff --git a/arm/android/third_party/ffmpeg/libavcodec/cbs_internal.h b/arm/android/third_party/ffmpeg/libavcodec/cbs_internal.h index b752d646..285deb40 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/cbs_internal.h +++ b/arm/android/third_party/ffmpeg/libavcodec/cbs_internal.h @@ -157,24 +157,29 @@ typedef struct CodedBitstreamType { void ff_cbs_trace_header(CodedBitstreamContext *ctx, const char *name); -void ff_cbs_trace_syntax_element(CodedBitstreamContext *ctx, int position, - const char *name, const int *subscripts, - const char *bitstring, int64_t value); - // Helper functions for read/write of common bitstream elements, including -// generation of trace output. +// generation of trace output. The simple functions are equivalent to +// their non-simple counterparts except that their range is unrestricted +// (i.e. only limited by the amount of bits used) and they lack +// the ability to use subscripts. int ff_cbs_read_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, int width, const char *name, const int *subscripts, uint32_t *write_to, uint32_t range_min, uint32_t range_max); +int ff_cbs_read_simple_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, + int width, const char *name, uint32_t *write_to); + int ff_cbs_write_unsigned(CodedBitstreamContext *ctx, PutBitContext *pbc, int width, const char *name, const int *subscripts, uint32_t value, uint32_t range_min, uint32_t range_max); +int ff_cbs_write_simple_unsigned(CodedBitstreamContext *ctx, PutBitContext *pbc, + int width, const char *name, uint32_t value); + int ff_cbs_read_signed(CodedBitstreamContext *ctx, GetBitContext *gbc, int width, const char *name, const int *subscripts, int32_t *write_to, @@ -197,6 +202,87 @@ int ff_cbs_write_signed(CodedBitstreamContext *ctx, PutBitContext *pbc, // range_min in the above functions. #define MIN_INT_BITS(length) (-(INT64_C(1) << ((length) - 1))) + +// Start of a syntax element during read tracing. +#define CBS_TRACE_READ_START() \ + GetBitContext trace_start; \ + do { \ + if (ctx->trace_enable) \ + trace_start = *gbc; \ + } while (0) + +// End of a syntax element for tracing, make callback. +#define CBS_TRACE_READ_END() \ + do { \ + if (ctx->trace_enable) { \ + int start_position = get_bits_count(&trace_start); \ + int end_position = get_bits_count(gbc); \ + av_assert0(start_position <= end_position); \ + ctx->trace_read_callback(ctx->trace_context, &trace_start, \ + end_position - start_position, \ + name, subscripts, value); \ + } \ + } while (0) + +// End of a syntax element with no subscript entries. +#define CBS_TRACE_READ_END_NO_SUBSCRIPTS() \ + do { \ + const int *subscripts = NULL; \ + CBS_TRACE_READ_END(); \ + } while (0) + +// End of a syntax element which is made up of subelements which +// are aleady traced, so we are only showing the value. +#define CBS_TRACE_READ_END_VALUE_ONLY() \ + do { \ + if (ctx->trace_enable) { \ + ctx->trace_read_callback(ctx->trace_context, &trace_start, 0, \ + name, subscripts, value); \ + } \ + } while (0) + +// Start of a syntax element during write tracing. +#define CBS_TRACE_WRITE_START() \ + int start_position; \ + do { \ + if (ctx->trace_enable) \ + start_position = put_bits_count(pbc);; \ + } while (0) + +// End of a syntax element for tracing, make callback. +#define CBS_TRACE_WRITE_END() \ + do { \ + if (ctx->trace_enable) { \ + int end_position = put_bits_count(pbc); \ + av_assert0(start_position <= end_position); \ + ctx->trace_write_callback(ctx->trace_context, pbc, \ + end_position - start_position, \ + name, subscripts, value); \ + } \ + } while (0) + +// End of a syntax element with no subscript entries. +#define CBS_TRACE_WRITE_END_NO_SUBSCRIPTS() \ + do { \ + const int *subscripts = NULL; \ + CBS_TRACE_WRITE_END(); \ + } while (0) + +// End of a syntax element which is made up of subelements which are +// aleady traced, so we are only showing the value. This forges a +// PutBitContext to point to the position of the start of the syntax +// element, but the other state doesn't matter because length is zero. +#define CBS_TRACE_WRITE_END_VALUE_ONLY() \ + do { \ + if (ctx->trace_enable) { \ + PutBitContext tmp; \ + init_put_bits(&tmp, pbc->buf, start_position); \ + skip_put_bits(&tmp, start_position); \ + ctx->trace_write_callback(ctx->trace_context, &tmp, 0, \ + name, subscripts, value); \ + } \ + } while (0) + #define TYPE_LIST(...) { __VA_ARGS__ } #define CBS_UNIT_TYPE_POD(type_, structure) { \ .nb_unit_types = 1, \ diff --git a/arm/android/third_party/ffmpeg/libavcodec/cbs_mpeg2.c b/arm/android/third_party/ffmpeg/libavcodec/cbs_mpeg2.c index 04b0c7f8..37fc28a4 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/cbs_mpeg2.c +++ b/arm/android/third_party/ffmpeg/libavcodec/cbs_mpeg2.c @@ -40,8 +40,6 @@ #define SUBSCRIPTS(subs, ...) (subs > 0 ? ((int[subs + 1]){ subs, __VA_ARGS__ }) : NULL) -#define ui(width, name) \ - xui(width, name, current->name, 0, MAX_UINT_BITS(width), 0, ) #define uir(width, name) \ xui(width, name, current->name, 1, MAX_UINT_BITS(width), 0, ) #define uis(width, name, subs, ...) \ @@ -65,6 +63,12 @@ #define READWRITE read #define RWContext GetBitContext +#define ui(width, name) do { \ + uint32_t value; \ + CHECK(ff_cbs_read_simple_unsigned(ctx, rw, width, #name, \ + &value)); \ + current->name = value; \ + } while (0) #define xuia(width, string, var, range_min, range_max, subs, ...) do { \ uint32_t value; \ CHECK(ff_cbs_read_unsigned(ctx, rw, width, string, \ @@ -95,6 +99,7 @@ #undef READ #undef READWRITE #undef RWContext +#undef ui #undef xuia #undef xsi #undef nextbits @@ -105,6 +110,11 @@ #define READWRITE write #define RWContext PutBitContext +#define ui(width, name) do { \ + CHECK(ff_cbs_write_simple_unsigned(ctx, rw, width, #name, \ + current->name)); \ + } while (0) + #define xuia(width, string, var, range_min, range_max, subs, ...) do { \ CHECK(ff_cbs_write_unsigned(ctx, rw, width, string, \ SUBSCRIPTS(subs, __VA_ARGS__), \ @@ -134,6 +144,7 @@ #undef WRITE #undef READWRITE #undef RWContext +#undef ui #undef xuia #undef xsi #undef nextbits diff --git a/arm/android/third_party/ffmpeg/libavcodec/cbs_vp9.c b/arm/android/third_party/ffmpeg/libavcodec/cbs_vp9.c index 184fdcad..816d06da 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/cbs_vp9.c +++ b/arm/android/third_party/ffmpeg/libavcodec/cbs_vp9.c @@ -28,11 +28,10 @@ static int cbs_vp9_read_s(CodedBitstreamContext *ctx, GetBitContext *gbc, const int *subscripts, int32_t *write_to) { uint32_t magnitude; - int position, sign; + int sign; int32_t value; - if (ctx->trace_enable) - position = get_bits_count(gbc); + CBS_TRACE_READ_START(); if (get_bits_left(gbc) < width + 1) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid signed value at " @@ -44,17 +43,7 @@ static int cbs_vp9_read_s(CodedBitstreamContext *ctx, GetBitContext *gbc, sign = get_bits1(gbc); value = sign ? -(int32_t)magnitude : magnitude; - if (ctx->trace_enable) { - char bits[33]; - int i; - for (i = 0; i < width; i++) - bits[i] = magnitude >> (width - i - 1) & 1 ? '1' : '0'; - bits[i] = sign ? '1' : '0'; - bits[i + 1] = 0; - - ff_cbs_trace_syntax_element(ctx, position, name, subscripts, - bits, value); - } + CBS_TRACE_READ_END(); *write_to = value; return 0; @@ -67,27 +56,19 @@ static int cbs_vp9_write_s(CodedBitstreamContext *ctx, PutBitContext *pbc, uint32_t magnitude; int sign; + CBS_TRACE_WRITE_START(); + if (put_bits_left(pbc) < width + 1) return AVERROR(ENOSPC); sign = value < 0; magnitude = sign ? -value : value; - if (ctx->trace_enable) { - char bits[33]; - int i; - for (i = 0; i < width; i++) - bits[i] = magnitude >> (width - i - 1) & 1 ? '1' : '0'; - bits[i] = sign ? '1' : '0'; - bits[i + 1] = 0; - - ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), - name, subscripts, bits, value); - } - put_bits(pbc, width, magnitude); put_bits(pbc, 1, sign); + CBS_TRACE_WRITE_END(); + return 0; } @@ -96,32 +77,24 @@ static int cbs_vp9_read_increment(CodedBitstreamContext *ctx, GetBitContext *gbc const char *name, uint32_t *write_to) { uint32_t value; - int position, i; - char bits[8]; - av_assert0(range_min <= range_max && range_max - range_min < sizeof(bits) - 1); - if (ctx->trace_enable) - position = get_bits_count(gbc); + CBS_TRACE_READ_START(); - for (i = 0, value = range_min; value < range_max;) { + av_assert0(range_min <= range_max && range_max - range_min < 32); + + for (value = range_min; value < range_max;) { if (get_bits_left(gbc) < 1) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid increment value at " "%s: bitstream ended.\n", name); return AVERROR_INVALIDDATA; } - if (get_bits1(gbc)) { - bits[i++] = '1'; + if (get_bits1(gbc)) ++value; - } else { - bits[i++] = '0'; + else break; - } } - if (ctx->trace_enable) { - bits[i] = 0; - ff_cbs_trace_syntax_element(ctx, position, name, NULL, bits, value); - } + CBS_TRACE_READ_END_NO_SUBSCRIPTS(); *write_to = value; return 0; @@ -133,6 +106,8 @@ static int cbs_vp9_write_increment(CodedBitstreamContext *ctx, PutBitContext *pb { int len; + CBS_TRACE_WRITE_START(); + av_assert0(range_min <= range_max && range_max - range_min < 8); if (value < range_min || value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " @@ -148,23 +123,11 @@ static int cbs_vp9_write_increment(CodedBitstreamContext *ctx, PutBitContext *pb if (put_bits_left(pbc) < len) return AVERROR(ENOSPC); - if (ctx->trace_enable) { - char bits[8]; - int i; - for (i = 0; i < len; i++) { - if (range_min + i == value) - bits[i] = '0'; - else - bits[i] = '1'; - } - bits[i] = 0; - ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), - name, NULL, bits, value); - } - if (len > 0) put_bits(pbc, len, (1 << len) - 1 - (value != range_max)); + CBS_TRACE_WRITE_END_NO_SUBSCRIPTS(); + return 0; } @@ -173,13 +136,12 @@ static int cbs_vp9_read_le(CodedBitstreamContext *ctx, GetBitContext *gbc, const int *subscripts, uint32_t *write_to) { uint32_t value; - int position, b; + int b; + + CBS_TRACE_READ_START(); av_assert0(width % 8 == 0); - if (ctx->trace_enable) - position = get_bits_count(gbc); - if (get_bits_left(gbc) < width) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid le value at " "%s: bitstream ended.\n", name); @@ -190,17 +152,7 @@ static int cbs_vp9_read_le(CodedBitstreamContext *ctx, GetBitContext *gbc, for (b = 0; b < width; b += 8) value |= get_bits(gbc, 8) << b; - if (ctx->trace_enable) { - char bits[33]; - int i; - for (b = 0; b < width; b += 8) - for (i = 0; i < 8; i++) - bits[b + i] = value >> (b + i) & 1 ? '1' : '0'; - bits[b] = 0; - - ff_cbs_trace_syntax_element(ctx, position, name, subscripts, - bits, value); - } + CBS_TRACE_READ_END(); *write_to = value; return 0; @@ -212,26 +164,18 @@ static int cbs_vp9_write_le(CodedBitstreamContext *ctx, PutBitContext *pbc, { int b; + CBS_TRACE_WRITE_START(); + av_assert0(width % 8 == 0); if (put_bits_left(pbc) < width) return AVERROR(ENOSPC); - if (ctx->trace_enable) { - char bits[33]; - int i; - for (b = 0; b < width; b += 8) - for (i = 0; i < 8; i++) - bits[b + i] = value >> (b + i) & 1 ? '1' : '0'; - bits[b] = 0; - - ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), - name, subscripts, bits, value); - } - for (b = 0; b < width; b += 8) put_bits(pbc, 8, value >> b & 0xff); + CBS_TRACE_WRITE_END(); + return 0; } @@ -251,8 +195,6 @@ static int cbs_vp9_write_le(CodedBitstreamContext *ctx, PutBitContext *pbc, #define SUBSCRIPTS(subs, ...) (subs > 0 ? ((int[subs + 1]){ subs, __VA_ARGS__ }) : NULL) -#define f(width, name) \ - xf(width, name, current->name, 0, ) #define s(width, name) \ xs(width, name, current->name, 0, ) #define fs(width, name, subs, ...) \ @@ -264,6 +206,12 @@ static int cbs_vp9_write_le(CodedBitstreamContext *ctx, PutBitContext *pbc, #define READWRITE read #define RWContext GetBitContext +#define f(width, name) do { \ + uint32_t value; \ + CHECK(ff_cbs_read_simple_unsigned(ctx, rw, width, #name, \ + &value)); \ + current->name = value; \ + } while (0) #define xf(width, name, var, subs, ...) do { \ uint32_t value; \ CHECK(ff_cbs_read_unsigned(ctx, rw, width, #name, \ @@ -329,6 +277,7 @@ static int cbs_vp9_write_le(CodedBitstreamContext *ctx, PutBitContext *pbc, #undef READ #undef READWRITE #undef RWContext +#undef f #undef xf #undef xs #undef increment @@ -344,6 +293,10 @@ static int cbs_vp9_write_le(CodedBitstreamContext *ctx, PutBitContext *pbc, #define READWRITE write #define RWContext PutBitContext +#define f(width, name) do { \ + CHECK(ff_cbs_write_simple_unsigned(ctx, rw, width, #name, \ + current->name)); \ + } while (0) #define xf(width, name, var, subs, ...) do { \ CHECK(ff_cbs_write_unsigned(ctx, rw, width, #name, \ SUBSCRIPTS(subs, __VA_ARGS__), \ @@ -396,6 +349,7 @@ static int cbs_vp9_write_le(CodedBitstreamContext *ctx, PutBitContext *pbc, #undef WRITE #undef READWRITE #undef RWContext +#undef f #undef xf #undef xs #undef increment diff --git a/arm/android/third_party/ffmpeg/libavcodec/cdgraphics.c b/arm/android/third_party/ffmpeg/libavcodec/cdgraphics.c index 0c5022a5..f33f7fbf 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/cdgraphics.c +++ b/arm/android/third_party/ffmpeg/libavcodec/cdgraphics.c @@ -90,19 +90,19 @@ static av_cold int cdg_decode_init(AVCodecContext *avctx) static void cdg_border_preset(CDGraphicsContext *cc, uint8_t *data) { - int y; - int lsize = cc->frame->linesize[0]; + ptrdiff_t lsize = cc->frame->linesize[0]; uint8_t *buf = cc->frame->data[0]; int color = data[0] & 0x0F; if (!(data[1] & 0x0F)) { /// fill the top and bottom borders - memset(buf, color, CDG_BORDER_HEIGHT * lsize); - memset(buf + (CDG_FULL_HEIGHT - CDG_BORDER_HEIGHT) * lsize, - color, CDG_BORDER_HEIGHT * lsize); + for (int y = 0; y < CDG_BORDER_HEIGHT; y++) + memset(buf + y * lsize, color, cc->frame->width); + for (int y = CDG_FULL_HEIGHT-CDG_BORDER_HEIGHT; y < CDG_FULL_HEIGHT; y++) + memset(buf + y * lsize, color, cc->frame->width); /// fill the side borders - for (y = CDG_BORDER_HEIGHT; y < CDG_FULL_HEIGHT - CDG_BORDER_HEIGHT; y++) { + for (int y = CDG_BORDER_HEIGHT; y < CDG_FULL_HEIGHT - CDG_BORDER_HEIGHT; y++) { memset(buf + y * lsize, color, CDG_BORDER_WIDTH); memset(buf + CDG_FULL_WIDTH - CDG_BORDER_WIDTH + y * lsize, color, CDG_BORDER_WIDTH); @@ -138,7 +138,7 @@ static int cdg_tile_block(CDGraphicsContext *cc, uint8_t *data, int b) int color; int x, y; int ai; - int stride = cc->frame->linesize[0]; + ptrdiff_t stride = cc->frame->linesize[0]; uint8_t *buf = cc->frame->data[0]; ri = (data[2] & 0x1F) * CDG_TILE_HEIGHT + cc->vscroll; @@ -210,7 +210,7 @@ static void cdg_scroll(CDGraphicsContext *cc, uint8_t *data, int color; int hscmd, h_off, hinc, vscmd, v_off, vinc; int y; - int stride = cc->frame->linesize[0]; + ptrdiff_t stride = cc->frame->linesize[0]; uint8_t *in = cc->frame->data[0]; uint8_t *out = new_frame->data[0]; @@ -249,11 +249,11 @@ static void cdg_scroll(CDGraphicsContext *cc, uint8_t *data, if (vinc > 0) cdg_fill_wrapper(0, 0, out, 0, CDG_FULL_HEIGHT - vinc, in, color, - stride, vinc, stride, roll_over); + FFABS(stride), vinc, stride, roll_over); else if (vinc < 0) cdg_fill_wrapper(0, CDG_FULL_HEIGHT + vinc, out, 0, 0, in, color, - stride, -1 * vinc, stride, roll_over); + FFABS(stride), -1 * vinc, stride, roll_over); if (hinc > 0) cdg_fill_wrapper(0, 0, out, @@ -290,7 +290,8 @@ static int cdg_decode_frame(AVCodecContext *avctx, AVFrame *frame, if ((ret = ff_reget_buffer(avctx, cc->frame, 0)) < 0) return ret; if (!cc->cleared) { - memset(cc->frame->data[0], 0, cc->frame->linesize[0] * avctx->height); + for (int y = 0; y < avctx->height; y++) + memset(cc->frame->data[0] + y * cc->frame->linesize[0], 0, avctx->width); memset(cc->frame->data[1], 0, AVPALETTE_SIZE); cc->cleared = 1; } @@ -304,9 +305,11 @@ static int cdg_decode_frame(AVCodecContext *avctx, AVFrame *frame, if ((command & CDG_MASK) == CDG_COMMAND) { switch (inst) { case CDG_INST_MEMORY_PRESET: - if (!(cdg_data[1] & 0x0F)) - memset(cc->frame->data[0], cdg_data[0] & 0x0F, - cc->frame->linesize[0] * CDG_FULL_HEIGHT); + if (!(cdg_data[1] & 0x0F)) { + for (int y = 0; y < avctx->height; y++) + memset(cc->frame->data[0] + y * cc->frame->linesize[0], + cdg_data[0] & 0x0F, avctx->width); + } break; case CDG_INST_LOAD_PAL_LO: case CDG_INST_LOAD_PAL_HIGH: @@ -344,8 +347,7 @@ static int cdg_decode_frame(AVCodecContext *avctx, AVFrame *frame, return ret; cdg_scroll(cc, cdg_data, frame, inst == CDG_INST_SCROLL_COPY); - av_frame_unref(cc->frame); - ret = av_frame_ref(cc->frame, frame); + ret = av_frame_replace(cc->frame, frame); if (ret < 0) return ret; break; @@ -377,7 +379,8 @@ static void cdg_decode_flush(AVCodecContext *avctx) if (!cc->frame->data[0]) return; - memset(cc->frame->data[0], 0, cc->frame->linesize[0] * avctx->height); + for (int y = 0; y < avctx->height; y++) + memset(cc->frame->data[0] + y * cc->frame->linesize[0], 0, avctx->width); if (!avctx->frame_num) memset(cc->frame->data[1], 0, AVPALETTE_SIZE); } diff --git a/arm/android/third_party/ffmpeg/libavcodec/cdxl.c b/arm/android/third_party/ffmpeg/libavcodec/cdxl.c index 085ae97c..3c892ada 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/cdxl.c +++ b/arm/android/third_party/ffmpeg/libavcodec/cdxl.c @@ -125,9 +125,10 @@ static void chunky2chunky(CDXLVideoContext *c, int linesize, uint8_t *out) } } -static void import_format(CDXLVideoContext *c, int linesize, uint8_t *out) +static void import_format(CDXLVideoContext *c, ptrdiff_t linesize, uint8_t *out) { - memset(out, 0, linesize * c->avctx->height); + for (int y = 0; y < c->avctx->height; y++) + memset(out + y * linesize, 0, c->avctx->width); switch (c->format) { case BIT_PLANAR: diff --git a/arm/android/third_party/ffmpeg/libavcodec/celp_math.h b/arm/android/third_party/ffmpeg/libavcodec/celp_math.h index 18888a42..99a04707 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/celp_math.h +++ b/arm/android/third_party/ffmpeg/libavcodec/celp_math.h @@ -78,7 +78,7 @@ int64_t ff_dot_product(const int16_t *a, const int16_t *b, int length); * * @return value << offset, if offset>=0; value >> -offset - otherwise */ -static inline int bidir_sal(int value, int offset) +static inline unsigned bidir_sal(unsigned value, int offset) { if(offset < 0) return value >> -offset; else return value << offset; diff --git a/arm/android/third_party/ffmpeg/libavcodec/cfhddata.c b/arm/android/third_party/ffmpeg/libavcodec/cfhddata.c index fd5cc817..a3948a14 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/cfhddata.c +++ b/arm/android/third_party/ffmpeg/libavcodec/cfhddata.c @@ -150,7 +150,7 @@ static av_cold int cfhd_init_vlc(CFHD_RL_VLC_ELEM out[], unsigned out_size, } } - ret = ff_init_vlc_from_lengths(&vlc, VLC_BITS, j, + ret = ff_vlc_init_from_lengths(&vlc, VLC_BITS, j, &tmp[0].len, sizeof(tmp[0]), NULL, 0, 0, 0, 0, logctx); if (ret < 0) @@ -173,7 +173,7 @@ static av_cold int cfhd_init_vlc(CFHD_RL_VLC_ELEM out[], unsigned out_size, out[i].level = level; out[i].run = run; } - ff_free_vlc(&vlc); + ff_vlc_free(&vlc); return 0; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/clearvideo.c b/arm/android/third_party/ffmpeg/libavcodec/clearvideo.c index f84e3e6e..7f2c1c5f 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/clearvideo.c +++ b/arm/android/third_party/ffmpeg/libavcodec/clearvideo.c @@ -637,8 +637,8 @@ static av_cold void build_vlc(VLC *vlc, const uint8_t counts[16], } vlc->table = &vlc_buf[*offset]; vlc->table_allocated = FF_ARRAY_ELEMS(vlc_buf) - *offset; - ff_init_vlc_from_lengths(vlc, CLV_VLC_BITS, num, lens, 1, - *syms, 2, 2, 0, INIT_VLC_STATIC_OVERLONG, NULL); + ff_vlc_init_from_lengths(vlc, CLV_VLC_BITS, num, lens, 1, + *syms, 2, 2, 0, VLC_INIT_STATIC_OVERLONG, NULL); *syms += num; *offset += vlc->table_size; } @@ -647,10 +647,10 @@ static av_cold void clv_init_static(void) { const uint16_t *mv_syms = clv_mv_syms, *bias_syms = clv_bias_syms; - INIT_VLC_STATIC_FROM_LENGTHS(&dc_vlc, CLV_VLC_BITS, NUM_DC_CODES, + VLC_INIT_STATIC_FROM_LENGTHS(&dc_vlc, CLV_VLC_BITS, NUM_DC_CODES, clv_dc_lens, 1, clv_dc_syms, 1, 1, -63, 0, 1104); - INIT_VLC_STATIC_FROM_LENGTHS(&ac_vlc, CLV_VLC_BITS, NUM_AC_CODES, + VLC_INIT_STATIC_FROM_LENGTHS(&ac_vlc, CLV_VLC_BITS, NUM_AC_CODES, clv_ac_bits, 1, clv_ac_syms, 2, 2, 0, 0, 554); for (unsigned i = 0, j = 0, k = 0, offset = 0;; i++) { @@ -663,10 +663,10 @@ static av_cold void clv_init_static(void) if (0x1B7 & (1 << i)) { lev[i].flags_cb.table = &vlc_buf[offset]; lev[i].flags_cb.table_allocated = FF_ARRAY_ELEMS(vlc_buf) - offset; - ff_init_vlc_from_lengths(&lev[i].flags_cb, CLV_VLC_BITS, 16, + ff_vlc_init_from_lengths(&lev[i].flags_cb, CLV_VLC_BITS, 16, clv_flags_bits[j], 1, clv_flags_syms[j], 1, 1, - 0, INIT_VLC_STATIC_OVERLONG, NULL); + 0, VLC_INIT_STATIC_OVERLONG, NULL); offset += lev[i].flags_cb.table_size; build_vlc(&lev[i + 1].bias_cb, clv_bias_len_counts[j], diff --git a/arm/android/third_party/ffmpeg/libavcodec/cllc.c b/arm/android/third_party/ffmpeg/libavcodec/cllc.c index 52cb86e5..0c6ae13d 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/cllc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/cllc.c @@ -77,7 +77,7 @@ static int read_code_table(CLLCContext *ctx, GetBitContext *gb, VLC *vlc) } } - return ff_init_vlc_from_lengths(vlc, VLC_BITS, count, bits, 1, + return ff_vlc_init_from_lengths(vlc, VLC_BITS, count, bits, 1, symbols, 1, 1, 0, 0, ctx->avctx); } @@ -235,7 +235,7 @@ static int decode_argb_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic) ret = read_code_table(ctx, gb, &vlc[i]); if (ret < 0) { for (j = 0; j < i; j++) - ff_free_vlc(&vlc[j]); + ff_vlc_free(&vlc[j]); av_log(ctx->avctx, AV_LOG_ERROR, "Could not read code table %d.\n", i); @@ -251,7 +251,7 @@ static int decode_argb_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic) } for (i = 0; i < 4; i++) - ff_free_vlc(&vlc[i]); + ff_vlc_free(&vlc[i]); return 0; } @@ -278,7 +278,7 @@ static int decode_rgb24_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic) ret = read_code_table(ctx, gb, &vlc[i]); if (ret < 0) { for (j = 0; j < i; j++) - ff_free_vlc(&vlc[j]); + ff_vlc_free(&vlc[j]); av_log(ctx->avctx, AV_LOG_ERROR, "Could not read code table %d.\n", i); @@ -295,7 +295,7 @@ static int decode_rgb24_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic) } for (i = 0; i < 3; i++) - ff_free_vlc(&vlc[i]); + ff_vlc_free(&vlc[i]); return 0; } @@ -331,7 +331,7 @@ static int decode_yuv_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic) ret = read_code_table(ctx, gb, &vlc[i]); if (ret < 0) { for (j = 0; j < i; j++) - ff_free_vlc(&vlc[j]); + ff_vlc_free(&vlc[j]); av_log(ctx->avctx, AV_LOG_ERROR, "Could not read code table %d.\n", i); @@ -350,7 +350,7 @@ static int decode_yuv_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic) } for (i = 0; i < 2; i++) - ff_free_vlc(&vlc[i]); + ff_vlc_free(&vlc[i]); return 0; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/codec.h b/arm/android/third_party/ffmpeg/libavcodec/codec.h index 7a932d75..8034f1a5 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/codec.h +++ b/arm/android/third_party/ffmpeg/libavcodec/codec.h @@ -217,7 +217,7 @@ typedef struct AVCodec { const uint64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 #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} + const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {AV_PROFILE_UNKNOWN} /** * Group name of the codec implementation. diff --git a/arm/android/third_party/ffmpeg/libavcodec/codec_desc.c b/arm/android/third_party/ffmpeg/libavcodec/codec_desc.c index 4406dd83..f556bb94 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/codec_desc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/codec_desc.c @@ -3413,6 +3413,13 @@ static const AVCodecDescriptor codec_descriptors[] = { .long_name = NULL_IF_CONFIG_SMALL("AC-4"), .props = AV_CODEC_PROP_LOSSY, }, + { + .id = AV_CODEC_ID_OSQ, + .type = AVMEDIA_TYPE_AUDIO, + .name = "osq", + .long_name = NULL_IF_CONFIG_SMALL("OSQ (Original Sound Quality)"), + .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS, + }, /* subtitle codecs */ { diff --git a/arm/android/third_party/ffmpeg/libavcodec/codec_desc.h b/arm/android/third_party/ffmpeg/libavcodec/codec_desc.h index dd449111..96afd202 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/codec_desc.h +++ b/arm/android/third_party/ffmpeg/libavcodec/codec_desc.h @@ -60,7 +60,7 @@ typedef struct AVCodecDescriptor { const char *const *mime_types; /** * If non-NULL, an array of profiles recognized for this codec. - * Terminated with FF_PROFILE_UNKNOWN. + * Terminated with AV_PROFILE_UNKNOWN. */ const struct AVProfile *profiles; } AVCodecDescriptor; diff --git a/arm/android/third_party/ffmpeg/libavcodec/codec_id.h b/arm/android/third_party/ffmpeg/libavcodec/codec_id.h index a5a0cb85..29b410b8 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/codec_id.h +++ b/arm/android/third_party/ffmpeg/libavcodec/codec_id.h @@ -543,6 +543,7 @@ enum AVCodecID { AV_CODEC_ID_WAVARC, AV_CODEC_ID_RKA, AV_CODEC_ID_AC4, + AV_CODEC_ID_OSQ, /* subtitle codecs */ AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. diff --git a/arm/android/third_party/ffmpeg/libavcodec/codec_par.c b/arm/android/third_party/ffmpeg/libavcodec/codec_par.c index 775c1870..e4e4cd48 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/codec_par.c +++ b/arm/android/third_party/ffmpeg/libavcodec/codec_par.c @@ -47,8 +47,8 @@ static void codec_parameters_reset(AVCodecParameters *par) par->chroma_location = AVCHROMA_LOC_UNSPECIFIED; par->sample_aspect_ratio = (AVRational){ 0, 1 }; par->framerate = (AVRational){ 0, 1 }; - par->profile = FF_PROFILE_UNKNOWN; - par->level = FF_LEVEL_UNKNOWN; + par->profile = AV_PROFILE_UNKNOWN; + par->level = AV_LEVEL_UNKNOWN; } AVCodecParameters *avcodec_parameters_alloc(void) @@ -253,8 +253,8 @@ FF_ENABLE_DEPRECATION_WARNINGS break; } + av_freep(&codec->extradata); if (par->extradata) { - av_freep(&codec->extradata); codec->extradata = av_mallocz(par->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE); if (!codec->extradata) return AVERROR(ENOMEM); diff --git a/arm/android/third_party/ffmpeg/libavcodec/codec_par.h b/arm/android/third_party/ffmpeg/libavcodec/codec_par.h index add90fdb..c1679ea0 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/codec_par.h +++ b/arm/android/third_party/ffmpeg/libavcodec/codec_par.h @@ -29,21 +29,13 @@ #include "libavutil/pixfmt.h" #include "codec_id.h" +#include "defs.h" /** * @addtogroup lavc_core * @{ */ -enum AVFieldOrder { - AV_FIELD_UNKNOWN, - AV_FIELD_PROGRESSIVE, - AV_FIELD_TT, ///< Top coded_first, top displayed first - AV_FIELD_BB, ///< Bottom coded first, bottom displayed first - AV_FIELD_TB, ///< Top coded first, bottom displayed first - AV_FIELD_BT, ///< Bottom coded first, top displayed first -}; - /** * This struct describes the properties of an encoded stream. * diff --git a/arm/android/third_party/ffmpeg/libavcodec/cook.c b/arm/android/third_party/ffmpeg/libavcodec/cook.c index 7d05afcc..705213de 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/cook.c +++ b/arm/android/third_party/ffmpeg/libavcodec/cook.c @@ -208,7 +208,7 @@ static av_cold int build_vlc(VLC *vlc, int nb_bits, const uint8_t counts[16], for (unsigned count = num + counts[i]; num < count; num++) lens[num] = i + 1; - return ff_init_vlc_from_lengths(vlc, nb_bits, num, lens, 1, + return ff_vlc_init_from_lengths(vlc, nb_bits, num, lens, 1, syms, symbol_size, symbol_size, offset, 0, logctx); } @@ -341,11 +341,11 @@ static av_cold int cook_decode_close(AVCodecContext *avctx) /* Free the VLC tables. */ for (i = 0; i < 13; i++) - ff_free_vlc(&q->envelope_quant_index[i]); + ff_vlc_free(&q->envelope_quant_index[i]); for (i = 0; i < 7; i++) - ff_free_vlc(&q->sqvh[i]); + ff_vlc_free(&q->sqvh[i]); for (i = 0; i < q->num_subpackets; i++) - ff_free_vlc(&q->subpacket[i].channel_coupling); + ff_vlc_free(&q->subpacket[i].channel_coupling); av_log(avctx, AV_LOG_DEBUG, "Memory deallocated.\n"); diff --git a/arm/android/third_party/ffmpeg/libavcodec/cscd.c b/arm/android/third_party/ffmpeg/libavcodec/cscd.c index 23dd2df9..685cf18c 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/cscd.c +++ b/arm/android/third_party/ffmpeg/libavcodec/cscd.c @@ -70,6 +70,9 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, int buf_size = avpkt->size; CamStudioContext *c = avctx->priv_data; int ret; + int bpp = avctx->bits_per_coded_sample / 8; + int bugdelta = FFALIGN(avctx->width * bpp, 4) * avctx->height + - (avctx->width & ~3) * bpp * avctx->height; if (buf_size < 2) { av_log(avctx, AV_LOG_ERROR, "coded frame too small\n"); @@ -83,7 +86,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, switch ((buf[0] >> 1) & 7) { case 0: { // lzo compression int outlen = c->decomp_size, inlen = buf_size - 2; - if (av_lzo1x_decode(c->decomp_buf, &outlen, &buf[2], &inlen) || outlen) { + if (av_lzo1x_decode(c->decomp_buf, &outlen, &buf[2], &inlen) || (outlen && outlen != bugdelta)) { av_log(avctx, AV_LOG_ERROR, "error during lzo decompression\n"); return AVERROR_INVALIDDATA; } @@ -92,7 +95,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, case 1: { // zlib compression #if CONFIG_ZLIB unsigned long dlen = c->decomp_size; - if (uncompress(c->decomp_buf, &dlen, &buf[2], buf_size - 2) != Z_OK || dlen != c->decomp_size) { + if (uncompress(c->decomp_buf, &dlen, &buf[2], buf_size - 2) != Z_OK || (dlen != c->decomp_size && dlen != c->decomp_size - bugdelta)) { av_log(avctx, AV_LOG_ERROR, "error during zlib decompression\n"); return AVERROR_INVALIDDATA; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/cuviddec.c b/arm/android/third_party/ffmpeg/libavcodec/cuviddec.c index 814bc53f..da37207c 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/cuviddec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/cuviddec.c @@ -360,6 +360,11 @@ static int CUDAAPI cuvid_handle_video_sequence(void *opaque, CUVIDEOFORMAT* form } } + if(ctx->cuparseinfo.ulMaxNumDecodeSurfaces != cuinfo.ulNumDecodeSurfaces) { + ctx->cuparseinfo.ulMaxNumDecodeSurfaces = cuinfo.ulNumDecodeSurfaces; + return cuinfo.ulNumDecodeSurfaces; + } + return 1; } @@ -1022,7 +1027,7 @@ static av_cold int cuvid_decode_init(AVCodecContext *avctx) goto error; } - ctx->cuparseinfo.ulMaxNumDecodeSurfaces = ctx->nb_surfaces; + ctx->cuparseinfo.ulMaxNumDecodeSurfaces = 1; ctx->cuparseinfo.ulMaxDisplayDelay = (avctx->flags & AV_CODEC_FLAG_LOW_DELAY) ? 0 : CUVID_MAX_DISPLAY_DELAY; ctx->cuparseinfo.pUserData = avctx; ctx->cuparseinfo.pfnSequenceCallback = cuvid_handle_video_sequence; diff --git a/arm/android/third_party/ffmpeg/libavcodec/dca_core.c b/arm/android/third_party/ffmpeg/libavcodec/dca_core.c index c50d005a..60508fab 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/dca_core.c +++ b/arm/android/third_party/ffmpeg/libavcodec/dca_core.c @@ -19,6 +19,7 @@ */ #include "libavutil/channel_layout.h" +#include "libavutil/emms.h" #include "dcaadpcm.h" #include "dcadec.h" #include "dcadata.h" @@ -2386,13 +2387,13 @@ int ff_dca_core_filter_frame(DCACoreDecoder *s, AVFrame *frame) // Set profile, bit rate, etc if (s->ext_audio_mask & DCA_EXSS_MASK) - avctx->profile = FF_PROFILE_DTS_HD_HRA; + avctx->profile = AV_PROFILE_DTS_HD_HRA; else if (s->ext_audio_mask & (DCA_CSS_XXCH | DCA_CSS_XCH)) - avctx->profile = FF_PROFILE_DTS_ES; + avctx->profile = AV_PROFILE_DTS_ES; else if (s->ext_audio_mask & DCA_CSS_X96) - avctx->profile = FF_PROFILE_DTS_96_24; + avctx->profile = AV_PROFILE_DTS_96_24; else - avctx->profile = FF_PROFILE_DTS; + avctx->profile = AV_PROFILE_DTS; if (s->bit_rate > 3 && !(s->ext_audio_mask & DCA_EXSS_MASK)) avctx->bit_rate = s->bit_rate; diff --git a/arm/android/third_party/ffmpeg/libavcodec/dca_lbr.c b/arm/android/third_party/ffmpeg/libavcodec/dca_lbr.c index bef0054d..c9c5c0f8 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/dca_lbr.c +++ b/arm/android/third_party/ffmpeg/libavcodec/dca_lbr.c @@ -1744,7 +1744,7 @@ int ff_dca_lbr_filter_frame(DCALbrDecoder *s, AVFrame *frame) avctx->sample_rate = s->sample_rate; avctx->sample_fmt = AV_SAMPLE_FMT_FLTP; avctx->bits_per_raw_sample = 0; - avctx->profile = FF_PROFILE_DTS_EXPRESS; + avctx->profile = AV_PROFILE_DTS_EXPRESS; avctx->bit_rate = s->bit_rate_scaled; if (s->flags & LBR_FLAG_LFE_PRESENT) { diff --git a/arm/android/third_party/ffmpeg/libavcodec/dca_parser.c b/arm/android/third_party/ffmpeg/libavcodec/dca_parser.c index 3148397b..eb0ef55d 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/dca_parser.c +++ b/arm/android/third_party/ffmpeg/libavcodec/dca_parser.c @@ -228,7 +228,7 @@ static int dca_parse_params(DCAParseContext *pc1, const uint8_t *buf, *sample_rate = ff_dca_sampling_freqs[pc1->sr_code]; *duration = 1024 << ff_dca_freq_ranges[pc1->sr_code]; - *profile = FF_PROFILE_DTS_EXPRESS; + *profile = AV_PROFILE_DTS_EXPRESS; return 0; } @@ -253,7 +253,7 @@ static int dca_parse_params(DCAParseContext *pc1, const uint8_t *buf, *sample_rate = asset->max_sample_rate; *duration = (1 + (*sample_rate > 96000)) << nsamples_log2; - *profile = FF_PROFILE_DTS_HD_MA; + *profile = AV_PROFILE_DTS_HD_MA; return 0; } @@ -268,18 +268,18 @@ static int dca_parse_params(DCAParseContext *pc1, const uint8_t *buf, *duration = h.npcmblocks * DCA_PCMBLOCK_SAMPLES; *sample_rate = ff_dca_sample_rates[h.sr_code]; - if (*profile != FF_PROFILE_UNKNOWN) + if (*profile != AV_PROFILE_UNKNOWN) return 0; - *profile = FF_PROFILE_DTS; + *profile = AV_PROFILE_DTS; if (h.ext_audio_present) { switch (h.ext_audio_type) { case DCA_EXT_AUDIO_XCH: case DCA_EXT_AUDIO_XXCH: - *profile = FF_PROFILE_DTS_ES; + *profile = AV_PROFILE_DTS_ES; break; case DCA_EXT_AUDIO_X96: - *profile = FF_PROFILE_DTS_96_24; + *profile = AV_PROFILE_DTS_96_24; break; } } @@ -296,9 +296,9 @@ static int dca_parse_params(DCAParseContext *pc1, const uint8_t *buf, return 0; if (asset->extension_mask & DCA_EXSS_XLL) - *profile = FF_PROFILE_DTS_HD_MA; + *profile = AV_PROFILE_DTS_HD_MA; else if (asset->extension_mask & (DCA_EXSS_XBR | DCA_EXSS_XXCH | DCA_EXSS_X96)) - *profile = FF_PROFILE_DTS_HD_HRA; + *profile = AV_PROFILE_DTS_HD_HRA; return 0; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/dca_xll.c b/arm/android/third_party/ffmpeg/libavcodec/dca_xll.c index b8cf37a3..15f9bd91 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/dca_xll.c +++ b/arm/android/third_party/ffmpeg/libavcodec/dca_xll.c @@ -1446,11 +1446,11 @@ int ff_dca_xll_filter_frame(DCAXllDecoder *s, AVFrame *frame) } if (s->x_imax_syncword_present) { - avctx->profile = FF_PROFILE_DTS_HD_MA_X_IMAX; + avctx->profile = AV_PROFILE_DTS_HD_MA_X_IMAX; } else if (s->x_syncword_present) { - avctx->profile = FF_PROFILE_DTS_HD_MA_X; + avctx->profile = AV_PROFILE_DTS_HD_MA_X; } else { - avctx->profile = FF_PROFILE_DTS_HD_MA; + avctx->profile = AV_PROFILE_DTS_HD_MA; } avctx->bits_per_raw_sample = p->storage_bit_res; diff --git a/arm/android/third_party/ffmpeg/libavcodec/dcadec.c b/arm/android/third_party/ffmpeg/libavcodec/dcadec.c index 3e3e3053..1fee49cf 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/dcadec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/dcadec.c @@ -217,11 +217,10 @@ static int dcadec_decode_frame(AVCodecContext *avctx, AVFrame *frame, if (asset && (asset->extension_mask & DCA_EXSS_XLL)) { if ((ret = ff_dca_xll_parse(&s->xll, input, asset)) < 0) { // Conceal XLL synchronization error - if (ret == AVERROR(EAGAIN) - && (prev_packet & DCA_PACKET_XLL) - && (s->packet & DCA_PACKET_CORE)) - s->packet |= DCA_PACKET_XLL | DCA_PACKET_RECOVERY; - else if (ret == AVERROR(ENOMEM) || (avctx->err_recognition & AV_EF_EXPLODE)) + if (ret == AVERROR(EAGAIN)) { + if ((prev_packet & DCA_PACKET_XLL) && (s->packet & DCA_PACKET_CORE)) + s->packet |= DCA_PACKET_XLL | DCA_PACKET_RECOVERY; + } else if (ret == AVERROR(ENOMEM) || (avctx->err_recognition & AV_EF_EXPLODE)) return ret; } else { s->packet |= DCA_PACKET_XLL; diff --git a/arm/android/third_party/ffmpeg/libavcodec/dcahuff.c b/arm/android/third_party/ffmpeg/libavcodec/dcahuff.c index af3a6e53..7c4b1d82 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/dcahuff.c +++ b/arm/android/third_party/ffmpeg/libavcodec/dcahuff.c @@ -796,9 +796,9 @@ av_cold void ff_dca_init_vlcs(void) do { \ vlc.table = &dca_table[offset]; \ vlc.table_allocated = FF_ARRAY_ELEMS(dca_table) - offset; \ - ff_init_vlc_from_lengths(&vlc, nb_bits, nb_codes, &src_table[0][1], 2, \ + ff_vlc_init_from_lengths(&vlc, nb_bits, nb_codes, &src_table[0][1], 2, \ &src_table[0][0], 2, 1, entry_offset, \ - INIT_VLC_STATIC_OVERLONG, NULL); \ + VLC_INIT_STATIC_OVERLONG, NULL); \ offset += vlc.table_size; \ src_table += nb_codes; \ } while (0) @@ -822,9 +822,9 @@ av_cold void ff_dca_init_vlcs(void) do { \ vlc.table = &dca_table[offset]; \ vlc.table_allocated = FF_ARRAY_ELEMS(dca_table) - offset; \ - ff_init_vlc_from_lengths(&vlc, nb_bits, nb_codes, &src_table[0][1], 2, \ + ff_vlc_init_from_lengths(&vlc, nb_bits, nb_codes, &src_table[0][1], 2, \ &src_table[0][0], 2, 1, entry_offset, \ - INIT_VLC_STATIC_OVERLONG | INIT_VLC_LE,\ + VLC_INIT_STATIC_OVERLONG | VLC_INIT_LE,\ NULL); \ offset += vlc.table_size; \ src_table += nb_codes; \ diff --git a/arm/android/third_party/ffmpeg/libavcodec/dct.h b/arm/android/third_party/ffmpeg/libavcodec/dct.h index 0a03e256..17c881a6 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/dct.h +++ b/arm/android/third_party/ffmpeg/libavcodec/dct.h @@ -21,44 +21,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(AVCODEC_DCT_H) && (!defined(FFT_FLOAT) || FFT_FLOAT) +#ifndef AVCODEC_DCT_H #define AVCODEC_DCT_H #include #include -#include "rdft.h" - -struct DCTContext { - int nbits; - int inverse; - RDFTContext rdft; - const float *costab; - FFTSample *csc2; - void (*dct_calc)(struct DCTContext *s, FFTSample *data); - void (*dct32)(FFTSample *out, const FFTSample *in); -}; - -/** - * Set up DCT. - * @param nbits size of the input array: - * (1 << nbits) for DCT-II, DCT-III and DST-I - * (1 << nbits) + 1 for DCT-I - * - * @note the first element of the input of DST-I is ignored - */ -int ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType type); -void ff_dct_end (DCTContext *s); - -void ff_dct_init_x86(DCTContext *s); - -void ff_fdct_ifast(int16_t *data); -void ff_fdct_ifast248(int16_t *data); -void ff_jpeg_fdct_islow_8(int16_t *data); -void ff_jpeg_fdct_islow_10(int16_t *data); -void ff_fdct248_islow_8(int16_t *data); -void ff_fdct248_islow_10(int16_t *data); - void ff_j_rev_dct(int16_t *data); void ff_j_rev_dct4(int16_t *data); void ff_j_rev_dct2(int16_t *data); diff --git a/arm/android/third_party/ffmpeg/libavcodec/decode.c b/arm/android/third_party/ffmpeg/libavcodec/decode.c index f0e6acc0..8f94678e 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/decode.c +++ b/arm/android/third_party/ffmpeg/libavcodec/decode.c @@ -32,6 +32,7 @@ #include "libavutil/bprint.h" #include "libavutil/channel_layout.h" #include "libavutil/common.h" +#include "libavutil/emms.h" #include "libavutil/fifo.h" #include "libavutil/frame.h" #include "libavutil/hwcontext.h" @@ -44,8 +45,10 @@ #include "avcodec_internal.h" #include "bytestream.h" #include "bsf.h" +#include "codec_desc.h" #include "codec_internal.h" #include "decode.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "internal.h" #include "packet_internal.h" @@ -104,15 +107,26 @@ FF_DISABLE_DEPRECATION_WARNINGS ret = AVERROR_INVALIDDATA; goto fail2; } - avctx->channels = val; + av_channel_layout_uninit(&avctx->ch_layout); + avctx->ch_layout.nb_channels = val; + avctx->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; size -= 4; } if (flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) { if (size < 8) goto fail; - avctx->channel_layout = bytestream_get_le64(&data); + av_channel_layout_uninit(&avctx->ch_layout); + ret = av_channel_layout_from_mask(&avctx->ch_layout, bytestream_get_le64(&data)); + if (ret < 0) + goto fail2; size -= 8; } + if (flags & (AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT | + AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT)) { + avctx->channels = avctx->ch_layout.nb_channels; + avctx->channel_layout = (avctx->ch_layout.order == AV_CHANNEL_ORDER_NATIVE) ? + avctx->ch_layout.u.mask : 0; + } FF_ENABLE_DEPRECATION_WARNINGS #endif if (flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) { @@ -444,6 +458,9 @@ FF_ENABLE_DEPRECATION_WARNINGS if (ret == AVERROR(EAGAIN)) av_frame_unref(frame); + // FF_CODEC_CB_TYPE_DECODE decoders must not return AVERROR EAGAIN + // code later will add AVERROR(EAGAIN) to a pointer + av_assert0(consumed != AVERROR(EAGAIN)); if (consumed < 0) ret = consumed; if (consumed >= 0 && avctx->codec->type == AVMEDIA_TYPE_VIDEO) @@ -520,7 +537,9 @@ static int detect_colorspace(AVCodecContext *avctx, AVFrame *frame) if (!profile) return AVERROR_INVALIDDATA; - ret = ff_icc_profile_read_primaries(&avci->icc, profile, &coeffs); + ret = ff_icc_profile_sanitize(&avci->icc, profile); + if (!ret) + ret = ff_icc_profile_read_primaries(&avci->icc, profile, &coeffs); if (!ret) ret = ff_icc_profile_detect_transfer(&avci->icc, profile, &trc); cmsCloseProfile(profile); @@ -1148,7 +1167,7 @@ int avcodec_get_hw_frames_parameters(AVCodecContext *avctx, { AVBufferRef *frames_ref = NULL; const AVCodecHWConfigInternal *hw_config; - const AVHWAccel *hwa; + const FFHWAccel *hwa; int i, ret; for (i = 0;; i++) { @@ -1200,14 +1219,14 @@ int avcodec_get_hw_frames_parameters(AVCodecContext *avctx, } static int hwaccel_init(AVCodecContext *avctx, - const AVHWAccel *hwaccel) + const FFHWAccel *hwaccel) { int err; - if (hwaccel->capabilities & AV_HWACCEL_CODEC_CAP_EXPERIMENTAL && + if (hwaccel->p.capabilities & AV_HWACCEL_CODEC_CAP_EXPERIMENTAL && avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) { av_log(avctx, AV_LOG_WARNING, "Ignoring experimental hwaccel: %s\n", - hwaccel->name); + hwaccel->p.name); return AVERROR_PATCHWELCOME; } @@ -1218,13 +1237,13 @@ static int hwaccel_init(AVCodecContext *avctx, return AVERROR(ENOMEM); } - avctx->hwaccel = hwaccel; + avctx->hwaccel = &hwaccel->p; if (hwaccel->init) { err = hwaccel->init(avctx); if (err < 0) { av_log(avctx, AV_LOG_ERROR, "Failed setup for format %s: " "hwaccel initialisation returned error.\n", - av_get_pix_fmt_name(hwaccel->pix_fmt)); + av_get_pix_fmt_name(hwaccel->p.pix_fmt)); av_freep(&avctx->internal->hwaccel_priv_data); avctx->hwaccel = NULL; return err; @@ -1236,8 +1255,8 @@ static int hwaccel_init(AVCodecContext *avctx, void ff_hwaccel_uninit(AVCodecContext *avctx) { - if (avctx->hwaccel && avctx->hwaccel->uninit) - avctx->hwaccel->uninit(avctx); + if (FF_HW_HAS_CB(avctx, uninit)) + FF_HW_SIMPLE_CALL(avctx, uninit); av_freep(&avctx->internal->hwaccel_priv_data); @@ -1460,10 +1479,11 @@ FF_ENABLE_DEPRECATION_WARNINGS int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame) { - const AVPacket *pkt = avctx->internal->last_pkt_props; int ret; if (!(ffcodec(avctx->codec)->caps_internal & FF_CODEC_CAP_SETS_FRAME_PROPS)) { + const AVPacket *pkt = avctx->internal->last_pkt_props; + ret = ff_decode_frame_props_from_pkt(avctx, frame, pkt); if (ret < 0) return ret; @@ -1558,7 +1578,7 @@ int ff_attach_decode_data(AVFrame *frame) int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags) { - const AVHWAccel *hwaccel = avctx->hwaccel; + const FFHWAccel *hwaccel = ffhwaccel(avctx->hwaccel); int override_dimensions = 1; int ret; @@ -1777,24 +1797,36 @@ int ff_copy_palette(void *dst, const AVPacket *src, void *logctx) return 0; } -AVBufferRef *ff_hwaccel_frame_priv_alloc(AVCodecContext *avctx, - const AVHWAccel *hwaccel) +int ff_hwaccel_frame_priv_alloc(AVCodecContext *avctx, void **hwaccel_picture_private, + AVBufferRef **hwaccel_priv_buf) { + const FFHWAccel *hwaccel = ffhwaccel(avctx->hwaccel); AVBufferRef *ref; - AVHWFramesContext *frames_ctx = (AVHWFramesContext *)avctx->hw_frames_ctx->data; - uint8_t *data = av_mallocz(hwaccel->frame_priv_data_size); + AVHWFramesContext *frames_ctx; + uint8_t *data; + + if (!hwaccel || !hwaccel->frame_priv_data_size) + return 0; + + av_assert0(!*hwaccel_picture_private); + data = av_mallocz(hwaccel->frame_priv_data_size); if (!data) - return NULL; + return AVERROR(ENOMEM); + + frames_ctx = (AVHWFramesContext *)avctx->hw_frames_ctx->data; ref = av_buffer_create(data, hwaccel->frame_priv_data_size, hwaccel->free_frame_priv, frames_ctx->device_ctx, 0); if (!ref) { av_free(data); - return NULL; + return AVERROR(ENOMEM); } - return ref; + *hwaccel_priv_buf = ref; + *hwaccel_picture_private = ref->data; + + return 0; } void ff_decode_flush_buffers(AVCodecContext *avctx) diff --git a/arm/android/third_party/ffmpeg/libavcodec/decode.h b/arm/android/third_party/ffmpeg/libavcodec/decode.h index 2b9fe599..a52152e4 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/decode.h +++ b/arm/android/third_party/ffmpeg/libavcodec/decode.h @@ -140,14 +140,17 @@ int ff_side_data_update_matrix_encoding(AVFrame *frame, enum AVMatrixEncoding matrix_encoding); /** - * Allocate a hwaccel frame private data and create an AVBufferRef - * from it. + * Allocate a hwaccel frame private data if the provided avctx + * uses a hwaccel method that needs it. The private data will + * be refcounted via the AVBuffer API (if allocated). * - * @param avctx The codec context which to attach as an opaque value - * @param hwaccel The hwaccel for which to allocate - * @return The allocated buffer + * @param avctx The codec context + * @param hwaccel_picture_private Pointer to return hwaccel_picture_private + * @param hwaccel_priv_buf Pointer to return the AVBufferRef owning + * hwaccel_picture_private + * @return 0 on success, < 0 on error */ -AVBufferRef *ff_hwaccel_frame_priv_alloc(AVCodecContext *avctx, - const AVHWAccel *hwaccel); +int ff_hwaccel_frame_priv_alloc(AVCodecContext *avctx, void **hwaccel_picture_private, + AVBufferRef **hwaccel_priv_buf); #endif /* AVCODEC_DECODE_H */ diff --git a/arm/android/third_party/ffmpeg/libavcodec/defs.h b/arm/android/third_party/ffmpeg/libavcodec/defs.h index fbe3254d..00d840ec 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/defs.h +++ b/arm/android/third_party/ffmpeg/libavcodec/defs.h @@ -61,6 +61,149 @@ #define FF_COMPLIANCE_UNOFFICIAL -1 ///< Allow unofficial extensions #define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things. + +#define AV_PROFILE_UNKNOWN -99 +#define AV_PROFILE_RESERVED -100 + +#define AV_PROFILE_AAC_MAIN 0 +#define AV_PROFILE_AAC_LOW 1 +#define AV_PROFILE_AAC_SSR 2 +#define AV_PROFILE_AAC_LTP 3 +#define AV_PROFILE_AAC_HE 4 +#define AV_PROFILE_AAC_HE_V2 28 +#define AV_PROFILE_AAC_LD 22 +#define AV_PROFILE_AAC_ELD 38 +#define AV_PROFILE_MPEG2_AAC_LOW 128 +#define AV_PROFILE_MPEG2_AAC_HE 131 + +#define AV_PROFILE_DNXHD 0 +#define AV_PROFILE_DNXHR_LB 1 +#define AV_PROFILE_DNXHR_SQ 2 +#define AV_PROFILE_DNXHR_HQ 3 +#define AV_PROFILE_DNXHR_HQX 4 +#define AV_PROFILE_DNXHR_444 5 + +#define AV_PROFILE_DTS 20 +#define AV_PROFILE_DTS_ES 30 +#define AV_PROFILE_DTS_96_24 40 +#define AV_PROFILE_DTS_HD_HRA 50 +#define AV_PROFILE_DTS_HD_MA 60 +#define AV_PROFILE_DTS_EXPRESS 70 +#define AV_PROFILE_DTS_HD_MA_X 61 +#define AV_PROFILE_DTS_HD_MA_X_IMAX 62 + +#define AV_PROFILE_EAC3_DDP_ATMOS 30 + +#define AV_PROFILE_TRUEHD_ATMOS 30 + +#define AV_PROFILE_MPEG2_422 0 +#define AV_PROFILE_MPEG2_HIGH 1 +#define AV_PROFILE_MPEG2_SS 2 +#define AV_PROFILE_MPEG2_SNR_SCALABLE 3 +#define AV_PROFILE_MPEG2_MAIN 4 +#define AV_PROFILE_MPEG2_SIMPLE 5 + +#define AV_PROFILE_H264_CONSTRAINED (1<<9) // 8+1; constraint_set1_flag +#define AV_PROFILE_H264_INTRA (1<<11) // 8+3; constraint_set3_flag + +#define AV_PROFILE_H264_BASELINE 66 +#define AV_PROFILE_H264_CONSTRAINED_BASELINE (66|AV_PROFILE_H264_CONSTRAINED) +#define AV_PROFILE_H264_MAIN 77 +#define AV_PROFILE_H264_EXTENDED 88 +#define AV_PROFILE_H264_HIGH 100 +#define AV_PROFILE_H264_HIGH_10 110 +#define AV_PROFILE_H264_HIGH_10_INTRA (110|AV_PROFILE_H264_INTRA) +#define AV_PROFILE_H264_MULTIVIEW_HIGH 118 +#define AV_PROFILE_H264_HIGH_422 122 +#define AV_PROFILE_H264_HIGH_422_INTRA (122|AV_PROFILE_H264_INTRA) +#define AV_PROFILE_H264_STEREO_HIGH 128 +#define AV_PROFILE_H264_HIGH_444 144 +#define AV_PROFILE_H264_HIGH_444_PREDICTIVE 244 +#define AV_PROFILE_H264_HIGH_444_INTRA (244|AV_PROFILE_H264_INTRA) +#define AV_PROFILE_H264_CAVLC_444 44 + +#define AV_PROFILE_VC1_SIMPLE 0 +#define AV_PROFILE_VC1_MAIN 1 +#define AV_PROFILE_VC1_COMPLEX 2 +#define AV_PROFILE_VC1_ADVANCED 3 + +#define AV_PROFILE_MPEG4_SIMPLE 0 +#define AV_PROFILE_MPEG4_SIMPLE_SCALABLE 1 +#define AV_PROFILE_MPEG4_CORE 2 +#define AV_PROFILE_MPEG4_MAIN 3 +#define AV_PROFILE_MPEG4_N_BIT 4 +#define AV_PROFILE_MPEG4_SCALABLE_TEXTURE 5 +#define AV_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION 6 +#define AV_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE 7 +#define AV_PROFILE_MPEG4_HYBRID 8 +#define AV_PROFILE_MPEG4_ADVANCED_REAL_TIME 9 +#define AV_PROFILE_MPEG4_CORE_SCALABLE 10 +#define AV_PROFILE_MPEG4_ADVANCED_CODING 11 +#define AV_PROFILE_MPEG4_ADVANCED_CORE 12 +#define AV_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13 +#define AV_PROFILE_MPEG4_SIMPLE_STUDIO 14 +#define AV_PROFILE_MPEG4_ADVANCED_SIMPLE 15 + +#define AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 1 +#define AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 2 +#define AV_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION 32768 +#define AV_PROFILE_JPEG2000_DCINEMA_2K 3 +#define AV_PROFILE_JPEG2000_DCINEMA_4K 4 + +#define AV_PROFILE_VP9_0 0 +#define AV_PROFILE_VP9_1 1 +#define AV_PROFILE_VP9_2 2 +#define AV_PROFILE_VP9_3 3 + +#define AV_PROFILE_HEVC_MAIN 1 +#define AV_PROFILE_HEVC_MAIN_10 2 +#define AV_PROFILE_HEVC_MAIN_STILL_PICTURE 3 +#define AV_PROFILE_HEVC_REXT 4 +#define AV_PROFILE_HEVC_SCC 9 + +#define AV_PROFILE_VVC_MAIN_10 1 +#define AV_PROFILE_VVC_MAIN_10_444 33 + +#define AV_PROFILE_AV1_MAIN 0 +#define AV_PROFILE_AV1_HIGH 1 +#define AV_PROFILE_AV1_PROFESSIONAL 2 + +#define AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT 0xc0 +#define AV_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT 0xc1 +#define AV_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT 0xc2 +#define AV_PROFILE_MJPEG_HUFFMAN_LOSSLESS 0xc3 +#define AV_PROFILE_MJPEG_JPEG_LS 0xf7 + +#define AV_PROFILE_SBC_MSBC 1 + +#define AV_PROFILE_PRORES_PROXY 0 +#define AV_PROFILE_PRORES_LT 1 +#define AV_PROFILE_PRORES_STANDARD 2 +#define AV_PROFILE_PRORES_HQ 3 +#define AV_PROFILE_PRORES_4444 4 +#define AV_PROFILE_PRORES_XQ 5 + +#define AV_PROFILE_ARIB_PROFILE_A 0 +#define AV_PROFILE_ARIB_PROFILE_C 1 + +#define AV_PROFILE_KLVA_SYNC 0 +#define AV_PROFILE_KLVA_ASYNC 1 + +#define AV_PROFILE_EVC_BASELINE 0 +#define AV_PROFILE_EVC_MAIN 1 + + +#define AV_LEVEL_UNKNOWN -99 + +enum AVFieldOrder { + AV_FIELD_UNKNOWN, + AV_FIELD_PROGRESSIVE, + AV_FIELD_TT, ///< Top coded_first, top displayed first + AV_FIELD_BB, ///< Bottom coded first, bottom displayed first + AV_FIELD_TB, ///< Top coded first, bottom displayed first + AV_FIELD_BT, ///< Bottom coded first, top displayed first +}; + /** * @ingroup lavc_decoding */ diff --git a/arm/android/third_party/ffmpeg/libavcodec/dirac.c b/arm/android/third_party/ffmpeg/libavcodec/dirac.c index bc51a2fb..47363049 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/dirac.c +++ b/arm/android/third_party/ffmpeg/libavcodec/dirac.c @@ -26,9 +26,12 @@ * @author Marco Gerards , David Conrad, Jordi Ortiz */ +#include "config.h" + #include "libavutil/pixdesc.h" #include "dirac.h" +#include "get_bits.h" #include "golomb.h" #include "mpeg12data.h" diff --git a/arm/android/third_party/ffmpeg/libavcodec/dirac.h b/arm/android/third_party/ffmpeg/libavcodec/dirac.h index e6d9d346..8c348cdc 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/dirac.h +++ b/arm/android/third_party/ffmpeg/libavcodec/dirac.h @@ -31,7 +31,11 @@ * @author Jordi Ortiz */ -#include "avcodec.h" +#include +#include + +#include "libavutil/pixfmt.h" +#include "libavutil/rational.h" /** * The spec limits the number of wavelet decompositions to 4 for both diff --git a/arm/android/third_party/ffmpeg/libavcodec/dirac_dwt.c b/arm/android/third_party/ffmpeg/libavcodec/dirac_dwt.c index 4039899c..d473f64d 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/dirac_dwt.c +++ b/arm/android/third_party/ffmpeg/libavcodec/dirac_dwt.c @@ -21,6 +21,7 @@ #include "libavutil/attributes.h" #include "libavutil/common.h" +#include "libavutil/log.h" #include "dirac_dwt.h" #define TEMPLATE_8bit diff --git a/arm/android/third_party/ffmpeg/libavcodec/dnxhddata.c b/arm/android/third_party/ffmpeg/libavcodec/dnxhddata.c index d52abe87..ce06d77f 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/dnxhddata.c +++ b/arm/android/third_party/ffmpeg/libavcodec/dnxhddata.c @@ -22,7 +22,7 @@ #include #include "libavutil/log.h" #include "libavutil/macros.h" -#include "avcodec.h" +#include "defs.h" #include "dnxhddata.h" /* The quantization tables below are in zigzag order! */ @@ -1110,15 +1110,15 @@ int ff_dnxhd_get_hr_frame_size(int cid, int w, int h) static int dnxhd_find_hr_cid(AVCodecContext *avctx) { switch (avctx->profile) { - case FF_PROFILE_DNXHR_444: + case AV_PROFILE_DNXHR_444: return 1270; - case FF_PROFILE_DNXHR_HQX: + case AV_PROFILE_DNXHR_HQX: return 1271; - case FF_PROFILE_DNXHR_HQ: + case AV_PROFILE_DNXHR_HQ: return 1272; - case FF_PROFILE_DNXHR_SQ: + case AV_PROFILE_DNXHR_SQ: return 1273; - case FF_PROFILE_DNXHR_LB: + case AV_PROFILE_DNXHR_LB: return 1274; } return 0; @@ -1129,7 +1129,7 @@ int ff_dnxhd_find_cid(AVCodecContext *avctx, int bit_depth) int i, j; int mbs = avctx->bit_rate / 1000000; - if (avctx->profile != FF_PROFILE_DNXHD) + if (avctx->profile != AV_PROFILE_DNXHD) return dnxhd_find_hr_cid(avctx); if (!mbs) diff --git a/arm/android/third_party/ffmpeg/libavcodec/dnxhddec.c b/arm/android/third_party/ffmpeg/libavcodec/dnxhddec.c index 84bd0e61..d96b82c0 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/dnxhddec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/dnxhddec.c @@ -130,21 +130,22 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, uint32_t cid, int bitdepth) ctx->cid_table = cid_table; av_log(ctx->avctx, AV_LOG_VERBOSE, "Profile cid %"PRIu32".\n", cid); - ff_free_vlc(&ctx->ac_vlc); - ff_free_vlc(&ctx->dc_vlc); - ff_free_vlc(&ctx->run_vlc); + ff_vlc_free(&ctx->ac_vlc); + ff_vlc_free(&ctx->dc_vlc); + ff_vlc_free(&ctx->run_vlc); - if ((ret = init_vlc(&ctx->ac_vlc, DNXHD_VLC_BITS, 257, + if ((ret = vlc_init(&ctx->ac_vlc, DNXHD_VLC_BITS, 257, ctx->cid_table->ac_bits, 1, 1, ctx->cid_table->ac_codes, 2, 2, 0)) < 0) goto out; - if ((ret = init_vlc(&ctx->dc_vlc, DNXHD_DC_VLC_BITS, bitdepth > 8 ? 14 : 12, + if ((ret = vlc_init(&ctx->dc_vlc, DNXHD_DC_VLC_BITS, bitdepth > 8 ? 14 : 12, ctx->cid_table->dc_bits, 1, 1, ctx->cid_table->dc_codes, 1, 1, 0)) < 0) goto out; - if ((ret = init_vlc(&ctx->run_vlc, DNXHD_VLC_BITS, 62, + if ((ret = ff_vlc_init_sparse(&ctx->run_vlc, DNXHD_VLC_BITS, 62, ctx->cid_table->run_bits, 1, 1, - ctx->cid_table->run_codes, 2, 2, 0)) < 0) + ctx->cid_table->run_codes, 2, 2, + ctx->cid_table->run, 1, 1, 0)) < 0) goto out; ctx->cid = cid; @@ -152,7 +153,7 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, uint32_t cid, int bitdepth) ret = 0; out: if (ret < 0) - av_log(ctx->avctx, AV_LOG_ERROR, "init_vlc failed\n"); + av_log(ctx->avctx, AV_LOG_ERROR, "vlc_init failed\n"); return ret; } @@ -160,17 +161,17 @@ static int dnxhd_get_profile(int cid) { switch(cid) { case 1270: - return FF_PROFILE_DNXHR_444; + return AV_PROFILE_DNXHR_444; case 1271: - return FF_PROFILE_DNXHR_HQX; + return AV_PROFILE_DNXHR_HQX; case 1272: - return FF_PROFILE_DNXHR_HQ; + return AV_PROFILE_DNXHR_HQ; case 1273: - return FF_PROFILE_DNXHR_SQ; + return AV_PROFILE_DNXHR_SQ; case 1274: - return FF_PROFILE_DNXHR_LB; + return AV_PROFILE_DNXHR_LB; } - return FF_PROFILE_DNXHD; + return AV_PROFILE_DNXHD; } static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, @@ -262,7 +263,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, ctx->decode_dct_block = dnxhd_decode_dct_block_12; ctx->pix_fmt = AV_PIX_FMT_YUV422P12; } else if (bitdepth == 10) { - if (ctx->avctx->profile == FF_PROFILE_DNXHR_HQX) + if (ctx->avctx->profile == AV_PROFILE_DNXHR_HQX) ctx->decode_dct_block = dnxhd_decode_dct_block_10_444; else ctx->decode_dct_block = dnxhd_decode_dct_block_10; @@ -358,7 +359,7 @@ static av_always_inline int dnxhd_decode_dct_block(const DNXHDContext *ctx, int level_shift, int dc_shift) { - int i, j, index1, index2, len, flags; + int i, j, index1, len, flags; int level, component, sign; const int *scale; const uint8_t *weight_matrix; @@ -425,10 +426,11 @@ static av_always_inline int dnxhd_decode_dct_block(const DNXHDContext *ctx, } if (flags & 2) { + int run; UPDATE_CACHE(bs, &row->gb); - GET_VLC(index2, bs, &row->gb, ctx->run_vlc.table, + GET_VLC(run, bs, &row->gb, ctx->run_vlc.table, DNXHD_VLC_BITS, 2); - i += ctx->cid_table->run[index2]; + i += run; } if (++i > 63) { @@ -716,9 +718,9 @@ static av_cold int dnxhd_decode_close(AVCodecContext *avctx) { DNXHDContext *ctx = avctx->priv_data; - ff_free_vlc(&ctx->ac_vlc); - ff_free_vlc(&ctx->dc_vlc); - ff_free_vlc(&ctx->run_vlc); + ff_vlc_free(&ctx->ac_vlc); + ff_vlc_free(&ctx->dc_vlc); + ff_vlc_free(&ctx->run_vlc); av_freep(&ctx->rows); diff --git a/arm/android/third_party/ffmpeg/libavcodec/dnxhdenc.c b/arm/android/third_party/ffmpeg/libavcodec/dnxhdenc.c index a1852fa6..f52a2e99 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/dnxhdenc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/dnxhdenc.c @@ -54,19 +54,19 @@ static const AVOption options[] = { offsetof(DNXHDEncContext, intra_quant_bias), AV_OPT_TYPE_INT, { .i64 = 0 }, INT_MIN, INT_MAX, VE }, { "profile", NULL, offsetof(DNXHDEncContext, profile), AV_OPT_TYPE_INT, - { .i64 = FF_PROFILE_DNXHD }, - FF_PROFILE_DNXHD, FF_PROFILE_DNXHR_444, VE, "profile" }, - { "dnxhd", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_DNXHD }, + { .i64 = AV_PROFILE_DNXHD }, + AV_PROFILE_DNXHD, AV_PROFILE_DNXHR_444, VE, "profile" }, + { "dnxhd", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_DNXHD }, 0, 0, VE, "profile" }, - { "dnxhr_444", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_DNXHR_444 }, + { "dnxhr_444", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_DNXHR_444 }, 0, 0, VE, "profile" }, - { "dnxhr_hqx", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_DNXHR_HQX }, + { "dnxhr_hqx", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_DNXHR_HQX }, 0, 0, VE, "profile" }, - { "dnxhr_hq", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_DNXHR_HQ }, + { "dnxhr_hq", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_DNXHR_HQ }, 0, 0, VE, "profile" }, - { "dnxhr_sq", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_DNXHR_SQ }, + { "dnxhr_sq", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_DNXHR_SQ }, 0, 0, VE, "profile" }, - { "dnxhr_lb", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_DNXHR_LB }, + { "dnxhr_lb", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_DNXHR_LB }, 0, 0, VE, "profile" }, { NULL } }; @@ -367,30 +367,30 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx) break; } - if ((ctx->profile == FF_PROFILE_DNXHR_444 && (avctx->pix_fmt != AV_PIX_FMT_YUV444P10 && + if ((ctx->profile == AV_PROFILE_DNXHR_444 && (avctx->pix_fmt != AV_PIX_FMT_YUV444P10 && avctx->pix_fmt != AV_PIX_FMT_GBRP10)) || - (ctx->profile != FF_PROFILE_DNXHR_444 && (avctx->pix_fmt == AV_PIX_FMT_YUV444P10 || + (ctx->profile != AV_PROFILE_DNXHR_444 && (avctx->pix_fmt == AV_PIX_FMT_YUV444P10 || avctx->pix_fmt == AV_PIX_FMT_GBRP10))) { av_log(avctx, AV_LOG_ERROR, "pixel format is incompatible with DNxHD profile\n"); return AVERROR(EINVAL); } - if (ctx->profile == FF_PROFILE_DNXHR_HQX && avctx->pix_fmt != AV_PIX_FMT_YUV422P10) { + if (ctx->profile == AV_PROFILE_DNXHR_HQX && avctx->pix_fmt != AV_PIX_FMT_YUV422P10) { av_log(avctx, AV_LOG_ERROR, "pixel format is incompatible with DNxHR HQX profile\n"); return AVERROR(EINVAL); } - if ((ctx->profile == FF_PROFILE_DNXHR_LB || - ctx->profile == FF_PROFILE_DNXHR_SQ || - ctx->profile == FF_PROFILE_DNXHR_HQ) && avctx->pix_fmt != AV_PIX_FMT_YUV422P) { + if ((ctx->profile == AV_PROFILE_DNXHR_LB || + ctx->profile == AV_PROFILE_DNXHR_SQ || + ctx->profile == AV_PROFILE_DNXHR_HQ) && avctx->pix_fmt != AV_PIX_FMT_YUV422P) { av_log(avctx, AV_LOG_ERROR, "pixel format is incompatible with DNxHR LB/SQ/HQ profile\n"); return AVERROR(EINVAL); } - ctx->is_444 = ctx->profile == FF_PROFILE_DNXHR_444; + ctx->is_444 = ctx->profile == AV_PROFILE_DNXHR_444; avctx->profile = ctx->profile; ctx->cid = ff_dnxhd_find_cid(avctx, ctx->bit_depth); if (!ctx->cid) { @@ -426,13 +426,13 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx) ff_pixblockdsp_init(&ctx->m.pdsp, avctx); ff_dct_encode_init(&ctx->m); - if (ctx->profile != FF_PROFILE_DNXHD) + if (ctx->profile != AV_PROFILE_DNXHD) ff_videodsp_init(&ctx->m.vdsp, ctx->bit_depth); if (!ctx->m.dct_quantize) ctx->m.dct_quantize = ff_dct_quantize_c; - if (ctx->is_444 || ctx->profile == FF_PROFILE_DNXHR_HQX) { + if (ctx->is_444 || ctx->profile == AV_PROFILE_DNXHR_HQX) { ctx->m.dct_quantize = dnxhd_10bit_dct_quantize_444; ctx->get_pixels_8x4_sym = dnxhd_10bit_get_pixels_8x4_sym; ctx->block_width_l2 = 4; @@ -457,7 +457,7 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx) ctx->m.mb_height /= 2; } - if (ctx->interlaced && ctx->profile != FF_PROFILE_DNXHD) { + if (ctx->interlaced && ctx->profile != AV_PROFILE_DNXHD) { av_log(avctx, AV_LOG_ERROR, "Interlaced encoding is not supported for DNxHR profiles.\n"); return AVERROR(EINVAL); diff --git a/arm/android/third_party/ffmpeg/libavcodec/dolby_e.c b/arm/android/third_party/ffmpeg/libavcodec/dolby_e.c index 921c33f3..b8dac0fa 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/dolby_e.c +++ b/arm/android/third_party/ffmpeg/libavcodec/dolby_e.c @@ -1200,7 +1200,7 @@ static av_cold void init_tables(void) gain_tab[i] = exp2f((i - 960) / 64.0f); // short 1 - ff_kbd_window_init(window, 3.0f, 128); + avpriv_kbd_window_init(window, 3.0f, 128); for (i = 0; i < 128; i++) window[128 + i] = window[127 - i]; @@ -1227,7 +1227,7 @@ static av_cold void init_tables(void) window[1088 + i] = 1.0f; // long - ff_kbd_window_init(window + 1408, 3.0f, 256); + avpriv_kbd_window_init(window + 1408, 3.0f, 256); for (i = 0; i < 640; i++) window[1664 + i] = 1.0f; for (i = 0; i < 256; i++) diff --git a/arm/android/third_party/ffmpeg/libavcodec/dvdec.c b/arm/android/third_party/ffmpeg/libavcodec/dvdec.c index c57578a2..f66a5f1a 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/dvdec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/dvdec.c @@ -36,6 +36,7 @@ */ #include "libavutil/avassert.h" +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "libavutil/mem_internal.h" #include "libavutil/thread.h" @@ -174,9 +175,9 @@ static av_cold void dv_init_static(void) /* NOTE: as a trick, we use the fact the no codes are unused * to accelerate the parsing of partial codes */ - ff_init_vlc_from_lengths(&dv_vlc, TEX_VLC_BITS, j, + ff_vlc_init_from_lengths(&dv_vlc, TEX_VLC_BITS, j, &tmp[0].len, sizeof(tmp[0]), - NULL, 0, 0, 0, INIT_VLC_USE_NEW_STATIC, NULL); + NULL, 0, 0, 0, VLC_INIT_USE_STATIC, NULL); av_assert1(dv_vlc.table_size == 1664); for (int i = 0; i < dv_vlc.table_size; i++) { diff --git a/arm/android/third_party/ffmpeg/libavcodec/dvenc.c b/arm/android/third_party/ffmpeg/libavcodec/dvenc.c index 7bd50174..ce212470 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/dvenc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/dvenc.c @@ -29,6 +29,7 @@ #include "config.h" #include "libavutil/attributes.h" +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "libavutil/mem_internal.h" #include "libavutil/opt.h" diff --git a/arm/android/third_party/ffmpeg/libavcodec/dxa.c b/arm/android/third_party/ffmpeg/libavcodec/dxa.c index d903b7ec..d33ac3c8 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/dxa.c +++ b/arm/android/third_party/ffmpeg/libavcodec/dxa.c @@ -45,8 +45,8 @@ typedef struct DxaDecContext { uint32_t pal[256]; } DxaDecContext; -static const int shift1[6] = { 0, 8, 8, 8, 4, 4 }; -static const int shift2[6] = { 0, 0, 8, 4, 0, 4 }; +static const uint8_t shift1[6] = { 0, 8, 8, 8, 4, 4 }; +static const uint8_t shift2[6] = { 0, 0, 8, 4, 0, 4 }; static int decode_13(AVCodecContext *avctx, DxaDecContext *c, uint8_t* dst, int stride, uint8_t *src, int srcsize, uint8_t *ref) @@ -317,8 +317,7 @@ FF_ENABLE_DEPRECATION_WARNINGS return AVERROR_INVALIDDATA; } - av_frame_unref(c->prev); - if ((ret = av_frame_ref(c->prev, frame)) < 0) + if ((ret = av_frame_replace(c->prev, frame)) < 0) return ret; *got_frame = 1; diff --git a/arm/android/third_party/ffmpeg/libavcodec/dxva2.c b/arm/android/third_party/ffmpeg/libavcodec/dxva2.c index 568d686f..d7bc5875 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/dxva2.c +++ b/arm/android/third_party/ffmpeg/libavcodec/dxva2.c @@ -53,28 +53,28 @@ DEFINE_GUID(ff_IID_IDirectXVideoDecoderService, 0xfc51a551,0xd5e7,0x11d9,0xaf,0x typedef struct dxva_mode { const GUID *guid; enum AVCodecID codec; - // List of supported profiles, terminated by a FF_PROFILE_UNKNOWN entry. + // List of supported profiles, terminated by a AV_PROFILE_UNKNOWN entry. // If NULL, don't check profile. const int *profiles; } dxva_mode; -static const int prof_mpeg2_main[] = {FF_PROFILE_MPEG2_SIMPLE, - FF_PROFILE_MPEG2_MAIN, - FF_PROFILE_UNKNOWN}; -static const int prof_h264_high[] = {FF_PROFILE_H264_CONSTRAINED_BASELINE, - FF_PROFILE_H264_MAIN, - FF_PROFILE_H264_HIGH, - FF_PROFILE_UNKNOWN}; -static const int prof_hevc_main[] = {FF_PROFILE_HEVC_MAIN, - FF_PROFILE_UNKNOWN}; -static const int prof_hevc_main10[] = {FF_PROFILE_HEVC_MAIN_10, - FF_PROFILE_UNKNOWN}; -static const int prof_vp9_profile0[] = {FF_PROFILE_VP9_0, - FF_PROFILE_UNKNOWN}; -static const int prof_vp9_profile2[] = {FF_PROFILE_VP9_2, - FF_PROFILE_UNKNOWN}; -static const int prof_av1_profile0[] = {FF_PROFILE_AV1_MAIN, - FF_PROFILE_UNKNOWN}; +static const int prof_mpeg2_main[] = {AV_PROFILE_MPEG2_SIMPLE, + AV_PROFILE_MPEG2_MAIN, + AV_PROFILE_UNKNOWN}; +static const int prof_h264_high[] = {AV_PROFILE_H264_CONSTRAINED_BASELINE, + AV_PROFILE_H264_MAIN, + AV_PROFILE_H264_HIGH, + AV_PROFILE_UNKNOWN}; +static const int prof_hevc_main[] = {AV_PROFILE_HEVC_MAIN, + AV_PROFILE_UNKNOWN}; +static const int prof_hevc_main10[] = {AV_PROFILE_HEVC_MAIN_10, + AV_PROFILE_UNKNOWN}; +static const int prof_vp9_profile0[] = {AV_PROFILE_VP9_0, + AV_PROFILE_UNKNOWN}; +static const int prof_vp9_profile2[] = {AV_PROFILE_VP9_2, + AV_PROFILE_UNKNOWN}; +static const int prof_av1_profile0[] = {AV_PROFILE_AV1_MAIN, + AV_PROFILE_UNKNOWN}; static const dxva_mode dxva_modes[] = { /* MPEG-2 */ @@ -199,7 +199,7 @@ static int dxva_check_codec_compatibility(AVCodecContext *avctx, const dxva_mode if (mode->profiles && !(avctx->hwaccel_flags & AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH)) { int i, found = 0; - for (i = 0; mode->profiles[i] != FF_PROFILE_UNKNOWN; i++) { + for (i = 0; mode->profiles[i] != AV_PROFILE_UNKNOWN; i++) { if (avctx->profile == mode->profiles[i]) { found = 1; break; diff --git a/arm/android/third_party/ffmpeg/libavcodec/dxva2_av1.c b/arm/android/third_party/ffmpeg/libavcodec/dxva2_av1.c index 228f72ba..ab118a43 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/dxva2_av1.c +++ b/arm/android/third_party/ffmpeg/libavcodec/dxva2_av1.c @@ -27,6 +27,7 @@ #include "dxva2_internal.h" #include "av1dec.h" +#include "hwaccel_internal.h" #define MAX_TILES 256 @@ -457,11 +458,11 @@ static int dxva2_av1_uninit(AVCodecContext *avctx) } #if CONFIG_AV1_DXVA2_HWACCEL -const AVHWAccel ff_av1_dxva2_hwaccel = { - .name = "av1_dxva2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AV1, - .pix_fmt = AV_PIX_FMT_DXVA2_VLD, +const FFHWAccel ff_av1_dxva2_hwaccel = { + .p.name = "av1_dxva2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, + .p.pix_fmt = AV_PIX_FMT_DXVA2_VLD, .init = ff_dxva2_decode_init, .uninit = dxva2_av1_uninit, .start_frame = dxva2_av1_start_frame, @@ -474,11 +475,11 @@ const AVHWAccel ff_av1_dxva2_hwaccel = { #endif #if CONFIG_AV1_D3D11VA_HWACCEL -const AVHWAccel ff_av1_d3d11va_hwaccel = { - .name = "av1_d3d11va", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AV1, - .pix_fmt = AV_PIX_FMT_D3D11VA_VLD, +const FFHWAccel ff_av1_d3d11va_hwaccel = { + .p.name = "av1_d3d11va", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, + .p.pix_fmt = AV_PIX_FMT_D3D11VA_VLD, .init = ff_dxva2_decode_init, .uninit = dxva2_av1_uninit, .start_frame = dxva2_av1_start_frame, @@ -491,11 +492,11 @@ const AVHWAccel ff_av1_d3d11va_hwaccel = { #endif #if CONFIG_AV1_D3D11VA2_HWACCEL -const AVHWAccel ff_av1_d3d11va2_hwaccel = { - .name = "av1_d3d11va2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AV1, - .pix_fmt = AV_PIX_FMT_D3D11, +const FFHWAccel ff_av1_d3d11va2_hwaccel = { + .p.name = "av1_d3d11va2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, + .p.pix_fmt = AV_PIX_FMT_D3D11, .init = ff_dxva2_decode_init, .uninit = dxva2_av1_uninit, .start_frame = dxva2_av1_start_frame, diff --git a/arm/android/third_party/ffmpeg/libavcodec/dxva2_h264.c b/arm/android/third_party/ffmpeg/libavcodec/dxva2_h264.c index 6300b141..20e64f84 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/dxva2_h264.c +++ b/arm/android/third_party/ffmpeg/libavcodec/dxva2_h264.c @@ -28,6 +28,7 @@ #include "h264dec.h" #include "h264data.h" #include "h264_ps.h" +#include "hwaccel_internal.h" #include "mpegutils.h" struct dxva2_picture_context { @@ -516,11 +517,11 @@ static int dxva2_h264_end_frame(AVCodecContext *avctx) } #if CONFIG_H264_DXVA2_HWACCEL -const AVHWAccel ff_h264_dxva2_hwaccel = { - .name = "h264_dxva2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, - .pix_fmt = AV_PIX_FMT_DXVA2_VLD, +const FFHWAccel ff_h264_dxva2_hwaccel = { + .p.name = "h264_dxva2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, + .p.pix_fmt = AV_PIX_FMT_DXVA2_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_h264_start_frame, @@ -533,11 +534,11 @@ const AVHWAccel ff_h264_dxva2_hwaccel = { #endif #if CONFIG_H264_D3D11VA_HWACCEL -const AVHWAccel ff_h264_d3d11va_hwaccel = { - .name = "h264_d3d11va", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, - .pix_fmt = AV_PIX_FMT_D3D11VA_VLD, +const FFHWAccel ff_h264_d3d11va_hwaccel = { + .p.name = "h264_d3d11va", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, + .p.pix_fmt = AV_PIX_FMT_D3D11VA_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_h264_start_frame, @@ -550,11 +551,11 @@ const AVHWAccel ff_h264_d3d11va_hwaccel = { #endif #if CONFIG_H264_D3D11VA2_HWACCEL -const AVHWAccel ff_h264_d3d11va2_hwaccel = { - .name = "h264_d3d11va2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, - .pix_fmt = AV_PIX_FMT_D3D11, +const FFHWAccel ff_h264_d3d11va2_hwaccel = { + .p.name = "h264_d3d11va2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, + .p.pix_fmt = AV_PIX_FMT_D3D11, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_h264_start_frame, diff --git a/arm/android/third_party/ffmpeg/libavcodec/dxva2_hevc.c b/arm/android/third_party/ffmpeg/libavcodec/dxva2_hevc.c index 6b239d99..b6c08943 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/dxva2_hevc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/dxva2_hevc.c @@ -27,6 +27,7 @@ #include "dxva2_internal.h" #include "hevc_data.h" #include "hevcdec.h" +#include "hwaccel_internal.h" #define MAX_SLICES 256 @@ -420,11 +421,11 @@ static int dxva2_hevc_end_frame(AVCodecContext *avctx) } #if CONFIG_HEVC_DXVA2_HWACCEL -const AVHWAccel ff_hevc_dxva2_hwaccel = { - .name = "hevc_dxva2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, - .pix_fmt = AV_PIX_FMT_DXVA2_VLD, +const FFHWAccel ff_hevc_dxva2_hwaccel = { + .p.name = "hevc_dxva2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, + .p.pix_fmt = AV_PIX_FMT_DXVA2_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_hevc_start_frame, @@ -437,11 +438,11 @@ const AVHWAccel ff_hevc_dxva2_hwaccel = { #endif #if CONFIG_HEVC_D3D11VA_HWACCEL -const AVHWAccel ff_hevc_d3d11va_hwaccel = { - .name = "hevc_d3d11va", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, - .pix_fmt = AV_PIX_FMT_D3D11VA_VLD, +const FFHWAccel ff_hevc_d3d11va_hwaccel = { + .p.name = "hevc_d3d11va", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, + .p.pix_fmt = AV_PIX_FMT_D3D11VA_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_hevc_start_frame, @@ -454,11 +455,11 @@ const AVHWAccel ff_hevc_d3d11va_hwaccel = { #endif #if CONFIG_HEVC_D3D11VA2_HWACCEL -const AVHWAccel ff_hevc_d3d11va2_hwaccel = { - .name = "hevc_d3d11va2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, - .pix_fmt = AV_PIX_FMT_D3D11, +const FFHWAccel ff_hevc_d3d11va2_hwaccel = { + .p.name = "hevc_d3d11va2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, + .p.pix_fmt = AV_PIX_FMT_D3D11, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_hevc_start_frame, diff --git a/arm/android/third_party/ffmpeg/libavcodec/dxva2_mpeg2.c b/arm/android/third_party/ffmpeg/libavcodec/dxva2_mpeg2.c index 1989c588..75c41665 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/dxva2_mpeg2.c +++ b/arm/android/third_party/ffmpeg/libavcodec/dxva2_mpeg2.c @@ -25,6 +25,7 @@ #include "libavutil/log.h" #include "dxva2_internal.h" +#include "hwaccel_internal.h" #include "mpegutils.h" #include "mpegvideodec.h" @@ -316,11 +317,11 @@ static int dxva2_mpeg2_end_frame(AVCodecContext *avctx) } #if CONFIG_MPEG2_DXVA2_HWACCEL -const AVHWAccel ff_mpeg2_dxva2_hwaccel = { - .name = "mpeg2_dxva2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG2VIDEO, - .pix_fmt = AV_PIX_FMT_DXVA2_VLD, +const FFHWAccel ff_mpeg2_dxva2_hwaccel = { + .p.name = "mpeg2_dxva2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG2VIDEO, + .p.pix_fmt = AV_PIX_FMT_DXVA2_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_mpeg2_start_frame, @@ -333,11 +334,11 @@ const AVHWAccel ff_mpeg2_dxva2_hwaccel = { #endif #if CONFIG_MPEG2_D3D11VA_HWACCEL -const AVHWAccel ff_mpeg2_d3d11va_hwaccel = { - .name = "mpeg2_d3d11va", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG2VIDEO, - .pix_fmt = AV_PIX_FMT_D3D11VA_VLD, +const FFHWAccel ff_mpeg2_d3d11va_hwaccel = { + .p.name = "mpeg2_d3d11va", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG2VIDEO, + .p.pix_fmt = AV_PIX_FMT_D3D11VA_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_mpeg2_start_frame, @@ -350,11 +351,11 @@ const AVHWAccel ff_mpeg2_d3d11va_hwaccel = { #endif #if CONFIG_MPEG2_D3D11VA2_HWACCEL -const AVHWAccel ff_mpeg2_d3d11va2_hwaccel = { - .name = "mpeg2_d3d11va2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG2VIDEO, - .pix_fmt = AV_PIX_FMT_D3D11, +const FFHWAccel ff_mpeg2_d3d11va2_hwaccel = { + .p.name = "mpeg2_d3d11va2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG2VIDEO, + .p.pix_fmt = AV_PIX_FMT_D3D11, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_mpeg2_start_frame, diff --git a/arm/android/third_party/ffmpeg/libavcodec/dxva2_vc1.c b/arm/android/third_party/ffmpeg/libavcodec/dxva2_vc1.c index 12e3de59..b35fb115 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/dxva2_vc1.c +++ b/arm/android/third_party/ffmpeg/libavcodec/dxva2_vc1.c @@ -23,6 +23,7 @@ #include "config_components.h" #include "dxva2_internal.h" +#include "hwaccel_internal.h" #include "mpegutils.h" #include "mpegvideodec.h" #include "vc1.h" @@ -376,11 +377,11 @@ static int dxva2_vc1_end_frame(AVCodecContext *avctx) } #if CONFIG_WMV3_DXVA2_HWACCEL -const AVHWAccel ff_wmv3_dxva2_hwaccel = { - .name = "wmv3_dxva2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WMV3, - .pix_fmt = AV_PIX_FMT_DXVA2_VLD, +const FFHWAccel ff_wmv3_dxva2_hwaccel = { + .p.name = "wmv3_dxva2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WMV3, + .p.pix_fmt = AV_PIX_FMT_DXVA2_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_vc1_start_frame, @@ -393,11 +394,11 @@ const AVHWAccel ff_wmv3_dxva2_hwaccel = { #endif #if CONFIG_VC1_DXVA2_HWACCEL -const AVHWAccel ff_vc1_dxva2_hwaccel = { - .name = "vc1_dxva2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VC1, - .pix_fmt = AV_PIX_FMT_DXVA2_VLD, +const FFHWAccel ff_vc1_dxva2_hwaccel = { + .p.name = "vc1_dxva2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VC1, + .p.pix_fmt = AV_PIX_FMT_DXVA2_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_vc1_start_frame, @@ -410,11 +411,11 @@ const AVHWAccel ff_vc1_dxva2_hwaccel = { #endif #if CONFIG_WMV3_D3D11VA_HWACCEL -const AVHWAccel ff_wmv3_d3d11va_hwaccel = { - .name = "wmv3_d3d11va", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WMV3, - .pix_fmt = AV_PIX_FMT_D3D11VA_VLD, +const FFHWAccel ff_wmv3_d3d11va_hwaccel = { + .p.name = "wmv3_d3d11va", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WMV3, + .p.pix_fmt = AV_PIX_FMT_D3D11VA_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_vc1_start_frame, @@ -427,11 +428,11 @@ const AVHWAccel ff_wmv3_d3d11va_hwaccel = { #endif #if CONFIG_WMV3_D3D11VA2_HWACCEL -const AVHWAccel ff_wmv3_d3d11va2_hwaccel = { - .name = "wmv3_d3d11va2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WMV3, - .pix_fmt = AV_PIX_FMT_D3D11, +const FFHWAccel ff_wmv3_d3d11va2_hwaccel = { + .p.name = "wmv3_d3d11va2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WMV3, + .p.pix_fmt = AV_PIX_FMT_D3D11, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_vc1_start_frame, @@ -444,11 +445,11 @@ const AVHWAccel ff_wmv3_d3d11va2_hwaccel = { #endif #if CONFIG_VC1_D3D11VA_HWACCEL -const AVHWAccel ff_vc1_d3d11va_hwaccel = { - .name = "vc1_d3d11va", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VC1, - .pix_fmt = AV_PIX_FMT_D3D11VA_VLD, +const FFHWAccel ff_vc1_d3d11va_hwaccel = { + .p.name = "vc1_d3d11va", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VC1, + .p.pix_fmt = AV_PIX_FMT_D3D11VA_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_vc1_start_frame, @@ -461,11 +462,11 @@ const AVHWAccel ff_vc1_d3d11va_hwaccel = { #endif #if CONFIG_VC1_D3D11VA2_HWACCEL -const AVHWAccel ff_vc1_d3d11va2_hwaccel = { - .name = "vc1_d3d11va2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VC1, - .pix_fmt = AV_PIX_FMT_D3D11, +const FFHWAccel ff_vc1_d3d11va2_hwaccel = { + .p.name = "vc1_d3d11va2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VC1, + .p.pix_fmt = AV_PIX_FMT_D3D11, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_vc1_start_frame, diff --git a/arm/android/third_party/ffmpeg/libavcodec/dxva2_vp9.c b/arm/android/third_party/ffmpeg/libavcodec/dxva2_vp9.c index dbe6c08a..eba4df90 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/dxva2_vp9.c +++ b/arm/android/third_party/ffmpeg/libavcodec/dxva2_vp9.c @@ -26,6 +26,7 @@ #include "libavutil/pixdesc.h" #include "dxva2_internal.h" +#include "hwaccel_internal.h" #include "vp9shared.h" struct vp9_dxva2_picture_context { @@ -307,11 +308,11 @@ static int dxva2_vp9_end_frame(AVCodecContext *avctx) } #if CONFIG_VP9_DXVA2_HWACCEL -const AVHWAccel ff_vp9_dxva2_hwaccel = { - .name = "vp9_dxva2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP9, - .pix_fmt = AV_PIX_FMT_DXVA2_VLD, +const FFHWAccel ff_vp9_dxva2_hwaccel = { + .p.name = "vp9_dxva2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP9, + .p.pix_fmt = AV_PIX_FMT_DXVA2_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_vp9_start_frame, @@ -324,11 +325,11 @@ const AVHWAccel ff_vp9_dxva2_hwaccel = { #endif #if CONFIG_VP9_D3D11VA_HWACCEL -const AVHWAccel ff_vp9_d3d11va_hwaccel = { - .name = "vp9_d3d11va", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP9, - .pix_fmt = AV_PIX_FMT_D3D11VA_VLD, +const FFHWAccel ff_vp9_d3d11va_hwaccel = { + .p.name = "vp9_d3d11va", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP9, + .p.pix_fmt = AV_PIX_FMT_D3D11VA_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_vp9_start_frame, @@ -341,11 +342,11 @@ const AVHWAccel ff_vp9_d3d11va_hwaccel = { #endif #if CONFIG_VP9_D3D11VA2_HWACCEL -const AVHWAccel ff_vp9_d3d11va2_hwaccel = { - .name = "vp9_d3d11va2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP9, - .pix_fmt = AV_PIX_FMT_D3D11, +const FFHWAccel ff_vp9_d3d11va2_hwaccel = { + .p.name = "vp9_d3d11va2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP9, + .p.pix_fmt = AV_PIX_FMT_D3D11, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_vp9_start_frame, diff --git a/arm/android/third_party/ffmpeg/libavcodec/eacmv.c b/arm/android/third_party/ffmpeg/libavcodec/eacmv.c index e73e310c..43dba20f 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/eacmv.c +++ b/arm/android/third_party/ffmpeg/libavcodec/eacmv.c @@ -210,9 +210,8 @@ static int cmv_decode_frame(AVCodecContext *avctx, AVFrame *frame, cmv_decode_intra(s, frame, buf+2, buf_end); } - av_frame_unref(s->last2_frame); - av_frame_move_ref(s->last2_frame, s->last_frame); - if ((ret = av_frame_ref(s->last_frame, frame)) < 0) + FFSWAP(AVFrame*, s->last2_frame, s->last_frame); + if ((ret = av_frame_replace(s->last_frame, frame)) < 0) return ret; *got_frame = 1; diff --git a/arm/android/third_party/ffmpeg/libavcodec/eamad.c b/arm/android/third_party/ffmpeg/libavcodec/eamad.c index 45012c62..287575e0 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/eamad.c +++ b/arm/android/third_party/ffmpeg/libavcodec/eamad.c @@ -317,8 +317,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, *got_frame = 1; if (chunk_type != MADe_TAG) { - av_frame_unref(s->last_frame); - if ((ret = av_frame_ref(s->last_frame, frame)) < 0) + if ((ret = av_frame_replace(s->last_frame, frame)) < 0) return ret; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/eatgv.c b/arm/android/third_party/ffmpeg/libavcodec/eatgv.c index a2aead46..35bd88b7 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/eatgv.c +++ b/arm/android/third_party/ffmpeg/libavcodec/eatgv.c @@ -338,8 +338,7 @@ static int tgv_decode_frame(AVCodecContext *avctx, AVFrame *frame, } } - av_frame_unref(s->last_frame); - if ((ret = av_frame_ref(s->last_frame, frame)) < 0) + if ((ret = av_frame_replace(s->last_frame, frame)) < 0) return ret; *got_frame = 1; diff --git a/arm/android/third_party/ffmpeg/libavcodec/encode.c b/arm/android/third_party/ffmpeg/libavcodec/encode.c index 32cc903b..a436be26 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/encode.c +++ b/arm/android/third_party/ffmpeg/libavcodec/encode.c @@ -21,6 +21,7 @@ #include "libavutil/attributes.h" #include "libavutil/avassert.h" #include "libavutil/channel_layout.h" +#include "libavutil/emms.h" #include "libavutil/frame.h" #include "libavutil/imgutils.h" #include "libavutil/internal.h" @@ -29,6 +30,7 @@ #include "avcodec.h" #include "avcodec_internal.h" +#include "codec_desc.h" #include "codec_internal.h" #include "encode.h" #include "frame_thread_encoder.h" @@ -864,3 +866,34 @@ AVCodecInternal *ff_encode_internal_alloc(void) { return av_mallocz(sizeof(EncodeContext)); } + +AVCPBProperties *ff_encode_add_cpb_side_data(AVCodecContext *avctx) +{ + AVPacketSideData *tmp; + AVCPBProperties *props; + size_t size; + int i; + + for (i = 0; i < avctx->nb_coded_side_data; i++) + if (avctx->coded_side_data[i].type == AV_PKT_DATA_CPB_PROPERTIES) + return (AVCPBProperties *)avctx->coded_side_data[i].data; + + props = av_cpb_properties_alloc(&size); + if (!props) + return NULL; + + tmp = av_realloc_array(avctx->coded_side_data, avctx->nb_coded_side_data + 1, sizeof(*tmp)); + if (!tmp) { + av_freep(&props); + return NULL; + } + + avctx->coded_side_data = tmp; + avctx->nb_coded_side_data++; + + avctx->coded_side_data[avctx->nb_coded_side_data - 1].type = AV_PKT_DATA_CPB_PROPERTIES; + avctx->coded_side_data[avctx->nb_coded_side_data - 1].data = (uint8_t*)props; + avctx->coded_side_data[avctx->nb_coded_side_data - 1].size = size; + + return props; +} diff --git a/arm/android/third_party/ffmpeg/libavcodec/encode.h b/arm/android/third_party/ffmpeg/libavcodec/encode.h index dfaab7c9..e019cd77 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/encode.h +++ b/arm/android/third_party/ffmpeg/libavcodec/encode.h @@ -73,6 +73,11 @@ int ff_encode_reordered_opaque(AVCodecContext *avctx, int ff_encode_encode_cb(AVCodecContext *avctx, AVPacket *avpkt, AVFrame *frame, int *got_packet); +/** + * Add a CPB properties side data to an encoding context. + */ +AVCPBProperties *ff_encode_add_cpb_side_data(AVCodecContext *avctx); + /** * Rescale from sample rate to AVCodecContext.time_base. */ diff --git a/arm/android/third_party/ffmpeg/libavcodec/error_resilience.c b/arm/android/third_party/ffmpeg/libavcodec/error_resilience.c index 2aa6f1d8..9d03e532 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/error_resilience.c +++ b/arm/android/third_party/ffmpeg/libavcodec/error_resilience.c @@ -393,7 +393,7 @@ static void guess_mv(ERContext *s) const ptrdiff_t mb_stride = s->mb_stride; const int mb_width = s->mb_width; int mb_height = s->mb_height; - int i, depth, num_avail; + int i, num_avail; int mb_x, mb_y; ptrdiff_t mot_step, mot_stride; int blocklist_length, next_blocklist_length; @@ -469,7 +469,7 @@ static void guess_mv(ERContext *s) } } - for (depth = 0; ; depth++) { + for (;;) { int changed, pass, none_left; int blocklist_index; @@ -804,7 +804,7 @@ void ff_er_frame_start(ERContext *s) static int er_supported(ERContext *s) { - if(s->avctx->hwaccel && s->avctx->hwaccel->decode_slice || + if (s->avctx->hwaccel || !s->cur_pic.f || s->cur_pic.field_picture ) @@ -828,7 +828,7 @@ void ff_er_add_slice(ERContext *s, int startx, int starty, const int end_xy = s->mb_index2xy[end_i]; int mask = -1; - if (s->avctx->hwaccel && s->avctx->hwaccel->decode_slice) + if (s->avctx->hwaccel) return; if (start_i > end_i || start_xy > end_xy) { @@ -889,7 +889,7 @@ void ff_er_add_slice(ERContext *s, int startx, int starty, } } -void ff_er_frame_end(ERContext *s) +void ff_er_frame_end(ERContext *s, int *decode_error_flags) { int *linesize = NULL; int i, mb_x, mb_y, error, error_type, dc_error, mv_error, ac_error; @@ -1114,7 +1114,10 @@ void ff_er_frame_end(ERContext *s) av_log(s->avctx, AV_LOG_INFO, "concealing %d DC, %d AC, %d MV errors in %c frame\n", dc_error, ac_error, mv_error, av_get_picture_type_char(s->cur_pic.f->pict_type)); - s->cur_pic.f->decode_error_flags |= FF_DECODE_ERROR_CONCEALMENT_ACTIVE; + if (decode_error_flags) + *decode_error_flags |= FF_DECODE_ERROR_CONCEALMENT_ACTIVE; + else + s->cur_pic.f->decode_error_flags |= FF_DECODE_ERROR_CONCEALMENT_ACTIVE; is_intra_likely = is_intra_more_likely(s); diff --git a/arm/android/third_party/ffmpeg/libavcodec/error_resilience.h b/arm/android/third_party/ffmpeg/libavcodec/error_resilience.h index 47cc8a4f..b03f8ec8 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/error_resilience.h +++ b/arm/android/third_party/ffmpeg/libavcodec/error_resilience.h @@ -90,7 +90,17 @@ typedef struct ERContext { } ERContext; void ff_er_frame_start(ERContext *s); -void ff_er_frame_end(ERContext *s); + +/** + * Indicate that a frame has finished decoding and perform error concealment + * in case it has been enabled and is necessary and supported. + * + * @param s ERContext in use + * @param decode_error_flags pointer where updated decode_error_flags are written + * if supplied; if not, the new flags are directly + * applied to the AVFrame whose errors are concealed + */ +void ff_er_frame_end(ERContext *s, int *decode_error_flags); void ff_er_add_slice(ERContext *s, int startx, int starty, int endx, int endy, int status); diff --git a/arm/android/third_party/ffmpeg/libavcodec/escape124.c b/arm/android/third_party/ffmpeg/libavcodec/escape124.c index 592de09a..357320ef 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/escape124.c +++ b/arm/android/third_party/ffmpeg/libavcodec/escape124.c @@ -234,7 +234,7 @@ static int escape124_decode_frame(AVCodecContext *avctx, AVFrame *frame, if ((ret = av_frame_ref(frame, s->frame)) < 0) return ret; - return frame_size; + return 0; } for (i = 0; i < 3; i++) { @@ -362,13 +362,12 @@ static int escape124_decode_frame(AVCodecContext *avctx, AVFrame *frame, "Escape sizes: %i, %i, %i\n", frame_size, buf_size, get_bits_count(&gb) / 8); - av_frame_unref(s->frame); - if ((ret = av_frame_ref(s->frame, frame)) < 0) + if ((ret = av_frame_replace(s->frame, frame)) < 0) return ret; *got_frame = 1; - return frame_size; + return 0; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/evc.h b/arm/android/third_party/ffmpeg/libavcodec/evc.h index d1fdb4fa..9711c760 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/evc.h +++ b/arm/android/third_party/ffmpeg/libavcodec/evc.h @@ -126,7 +126,7 @@ enum { EVC_MAX_NUM_REF_PICS = 21, - EVC_MAX_NUM_RPLS = 32, + EVC_MAX_NUM_RPLS = 64, // A.4.1: pic_width_in_luma_samples and pic_height_in_luma_samples are // constrained to be not greater than sqrt(MaxLumaPs * 8). Hence height/ diff --git a/arm/android/third_party/ffmpeg/libavcodec/evc_frame_merge_bsf.c b/arm/android/third_party/ffmpeg/libavcodec/evc_frame_merge_bsf.c index cfdf24c6..7b8e6b1c 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/evc_frame_merge_bsf.c +++ b/arm/android/third_party/ffmpeg/libavcodec/evc_frame_merge_bsf.c @@ -18,13 +18,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "get_bits.h" -#include "golomb.h" #include "bsf.h" #include "bsf_internal.h" -#include "avcodec.h" #include "evc.h" #include "evc_parse.h" +#include "evc_ps.h" // Access unit data typedef struct AccessUnitBuffer { diff --git a/arm/android/third_party/ffmpeg/libavcodec/evc_parse.c b/arm/android/third_party/ffmpeg/libavcodec/evc_parse.c index 447f6195..bd3a4416 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/evc_parse.c +++ b/arm/android/third_party/ffmpeg/libavcodec/evc_parse.c @@ -17,7 +17,6 @@ */ #include "golomb.h" -#include "parser.h" #include "evc.h" #include "evc_parse.h" diff --git a/arm/android/third_party/ffmpeg/libavcodec/evc_parse.h b/arm/android/third_party/ffmpeg/libavcodec/evc_parse.h index 55cdd553..47123108 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/evc_parse.h +++ b/arm/android/third_party/ffmpeg/libavcodec/evc_parse.h @@ -28,7 +28,6 @@ #include "libavutil/intreadwrite.h" #include "libavutil/log.h" -#include "libavutil/rational.h" #include "evc.h" #include "evc_ps.h" diff --git a/arm/android/third_party/ffmpeg/libavcodec/evc_parser.c b/arm/android/third_party/ffmpeg/libavcodec/evc_parser.c index 76790d81..8590ebcd 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/evc_parser.c +++ b/arm/android/third_party/ffmpeg/libavcodec/evc_parser.c @@ -20,7 +20,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "parser.h" +#include "avcodec.h" #include "bytestream.h" #include "evc.h" #include "evc_parse.h" diff --git a/arm/android/third_party/ffmpeg/libavcodec/evc_ps.c b/arm/android/third_party/ffmpeg/libavcodec/evc_ps.c index fc2105b3..c11b92d1 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/evc_ps.c +++ b/arm/android/third_party/ffmpeg/libavcodec/evc_ps.c @@ -16,18 +16,22 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "get_bits.h" #include "golomb.h" -#include "parser.h" #include "evc.h" #include "evc_ps.h" #define EXTENDED_SAR 255 // @see ISO_IEC_23094-1 (7.3.7 Reference picture list structure syntax) -static int ref_pic_list_struct(GetBitContext *gb, RefPicListStruct *rpl) +static int ref_pic_list_struct(const EVCParserSPS *sps, GetBitContext *gb, RefPicListStruct *rpl) { uint32_t delta_poc_st, strp_entry_sign_flag = 0; rpl->ref_pic_num = get_ue_golomb_long(gb); + + if ((unsigned)rpl->ref_pic_num > sps->sps_max_dec_pic_buffering_minus1) + return AVERROR_INVALIDDATA; + if (rpl->ref_pic_num > 0) { delta_poc_st = get_ue_golomb_long(gb); @@ -53,6 +57,9 @@ static int ref_pic_list_struct(GetBitContext *gb, RefPicListStruct *rpl) static int hrd_parameters(GetBitContext *gb, HRDParameters *hrd) { hrd->cpb_cnt_minus1 = get_ue_golomb_31(gb); + if (hrd->cpb_cnt_minus1 >= FF_ARRAY_ELEMS(hrd->cpb_size_value_minus1)) + return AVERROR_INVALIDDATA; + hrd->bit_rate_scale = get_bits(gb, 4); hrd->cpb_size_scale = get_bits(gb, 4); for (int SchedSelIdx = 0; SchedSelIdx <= hrd->cpb_cnt_minus1; SchedSelIdx++) { @@ -71,6 +78,8 @@ static int hrd_parameters(GetBitContext *gb, HRDParameters *hrd) // @see ISO_IEC_23094-1 (E.2.1 VUI parameters syntax) static int vui_parameters(GetBitContext *gb, VUIParameters *vui) { + int ret; + vui->aspect_ratio_info_present_flag = get_bits(gb, 1); if (vui->aspect_ratio_info_present_flag) { vui->aspect_ratio_idc = get_bits(gb, 8); @@ -109,11 +118,18 @@ static int vui_parameters(GetBitContext *gb, VUIParameters *vui) vui->fixed_pic_rate_flag = get_bits(gb, 1); } vui->nal_hrd_parameters_present_flag = get_bits(gb, 1); - if (vui->nal_hrd_parameters_present_flag) - hrd_parameters(gb, &vui->hrd_parameters); + if (vui->nal_hrd_parameters_present_flag) { + ret = hrd_parameters(gb, &vui->hrd_parameters); + if (ret < 0) + return ret; + } + vui->vcl_hrd_parameters_present_flag = get_bits(gb, 1); - if (vui->vcl_hrd_parameters_present_flag) - hrd_parameters(gb, &vui->hrd_parameters); + if (vui->vcl_hrd_parameters_present_flag) { + ret = hrd_parameters(gb, &vui->hrd_parameters); + if (ret < 0) + return ret; + } if (vui->nal_hrd_parameters_present_flag || vui->vcl_hrd_parameters_present_flag) vui->low_delay_hrd_flag = get_bits(gb, 1); vui->pic_struct_present_flag = get_bits(gb, 1); @@ -239,17 +255,36 @@ int ff_evc_parse_sps(GetBitContext *gb, EVCParamSets *ps) sps->max_num_tid0_ref_pics = get_ue_golomb_31(gb); else { sps->sps_max_dec_pic_buffering_minus1 = get_ue_golomb_long(gb); + if ((unsigned)sps->sps_max_dec_pic_buffering_minus1 > 16 - 1) { + ret = AVERROR_INVALIDDATA; + goto fail; + } sps->long_term_ref_pic_flag = get_bits1(gb); sps->rpl1_same_as_rpl0_flag = get_bits1(gb); sps->num_ref_pic_list_in_sps[0] = get_ue_golomb(gb); - for (int i = 0; i < sps->num_ref_pic_list_in_sps[0]; ++i) - ref_pic_list_struct(gb, &sps->rpls[0][i]); + if ((unsigned)sps->num_ref_pic_list_in_sps[0] >= EVC_MAX_NUM_RPLS) { + ret = AVERROR_INVALIDDATA; + goto fail; + } + + for (int i = 0; i < sps->num_ref_pic_list_in_sps[0]; ++i) { + ret = ref_pic_list_struct(sps, gb, &sps->rpls[0][i]); + if (ret < 0) + goto fail; + } if (!sps->rpl1_same_as_rpl0_flag) { sps->num_ref_pic_list_in_sps[1] = get_ue_golomb(gb); - for (int i = 0; i < sps->num_ref_pic_list_in_sps[1]; ++i) - ref_pic_list_struct(gb, &sps->rpls[1][i]); + if ((unsigned)sps->num_ref_pic_list_in_sps[1] >= EVC_MAX_NUM_RPLS) { + ret = AVERROR_INVALIDDATA; + goto fail; + } + for (int i = 0; i < sps->num_ref_pic_list_in_sps[1]; ++i) { + ret = ref_pic_list_struct(sps, gb, &sps->rpls[1][i]); + if (ret < 0) + goto fail; + } } } @@ -283,8 +318,11 @@ int ff_evc_parse_sps(GetBitContext *gb, EVCParamSets *ps) } sps->vui_parameters_present_flag = get_bits1(gb); - if (sps->vui_parameters_present_flag) - vui_parameters(gb, &(sps->vui_parameters)); + if (sps->vui_parameters_present_flag) { + ret = vui_parameters(gb, &(sps->vui_parameters)); + if (ret < 0) + goto fail; + } // @note // If necessary, add the missing fields to the EVCParserSPS structure diff --git a/arm/android/third_party/ffmpeg/libavcodec/exr.c b/arm/android/third_party/ffmpeg/libavcodec/exr.c index fae1d08a..b30d3b74 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/exr.c +++ b/arm/android/third_party/ffmpeg/libavcodec/exr.c @@ -404,8 +404,8 @@ static int huf_build_dec_table(const EXRContext *s, td->he[j].code = td->freq[iM] >> 6; j++; - ff_free_vlc(&td->vlc); - return ff_init_vlc_sparse(&td->vlc, 12, j, + ff_vlc_free(&td->vlc); + return ff_vlc_init_sparse(&td->vlc, 12, j, &td->he[0].len, sizeof(td->he[0]), sizeof(td->he[0].len), &td->he[0].code, sizeof(td->he[0]), sizeof(td->he[0].code), &td->he[0].sym, sizeof(td->he[0]), sizeof(td->he[0].sym), 0); @@ -760,8 +760,8 @@ static int pxr24_uncompress(const EXRContext *s, const uint8_t *src, static void unpack_14(const uint8_t b[14], uint16_t s[16]) { - unsigned short shift = (b[ 2] >> 2) & 15; - unsigned short bias = (0x20 << shift); + uint16_t shift = (b[ 2] >> 2) & 15; + uint16_t bias = (0x20 << shift); int i; s[ 0] = (b[0] << 8) | b[1]; @@ -1870,7 +1870,7 @@ static int decode_header(EXRContext *s, AVFrame *frame) continue; } else if ((var_size = check_header_variable(s, "tiles", "tiledesc", 22)) >= 0) { - char tileLevel; + uint8_t tileLevel; if (!s->is_tile) av_log(s->avctx, AV_LOG_WARNING, @@ -2088,6 +2088,8 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture, if (s->apply_trc_type != AVCOL_TRC_UNSPECIFIED) avctx->color_trc = s->apply_trc_type; + else if (s->gamma > 0.9999f && s->gamma < 1.0001f) + avctx->color_trc = AVCOL_TRC_LINEAR; switch (s->compression) { case EXR_RAW: @@ -2282,7 +2284,7 @@ static av_cold int decode_end(AVCodecContext *avctx) av_freep(&td->dc_data); av_freep(&td->rle_data); av_freep(&td->rle_raw_data); - ff_free_vlc(&td->vlc); + ff_vlc_free(&td->vlc); } av_freep(&s->thread_data); diff --git a/arm/android/third_party/ffmpeg/libavcodec/extract_extradata_bsf.c b/arm/android/third_party/ffmpeg/libavcodec/extract_extradata_bsf.c index d5c81a27..baa62929 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/extract_extradata_bsf.c +++ b/arm/android/third_party/ffmpeg/libavcodec/extract_extradata_bsf.c @@ -49,25 +49,53 @@ typedef struct ExtractExtradataContext { int remove; } ExtractExtradataContext; -static int val_in_array(const int *arr, int len, int val) +static int val_in_array(const int *arr, size_t len, int val) { - int i; - for (i = 0; i < len; i++) + for (size_t i = 0; i < len; i++) if (arr[i] == val) return 1; return 0; } -static int extract_extradata_av1(AVBSFContext *ctx, AVPacket *pkt, - uint8_t **data, int *size) +static int metadata_is_global(const AV1OBU *obu) +{ + static const int metadata_obu_types[] = { + AV1_METADATA_TYPE_HDR_CLL, AV1_METADATA_TYPE_HDR_MDCV, + }; + GetBitContext gb; + int metadata_type; + + if (init_get_bits(&gb, obu->data, obu->size_bits) < 0) + return 0; + + metadata_type = leb128(&gb); + + return val_in_array(metadata_obu_types, FF_ARRAY_ELEMS(metadata_obu_types), + metadata_type); +} + +static int obu_is_global(const AV1OBU *obu) { static const int extradata_obu_types[] = { AV1_OBU_SEQUENCE_HEADER, AV1_OBU_METADATA, }; + + if (!val_in_array(extradata_obu_types, FF_ARRAY_ELEMS(extradata_obu_types), + obu->type)) + return 0; + if (obu->type != AV1_OBU_METADATA) + return 1; + + return metadata_is_global(obu); +} + +static int extract_extradata_av1(AVBSFContext *ctx, AVPacket *pkt, + uint8_t **data, int *size) +{ + ExtractExtradataContext *s = ctx->priv_data; int extradata_size = 0, filtered_size = 0; - int nb_extradata_obu_types = FF_ARRAY_ELEMS(extradata_obu_types); int i, has_seq = 0, ret = 0; ret = ff_av1_packet_split(&s->av1_pkt, pkt->data, pkt->size, ctx); @@ -76,7 +104,7 @@ static int extract_extradata_av1(AVBSFContext *ctx, AVPacket *pkt, for (i = 0; i < s->av1_pkt.nb_obus; i++) { AV1OBU *obu = &s->av1_pkt.obus[i]; - if (val_in_array(extradata_obu_types, nb_extradata_obu_types, obu->type)) { + if (obu_is_global(obu)) { extradata_size += obu->raw_size; if (obu->type == AV1_OBU_SEQUENCE_HEADER) has_seq = 1; @@ -113,8 +141,7 @@ static int extract_extradata_av1(AVBSFContext *ctx, AVPacket *pkt, for (i = 0; i < s->av1_pkt.nb_obus; i++) { AV1OBU *obu = &s->av1_pkt.obus[i]; - if (val_in_array(extradata_obu_types, nb_extradata_obu_types, - obu->type)) { + if (obu_is_global(obu)) { bytestream2_put_bufferu(&pb_extradata, obu->raw_data, obu->raw_size); } else if (s->remove) { bytestream2_put_bufferu(&pb_filtered_data, obu->raw_data, obu->raw_size); @@ -149,7 +176,7 @@ static int extract_extradata_h2645(AVBSFContext *ctx, AVPacket *pkt, int extradata_size = 0, filtered_size = 0; const int *extradata_nal_types; - int nb_extradata_nal_types; + size_t nb_extradata_nal_types; int i, has_sps = 0, has_vps = 0, ret = 0; if (ctx->par_in->codec_id == AV_CODEC_ID_VVC) { diff --git a/arm/android/third_party/ffmpeg/libavcodec/faandct.c b/arm/android/third_party/ffmpeg/libavcodec/faandct.c index 38c392bb..b0b11859 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/faandct.c +++ b/arm/android/third_party/ffmpeg/libavcodec/faandct.c @@ -26,6 +26,7 @@ */ #include "faandct.h" +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "libavutil/libm.h" diff --git a/arm/android/third_party/ffmpeg/libavcodec/faanidct.c b/arm/android/third_party/ffmpeg/libavcodec/faanidct.c index 3921f82d..f2667fb7 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/faanidct.c +++ b/arm/android/third_party/ffmpeg/libavcodec/faanidct.c @@ -20,6 +20,7 @@ */ #include "faanidct.h" #include "libavutil/common.h" +#include "libavutil/emms.h" /* To allow switching to double. */ typedef float FLOAT; diff --git a/arm/android/third_party/ffmpeg/libavcodec/faxcompr.c b/arm/android/third_party/ffmpeg/libavcodec/faxcompr.c index d9dec3fc..62729fe9 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/faxcompr.c +++ b/arm/android/third_party/ffmpeg/libavcodec/faxcompr.c @@ -108,13 +108,13 @@ static av_cold void ccitt_unpack_init(void) ccitt_vlc[1].table = code_table2; ccitt_vlc[1].table_allocated = 648; for (i = 0; i < 2; i++) { - ff_init_vlc_sparse(&ccitt_vlc[i], 9, CCITT_SYMS, + ff_vlc_init_sparse(&ccitt_vlc[i], 9, CCITT_SYMS, ccitt_codes_lens[i], 1, 1, ccitt_codes_bits[i], 1, 1, ccitt_syms, 2, 2, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); } - INIT_VLC_STATIC(&ccitt_group3_2d_vlc, 9, 11, + VLC_INIT_STATIC(&ccitt_group3_2d_vlc, 9, 11, ccitt_group3_2d_lens, 1, 1, ccitt_group3_2d_bits, 1, 1, 512); } diff --git a/arm/android/third_party/ffmpeg/libavcodec/fdctdsp.c b/arm/android/third_party/ffmpeg/libavcodec/fdctdsp.c index 5306c9d0..f8ba1742 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/fdctdsp.c +++ b/arm/android/third_party/ffmpeg/libavcodec/fdctdsp.c @@ -18,7 +18,6 @@ #include "libavutil/attributes.h" #include "avcodec.h" -#include "dct.h" #include "faandct.h" #include "fdctdsp.h" #include "config.h" diff --git a/arm/android/third_party/ffmpeg/libavcodec/fdctdsp.h b/arm/android/third_party/ffmpeg/libavcodec/fdctdsp.h index 3e1f683b..7378eab8 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/fdctdsp.h +++ b/arm/android/third_party/ffmpeg/libavcodec/fdctdsp.h @@ -21,17 +21,28 @@ #include -#include "avcodec.h" +#include "libavutil/attributes_internal.h" + +struct AVCodecContext; typedef struct FDCTDSPContext { void (*fdct)(int16_t *block /* align 16 */); void (*fdct248)(int16_t *block /* align 16 */); } FDCTDSPContext; -void ff_fdctdsp_init(FDCTDSPContext *c, AVCodecContext *avctx); -void ff_fdctdsp_init_ppc(FDCTDSPContext *c, AVCodecContext *avctx, +FF_VISIBILITY_PUSH_HIDDEN +void ff_fdctdsp_init(FDCTDSPContext *c, struct AVCodecContext *avctx); +void ff_fdctdsp_init_ppc(FDCTDSPContext *c, struct AVCodecContext *avctx, unsigned high_bit_depth); -void ff_fdctdsp_init_x86(FDCTDSPContext *c, AVCodecContext *avctx, +void ff_fdctdsp_init_x86(FDCTDSPContext *c, struct AVCodecContext *avctx, unsigned high_bit_depth); +void ff_fdct_ifast(int16_t *data); +void ff_fdct_ifast248(int16_t *data); +void ff_jpeg_fdct_islow_8(int16_t *data); +void ff_jpeg_fdct_islow_10(int16_t *data); +void ff_fdct248_islow_8(int16_t *data); +void ff_fdct248_islow_10(int16_t *data); +FF_VISIBILITY_POP_HIDDEN + #endif /* AVCODEC_FDCTDSP_H */ diff --git a/arm/android/third_party/ffmpeg/libavcodec/ffjni.c b/arm/android/third_party/ffmpeg/libavcodec/ffjni.c index 154be9ae..e3cf24d3 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/ffjni.c +++ b/arm/android/third_party/ffmpeg/libavcodec/ffjni.c @@ -25,6 +25,7 @@ #include #include "libavutil/bprint.h" +#include "libavutil/error.h" #include "libavutil/log.h" #include "libavutil/mem.h" diff --git a/arm/android/third_party/ffmpeg/libavcodec/fflcms2.c b/arm/android/third_party/ffmpeg/libavcodec/fflcms2.c index 5443f178..3b67e62d 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/fflcms2.c +++ b/arm/android/third_party/ffmpeg/libavcodec/fflcms2.c @@ -201,6 +201,57 @@ static av_always_inline void XYZ_xy(cmsCIEXYZ XYZ, AVCIExy *xy) xy->y = av_d2q(k * XYZ.Y, 100000); } +static av_always_inline AVRational abs_sub_q(AVRational r1, AVRational r2) +{ + AVRational diff = av_sub_q(r1, r2); + /* denominator assumed to be positive */ + return av_make_q(abs(diff.num), diff.den); +} + +static const AVCIExy wp_d50 = { {3457, 10000}, {3585, 10000} }; /* CIE D50 */ + +int ff_icc_profile_sanitize(FFIccContext *s, cmsHPROFILE profile) +{ + cmsCIEXYZ *white, fixed; + AVCIExy wpxy; + AVRational diff, z; + if (!profile) + return 0; + + if (cmsGetEncodedICCversion(profile) >= 0x4000000) { // ICC v4 + switch (cmsGetHeaderRenderingIntent(profile)) { + case INTENT_RELATIVE_COLORIMETRIC: + case INTENT_ABSOLUTE_COLORIMETRIC: ; + /* ICC v4 colorimetric profiles are specified to always use D50 + * media white point, anything else is a violation of the spec. + * Sadly, such profiles are incredibly common (Apple...), so make + * an effort to fix them. */ + if (!(white = cmsReadTag(profile, cmsSigMediaWhitePointTag))) + return AVERROR_INVALIDDATA; + XYZ_xy(*white, &wpxy); + diff = av_add_q(abs_sub_q(wpxy.x, wp_d50.x), abs_sub_q(wpxy.y, wp_d50.y)); + if (av_cmp_q(diff, av_make_q(1, 1000)) > 0) { + av_log(s->avctx, AV_LOG_WARNING, "Invalid colorimetric ICCv4 " + "profile media white point tag (expected %.4f %.4f, " + "got %.4f %.4f)\n", + av_q2d(wp_d50.x), av_q2d(wp_d50.y), + av_q2d(wpxy.x), av_q2d(wpxy.y)); + /* x+y+z = 1 */ + z = av_sub_q(av_sub_q(av_make_q(1, 1), wp_d50.x), wp_d50.y); + fixed.X = av_q2d(av_div_q(wp_d50.x, wp_d50.y)) * white->Y; + fixed.Y = white->Y; + fixed.Z = av_q2d(av_div_q(z, wp_d50.y)) * white->Y; + if (!cmsWriteTag(profile, cmsSigMediaWhitePointTag, &fixed)) + return AVERROR_EXTERNAL; + } + break; + default: break; + } + } + + return 0; +} + int ff_icc_profile_read_primaries(FFIccContext *s, cmsHPROFILE profile, AVColorPrimariesDesc *out_primaries) { diff --git a/arm/android/third_party/ffmpeg/libavcodec/fflcms2.h b/arm/android/third_party/ffmpeg/libavcodec/fflcms2.h index af63c9a1..b54173e5 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/fflcms2.h +++ b/arm/android/third_party/ffmpeg/libavcodec/fflcms2.h @@ -65,6 +65,13 @@ int ff_icc_profile_generate(FFIccContext *s, */ int ff_icc_profile_attach(FFIccContext *s, cmsHPROFILE profile, AVFrame *frame); +/** + * Sanitize an ICC profile to try and fix badly broken values. + * + * Returns 0 on success, or a negative error code. + */ +int ff_icc_profile_sanitize(FFIccContext *s, cmsHPROFILE profile); + /** * Read the color primaries and white point coefficients encoded by an ICC * profile, and return the raw values in `out_primaries`. diff --git a/arm/android/third_party/ffmpeg/libavcodec/ffv1dec.c b/arm/android/third_party/ffmpeg/libavcodec/ffv1dec.c index 54cf075b..a376a4c8 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/ffv1dec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/ffv1dec.c @@ -626,6 +626,9 @@ static int read_header(FFV1Context *f) } else if (f->avctx->bits_per_raw_sample == 12) { f->packed_at_lsb = 1; f->avctx->pix_fmt = AV_PIX_FMT_GRAY12; + } else if (f->avctx->bits_per_raw_sample == 14) { + f->packed_at_lsb = 1; + f->avctx->pix_fmt = AV_PIX_FMT_GRAY14; } else if (f->avctx->bits_per_raw_sample == 16) { f->packed_at_lsb = 1; f->avctx->pix_fmt = AV_PIX_FMT_GRAY16; @@ -690,6 +693,12 @@ static int read_header(FFV1Context *f) case 0x10: f->avctx->pix_fmt = AV_PIX_FMT_YUV422P12; break; case 0x11: f->avctx->pix_fmt = AV_PIX_FMT_YUV420P12; break; } + } else if (f->avctx->bits_per_raw_sample == 12 && f->transparency) { + f->packed_at_lsb = 1; + switch(16 * f->chroma_h_shift + f->chroma_v_shift) { + case 0x00: f->avctx->pix_fmt = AV_PIX_FMT_YUVA444P12; break; + case 0x10: f->avctx->pix_fmt = AV_PIX_FMT_YUVA422P12; break; + } } else if (f->avctx->bits_per_raw_sample == 14 && !f->transparency) { f->packed_at_lsb = 1; switch(16 * f->chroma_h_shift + f->chroma_v_shift) { @@ -734,6 +743,8 @@ static int read_header(FFV1Context *f) f->avctx->pix_fmt = AV_PIX_FMT_GBRAP12; else if (f->avctx->bits_per_raw_sample == 14 && !f->transparency) f->avctx->pix_fmt = AV_PIX_FMT_GBRP14; + else if (f->avctx->bits_per_raw_sample == 14 && f->transparency) + f->avctx->pix_fmt = AV_PIX_FMT_GBRAP14; else if (f->avctx->bits_per_raw_sample == 16 && !f->transparency) { f->avctx->pix_fmt = AV_PIX_FMT_GBRP16; f->use32bit = 1; @@ -1061,26 +1072,19 @@ static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src) if (dst == src) return 0; - { - ThreadFrame picture = fdst->picture, last_picture = fdst->last_picture; - uint8_t (*initial_states[MAX_QUANT_TABLES])[32]; - struct FFV1Context *slice_context[MAX_SLICES]; - memcpy(initial_states, fdst->initial_states, sizeof(fdst->initial_states)); - memcpy(slice_context, fdst->slice_context , sizeof(fdst->slice_context)); + copy_fields(fdst, fsrc, fsrc); + fdst->use32bit = fsrc->use32bit; + memcpy(fdst->state_transition, fsrc->state_transition, + sizeof(fdst->state_transition)); + memcpy(fdst->quant_table, fsrc->quant_table, sizeof(fsrc->quant_table)); - memcpy(fdst, fsrc, sizeof(*fdst)); - memcpy(fdst->initial_states, initial_states, sizeof(fdst->initial_states)); - memcpy(fdst->slice_context, slice_context , sizeof(fdst->slice_context)); - fdst->picture = picture; - fdst->last_picture = last_picture; - for (i = 0; inum_h_slices * fdst->num_v_slices; i++) { - FFV1Context *fssrc = fsrc->slice_context[i]; - FFV1Context *fsdst = fdst->slice_context[i]; - copy_fields(fsdst, fssrc, fsrc); - } - av_assert0(!fdst->plane[0].state); - av_assert0(!fdst->sample_buffer); + for (i = 0; i < fdst->num_h_slices * fdst->num_v_slices; i++) { + FFV1Context *fssrc = fsrc->slice_context[i]; + FFV1Context *fsdst = fdst->slice_context[i]; + copy_fields(fsdst, fssrc, fsrc); } + av_assert0(!fdst->plane[0].state); + av_assert0(!fdst->sample_buffer); av_assert1(fdst->max_slice_count == fsrc->max_slice_count); diff --git a/arm/android/third_party/ffmpeg/libavcodec/ffv1enc.c b/arm/android/third_party/ffmpeg/libavcodec/ffv1enc.c index 746f7175..2778c630 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/ffv1enc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/ffv1enc.c @@ -585,8 +585,11 @@ static av_cold int encode_init(AVCodecContext *avctx) case AV_PIX_FMT_YUV440P12: case AV_PIX_FMT_YUV420P12: case AV_PIX_FMT_YUV422P12: + case AV_PIX_FMT_YUVA444P12: + case AV_PIX_FMT_YUVA422P12: if (!avctx->bits_per_raw_sample && !s->bits_per_raw_sample) s->bits_per_raw_sample = 12; + case AV_PIX_FMT_GRAY14: case AV_PIX_FMT_YUV444P14: case AV_PIX_FMT_YUV420P14: case AV_PIX_FMT_YUV422P14: @@ -667,6 +670,7 @@ static av_cold int encode_init(AVCodecContext *avctx) if (!avctx->bits_per_raw_sample && !s->bits_per_raw_sample) s->bits_per_raw_sample = 12; case AV_PIX_FMT_GBRP14: + case AV_PIX_FMT_GBRAP14: if (!avctx->bits_per_raw_sample && !s->bits_per_raw_sample) s->bits_per_raw_sample = 14; case AV_PIX_FMT_GBRP16: @@ -1284,13 +1288,14 @@ const FFCodec ff_ffv1_encoder = { AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUVA444P16, AV_PIX_FMT_YUVA422P16, AV_PIX_FMT_YUVA420P16, + AV_PIX_FMT_YUVA444P12, AV_PIX_FMT_YUVA422P12, AV_PIX_FMT_YUVA444P10, AV_PIX_FMT_YUVA422P10, AV_PIX_FMT_YUVA420P10, AV_PIX_FMT_YUVA444P9, AV_PIX_FMT_YUVA422P9, AV_PIX_FMT_YUVA420P9, AV_PIX_FMT_GRAY16, AV_PIX_FMT_GRAY8, AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10, - AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14, + AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14, AV_PIX_FMT_GBRAP14, AV_PIX_FMT_GBRAP10, AV_PIX_FMT_GBRAP12, AV_PIX_FMT_YA8, - AV_PIX_FMT_GRAY10, AV_PIX_FMT_GRAY12, + AV_PIX_FMT_GRAY10, AV_PIX_FMT_GRAY12, AV_PIX_FMT_GRAY14, AV_PIX_FMT_GBRP16, AV_PIX_FMT_RGB48, AV_PIX_FMT_GBRAP16, AV_PIX_FMT_RGBA64, AV_PIX_FMT_GRAY9, diff --git a/arm/android/third_party/ffmpeg/libavcodec/flac.c b/arm/android/third_party/ffmpeg/libavcodec/flac.c index 174b4801..fac4cff9 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/flac.c +++ b/arm/android/third_party/ffmpeg/libavcodec/flac.c @@ -48,14 +48,14 @@ static int64_t get_utf8(GetBitContext *gb) return val; } -int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, +int ff_flac_decode_frame_header(void *logctx, GetBitContext *gb, FLACFrameInfo *fi, int log_level_offset) { int bs_code, sr_code, bps_code; /* frame sync code */ if ((get_bits(gb, 15) & 0x7FFF) != 0x7FFC) { - av_log(avctx, AV_LOG_ERROR + log_level_offset, "invalid sync code\n"); + av_log(logctx, AV_LOG_ERROR + log_level_offset, "invalid sync code\n"); return AVERROR_INVALIDDATA; } @@ -75,7 +75,7 @@ int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, fi->channels = 2; fi->ch_mode -= FLAC_MAX_CHANNELS - 1; } else { - av_log(avctx, AV_LOG_ERROR + log_level_offset, + av_log(logctx, AV_LOG_ERROR + log_level_offset, "invalid channel mode: %d\n", fi->ch_mode); return AVERROR_INVALIDDATA; } @@ -83,7 +83,7 @@ int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, /* bits per sample */ bps_code = get_bits(gb, 3); if (bps_code == 3) { - av_log(avctx, AV_LOG_ERROR + log_level_offset, + av_log(logctx, AV_LOG_ERROR + log_level_offset, "invalid sample size code (%d)\n", bps_code); return AVERROR_INVALIDDATA; @@ -92,7 +92,7 @@ int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, /* reserved bit */ if (get_bits1(gb)) { - av_log(avctx, AV_LOG_ERROR + log_level_offset, + av_log(logctx, AV_LOG_ERROR + log_level_offset, "broken stream, invalid padding\n"); return AVERROR_INVALIDDATA; } @@ -100,14 +100,14 @@ int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, /* sample or frame count */ fi->frame_or_sample_num = get_utf8(gb); if (fi->frame_or_sample_num < 0) { - av_log(avctx, AV_LOG_ERROR + log_level_offset, + av_log(logctx, AV_LOG_ERROR + log_level_offset, "sample/frame number invalid; utf8 fscked\n"); return AVERROR_INVALIDDATA; } /* blocksize */ if (bs_code == 0) { - av_log(avctx, AV_LOG_ERROR + log_level_offset, + av_log(logctx, AV_LOG_ERROR + log_level_offset, "reserved blocksize code: 0\n"); return AVERROR_INVALIDDATA; } else if (bs_code == 6) { @@ -128,7 +128,7 @@ int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, } else if (sr_code == 14) { fi->samplerate = get_bits(gb, 16) * 10; } else { - av_log(avctx, AV_LOG_ERROR + log_level_offset, + av_log(logctx, AV_LOG_ERROR + log_level_offset, "illegal sample rate code %d\n", sr_code); return AVERROR_INVALIDDATA; @@ -138,7 +138,7 @@ int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, skip_bits(gb, 8); if (av_crc(av_crc_get_table(AV_CRC_8_ATM), 0, gb->buffer, get_bits_count(gb)/8)) { - av_log(avctx, AV_LOG_ERROR + log_level_offset, + av_log(logctx, AV_LOG_ERROR + log_level_offset, "header crc mismatch\n"); return AVERROR_INVALIDDATA; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/flac_parse.h b/arm/android/third_party/ffmpeg/libavcodec/flac_parse.h index 67a7320b..b0cbad82 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/flac_parse.h +++ b/arm/android/third_party/ffmpeg/libavcodec/flac_parse.h @@ -75,13 +75,13 @@ int ff_flac_is_extradata_valid(AVCodecContext *avctx, /** * Validate and decode a frame header. - * @param avctx AVCodecContext to use as av_log() context + * @param logctx context for logging * @param gb GetBitContext from which to read frame header * @param[out] fi frame information * @param log_level_offset log level offset. can be used to silence error messages. * @return non-zero on error, 0 if ok */ -int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, +int ff_flac_decode_frame_header(void *logctx, GetBitContext *gb, FLACFrameInfo *fi, int log_level_offset); void ff_flac_set_channel_layout(AVCodecContext *avctx, int channels); diff --git a/arm/android/third_party/ffmpeg/libavcodec/flacdec.c b/arm/android/third_party/ffmpeg/libavcodec/flacdec.c index 524a0469..ed2de14d 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/flacdec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/flacdec.c @@ -366,19 +366,19 @@ static int decode_subframe_fixed(FLACContext *s, int32_t *decoded, break; \ case 1: \ for (int i = pred_order; i < blocksize; i++) \ - decoded[i] = (int64_t)residual[i] + (int64_t)decoded[i-1];\ + decoded[i] = (uint64_t)residual[i] + (uint64_t)decoded[i-1];\ break; \ case 2: \ for (int i = pred_order; i < blocksize; i++) \ - decoded[i] = (int64_t)residual[i] + 2*(int64_t)decoded[i-1] - (int64_t)decoded[i-2]; \ + decoded[i] = (uint64_t)residual[i] + 2*(uint64_t)decoded[i-1] - (uint64_t)decoded[i-2]; \ break; \ case 3: \ for (int i = pred_order; i < blocksize; i++) \ - decoded[i] = (int64_t)residual[i] + 3*(int64_t)decoded[i-1] - 3*(int64_t)decoded[i-2] + (int64_t)decoded[i-3]; \ + decoded[i] = (uint64_t)residual[i] + 3*(uint64_t)decoded[i-1] - 3*(uint64_t)decoded[i-2] + (uint64_t)decoded[i-3]; \ break; \ case 4: \ for (int i = pred_order; i < blocksize; i++) \ - decoded[i] = (int64_t)residual[i] + 4*(int64_t)decoded[i-1] - 6*(int64_t)decoded[i-2] + 4*(int64_t)decoded[i-3] - (int64_t)decoded[i-4]; \ + decoded[i] = (uint64_t)residual[i] + 4*(uint64_t)decoded[i-1] - 6*(uint64_t)decoded[i-2] + 4*(uint64_t)decoded[i-3] - (uint64_t)decoded[i-4]; \ break; \ default: \ av_log(s->avctx, AV_LOG_ERROR, "illegal pred order %d\n", pred_order); \ @@ -706,10 +706,10 @@ static void decorrelate_33bps(int ch_mode, int32_t **decoded, int64_t *decoded_3 int i; if (ch_mode == FLAC_CHMODE_LEFT_SIDE ) { for (i = 0; i < len; i++) - decoded[1][i] = decoded[0][i] - decoded_33bps[i]; + decoded[1][i] = decoded[0][i] - (uint64_t)decoded_33bps[i]; } else if (ch_mode == FLAC_CHMODE_RIGHT_SIDE ) { for (i = 0; i < len; i++) - decoded[0][i] = decoded[1][i] + decoded_33bps[i]; + decoded[0][i] = decoded[1][i] + (uint64_t)decoded_33bps[i]; } else if (ch_mode == FLAC_CHMODE_MID_SIDE ) { for (i = 0; i < len; i++) { uint64_t a = decoded[0][i]; diff --git a/arm/android/third_party/ffmpeg/libavcodec/flicvideo.c b/arm/android/third_party/ffmpeg/libavcodec/flicvideo.c index e4b334e1..6ce033ba 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/flicvideo.c +++ b/arm/android/third_party/ffmpeg/libavcodec/flicvideo.c @@ -60,12 +60,28 @@ #define FLC_DTA_TYPE_CODE (0xAF44) /* Marks an "Extended FLC" comes from Dave's Targa Animator (DTA) */ #define FLC_MAGIC_CARPET_SYNTHETIC_TYPE_CODE (0xAF13) +static inline int check_pixel_ptr(ptrdiff_t ptr, int n, + ptrdiff_t limit, int direction) +{ + if (( direction && ptr + n > limit) || + (!direction && ptr + n < limit)) + return AVERROR_INVALIDDATA; + return 0; +} + #define CHECK_PIXEL_PTR(n) \ - if (pixel_ptr + n > pixel_limit) { \ - av_log (s->avctx, AV_LOG_ERROR, "Invalid pixel_ptr = %d > pixel_limit = %d\n", \ - pixel_ptr + n, pixel_limit); \ - return AVERROR_INVALIDDATA; \ - } \ +{ \ + ret = check_pixel_ptr(pixel_ptr, (n), pixel_limit, direction); \ + if (ret < 0) \ + return ret; \ +} + +#define CHECK_Y_PTR() \ +{ \ + ret = check_pixel_ptr(y_ptr, 0, pixel_limit, direction); \ + if (ret < 0) \ + return ret; \ +} typedef struct FlicDecodeContext { AVCodecContext *avctx; @@ -79,7 +95,7 @@ typedef struct FlicDecodeContext { static av_cold int flic_decode_init(AVCodecContext *avctx) { FlicDecodeContext *s = avctx->priv_data; - unsigned char *fli_header = (unsigned char *)avctx->extradata; + uint8_t *fli_header = avctx->extradata; int depth; if (avctx->extradata_size != 0 && @@ -128,6 +144,7 @@ static av_cold int flic_decode_init(AVCodecContext *avctx) } switch (depth) { + case 1 : avctx->pix_fmt = AV_PIX_FMT_MONOBLACK; break; case 8 : avctx->pix_fmt = AV_PIX_FMT_PAL8; break; case 15 : avctx->pix_fmt = AV_PIX_FMT_RGB555; break; case 16 : avctx->pix_fmt = AV_PIX_FMT_RGB565; break; @@ -146,6 +163,198 @@ static av_cold int flic_decode_init(AVCodecContext *avctx) return 0; } +static int flic_decode_frame_1BPP(AVCodecContext *avctx, + AVFrame *rframe, int *got_frame, + const uint8_t *buf, int buf_size) +{ + FlicDecodeContext *s = avctx->priv_data; + + GetByteContext g2; + ptrdiff_t pixel_ptr; + + unsigned int frame_size; + int num_chunks; + + unsigned int chunk_size; + int chunk_type; + + int i, j, ret, direction; + + int lines; + int compressed_lines; + int starting_line; + int line_packets; + ptrdiff_t y_ptr; + int byte_run; + int pixel_skip; + int pixel_countdown; + unsigned char *pixels; + ptrdiff_t pixel_limit; + + bytestream2_init(&g2, buf, buf_size); + + if ((ret = ff_reget_buffer(avctx, s->frame, 0)) < 0) + return ret; + + direction = s->frame->linesize[0] > 0; + pixels = s->frame->data[0]; + pixel_limit = s->avctx->height * s->frame->linesize[0]; + if (buf_size < 16 || buf_size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE) + return AVERROR_INVALIDDATA; + frame_size = bytestream2_get_le32(&g2); + if (frame_size > buf_size) + frame_size = buf_size; + bytestream2_skip(&g2, 2); /* skip the magic number */ + num_chunks = bytestream2_get_le16(&g2); + bytestream2_skip(&g2, 8); /* skip padding */ + + if (frame_size < 16) + return AVERROR_INVALIDDATA; + + frame_size -= 16; + + /* iterate through the chunks */ + while ((frame_size >= 6) && (num_chunks > 0) && + bytestream2_get_bytes_left(&g2) >= 4) { + int stream_ptr_after_chunk; + chunk_size = bytestream2_get_le32(&g2); + if (chunk_size > frame_size) { + av_log(avctx, AV_LOG_WARNING, + "Invalid chunk_size = %u > frame_size = %u\n", chunk_size, frame_size); + chunk_size = frame_size; + } + stream_ptr_after_chunk = bytestream2_tell(&g2) - 4 + chunk_size; + + chunk_type = bytestream2_get_le16(&g2); + + switch (chunk_type) { + case FLI_BRUN: + /* Byte run compression: This chunk type only occurs in the first + * FLI frame and it will update the entire frame. */ + y_ptr = 0; + for (lines = 0; lines < s->avctx->height; lines++) { + pixel_ptr = y_ptr; + /* disregard the line packets; instead, iterate through all + * pixels on a row */ + bytestream2_skip(&g2, 1); + pixel_countdown = (s->avctx->width + 7) >> 3; + while (pixel_countdown > 0) { + if (bytestream2_tell(&g2) + 1 > stream_ptr_after_chunk) + break; + byte_run = sign_extend(bytestream2_get_byte(&g2), 8); + if (!byte_run) { + av_log(avctx, AV_LOG_ERROR, "Invalid byte run value.\n"); + return AVERROR_INVALIDDATA; + } + + if (byte_run > 0) { + int value = bytestream2_get_byte(&g2); + CHECK_PIXEL_PTR(byte_run); + for (j = 0; j < byte_run; j++) { + pixels[pixel_ptr++] = value; + pixel_countdown--; + if (pixel_countdown < 0) + av_log(avctx, AV_LOG_ERROR, "pixel_countdown < 0 (%d) at line %d\n", + pixel_countdown, lines); + } + } else { /* copy bytes if byte_run < 0 */ + byte_run = -byte_run; + CHECK_PIXEL_PTR(byte_run); + if (bytestream2_tell(&g2) + byte_run > stream_ptr_after_chunk) + break; + for (j = 0; j < byte_run; j++) { + pixels[pixel_ptr++] = bytestream2_get_byte(&g2); + pixel_countdown--; + if (pixel_countdown < 0) + av_log(avctx, AV_LOG_ERROR, "pixel_countdown < 0 (%d) at line %d\n", + pixel_countdown, lines); + } + } + } + + y_ptr += s->frame->linesize[0]; + } + break; + + case FLI_LC: + /* line compressed */ + starting_line = bytestream2_get_le16(&g2); + if (starting_line >= s->avctx->height) + return AVERROR_INVALIDDATA; + y_ptr = 0; + y_ptr += starting_line * s->frame->linesize[0]; + + compressed_lines = bytestream2_get_le16(&g2); + while (compressed_lines > 0) { + pixel_ptr = y_ptr; + CHECK_PIXEL_PTR(0); + pixel_countdown = (s->avctx->width + 7) >> 3; + if (bytestream2_tell(&g2) + 1 > stream_ptr_after_chunk) + break; + line_packets = bytestream2_get_byte(&g2); + if (line_packets > 0) { + for (i = 0; i < line_packets; i++) { + /* account for the skip bytes */ + if (bytestream2_tell(&g2) + 1 > stream_ptr_after_chunk) + break; + pixel_skip = bytestream2_get_byte(&g2); + pixel_ptr += pixel_skip; + pixel_countdown -= pixel_skip; + byte_run = sign_extend(bytestream2_get_byte(&g2),8); + if (byte_run > 0) { + CHECK_PIXEL_PTR(byte_run); + if (bytestream2_tell(&g2) + byte_run > stream_ptr_after_chunk) + break; + for (j = 0; j < byte_run; j++, pixel_countdown--) { + pixels[pixel_ptr++] = bytestream2_get_byte(&g2); + } + } else if (byte_run < 0) { + int value = bytestream2_get_byte(&g2); + byte_run = -byte_run; + CHECK_PIXEL_PTR(byte_run); + for (j = 0; j < byte_run; j++, pixel_countdown--) { + pixels[pixel_ptr++] = value; + } + } + } + } + + y_ptr += s->frame->linesize[0]; + compressed_lines--; + } + break; + + default: + av_log(avctx, AV_LOG_ERROR, "Unrecognized chunk type: %d\n", chunk_type); + break; + } + + if (stream_ptr_after_chunk - bytestream2_tell(&g2) >= 0) { + bytestream2_skip(&g2, stream_ptr_after_chunk - bytestream2_tell(&g2)); + } else { + av_log(avctx, AV_LOG_ERROR, "Chunk overread\n"); + break; + } + + frame_size -= chunk_size; + num_chunks--; + } + + /* by the end of the chunk, the stream ptr should equal the frame + * size (minus 1 or 2, possibly); if it doesn't, issue a warning */ + if (bytestream2_get_bytes_left(&g2) > 2) + av_log(avctx, AV_LOG_ERROR, "Processed FLI chunk where chunk size = %d " \ + "and final chunk ptr = %d\n", buf_size, + buf_size - bytestream2_get_bytes_left(&g2)); + + if ((ret = av_frame_ref(rframe, s->frame)) < 0) + return ret; + + *got_frame = 1; + + return buf_size; +} + static int flic_decode_frame_8BPP(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, const uint8_t *buf, int buf_size) @@ -153,7 +362,7 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx, FlicDecodeContext *s = avctx->priv_data; GetByteContext g2; - int pixel_ptr; + ptrdiff_t pixel_ptr; int palette_ptr; unsigned char palette_idx1; unsigned char palette_idx2; @@ -164,7 +373,7 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx, unsigned int chunk_size; int chunk_type; - int i, j, ret; + int i, j, ret, direction; int color_packets; int color_changes; @@ -175,18 +384,19 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx, int compressed_lines; int starting_line; int line_packets; - int y_ptr; + ptrdiff_t y_ptr; int byte_run; int pixel_skip; int pixel_countdown; unsigned char *pixels; - unsigned int pixel_limit; + ptrdiff_t pixel_limit; bytestream2_init(&g2, buf, buf_size); if ((ret = ff_reget_buffer(avctx, s->frame, 0)) < 0) return ret; + direction = s->frame->linesize[0] > 0; pixels = s->frame->data[0]; pixel_limit = s->avctx->height * s->frame->linesize[0]; if (buf_size < 16 || buf_size > INT_MAX - (3 * 256 + AV_INPUT_BUFFER_PADDING_SIZE)) @@ -271,8 +481,7 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx, while (compressed_lines > 0) { if (bytestream2_tell(&g2) + 2 > stream_ptr_after_chunk) break; - if (y_ptr > pixel_limit) - return AVERROR_INVALIDDATA; + CHECK_Y_PTR() line_packets = sign_extend(bytestream2_get_le16(&g2), 16); if ((line_packets & 0xC000) == 0xC000) { // line skip opcode @@ -374,8 +583,8 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx, case FLI_BLACK: /* set the whole frame to color 0 (which is usually black) */ - memset(pixels, 0, - s->frame->linesize[0] * s->avctx->height); + for (int y = 0; y < s->avctx->height; y++) + memset(pixels + y * s->frame->linesize[0], 0, s->avctx->width); break; case FLI_BRUN: @@ -433,7 +642,7 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx, "has incorrect size, skipping chunk\n", chunk_size - 6); bytestream2_skip(&g2, chunk_size - 6); } else { - for (y_ptr = 0; y_ptr < s->frame->linesize[0] * s->avctx->height; + for (y_ptr = 0; check_pixel_ptr(y_ptr, 0, pixel_limit, direction) == 0; y_ptr += s->frame->linesize[0]) { bytestream2_get_buffer(&g2, &pixels[y_ptr], s->avctx->width); @@ -498,7 +707,7 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx, FlicDecodeContext *s = avctx->priv_data; GetByteContext g2; - int pixel_ptr; + ptrdiff_t pixel_ptr; unsigned char palette_idx1; unsigned int frame_size; @@ -507,24 +716,25 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx, unsigned int chunk_size; int chunk_type; - int i, j, ret; + int i, j, ret, direction; int lines; int compressed_lines; int line_packets; - int y_ptr; + ptrdiff_t y_ptr; int byte_run; int pixel_skip; int pixel_countdown; unsigned char *pixels; int pixel; - unsigned int pixel_limit; + ptrdiff_t pixel_limit; bytestream2_init(&g2, buf, buf_size); if ((ret = ff_reget_buffer(avctx, s->frame, 0)) < 0) return ret; + direction = s->frame->linesize[0] > 0; pixels = s->frame->data[0]; pixel_limit = s->avctx->height * s->frame->linesize[0]; @@ -573,8 +783,7 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx, while (compressed_lines > 0) { if (bytestream2_tell(&g2) + 2 > stream_ptr_after_chunk) break; - if (y_ptr > pixel_limit) - return AVERROR_INVALIDDATA; + CHECK_Y_PTR() line_packets = sign_extend(bytestream2_get_le16(&g2), 16); if (line_packets < 0) { line_packets = -line_packets; @@ -625,8 +834,8 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx, case FLI_BLACK: /* set the whole frame to 0x0000 which is black in both 15Bpp and 16Bpp modes. */ - memset(pixels, 0x0000, - s->frame->linesize[0] * s->avctx->height); + for (int y = 0; y < s->avctx->height; y++) + memset(pixels + y * s->frame->linesize[0], 0, s->avctx->width * 2); break; case FLI_BRUN: @@ -740,7 +949,7 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx, if (bytestream2_get_bytes_left(&g2) < 2 * s->avctx->width * s->avctx->height ) return AVERROR_INVALIDDATA; - for (y_ptr = 0; y_ptr < s->frame->linesize[0] * s->avctx->height; + for (y_ptr = 0; check_pixel_ptr(y_ptr, 0, pixel_limit, direction) == 0; y_ptr += s->frame->linesize[0]) { pixel_countdown = s->avctx->width; @@ -798,7 +1007,7 @@ static int flic_decode_frame_24BPP(AVCodecContext *avctx, FlicDecodeContext *s = avctx->priv_data; GetByteContext g2; - int pixel_ptr; + ptrdiff_t pixel_ptr; unsigned char palette_idx1; unsigned int frame_size; @@ -807,24 +1016,25 @@ static int flic_decode_frame_24BPP(AVCodecContext *avctx, unsigned int chunk_size; int chunk_type; - int i, j, ret; + int i, j, ret, direction; int lines; int compressed_lines; int line_packets; - int y_ptr; + ptrdiff_t y_ptr; int byte_run; int pixel_skip; int pixel_countdown; unsigned char *pixels; int pixel; - unsigned int pixel_limit; + ptrdiff_t pixel_limit; bytestream2_init(&g2, buf, buf_size); if ((ret = ff_reget_buffer(avctx, s->frame, 0)) < 0) return ret; + direction = s->frame->linesize[0] > 0; pixels = s->frame->data[0]; pixel_limit = s->avctx->height * s->frame->linesize[0]; @@ -873,8 +1083,7 @@ static int flic_decode_frame_24BPP(AVCodecContext *avctx, while (compressed_lines > 0) { if (bytestream2_tell(&g2) + 2 > stream_ptr_after_chunk) break; - if (y_ptr > pixel_limit) - return AVERROR_INVALIDDATA; + CHECK_Y_PTR() line_packets = sign_extend(bytestream2_get_le16(&g2), 16); if (line_packets < 0) { line_packets = -line_packets; @@ -926,8 +1135,8 @@ static int flic_decode_frame_24BPP(AVCodecContext *avctx, case FLI_BLACK: /* set the whole frame to 0x00 which is black for 24 bit mode. */ - memset(pixels, 0x00, - s->frame->linesize[0] * s->avctx->height); + for (int y = 0; y < s->avctx->height; y++) + memset(pixels + y * s->frame->linesize[0], 0, s->avctx->width * 3); break; case FLI_BRUN: @@ -1026,7 +1235,7 @@ static int flic_decode_frame_24BPP(AVCodecContext *avctx, "bigger than image, skipping chunk\n", chunk_size - 6); bytestream2_skip(&g2, chunk_size - 6); } else { - for (y_ptr = 0; y_ptr < s->frame->linesize[0] * s->avctx->height; + for (y_ptr = 0; check_pixel_ptr(y_ptr, 0, pixel_limit, direction) == 0; y_ptr += s->frame->linesize[0]) { bytestream2_get_buffer(&g2, pixels + y_ptr, 3*s->avctx->width); @@ -1076,7 +1285,10 @@ static int flic_decode_frame(AVCodecContext *avctx, AVFrame *frame, { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; - if (avctx->pix_fmt == AV_PIX_FMT_PAL8) { + if (avctx->pix_fmt == AV_PIX_FMT_MONOBLACK) { + return flic_decode_frame_1BPP(avctx, frame, got_frame, + buf, buf_size); + } else if (avctx->pix_fmt == AV_PIX_FMT_PAL8) { return flic_decode_frame_8BPP(avctx, frame, got_frame, buf, buf_size); } else if ((avctx->pix_fmt == AV_PIX_FMT_RGB555) || diff --git a/arm/android/third_party/ffmpeg/libavcodec/fraps.c b/arm/android/third_party/ffmpeg/libavcodec/fraps.c index 834e6576..7790e689 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/fraps.c +++ b/arm/android/third_party/ffmpeg/libavcodec/fraps.c @@ -56,7 +56,6 @@ typedef struct FrapsContext { int tmpbuf_size; } FrapsContext; - /** * initializes decoder * @param avctx codec context @@ -123,13 +122,13 @@ static int fraps2_decode_plane(FrapsContext *s, uint8_t *dst, int stride, int w, else if (Uoff) dst[i] += 0x80; if (get_bits_left(&gb) < 0) { - ff_free_vlc(&vlc); + ff_vlc_free(&vlc); return AVERROR_INVALIDDATA; } } dst += stride; } - ff_free_vlc(&vlc); + ff_vlc_free(&vlc); return 0; } @@ -323,7 +322,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *f, return buf_size; } - /** * closes decoder * @param avctx codec context @@ -331,13 +329,12 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *f, */ static av_cold int decode_end(AVCodecContext *avctx) { - FrapsContext *s = (FrapsContext*)avctx->priv_data; + FrapsContext *s = avctx->priv_data; av_freep(&s->tmpbuf); return 0; } - const FFCodec ff_fraps_decoder = { .p.name = "fraps", CODEC_LONG_NAME("Fraps"), diff --git a/arm/android/third_party/ffmpeg/libavcodec/g2meet.c b/arm/android/third_party/ffmpeg/libavcodec/g2meet.c index 2dfa73df..34ff60a3 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/g2meet.c +++ b/arm/android/third_party/ffmpeg/libavcodec/g2meet.c @@ -195,8 +195,8 @@ static av_cold void jpg_free_context(JPGContext *ctx) int i; for (i = 0; i < 2; i++) { - ff_free_vlc(&ctx->dc_vlc[i]); - ff_free_vlc(&ctx->ac_vlc[i]); + ff_vlc_free(&ctx->dc_vlc[i]); + ff_vlc_free(&ctx->ac_vlc[i]); } av_freep(&ctx->buf); diff --git a/arm/android/third_party/ffmpeg/libavcodec/g722dsp.c b/arm/android/third_party/ffmpeg/libavcodec/g722dsp.c index c770bfbd..30228368 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/g722dsp.c +++ b/arm/android/third_party/ffmpeg/libavcodec/g722dsp.c @@ -71,6 +71,8 @@ av_cold void ff_g722dsp_init(G722DSPContext *c) #if ARCH_ARM ff_g722dsp_init_arm(c); +#elif ARCH_RISCV + ff_g722dsp_init_riscv(c); #elif ARCH_X86 ff_g722dsp_init_x86(c); #endif diff --git a/arm/android/third_party/ffmpeg/libavcodec/g722dsp.h b/arm/android/third_party/ffmpeg/libavcodec/g722dsp.h index c956a1e1..1aa7078a 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/g722dsp.h +++ b/arm/android/third_party/ffmpeg/libavcodec/g722dsp.h @@ -29,6 +29,7 @@ typedef struct G722DSPContext { void ff_g722dsp_init(G722DSPContext *c); void ff_g722dsp_init_arm(G722DSPContext *c); +void ff_g722dsp_init_riscv(G722DSPContext *c); void ff_g722dsp_init_x86(G722DSPContext *c); #endif /* AVCODEC_G722DSP_H */ diff --git a/arm/android/third_party/ffmpeg/libavcodec/g729postfilter.c b/arm/android/third_party/ffmpeg/libavcodec/g729postfilter.c index 26e937f0..382db924 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/g729postfilter.c +++ b/arm/android/third_party/ffmpeg/libavcodec/g729postfilter.c @@ -581,7 +581,7 @@ void ff_g729_postfilter(AudioDSPContext *adsp, int16_t* ht_prev_data, int* voici int16_t ff_g729_adaptive_gain_control(int gain_before, int gain_after, int16_t *speech, int subframe_size, int16_t gain_prev) { - int gain; // (3.12) + unsigned gain; // (3.12) int n; int exp_before, exp_after; @@ -603,7 +603,7 @@ int16_t ff_g729_adaptive_gain_control(int gain_before, int gain_after, int16_t * gain = ((gain_before - gain_after) << 14) / gain_after + 0x4000; gain = bidir_sal(gain, exp_after - exp_before); } - gain = av_clip_int16(gain); + gain = FFMIN(gain, 32767); gain = (gain * G729_AGC_FAC1 + 0x4000) >> 15; // gain * (1-0.9875) } else gain = 0; diff --git a/arm/android/third_party/ffmpeg/libavcodec/get_bits.h b/arm/android/third_party/ffmpeg/libavcodec/get_bits.h index 65dc080d..cfcf97c0 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/get_bits.h +++ b/arm/android/third_party/ffmpeg/libavcodec/get_bits.h @@ -93,6 +93,7 @@ typedef BitstreamContext GetBitContext; #define init_get_bits8 bits_init8 #define align_get_bits bits_align #define get_vlc2 bits_read_vlc +#define get_vlc_multi bits_read_vlc_multi #define init_get_bits8_le(s, buffer, byte_size) bits_init8_le((BitstreamContextLE*)s, buffer, byte_size) #define get_bits_le(s, n) bits_read_le((BitstreamContextLE*)s, n) @@ -186,21 +187,28 @@ static inline unsigned int show_bits(GetBitContext *s, int n); #define CLOSE_READER(name, gb) (gb)->index = name ## _index +#define UPDATE_CACHE_BE_EXT(name, gb, bits, dst_bits) name ## _cache = \ + AV_RB ## bits((gb)->buffer + (name ## _index >> 3)) << (name ## _index & 7) >> (bits - dst_bits) + +#define UPDATE_CACHE_LE_EXT(name, gb, bits, dst_bits) name ## _cache = \ + (uint ## dst_bits ## _t)(AV_RL ## bits((gb)->buffer + (name ## _index >> 3)) >> (name ## _index & 7)) + +/* Using these two macros ensures that 32 bits are available. */ +# define UPDATE_CACHE_LE_32(name, gb) UPDATE_CACHE_LE_EXT(name, (gb), 64, 32) + +# define UPDATE_CACHE_BE_32(name, gb) UPDATE_CACHE_BE_EXT(name, (gb), 64, 32) + # ifdef LONG_BITSTREAM_READER -# define UPDATE_CACHE_LE(name, gb) name ## _cache = \ - AV_RL64((gb)->buffer + (name ## _index >> 3)) >> (name ## _index & 7) +# define UPDATE_CACHE_LE(name, gb) UPDATE_CACHE_LE_32(name, (gb)) -# define UPDATE_CACHE_BE(name, gb) name ## _cache = \ - AV_RB64((gb)->buffer + (name ## _index >> 3)) >> (32 - (name ## _index & 7)) +# define UPDATE_CACHE_BE(name, gb) UPDATE_CACHE_BE_32(name, (gb)) #else -# define UPDATE_CACHE_LE(name, gb) name ## _cache = \ - AV_RL32((gb)->buffer + (name ## _index >> 3)) >> (name ## _index & 7) +# define UPDATE_CACHE_LE(name, gb) UPDATE_CACHE_LE_EXT(name, (gb), 32, 32) -# define UPDATE_CACHE_BE(name, gb) name ## _cache = \ - AV_RB32((gb)->buffer + (name ## _index >> 3)) << (name ## _index & 7) +# define UPDATE_CACHE_BE(name, gb) UPDATE_CACHE_BE_EXT(name, (gb), 32, 32) #endif @@ -208,12 +216,14 @@ static inline unsigned int show_bits(GetBitContext *s, int n); #ifdef BITSTREAM_READER_LE # define UPDATE_CACHE(name, gb) UPDATE_CACHE_LE(name, gb) +# define UPDATE_CACHE_32(name, gb) UPDATE_CACHE_LE_32(name, (gb)) # define SKIP_CACHE(name, gb, num) name ## _cache >>= (num) #else # define UPDATE_CACHE(name, gb) UPDATE_CACHE_BE(name, gb) +# define UPDATE_CACHE_32(name, gb) UPDATE_CACHE_BE_32(name, (gb)) # define SKIP_CACHE(name, gb, num) name ## _cache <<= (num) @@ -413,15 +423,26 @@ static inline unsigned int get_bits_long(GetBitContext *s, int n) av_assert2(n>=0 && n<=32); if (!n) { return 0; - } else if (n <= MIN_CACHE_BITS) { + } else if ((!HAVE_FAST_64BIT || av_builtin_constant_p(n <= MIN_CACHE_BITS)) + && n <= MIN_CACHE_BITS) { return get_bits(s, n); } else { +#if HAVE_FAST_64BIT + unsigned tmp; + OPEN_READER(re, s); + UPDATE_CACHE_32(re, s); + tmp = SHOW_UBITS(re, s, n); + LAST_SKIP_BITS(re, s, n); + CLOSE_READER(re, s); + return tmp; +#else #ifdef BITSTREAM_READER_LE unsigned ret = get_bits(s, 16); return ret | (get_bits(s, n - 16) << 16); #else unsigned ret = get_bits(s, 16) << (n - 16); return ret | get_bits(s, n - 16); +#endif #endif } } @@ -622,7 +643,7 @@ static inline const uint8_t *align_get_bits(GetBitContext *s) /** * Parse a vlc code. * @param bits is the number of bits which will be read at once, must be - * identical to nb_bits in init_vlc() + * identical to nb_bits in vlc_init() * @param max_depth is the number of times bits bits must be read to completely * read the longest vlc code * = (max_vlc_length + bits - 1) / bits @@ -643,6 +664,15 @@ static av_always_inline int get_vlc2(GetBitContext *s, const VLCElem *table, return code; } +static inline int get_vlc_multi(GetBitContext *s, uint8_t *dst, + const VLC_MULTI_ELEM *const Jtable, + const VLCElem *const table, + const int bits, const int max_depth) +{ + dst[0] = get_vlc2(s, table, bits, max_depth); + return 1; +} + static inline int decode012(GetBitContext *gb) { int n; diff --git a/arm/android/third_party/ffmpeg/libavcodec/gif.c b/arm/android/third_party/ffmpeg/libavcodec/gif.c index 131af619..11add644 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/gif.c +++ b/arm/android/third_party/ffmpeg/libavcodec/gif.c @@ -503,8 +503,7 @@ static int gif_encode_frame(AVCodecContext *avctx, AVPacket *pkt, } if (!s->image) { - av_frame_unref(s->last_frame); - ret = av_frame_ref(s->last_frame, pict); + ret = av_frame_replace(s->last_frame, pict); if (ret < 0) return ret; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/gifdec.c b/arm/android/third_party/ffmpeg/libavcodec/gifdec.c index 86aaa888..a97a6d15 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/gifdec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/gifdec.c @@ -59,7 +59,7 @@ typedef struct GifState { /* depending on disposal method we store either part of the image * drawn on the canvas or background color that * should be used upon disposal */ - uint32_t * stored_img; + uint8_t *stored_img; int stored_img_size; int stored_bg_color; @@ -86,52 +86,55 @@ static void gif_read_palette(GifState *s, uint32_t *pal, int nb) static void gif_fill(AVFrame *picture, uint32_t color) { - uint32_t *p = (uint32_t *)picture->data[0]; - uint32_t *p_end = p + (picture->linesize[0] / sizeof(uint32_t)) * picture->height; + const ptrdiff_t linesize = picture->linesize[0]; + uint8_t *py = picture->data[0]; + const int w = picture->width; + const int h = picture->height; - for (; p < p_end; p++) - *p = color; + for (int y = 0; y < h; y++) { + uint32_t *px = (uint32_t *)py; + for (int x = 0; x < w; x++) + px[x] = color; + py += linesize; + } } static void gif_fill_rect(AVFrame *picture, uint32_t color, int l, int t, int w, int h) { - const int linesize = picture->linesize[0] / sizeof(uint32_t); - const uint32_t *py = (uint32_t *)picture->data[0] + t * linesize; - const uint32_t *pr, *pb = py + h * linesize; - uint32_t *px; + const ptrdiff_t linesize = picture->linesize[0]; + uint8_t *py = picture->data[0] + t * linesize; - for (; py < pb; py += linesize) { - px = (uint32_t *)py + l; - pr = px + w; - - for (; px < pr; px++) - *px = color; + for (int y = 0; y < h; y++) { + uint32_t *px = ((uint32_t *)py) + l; + for (int x = 0; x < w; x++) + px[x] = color; + py += linesize; } } -static void gif_copy_img_rect(const uint32_t *src, uint32_t *dst, - int linesize, int l, int t, int w, int h) +static void gif_copy_img_rect(const uint8_t *src, uint8_t *dst, + ptrdiff_t src_linesize, + ptrdiff_t dst_linesize, + int l, int t, int w, int h) { - const int y_start = t * linesize; - const uint32_t *src_px, - *src_py = src + y_start, - *dst_py = dst + y_start; - const uint32_t *src_pb = src_py + h * linesize; - uint32_t *dst_px; + const uint8_t *src_py = src; + uint8_t *dst_py = dst; - for (; src_py < src_pb; src_py += linesize, dst_py += linesize) { - src_px = src_py + l; - dst_px = (uint32_t *)dst_py + l; - - memcpy(dst_px, src_px, w * sizeof(uint32_t)); + src_py += t * src_linesize; + dst_py += t * dst_linesize; + for (int y = 0; y < h; y++) { + memcpy(dst_py + l * 4, src_py + l * 4, w * 4); + src_py += src_linesize; + dst_py += dst_linesize; } } static int gif_read_image(GifState *s, AVFrame *frame) { int left, top, width, height, bits_per_pixel, code_size, flags, pw; - int is_interleaved, has_local_palette, y, pass, y1, linesize, pal_size, lzwed_len; + int is_interleaved, has_local_palette, y, pass, y1, pal_size, lzwed_len; uint32_t *ptr, *pal, *px, *pr, *ptr1; + ptrdiff_t linesize; int ret; uint8_t *idx; @@ -214,8 +217,8 @@ static int gif_read_image(GifState *s, AVFrame *frame) if (s->gce_prev_disposal == GCE_DISPOSAL_BACKGROUND) { gif_fill_rect(frame, s->stored_bg_color, s->gce_l, s->gce_t, s->gce_w, s->gce_h); } else if (s->gce_prev_disposal == GCE_DISPOSAL_RESTORE) { - gif_copy_img_rect(s->stored_img, (uint32_t *)frame->data[0], - frame->linesize[0] / sizeof(uint32_t), s->gce_l, s->gce_t, s->gce_w, s->gce_h); + gif_copy_img_rect(s->stored_img, frame->data[0], + FFABS(frame->linesize[0]), frame->linesize[0], s->gce_l, s->gce_t, s->gce_w, s->gce_h); } s->gce_prev_disposal = s->gce_disposal; @@ -230,12 +233,12 @@ static int gif_read_image(GifState *s, AVFrame *frame) else s->stored_bg_color = s->bg_color; } else if (s->gce_disposal == GCE_DISPOSAL_RESTORE) { - av_fast_malloc(&s->stored_img, &s->stored_img_size, frame->linesize[0] * frame->height); + av_fast_malloc(&s->stored_img, &s->stored_img_size, FFABS(frame->linesize[0]) * frame->height); if (!s->stored_img) return AVERROR(ENOMEM); - gif_copy_img_rect((uint32_t *)frame->data[0], s->stored_img, - frame->linesize[0] / sizeof(uint32_t), left, top, pw, height); + gif_copy_img_rect(frame->data[0], s->stored_img, + frame->linesize[0], FFABS(frame->linesize[0]), left, top, pw, height); } } @@ -252,8 +255,8 @@ static int gif_read_image(GifState *s, AVFrame *frame) } /* read all the image */ - linesize = frame->linesize[0] / sizeof(uint32_t); - ptr1 = (uint32_t *)frame->data[0] + top * linesize + left; + linesize = frame->linesize[0]; + ptr1 = (uint32_t *)(frame->data[0] + top * linesize) + left; ptr = ptr1; pass = 0; y1 = 0; @@ -278,24 +281,24 @@ static int gif_read_image(GifState *s, AVFrame *frame) case 0: case 1: y1 += 8; - ptr += linesize * 8; + ptr += linesize * 2; break; case 2: y1 += 4; - ptr += linesize * 4; + ptr += linesize * 1; break; case 3: y1 += 2; - ptr += linesize * 2; + ptr += linesize / 2; break; } while (y1 >= height) { y1 = 4 >> pass; - ptr = ptr1 + linesize * y1; + ptr = ptr1 + linesize / 4 * y1; pass++; } } else { - ptr += linesize; + ptr += linesize / 4; } } diff --git a/arm/android/third_party/ffmpeg/libavcodec/h261dec.c b/arm/android/third_party/ffmpeg/libavcodec/h261dec.c index 620b7eef..c41b96c3 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/h261dec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/h261dec.c @@ -64,16 +64,16 @@ typedef struct H261DecContext { static av_cold void h261_decode_init_static(void) { - INIT_VLC_STATIC(&h261_mba_vlc, H261_MBA_VLC_BITS, 35, + VLC_INIT_STATIC(&h261_mba_vlc, H261_MBA_VLC_BITS, 35, ff_h261_mba_bits, 1, 1, ff_h261_mba_code, 1, 1, 540); - INIT_VLC_STATIC(&h261_mtype_vlc, H261_MTYPE_VLC_BITS, 10, + VLC_INIT_STATIC(&h261_mtype_vlc, H261_MTYPE_VLC_BITS, 10, ff_h261_mtype_bits, 1, 1, ff_h261_mtype_code, 1, 1, 80); - INIT_VLC_STATIC(&h261_mv_vlc, H261_MV_VLC_BITS, 17, + VLC_INIT_STATIC(&h261_mv_vlc, H261_MV_VLC_BITS, 17, &ff_h261_mv_tab[0][1], 2, 1, &ff_h261_mv_tab[0][0], 2, 1, 144); - INIT_VLC_STATIC(&h261_cbp_vlc, H261_CBP_VLC_BITS, 63, + VLC_INIT_STATIC(&h261_cbp_vlc, H261_CBP_VLC_BITS, 63, &ff_h261_cbp_tab[0][1], 2, 1, &ff_h261_cbp_tab[0][0], 2, 1, 512); INIT_FIRST_VLC_RL(ff_h261_rl_tcoeff, 552); diff --git a/arm/android/third_party/ffmpeg/libavcodec/h263dec.c b/arm/android/third_party/ffmpeg/libavcodec/h263dec.c index b5c0f4a5..3dc9f7f5 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/h263dec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/h263dec.c @@ -36,6 +36,7 @@ #include "flvdec.h" #include "h263.h" #include "h263dec.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "mpeg_er.h" #include "mpeg4video.h" @@ -190,7 +191,7 @@ static int decode_slice(MpegEncContext *s) if (s->avctx->hwaccel) { const uint8_t *start = s->gb.buffer + get_bits_count(&s->gb) / 8; - ret = s->avctx->hwaccel->decode_slice(s->avctx, start, s->gb.buffer_end - start); + ret = FF_HW_CALL(s->avctx, decode_slice, start, s->gb.buffer_end - start); // ensure we exit decode loop s->mb_y = s->mb_height; return ret; @@ -568,8 +569,8 @@ retry: ff_thread_finish_setup(avctx); if (avctx->hwaccel) { - ret = avctx->hwaccel->start_frame(avctx, s->gb.buffer, - s->gb.buffer_end - s->gb.buffer); + ret = FF_HW_CALL(avctx, start_frame, + s->gb.buffer, s->gb.buffer_end - s->gb.buffer); if (ret < 0 ) return ret; } @@ -621,10 +622,10 @@ retry: av_assert1(s->bitstream_buffer_size == 0); frame_end: if (!s->studio_profile) - ff_er_frame_end(&s->er); + ff_er_frame_end(&s->er, NULL); if (avctx->hwaccel) { - ret = avctx->hwaccel->end_frame(avctx); + ret = FF_HW_SIMPLE_CALL(avctx, end_frame); if (ret < 0) return ret; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/h2645_sei.c b/arm/android/third_party/ffmpeg/libavcodec/h2645_sei.c index 63ab711b..cb6be059 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/h2645_sei.c +++ b/arm/android/third_party/ffmpeg/libavcodec/h2645_sei.c @@ -29,6 +29,7 @@ #include "libavutil/display.h" #include "libavutil/hdr_dynamic_metadata.h" #include "libavutil/film_grain_params.h" +#include "libavutil/mastering_display_metadata.h" #include "libavutil/pixdesc.h" #include "libavutil/stereo3d.h" @@ -392,6 +393,52 @@ static int decode_film_grain_characteristics(H2645SEIFilmGrainCharacteristics *h return 0; } +static int decode_nal_sei_mastering_display_info(H2645SEIMasteringDisplay *s, + GetByteContext *gb) +{ + int i; + + if (bytestream2_get_bytes_left(gb) < 24) + return AVERROR_INVALIDDATA; + + // Mastering primaries + for (i = 0; i < 3; i++) { + s->display_primaries[i][0] = bytestream2_get_be16u(gb); + s->display_primaries[i][1] = bytestream2_get_be16u(gb); + } + // White point (x, y) + s->white_point[0] = bytestream2_get_be16u(gb); + s->white_point[1] = bytestream2_get_be16u(gb); + + // Max and min luminance of mastering display + s->max_luminance = bytestream2_get_be32u(gb); + s->min_luminance = bytestream2_get_be32u(gb); + + // As this SEI message comes before the first frame that references it, + // initialize the flag to 2 and decrement on IRAP access unit so it + // persists for the coded video sequence (e.g., between two IRAPs) + s->present = 2; + + return 0; +} + +static int decode_nal_sei_content_light_info(H2645SEIContentLight *s, + GetByteContext *gb) +{ + if (bytestream2_get_bytes_left(gb) < 4) + return AVERROR_INVALIDDATA; + + // Max and average light levels + s->max_content_light_level = bytestream2_get_be16u(gb); + s->max_pic_average_light_level = bytestream2_get_be16u(gb); + // As this SEI message comes before the first frame that references it, + // initialize the flag to 2 and decrement on IRAP access unit so it + // persists for the coded video sequence (e.g., between two IRAPs) + s->present = 2; + + return 0; +} + int ff_h2645_sei_message_decode(H2645SEI *h, enum SEIType type, enum AVCodecID codec_id, GetBitContext *gb, GetByteContext *gbyte, void *logctx) @@ -412,6 +459,11 @@ int ff_h2645_sei_message_decode(H2645SEI *h, enum SEIType type, case SEI_TYPE_AMBIENT_VIEWING_ENVIRONMENT: return decode_ambient_viewing_environment(&h->ambient_viewing_environment, gbyte); + case SEI_TYPE_MASTERING_DISPLAY_COLOUR_VOLUME: + return decode_nal_sei_mastering_display_info(&h->mastering_display, + gbyte); + case SEI_TYPE_CONTENT_LIGHT_LEVEL_INFO: + return decode_nal_sei_content_light_info(&h->content_light, gbyte); default: return FF_H2645_SEI_MESSAGE_UNHANDLED; } @@ -652,6 +704,64 @@ int ff_h2645_sei_to_frame(AVFrame *frame, H2645SEI *sei, dst_env->ambient_light_y = av_make_q(env->ambient_light_y, 50000); } + if (sei->mastering_display.present) { + // HEVC uses a g,b,r ordering, which we convert to a more natural r,g,b + const int mapping[3] = {2, 0, 1}; + const int chroma_den = 50000; + const int luma_den = 10000; + int i; + AVMasteringDisplayMetadata *metadata = + av_mastering_display_metadata_create_side_data(frame); + if (!metadata) + return AVERROR(ENOMEM); + + for (i = 0; i < 3; i++) { + const int j = mapping[i]; + metadata->display_primaries[i][0].num = sei->mastering_display.display_primaries[j][0]; + metadata->display_primaries[i][0].den = chroma_den; + metadata->display_primaries[i][1].num = sei->mastering_display.display_primaries[j][1]; + metadata->display_primaries[i][1].den = chroma_den; + } + metadata->white_point[0].num = sei->mastering_display.white_point[0]; + metadata->white_point[0].den = chroma_den; + metadata->white_point[1].num = sei->mastering_display.white_point[1]; + metadata->white_point[1].den = chroma_den; + + metadata->max_luminance.num = sei->mastering_display.max_luminance; + metadata->max_luminance.den = luma_den; + metadata->min_luminance.num = sei->mastering_display.min_luminance; + metadata->min_luminance.den = luma_den; + metadata->has_luminance = 1; + metadata->has_primaries = 1; + + av_log(avctx, AV_LOG_DEBUG, "Mastering Display Metadata:\n"); + av_log(avctx, AV_LOG_DEBUG, + "r(%5.4f,%5.4f) g(%5.4f,%5.4f) b(%5.4f %5.4f) wp(%5.4f, %5.4f)\n", + av_q2d(metadata->display_primaries[0][0]), + av_q2d(metadata->display_primaries[0][1]), + av_q2d(metadata->display_primaries[1][0]), + av_q2d(metadata->display_primaries[1][1]), + av_q2d(metadata->display_primaries[2][0]), + av_q2d(metadata->display_primaries[2][1]), + av_q2d(metadata->white_point[0]), av_q2d(metadata->white_point[1])); + av_log(avctx, AV_LOG_DEBUG, + "min_luminance=%f, max_luminance=%f\n", + av_q2d(metadata->min_luminance), av_q2d(metadata->max_luminance)); + } + + if (sei->content_light.present) { + AVContentLightMetadata *metadata = + av_content_light_metadata_create_side_data(frame); + if (!metadata) + return AVERROR(ENOMEM); + metadata->MaxCLL = sei->content_light.max_content_light_level; + metadata->MaxFALL = sei->content_light.max_pic_average_light_level; + + av_log(avctx, AV_LOG_DEBUG, "Content Light Level Metadata:\n"); + av_log(avctx, AV_LOG_DEBUG, "MaxCLL=%d, MaxFALL=%d\n", + metadata->MaxCLL, metadata->MaxFALL); + } + return 0; } @@ -667,4 +777,6 @@ void ff_h2645_sei_reset(H2645SEI *s) av_buffer_unref(&s->dynamic_hdr_vivid.info); s->ambient_viewing_environment.present = 0; + s->mastering_display.present = 0; + s->content_light.present = 0; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/h2645_sei.h b/arm/android/third_party/ffmpeg/libavcodec/h2645_sei.h index e07ae103..0ebf4801 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/h2645_sei.h +++ b/arm/android/third_party/ffmpeg/libavcodec/h2645_sei.h @@ -105,6 +105,20 @@ typedef struct H2645SEIFilmGrainCharacteristics { int persistence_flag; //< HEVC only } H2645SEIFilmGrainCharacteristics; +typedef struct H2645SEIMasteringDisplay { + int present; + uint16_t display_primaries[3][2]; + uint16_t white_point[2]; + uint32_t max_luminance; + uint32_t min_luminance; +} H2645SEIMasteringDisplay; + +typedef struct H2645SEIContentLight { + int present; + uint16_t max_content_light_level; + uint16_t max_pic_average_light_level; +} H2645SEIContentLight; + typedef struct H2645SEI { H2645SEIA53Caption a53_caption; H2645SEIAFD afd; @@ -116,6 +130,8 @@ typedef struct H2645SEI { H2645SEIAlternativeTransfer alternative_transfer; H2645SEIFilmGrainCharacteristics film_grain_characteristics; H2645SEIAmbientViewingEnvironment ambient_viewing_environment; + H2645SEIMasteringDisplay mastering_display; + H2645SEIContentLight content_light; } H2645SEI; enum { diff --git a/arm/android/third_party/ffmpeg/libavcodec/h264_cavlc.c b/arm/android/third_party/ffmpeg/libavcodec/h264_cavlc.c index 2ace4ca9..13c87bf9 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/h264_cavlc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/h264_cavlc.c @@ -328,26 +328,26 @@ av_cold void ff_h264_decode_init_vlc(void) chroma_dc_coeff_token_vlc.table = chroma_dc_coeff_token_vlc_table; chroma_dc_coeff_token_vlc.table_allocated = chroma_dc_coeff_token_vlc_table_size; - init_vlc(&chroma_dc_coeff_token_vlc, CHROMA_DC_COEFF_TOKEN_VLC_BITS, 4*5, + vlc_init(&chroma_dc_coeff_token_vlc, CHROMA_DC_COEFF_TOKEN_VLC_BITS, 4*5, &chroma_dc_coeff_token_len [0], 1, 1, &chroma_dc_coeff_token_bits[0], 1, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); chroma422_dc_coeff_token_vlc.table = chroma422_dc_coeff_token_vlc_table; chroma422_dc_coeff_token_vlc.table_allocated = chroma422_dc_coeff_token_vlc_table_size; - init_vlc(&chroma422_dc_coeff_token_vlc, CHROMA422_DC_COEFF_TOKEN_VLC_BITS, 4*9, + vlc_init(&chroma422_dc_coeff_token_vlc, CHROMA422_DC_COEFF_TOKEN_VLC_BITS, 4*9, &chroma422_dc_coeff_token_len [0], 1, 1, &chroma422_dc_coeff_token_bits[0], 1, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); offset = 0; for (int i = 0; i < 4; i++) { coeff_token_vlc[i].table = coeff_token_vlc_tables + offset; coeff_token_vlc[i].table_allocated = coeff_token_vlc_tables_size[i]; - init_vlc(&coeff_token_vlc[i], COEFF_TOKEN_VLC_BITS, 4*17, + vlc_init(&coeff_token_vlc[i], COEFF_TOKEN_VLC_BITS, 4*17, &coeff_token_len [i][0], 1, 1, &coeff_token_bits[i][0], 1, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); offset += coeff_token_vlc_tables_size[i]; } /* @@ -360,48 +360,48 @@ av_cold void ff_h264_decode_init_vlc(void) for (int i = 0; i < 3; i++) { chroma_dc_total_zeros_vlc[i + 1].table = chroma_dc_total_zeros_vlc_tables[i]; chroma_dc_total_zeros_vlc[i + 1].table_allocated = chroma_dc_total_zeros_vlc_tables_size; - init_vlc(&chroma_dc_total_zeros_vlc[i + 1], + vlc_init(&chroma_dc_total_zeros_vlc[i + 1], CHROMA_DC_TOTAL_ZEROS_VLC_BITS, 4, &chroma_dc_total_zeros_len [i][0], 1, 1, &chroma_dc_total_zeros_bits[i][0], 1, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); } for (int i = 0; i < 7; i++) { chroma422_dc_total_zeros_vlc[i + 1].table = chroma422_dc_total_zeros_vlc_tables[i]; chroma422_dc_total_zeros_vlc[i + 1].table_allocated = chroma422_dc_total_zeros_vlc_tables_size; - init_vlc(&chroma422_dc_total_zeros_vlc[i + 1], + vlc_init(&chroma422_dc_total_zeros_vlc[i + 1], CHROMA422_DC_TOTAL_ZEROS_VLC_BITS, 8, &chroma422_dc_total_zeros_len [i][0], 1, 1, &chroma422_dc_total_zeros_bits[i][0], 1, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); } for (int i = 0; i < 15; i++) { total_zeros_vlc[i + 1].table = total_zeros_vlc_tables[i]; total_zeros_vlc[i + 1].table_allocated = total_zeros_vlc_tables_size; - init_vlc(&total_zeros_vlc[i + 1], + vlc_init(&total_zeros_vlc[i + 1], TOTAL_ZEROS_VLC_BITS, 16, &total_zeros_len [i][0], 1, 1, &total_zeros_bits[i][0], 1, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); } for (int i = 0; i < 6; i++) { run_vlc[i + 1].table = run_vlc_tables[i]; run_vlc[i + 1].table_allocated = run_vlc_tables_size; - init_vlc(&run_vlc[i + 1], + vlc_init(&run_vlc[i + 1], RUN_VLC_BITS, 7, &run_len [i][0], 1, 1, &run_bits[i][0], 1, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); } run7_vlc.table = run7_vlc_table; run7_vlc.table_allocated = run7_vlc_table_size; - init_vlc(&run7_vlc, RUN7_VLC_BITS, 16, + vlc_init(&run7_vlc, RUN7_VLC_BITS, 16, &run_len [6][0], 1, 1, &run_bits[6][0], 1, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); init_cavlc_level_tab(); } diff --git a/arm/android/third_party/ffmpeg/libavcodec/h264_mb.c b/arm/android/third_party/ffmpeg/libavcodec/h264_mb.c index 0b317745..32d29cfb 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/h264_mb.c +++ b/arm/android/third_party/ffmpeg/libavcodec/h264_mb.c @@ -34,6 +34,7 @@ #include "h264dec.h" #include "h264_ps.h" #include "qpeldsp.h" +#include "rectangle.h" #include "threadframe.h" static inline int get_lowest_part_list_y(H264SliceContext *sl, diff --git a/arm/android/third_party/ffmpeg/libavcodec/h264_metadata_bsf.c b/arm/android/third_party/ffmpeg/libavcodec/h264_metadata_bsf.c index b9cfeaba..39b9e8ee 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/h264_metadata_bsf.c +++ b/arm/android/third_party/ffmpeg/libavcodec/h264_metadata_bsf.c @@ -26,10 +26,11 @@ #include "cbs.h" #include "cbs_bsf.h" #include "cbs_h264.h" +#include "cbs_sei.h" #include "h264.h" #include "h264_levels.h" -#include "h264_sei.h" #include "h2645data.h" +#include "sei.h" enum { FLIP_HORIZONTAL = 1, diff --git a/arm/android/third_party/ffmpeg/libavcodec/h264_mvpred.h b/arm/android/third_party/ffmpeg/libavcodec/h264_mvpred.h index 46ae2738..bc9fef50 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/h264_mvpred.h +++ b/arm/android/third_party/ffmpeg/libavcodec/h264_mvpred.h @@ -30,10 +30,142 @@ #include "h264dec.h" #include "mpegutils.h" +#include "rectangle.h" + #include "libavutil/avassert.h" #include "libavutil/mem_internal.h" +/** + * Get the predicted intra4x4 prediction mode. + */ +static av_always_inline int pred_intra_mode(const H264Context *h, + H264SliceContext *sl, int n) +{ + const int index8 = scan8[n]; + const int left = sl->intra4x4_pred_mode_cache[index8 - 1]; + const int top = sl->intra4x4_pred_mode_cache[index8 - 8]; + const int min = FFMIN(left, top); + + ff_tlog(h->avctx, "mode:%d %d min:%d\n", left, top, min); + + if (min < 0) + return DC_PRED; + else + return min; +} + +static av_always_inline void write_back_intra_pred_mode(const H264Context *h, + H264SliceContext *sl) +{ + int8_t *i4x4 = sl->intra4x4_pred_mode + h->mb2br_xy[sl->mb_xy]; + int8_t *i4x4_cache = sl->intra4x4_pred_mode_cache; + + AV_COPY32(i4x4, i4x4_cache + 4 + 8 * 4); + i4x4[4] = i4x4_cache[7 + 8 * 3]; + i4x4[5] = i4x4_cache[7 + 8 * 2]; + i4x4[6] = i4x4_cache[7 + 8 * 1]; +} + +static av_always_inline void write_back_non_zero_count(const H264Context *h, + H264SliceContext *sl) +{ + const int mb_xy = sl->mb_xy; + uint8_t *nnz = h->non_zero_count[mb_xy]; + uint8_t *nnz_cache = sl->non_zero_count_cache; + + AV_COPY32(&nnz[ 0], &nnz_cache[4 + 8 * 1]); + AV_COPY32(&nnz[ 4], &nnz_cache[4 + 8 * 2]); + AV_COPY32(&nnz[ 8], &nnz_cache[4 + 8 * 3]); + AV_COPY32(&nnz[12], &nnz_cache[4 + 8 * 4]); + AV_COPY32(&nnz[16], &nnz_cache[4 + 8 * 6]); + AV_COPY32(&nnz[20], &nnz_cache[4 + 8 * 7]); + AV_COPY32(&nnz[32], &nnz_cache[4 + 8 * 11]); + AV_COPY32(&nnz[36], &nnz_cache[4 + 8 * 12]); + + if (!h->chroma_y_shift) { + AV_COPY32(&nnz[24], &nnz_cache[4 + 8 * 8]); + AV_COPY32(&nnz[28], &nnz_cache[4 + 8 * 9]); + AV_COPY32(&nnz[40], &nnz_cache[4 + 8 * 13]); + AV_COPY32(&nnz[44], &nnz_cache[4 + 8 * 14]); + } +} + +static av_always_inline void write_back_motion_list(const H264Context *h, + H264SliceContext *sl, + int b_stride, + int b_xy, int b8_xy, + int mb_type, int list) +{ + int16_t(*mv_dst)[2] = &h->cur_pic.motion_val[list][b_xy]; + int16_t(*mv_src)[2] = &sl->mv_cache[list][scan8[0]]; + AV_COPY128(mv_dst + 0 * b_stride, mv_src + 8 * 0); + AV_COPY128(mv_dst + 1 * b_stride, mv_src + 8 * 1); + AV_COPY128(mv_dst + 2 * b_stride, mv_src + 8 * 2); + AV_COPY128(mv_dst + 3 * b_stride, mv_src + 8 * 3); + if (CABAC(h)) { + uint8_t (*mvd_dst)[2] = &sl->mvd_table[list][FMO ? 8 * sl->mb_xy + : h->mb2br_xy[sl->mb_xy]]; + uint8_t(*mvd_src)[2] = &sl->mvd_cache[list][scan8[0]]; + if (IS_SKIP(mb_type)) { + AV_ZERO128(mvd_dst); + } else { + AV_COPY64(mvd_dst, mvd_src + 8 * 3); + AV_COPY16(mvd_dst + 3 + 3, mvd_src + 3 + 8 * 0); + AV_COPY16(mvd_dst + 3 + 2, mvd_src + 3 + 8 * 1); + AV_COPY16(mvd_dst + 3 + 1, mvd_src + 3 + 8 * 2); + } + } + + { + int8_t *ref_index = &h->cur_pic.ref_index[list][b8_xy]; + int8_t *ref_cache = sl->ref_cache[list]; + ref_index[0 + 0 * 2] = ref_cache[scan8[0]]; + ref_index[1 + 0 * 2] = ref_cache[scan8[4]]; + ref_index[0 + 1 * 2] = ref_cache[scan8[8]]; + ref_index[1 + 1 * 2] = ref_cache[scan8[12]]; + } +} + +static av_always_inline void write_back_motion(const H264Context *h, + H264SliceContext *sl, + int mb_type) +{ + const int b_stride = h->b_stride; + const int b_xy = 4 * sl->mb_x + 4 * sl->mb_y * h->b_stride; // try mb2b(8)_xy + const int b8_xy = 4 * sl->mb_xy; + + if (USES_LIST(mb_type, 0)) { + write_back_motion_list(h, sl, b_stride, b_xy, b8_xy, mb_type, 0); + } else { + fill_rectangle(&h->cur_pic.ref_index[0][b8_xy], + 2, 2, 2, (uint8_t)LIST_NOT_USED, 1); + } + if (USES_LIST(mb_type, 1)) + write_back_motion_list(h, sl, b_stride, b_xy, b8_xy, mb_type, 1); + + if (sl->slice_type_nos == AV_PICTURE_TYPE_B && CABAC(h)) { + if (IS_8X8(mb_type)) { + uint8_t *direct_table = &h->direct_table[4 * sl->mb_xy]; + direct_table[1] = sl->sub_mb_type[1] >> 1; + direct_table[2] = sl->sub_mb_type[2] >> 1; + direct_table[3] = sl->sub_mb_type[3] >> 1; + } + } +} + +static av_always_inline int get_dct8x8_allowed(const H264Context *h, H264SliceContext *sl) +{ + if (h->ps.sps->direct_8x8_inference_flag) + return !(AV_RN64A(sl->sub_mb_type) & + ((MB_TYPE_16x8 | MB_TYPE_8x16 | MB_TYPE_8x8) * + 0x0001000100010001ULL)); + else + return !(AV_RN64A(sl->sub_mb_type) & + ((MB_TYPE_16x8 | MB_TYPE_8x16 | MB_TYPE_8x8 | MB_TYPE_DIRECT2) * + 0x0001000100010001ULL)); +} + static av_always_inline int fetch_diagonal_mv(const H264Context *h, H264SliceContext *sl, const int16_t **C, int i, int list, int part_width) diff --git a/arm/android/third_party/ffmpeg/libavcodec/h264_parse.c b/arm/android/third_party/ffmpeg/libavcodec/h264_parse.c index 97ddf0e4..3378650f 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/h264_parse.c +++ b/arm/android/third_party/ffmpeg/libavcodec/h264_parse.c @@ -526,22 +526,22 @@ int ff_h264_decode_extradata(const uint8_t *data, int size, H264ParamSets *ps, * * @param sps SPS * - * @return profile as defined by FF_PROFILE_H264_* + * @return profile as defined by AV_PROFILE_H264_* */ int ff_h264_get_profile(const SPS *sps) { int profile = sps->profile_idc; switch (sps->profile_idc) { - case FF_PROFILE_H264_BASELINE: + case AV_PROFILE_H264_BASELINE: // constraint_set1_flag set to 1 - profile |= (sps->constraint_set_flags & 1 << 1) ? FF_PROFILE_H264_CONSTRAINED : 0; + profile |= (sps->constraint_set_flags & 1 << 1) ? AV_PROFILE_H264_CONSTRAINED : 0; break; - case FF_PROFILE_H264_HIGH_10: - case FF_PROFILE_H264_HIGH_422: - case FF_PROFILE_H264_HIGH_444_PREDICTIVE: + case AV_PROFILE_H264_HIGH_10: + case AV_PROFILE_H264_HIGH_422: + case AV_PROFILE_H264_HIGH_444_PREDICTIVE: // constraint_set3_flag set to 1 - profile |= (sps->constraint_set_flags & 1 << 3) ? FF_PROFILE_H264_INTRA : 0; + profile |= (sps->constraint_set_flags & 1 << 3) ? AV_PROFILE_H264_INTRA : 0; break; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/h264_picture.c b/arm/android/third_party/ffmpeg/libavcodec/h264_picture.c index dcaf0fdb..31b5e231 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/h264_picture.c +++ b/arm/android/third_party/ffmpeg/libavcodec/h264_picture.c @@ -26,9 +26,11 @@ */ #include "libavutil/avassert.h" +#include "libavutil/emms.h" #include "error_resilience.h" #include "avcodec.h" #include "h264dec.h" +#include "hwaccel_internal.h" #include "mpegutils.h" #include "thread.h" #include "threadframe.h" @@ -52,6 +54,7 @@ void ff_h264_unref_picture(H264Context *h, H264Picture *pic) av_buffer_unref(&pic->motion_val_buf[i]); av_buffer_unref(&pic->ref_index_buf[i]); } + av_buffer_unref(&pic->decode_error_flags); memset((uint8_t*)pic + off, 0, sizeof(*pic) - off); } @@ -134,6 +137,10 @@ int ff_h264_ref_picture(H264Context *h, H264Picture *dst, H264Picture *src) dst->hwaccel_picture_private = dst->hwaccel_priv_buf->data; } + ret = av_buffer_replace(&dst->decode_error_flags, src->decode_error_flags); + if (ret < 0) + goto fail; + h264_copy_picture_params(dst, src); return 0; @@ -184,6 +191,10 @@ int ff_h264_replace_picture(H264Context *h, H264Picture *dst, const H264Picture dst->hwaccel_picture_private = src->hwaccel_picture_private; + ret = av_buffer_replace(&dst->decode_error_flags, src->decode_error_flags); + if (ret < 0) + goto fail; + h264_copy_picture_params(dst, src); return 0; @@ -233,7 +244,7 @@ int ff_h264_field_end(H264Context *h, H264SliceContext *sl, int in_setup) } if (avctx->hwaccel) { - err = avctx->hwaccel->end_frame(avctx); + err = FF_HW_SIMPLE_CALL(avctx, end_frame); if (err < 0) av_log(avctx, AV_LOG_ERROR, "hardware accelerator failed to decode picture\n"); diff --git a/arm/android/third_party/ffmpeg/libavcodec/h264_slice.c b/arm/android/third_party/ffmpeg/libavcodec/h264_slice.c index 41bf30ee..24f4690e 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/h264_slice.c +++ b/arm/android/third_party/ffmpeg/libavcodec/h264_slice.c @@ -28,15 +28,11 @@ #include "config_components.h" #include "libavutil/avassert.h" -#include "libavutil/display.h" -#include "libavutil/film_grain_params.h" #include "libavutil/pixdesc.h" #include "libavutil/timecode.h" -#include "internal.h" #include "decode.h" #include "cabac.h" #include "cabac_functions.h" -#include "decode.h" #include "error_resilience.h" #include "avcodec.h" #include "h264.h" @@ -209,16 +205,18 @@ static int alloc_picture(H264Context *h, H264Picture *pic) goto fail; } - if (h->avctx->hwaccel) { - const AVHWAccel *hwaccel = h->avctx->hwaccel; - av_assert0(!pic->hwaccel_picture_private); - if (hwaccel->frame_priv_data_size) { - pic->hwaccel_priv_buf = ff_hwaccel_frame_priv_alloc(h->avctx, hwaccel); - if (!pic->hwaccel_priv_buf) - return AVERROR(ENOMEM); - pic->hwaccel_picture_private = pic->hwaccel_priv_buf->data; - } + ret = ff_hwaccel_frame_priv_alloc(h->avctx, &pic->hwaccel_picture_private, + &pic->hwaccel_priv_buf); + if (ret < 0) + goto fail; + + if (h->decode_error_flags_pool) { + pic->decode_error_flags = av_buffer_pool_get(h->decode_error_flags_pool); + if (!pic->decode_error_flags) + goto fail; + atomic_init((atomic_int*)pic->decode_error_flags->data, 0); } + 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, @@ -304,6 +302,34 @@ static void copy_picture_range(H264Picture **to, H264Picture **from, int count, } } +static void color_frame(AVFrame *frame, const int c[4]) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format); + + av_assert0(desc->flags & AV_PIX_FMT_FLAG_PLANAR); + + for (int p = 0; p < desc->nb_components; p++) { + uint8_t *dst = frame->data[p]; + int is_chroma = p == 1 || p == 2; + int bytes = is_chroma ? AV_CEIL_RSHIFT(frame->width, desc->log2_chroma_w) : frame->width; + int height = is_chroma ? AV_CEIL_RSHIFT(frame->height, desc->log2_chroma_h) : frame->height; + if (desc->comp[0].depth >= 9) { + ((uint16_t*)dst)[0] = c[p]; + av_memcpy_backptr(dst + 2, 2, bytes - 2); + dst += frame->linesize[p]; + for (int y = 1; y < height; y++) { + memcpy(dst, frame->data[p], 2*bytes); + dst += frame->linesize[p]; + } + } else { + for (int y = 0; y < height; y++) { + memset(dst, c[p], bytes); + dst += frame->linesize[p]; + } + } + } +} + static int h264_slice_header_init(H264Context *h); int ff_h264_update_thread_context(AVCodecContext *dst, @@ -378,10 +404,6 @@ int ff_h264_update_thread_context(AVCodecContext *dst, memcpy(h->block_offset, h1->block_offset, sizeof(h->block_offset)); } - h->avctx->coded_height = h1->avctx->coded_height; - h->avctx->coded_width = h1->avctx->coded_width; - h->avctx->width = h1->avctx->width; - h->avctx->height = h1->avctx->height; h->width_from_caller = h1->width_from_caller; h->height_from_caller = h1->height_from_caller; h->coded_picture_number = h1->coded_picture_number; @@ -439,6 +461,8 @@ int ff_h264_update_thread_context(AVCodecContext *dst, return ret; h->sei.common.unregistered.x264_build = h1->sei.common.unregistered.x264_build; + h->sei.common.mastering_display = h1->sei.common.mastering_display; + h->sei.common.content_light = h1->sei.common.content_light; if (!h->cur_pic_ptr) return 0; @@ -784,8 +808,6 @@ static enum AVPixelFormat get_pixel_format(H264Context *h, int force_callback) CONFIG_H264_VDPAU_HWACCEL + \ CONFIG_H264_VULKAN_HWACCEL) enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmt = pix_fmts; - const enum AVPixelFormat *choices = pix_fmts; - int i; switch (h->ps.sps->bit_depth_luma) { case 9: @@ -886,9 +908,7 @@ static enum AVPixelFormat get_pixel_format(H264Context *h, int force_callback) #if CONFIG_H264_VAAPI_HWACCEL *fmt++ = AV_PIX_FMT_VAAPI; #endif - if (h->avctx->codec->pix_fmts) - choices = h->avctx->codec->pix_fmts; - else if (h->avctx->color_range == AVCOL_RANGE_JPEG) + if (h->avctx->color_range == AVCOL_RANGE_JPEG) *fmt++ = AV_PIX_FMT_YUVJ420P; else *fmt++ = AV_PIX_FMT_YUV420P; @@ -902,10 +922,10 @@ static enum AVPixelFormat get_pixel_format(H264Context *h, int force_callback) *fmt = AV_PIX_FMT_NONE; - for (i=0; choices[i] != AV_PIX_FMT_NONE; i++) - if (choices[i] == h->avctx->pix_fmt && !force_callback) - return choices[i]; - return ff_thread_get_format(h->avctx, choices); + for (int i = 0; pix_fmts[i] != AV_PIX_FMT_NONE; i++) + if (pix_fmts[i] == h->avctx->pix_fmt && !force_callback) + return pix_fmts[i]; + return ff_get_format(h->avctx, pix_fmts); } /* export coded and cropped frame dimensions to AVCodecContext */ @@ -1554,7 +1574,7 @@ static int h264_field_start(H264Context *h, const H264SliceContext *sl, if (h->short_ref[0]->field_picture) ff_thread_report_progress(&h->short_ref[0]->tf, INT_MAX, 1); } else if (!h->frame_recovered && !h->avctx->hwaccel) - ff_color_frame(h->short_ref[0]->f, c); + color_frame(h->short_ref[0]->f, c); h->short_ref[0]->frame_num = h->poc.prev_frame_num; } } diff --git a/arm/android/third_party/ffmpeg/libavcodec/h264dec.c b/arm/android/third_party/ffmpeg/libavcodec/h264dec.c index 17763939..70733d65 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/h264dec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/h264dec.c @@ -30,6 +30,7 @@ #include "config_components.h" #include "libavutil/avassert.h" +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/opt.h" #include "libavutil/thread.h" @@ -45,6 +46,7 @@ #include "h264data.h" #include "h264_ps.h" #include "golomb.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "mpegutils.h" #include "profiles.h" @@ -305,6 +307,12 @@ static int h264_init_context(AVCodecContext *avctx, H264Context *h) ff_h264_sei_uninit(&h->sei); + if (avctx->active_thread_type & FF_THREAD_FRAME) { + h->decode_error_flags_pool = av_buffer_pool_init(sizeof(atomic_int), NULL); + if (!h->decode_error_flags_pool) + return AVERROR(ENOMEM); + } + h->nb_slice_ctx = (avctx->active_thread_type & FF_THREAD_SLICE) ? avctx->thread_count : 1; h->slice_ctx = av_calloc(h->nb_slice_ctx, sizeof(*h->slice_ctx)); if (!h->slice_ctx) { @@ -351,6 +359,8 @@ static av_cold int h264_decode_end(AVCodecContext *avctx) h->cur_pic_ptr = NULL; + av_buffer_pool_uninit(&h->decode_error_flags_pool); + av_freep(&h->slice_ctx); h->nb_slice_ctx = 0; @@ -485,8 +495,8 @@ static void h264_decode_flush(AVCodecContext *avctx) ff_h264_free_tables(h); h->context_initialized = 0; - if (avctx->hwaccel && avctx->hwaccel->flush) - avctx->hwaccel->flush(avctx); + if (FF_HW_HAS_CB(avctx, flush)) + FF_HW_SIMPLE_CALL(avctx, flush); } static int get_last_needed_nal(H264Context *h) @@ -652,14 +662,14 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size) } if (h->avctx->hwaccel && - (ret = h->avctx->hwaccel->start_frame(h->avctx, buf, buf_size)) < 0) + (ret = FF_HW_CALL(h->avctx, start_frame, buf, buf_size)) < 0) goto end; } max_slice_ctx = avctx->hwaccel ? 1 : h->nb_slice_ctx; if (h->nb_slice_ctx_queued == max_slice_ctx) { if (h->avctx->hwaccel) { - ret = avctx->hwaccel->decode_slice(avctx, nal->raw_data, nal->raw_size); + ret = FF_HW_CALL(avctx, decode_slice, nal->raw_data, nal->raw_size); h->nb_slice_ctx_queued = 0; } else ret = ff_h264_execute_decode_slices(h); @@ -686,11 +696,9 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size) break; case H264_NAL_SPS: { GetBitContext tmp_gb = nal->gb; - if (avctx->hwaccel && avctx->hwaccel->decode_params) { - ret = avctx->hwaccel->decode_params(avctx, - nal->type, - nal->raw_data, - nal->raw_size); + if (FF_HW_HAS_CB(avctx, decode_params)) { + ret = FF_HW_CALL(avctx, decode_params, + nal->type, nal->raw_data, nal->raw_size); if (ret < 0) goto end; } @@ -705,11 +713,9 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size) break; } case H264_NAL_PPS: - if (avctx->hwaccel && avctx->hwaccel->decode_params) { - ret = avctx->hwaccel->decode_params(avctx, - nal->type, - nal->raw_data, - nal->raw_size); + if (FF_HW_HAS_CB(avctx, decode_params)) { + ret = FF_HW_CALL(avctx, decode_params, + nal->type, nal->raw_data, nal->raw_size); if (ret < 0) goto end; } @@ -741,7 +747,16 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size) // set decode_error_flags to allow users to detect concealed decoding errors if ((ret < 0 || h->er.error_occurred) && h->cur_pic_ptr) { - h->cur_pic_ptr->f->decode_error_flags |= FF_DECODE_ERROR_DECODE_SLICES; + if (h->cur_pic_ptr->decode_error_flags) { + /* Frame-threading in use */ + atomic_int *decode_error = (atomic_int*)h->cur_pic_ptr->decode_error_flags->data; + /* Using atomics here is not supposed to provide syncronisation; + * they are merely used to allow to set decode_error from both + * decoding threads in case of coded slices. */ + atomic_fetch_or_explicit(decode_error, FF_DECODE_ERROR_DECODE_SLICES, + memory_order_relaxed); + } else + h->cur_pic_ptr->f->decode_error_flags |= FF_DECODE_ERROR_DECODE_SLICES; } ret = 0; @@ -764,6 +779,7 @@ end: H264SliceContext *sl = h->slice_ctx; int use_last_pic = h->last_pic_for_ec.f->buf[0] && !sl->ref_count[0]; + int decode_error_flags = 0; ff_h264_set_erpic(&h->er.cur_pic, h->cur_pic_ptr); @@ -781,7 +797,15 @@ end: if (sl->ref_count[1]) ff_h264_set_erpic(&h->er.next_pic, sl->ref_list[1][0].parent); - ff_er_frame_end(&h->er); + ff_er_frame_end(&h->er, &decode_error_flags); + if (decode_error_flags) { + if (h->cur_pic_ptr->decode_error_flags) { + atomic_int *decode_error = (atomic_int*)h->cur_pic_ptr->decode_error_flags->data; + atomic_fetch_or_explicit(decode_error, decode_error_flags, + memory_order_relaxed); + } else + h->cur_pic_ptr->f->decode_error_flags |= decode_error_flags; + } if (use_last_pic) memset(&sl->ref_list[0][0], 0, sizeof(sl->ref_list[0][0])); } @@ -853,6 +877,14 @@ static int output_frame(H264Context *h, AVFrame *dst, H264Picture *srcp) if (srcp->needs_fg && (ret = av_frame_copy_props(dst, srcp->f)) < 0) return ret; + if (srcp->decode_error_flags) { + atomic_int *decode_error = (atomic_int*)srcp->decode_error_flags->data; + /* The following is not supposed to provide synchronisation at all: + * given that srcp has already finished decoding, decode_error + * has already been set to its final value. */ + dst->decode_error_flags |= atomic_load_explicit(decode_error, memory_order_relaxed); + } + av_dict_set(&dst->metadata, "stereo_mode", ff_h264_sei_stereo_mode(&h->sei.common.frame_packing), 0); if (srcp->sei_recovery_frame_cnt == 0) diff --git a/arm/android/third_party/ffmpeg/libavcodec/h264dec.h b/arm/android/third_party/ffmpeg/libavcodec/h264dec.h index 9a1ec1ba..322c06a1 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/h264dec.h +++ b/arm/android/third_party/ffmpeg/libavcodec/h264dec.h @@ -29,7 +29,6 @@ #define AVCODEC_H264DEC_H #include "libavutil/buffer.h" -#include "libavutil/intreadwrite.h" #include "libavutil/mem_internal.h" #include "cabac.h" @@ -44,7 +43,6 @@ #include "h264qpel.h" #include "h274.h" #include "mpegutils.h" -#include "rectangle.h" #include "videodsp.h" #define H264_MAX_PICTURE_COUNT 36 @@ -154,6 +152,9 @@ typedef struct H264Picture { int mb_width, mb_height; int mb_stride; + + /* data points to an atomic_int */ + AVBufferRef *decode_error_flags; } H264Picture; typedef struct H264Ref { @@ -551,6 +552,7 @@ typedef struct H264Context { AVBufferPool *mb_type_pool; AVBufferPool *motion_val_pool; AVBufferPool *ref_index_pool; + AVBufferPool *decode_error_flags_pool; int ref2frm[MAX_SLICES][2][64]; ///< reference to frame number lists, used in the loop filter, the first 2 are for -2,-1 } H264Context; @@ -649,136 +651,6 @@ static av_always_inline int get_chroma_qp(const PPS *pps, int t, int qscale) return pps->chroma_qp_table[t][qscale]; } -/** - * Get the predicted intra4x4 prediction mode. - */ -static av_always_inline int pred_intra_mode(const H264Context *h, - H264SliceContext *sl, int n) -{ - const int index8 = scan8[n]; - const int left = sl->intra4x4_pred_mode_cache[index8 - 1]; - const int top = sl->intra4x4_pred_mode_cache[index8 - 8]; - const int min = FFMIN(left, top); - - ff_tlog(h->avctx, "mode:%d %d min:%d\n", left, top, min); - - if (min < 0) - return DC_PRED; - else - return min; -} - -static av_always_inline void write_back_intra_pred_mode(const H264Context *h, - H264SliceContext *sl) -{ - int8_t *i4x4 = sl->intra4x4_pred_mode + h->mb2br_xy[sl->mb_xy]; - int8_t *i4x4_cache = sl->intra4x4_pred_mode_cache; - - AV_COPY32(i4x4, i4x4_cache + 4 + 8 * 4); - i4x4[4] = i4x4_cache[7 + 8 * 3]; - i4x4[5] = i4x4_cache[7 + 8 * 2]; - i4x4[6] = i4x4_cache[7 + 8 * 1]; -} - -static av_always_inline void write_back_non_zero_count(const H264Context *h, - H264SliceContext *sl) -{ - const int mb_xy = sl->mb_xy; - uint8_t *nnz = h->non_zero_count[mb_xy]; - uint8_t *nnz_cache = sl->non_zero_count_cache; - - AV_COPY32(&nnz[ 0], &nnz_cache[4 + 8 * 1]); - AV_COPY32(&nnz[ 4], &nnz_cache[4 + 8 * 2]); - AV_COPY32(&nnz[ 8], &nnz_cache[4 + 8 * 3]); - AV_COPY32(&nnz[12], &nnz_cache[4 + 8 * 4]); - AV_COPY32(&nnz[16], &nnz_cache[4 + 8 * 6]); - AV_COPY32(&nnz[20], &nnz_cache[4 + 8 * 7]); - AV_COPY32(&nnz[32], &nnz_cache[4 + 8 * 11]); - AV_COPY32(&nnz[36], &nnz_cache[4 + 8 * 12]); - - if (!h->chroma_y_shift) { - AV_COPY32(&nnz[24], &nnz_cache[4 + 8 * 8]); - AV_COPY32(&nnz[28], &nnz_cache[4 + 8 * 9]); - AV_COPY32(&nnz[40], &nnz_cache[4 + 8 * 13]); - AV_COPY32(&nnz[44], &nnz_cache[4 + 8 * 14]); - } -} - -static av_always_inline void write_back_motion_list(const H264Context *h, - H264SliceContext *sl, - int b_stride, - int b_xy, int b8_xy, - int mb_type, int list) -{ - int16_t(*mv_dst)[2] = &h->cur_pic.motion_val[list][b_xy]; - int16_t(*mv_src)[2] = &sl->mv_cache[list][scan8[0]]; - AV_COPY128(mv_dst + 0 * b_stride, mv_src + 8 * 0); - AV_COPY128(mv_dst + 1 * b_stride, mv_src + 8 * 1); - AV_COPY128(mv_dst + 2 * b_stride, mv_src + 8 * 2); - AV_COPY128(mv_dst + 3 * b_stride, mv_src + 8 * 3); - if (CABAC(h)) { - uint8_t (*mvd_dst)[2] = &sl->mvd_table[list][FMO ? 8 * sl->mb_xy - : h->mb2br_xy[sl->mb_xy]]; - uint8_t(*mvd_src)[2] = &sl->mvd_cache[list][scan8[0]]; - if (IS_SKIP(mb_type)) { - AV_ZERO128(mvd_dst); - } else { - AV_COPY64(mvd_dst, mvd_src + 8 * 3); - AV_COPY16(mvd_dst + 3 + 3, mvd_src + 3 + 8 * 0); - AV_COPY16(mvd_dst + 3 + 2, mvd_src + 3 + 8 * 1); - AV_COPY16(mvd_dst + 3 + 1, mvd_src + 3 + 8 * 2); - } - } - - { - int8_t *ref_index = &h->cur_pic.ref_index[list][b8_xy]; - int8_t *ref_cache = sl->ref_cache[list]; - ref_index[0 + 0 * 2] = ref_cache[scan8[0]]; - ref_index[1 + 0 * 2] = ref_cache[scan8[4]]; - ref_index[0 + 1 * 2] = ref_cache[scan8[8]]; - ref_index[1 + 1 * 2] = ref_cache[scan8[12]]; - } -} - -static av_always_inline void write_back_motion(const H264Context *h, - H264SliceContext *sl, - int mb_type) -{ - const int b_stride = h->b_stride; - const int b_xy = 4 * sl->mb_x + 4 * sl->mb_y * h->b_stride; // try mb2b(8)_xy - const int b8_xy = 4 * sl->mb_xy; - - if (USES_LIST(mb_type, 0)) { - write_back_motion_list(h, sl, b_stride, b_xy, b8_xy, mb_type, 0); - } else { - fill_rectangle(&h->cur_pic.ref_index[0][b8_xy], - 2, 2, 2, (uint8_t)LIST_NOT_USED, 1); - } - if (USES_LIST(mb_type, 1)) - write_back_motion_list(h, sl, b_stride, b_xy, b8_xy, mb_type, 1); - - if (sl->slice_type_nos == AV_PICTURE_TYPE_B && CABAC(h)) { - if (IS_8X8(mb_type)) { - uint8_t *direct_table = &h->direct_table[4 * sl->mb_xy]; - direct_table[1] = sl->sub_mb_type[1] >> 1; - direct_table[2] = sl->sub_mb_type[2] >> 1; - direct_table[3] = sl->sub_mb_type[3] >> 1; - } - } -} - -static av_always_inline int get_dct8x8_allowed(const H264Context *h, H264SliceContext *sl) -{ - if (h->ps.sps->direct_8x8_inference_flag) - return !(AV_RN64A(sl->sub_mb_type) & - ((MB_TYPE_16x8 | MB_TYPE_8x16 | MB_TYPE_8x8) * - 0x0001000100010001ULL)); - else - return !(AV_RN64A(sl->sub_mb_type) & - ((MB_TYPE_16x8 | MB_TYPE_8x16 | MB_TYPE_8x8 | MB_TYPE_DIRECT2) * - 0x0001000100010001ULL)); -} - int ff_h264_field_end(H264Context *h, H264SliceContext *sl, int in_setup); int ff_h264_ref_picture(H264Context *h, H264Picture *dst, H264Picture *src); diff --git a/arm/android/third_party/ffmpeg/libavcodec/h266_metadata_bsf.c b/arm/android/third_party/ffmpeg/libavcodec/h266_metadata_bsf.c index c0dbf8ef..1f0f875c 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/h266_metadata_bsf.c +++ b/arm/android/third_party/ffmpeg/libavcodec/h266_metadata_bsf.c @@ -43,7 +43,7 @@ static int h266_metadata_update_fragment(AVBSFContext *bsf, AVPacket *pkt, int err, i; // If an AUD is present, it must be the first NAL unit. - if (pu->units[0].type == VVC_AUD_NUT) { + if (pu->nb_units && pu->units[0].type == VVC_AUD_NUT) { if (ctx->aud == BSF_ELEMENT_REMOVE) ff_cbs_delete_unit(pu, 0); } else if ( pkt && ctx->aud == BSF_ELEMENT_INSERT) { diff --git a/arm/android/third_party/ffmpeg/libavcodec/h274.c b/arm/android/third_party/ffmpeg/libavcodec/h274.c index a69f9411..57092003 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/h274.c +++ b/arm/android/third_party/ffmpeg/libavcodec/h274.c @@ -38,7 +38,7 @@ static void prng_shift(uint32_t *state) { // Primitive polynomial x^31 + x^3 + 1 (modulo 2) uint32_t x = *state; - uint8_t feedback = (x >> 2) ^ (x >> 30); + uint8_t feedback = 1u ^ (x >> 2) ^ (x >> 30); *state = (x << 1) | (feedback & 1u); } @@ -59,13 +59,13 @@ static void init_slice_c(int8_t out[64][64], uint8_t h, uint8_t v, // // Note: To make the subsequent matrix multiplication cache friendlier, we // store each *column* of the starting image in a *row* of `out` - for (int y = 0; y <= freq_v; y++) { - for (int x = 0; x <= freq_h; x += 4) { + for (int l = 0; l <= freq_v; l++) { + for (int k = 0; k <= freq_h; k += 4) { uint16_t offset = seed % 2048; - out[x + 0][y] = Gaussian_LUT[offset + 0]; - out[x + 1][y] = Gaussian_LUT[offset + 1]; - out[x + 2][y] = Gaussian_LUT[offset + 2]; - out[x + 3][y] = Gaussian_LUT[offset + 3]; + out[l][k + 0] = Gaussian_LUT[offset + 0]; + out[l][k + 1] = Gaussian_LUT[offset + 1]; + out[l][k + 2] = Gaussian_LUT[offset + 2]; + out[l][k + 3] = Gaussian_LUT[offset + 3]; prng_shift(&seed); } } @@ -74,9 +74,9 @@ static void init_slice_c(int8_t out[64][64], uint8_t h, uint8_t v, // 64x64 inverse integer transform for (int y = 0; y < 64; y++) { - for (int x = 0; x <= freq_h; x++) { + for (int x = 0; x <= freq_v; x++) { int32_t sum = 0; - for (int p = 0; p <= freq_v; p++) + for (int p = 0; p <= freq_h; p++) sum += R64T[y][p] * out[x][p]; tmp[y][x] = (sum + 128) >> 8; } @@ -85,8 +85,8 @@ static void init_slice_c(int8_t out[64][64], uint8_t h, uint8_t v, for (int y = 0; y < 64; y++) { for (int x = 0; x < 64; x++) { int32_t sum = 0; - for (int p = 0; p <= freq_h; p++) - sum += tmp[y][p] * R64T[x][p]; // R64T^T = R64 + for (int p = 0; p <= freq_v; p++) + sum += tmp[x][p] * R64T[y][p]; // R64T^T = R64 // Renormalize and clip to [-127, 127] out[y][x] = av_clip((sum + 128) >> 8, -127, 127); } @@ -110,7 +110,7 @@ static void init_slice(H274FilmGrainDatabase *database, uint8_t h, uint8_t v) init_slice_c(database->db[h][v], h, v, database->slice_tmp); } -// Computes the average of an 8x8 block, right-shifted by 6 +// Computes the average of an 8x8 block static uint16_t avg_8x8_c(const uint8_t *in, int in_stride) { uint16_t avg[8] = {0}; // summing over an array vectorizes better @@ -259,11 +259,11 @@ int ff_h274_apply_film_grain(AVFrame *out_frame, const AVFrame *in_frame, // only advanced in 16x16 blocks, so use a nested loop for (int y = 0; y < height; y += 16) { for (int x = 0; x < width; x += 16) { - uint16_t y_offset = (seed >> 16) % 52; - uint16_t x_offset = (seed & 0xFFFF) % 56; + uint16_t x_offset = (seed >> 16) % 52; + uint16_t y_offset = (seed & 0xFFFF) % 56; const int invert = (seed & 0x1); - y_offset &= 0xFFFC; - x_offset &= 0xFFF8; + x_offset &= 0xFFFC; + y_offset &= 0xFFF8; prng_shift(&seed); for (int yy = 0; yy < 16 && y+yy < height; yy += 8) { diff --git a/arm/android/third_party/ffmpeg/libavcodec/h274.h b/arm/android/third_party/ffmpeg/libavcodec/h274.h index 920f6991..cebc8bec 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/h274.h +++ b/arm/android/third_party/ffmpeg/libavcodec/h274.h @@ -40,11 +40,26 @@ typedef struct H274FilmGrainDatabase { int16_t slice_tmp[64][64]; } H274FilmGrainDatabase; +/** + * Check whether ff_h274_apply_film_grain() supports the given parameter combination. + * + * @param model_id model_id from AVFilmGrainParams to be supplied + * @param pix_fmt pixel format of the frames to be supplied + */ +static inline int ff_h274_film_grain_params_supported(int model_id, enum AVPixelFormat pix_fmt) +{ + return model_id == 0 && pix_fmt == AV_PIX_FMT_YUV420P; +} + // Synthesizes film grain on top of `in` and stores the result to `out`. `out` // must already have been allocated and set to the same size and format as // `in`. // // Returns a negative error code on error, such as invalid params. +// If ff_h274_film_grain_params_supported() indicated that the parameters +// are supported, no error will be returned if the arguments given to +// ff_h274_film_grain_params_supported() coincide with actual values +// from the frames and params. int ff_h274_apply_film_grain(AVFrame *out, const AVFrame *in, H274FilmGrainDatabase *db, const AVFilmGrainParams *params); diff --git a/arm/android/third_party/ffmpeg/libavcodec/hcadec.c b/arm/android/third_party/ffmpeg/libavcodec/hcadec.c index 2f019a82..6f277afb 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/hcadec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/hcadec.c @@ -28,8 +28,12 @@ #include "get_bits.h" #include "hca_data.h" +#define HCA_MASK 0x7f7f7f7f +#define MAX_CHANNELS 16 + typedef struct ChannelContext { - float base[128]; + DECLARE_ALIGNED(32, float, base)[128]; + DECLARE_ALIGNED(32, float, factors)[128]; DECLARE_ALIGNED(32, float, imdct_in)[128]; DECLARE_ALIGNED(32, float, imdct_out)[128]; DECLARE_ALIGNED(32, float, imdct_prev)[128]; @@ -44,11 +48,15 @@ typedef struct ChannelContext { typedef struct HCAContext { const AVCRC *crc_table; - ChannelContext ch[16]; + ChannelContext ch[MAX_CHANNELS]; uint8_t ath[128]; + uint8_t cipher[256]; + uint64_t key; + uint16_t subkey; int ath_type; + int ciph_type; unsigned hfr_group_count; uint8_t track_count; uint8_t channel_config; @@ -62,6 +70,93 @@ typedef struct HCAContext { AVFloatDSPContext *fdsp; } HCAContext; +static void cipher_init56_create_table(uint8_t *r, uint8_t key) +{ + const int mul = ((key & 1) << 3) | 5; + const int add = (key & 0xE) | 1; + + key >>= 4; + for (int i = 0; i < 16; i++) { + key = (key * mul + add) & 0xF; + r[i] = key; + } +} + +static void cipher_init56(uint8_t *cipher, uint64_t keycode) +{ + uint8_t base[256], base_r[16], base_c[16], kc[8], seed[16]; + + /* 56bit keycode encryption (given as a uint64_t number, but upper 8b aren't used) */ + /* keycode = keycode - 1 */ + if (keycode != 0) + keycode--; + + /* init keycode table */ + for (int r = 0; r < (8-1); r++) { + kc[r] = keycode & 0xFF; + keycode = keycode >> 8; + } + + /* init seed table */ + seed[ 0] = kc[1]; + seed[ 1] = kc[1] ^ kc[6]; + seed[ 2] = kc[2] ^ kc[3]; + seed[ 3] = kc[2]; + seed[ 4] = kc[2] ^ kc[1]; + seed[ 5] = kc[3] ^ kc[4]; + seed[ 6] = kc[3]; + seed[ 7] = kc[3] ^ kc[2]; + seed[ 8] = kc[4] ^ kc[5]; + seed[ 9] = kc[4]; + seed[10] = kc[4] ^ kc[3]; + seed[11] = kc[5] ^ kc[6]; + seed[12] = kc[5]; + seed[13] = kc[5] ^ kc[4]; + seed[14] = kc[6] ^ kc[1]; + seed[15] = kc[6]; + + /* init base table */ + cipher_init56_create_table(base_r, kc[0]); + for (int r = 0; r < 16; r++) { + uint8_t nb; + cipher_init56_create_table(base_c, seed[r]); + nb = base_r[r] << 4; + for (int c = 0; c < 16; c++) + base[r*16 + c] = nb | base_c[c]; /* combine nibbles */ + } + + /* final shuffle table */ + { + unsigned x = 0; + unsigned pos = 1; + + for (int i = 0; i < 256; i++) { + x = (x + 17) & 0xFF; + if (base[x] != 0 && base[x] != 0xFF) + cipher[pos++] = base[x]; + } + cipher[0] = 0; + cipher[0xFF] = 0xFF; + } +} + +static void cipher_init(uint8_t *cipher, int type, uint64_t keycode, uint16_t subkey) +{ + switch (type) { + case 56: + if (keycode) { + if (subkey) + keycode = keycode * (((uint64_t)subkey<<16u)|((uint16_t)~subkey+2u)); + cipher_init56(cipher, keycode); + } + break; + case 0: + for (int i = 0; i < 256; i++) + cipher[i] = i; + break; + } +} + static void ath_init1(uint8_t *ath, int sample_rate) { unsigned int index; @@ -101,24 +196,19 @@ static inline unsigned ceil2(unsigned a, unsigned b) return (b > 0) ? (a / b + ((a % b) ? 1 : 0)) : 0; } -static av_cold int decode_init(AVCodecContext *avctx) +static int init_hca(AVCodecContext *avctx, const uint8_t *extradata, + const int extradata_size) { HCAContext *c = avctx->priv_data; GetByteContext gb0, *const gb = &gb0; int8_t r[16] = { 0 }; - float scale = 1.f / 8.f; unsigned b, chunk; int version, ret; - avctx->sample_fmt = AV_SAMPLE_FMT_FLTP; - c->crc_table = av_crc_get_table(AV_CRC_16_ANSI); - - if (avctx->ch_layout.nb_channels <= 0 || avctx->ch_layout.nb_channels > 16) - return AVERROR(EINVAL); - - if (avctx->extradata_size < 36) + if (extradata_size < 36) return AVERROR_INVALIDDATA; - bytestream2_init(gb, avctx->extradata, avctx->extradata_size); + + bytestream2_init(gb, extradata, extradata_size); bytestream2_skipu(gb, 4); version = bytestream2_get_be16(gb); @@ -126,13 +216,13 @@ static av_cold int decode_init(AVCodecContext *avctx) c->ath_type = version >= 0x200 ? 0 : 1; - if (bytestream2_get_be32u(gb) != MKBETAG('f', 'm', 't', 0)) + if ((bytestream2_get_be32u(gb) & HCA_MASK) != MKBETAG('f', 'm', 't', 0)) return AVERROR_INVALIDDATA; bytestream2_skipu(gb, 4); bytestream2_skipu(gb, 4); bytestream2_skipu(gb, 4); - chunk = bytestream2_get_be32u(gb); + chunk = bytestream2_get_be32u(gb) & HCA_MASK; if (chunk == MKBETAG('c', 'o', 'm', 'p')) { bytestream2_skipu(gb, 2); bytestream2_skipu(gb, 1); @@ -161,9 +251,8 @@ static av_cold int decode_init(AVCodecContext *avctx) if (c->total_band_count > FF_ARRAY_ELEMS(c->ch->imdct_in)) return AVERROR_INVALIDDATA; - while (bytestream2_get_bytes_left(gb) >= 4) { - chunk = bytestream2_get_be32u(gb); + chunk = bytestream2_get_be32u(gb) & HCA_MASK; if (chunk == MKBETAG('v', 'b', 'r', 0)) { bytestream2_skip(gb, 2 + 2); } else if (chunk == MKBETAG('a', 't', 'h', 0)) { @@ -173,7 +262,7 @@ static av_cold int decode_init(AVCodecContext *avctx) } else if (chunk == MKBETAG('c', 'o', 'm', 'm')) { bytestream2_skip(gb, bytestream2_get_byte(gb) * 8); } else if (chunk == MKBETAG('c', 'i', 'p', 'h')) { - bytestream2_skip(gb, 2); + c->ciph_type = bytestream2_get_be16(gb); } else if (chunk == MKBETAG('l', 'o', 'o', 'p')) { bytestream2_skip(gb, 4 + 4 + 2 + 2); } else if (chunk == MKBETAG('p', 'a', 'd', 0)) { @@ -183,6 +272,14 @@ static av_cold int decode_init(AVCodecContext *avctx) } } + if (bytestream2_get_bytes_left(gb) >= 10) { + bytestream2_skip(gb, bytestream2_get_bytes_left(gb) - 10); + c->key = bytestream2_get_be64u(gb); + c->subkey = bytestream2_get_be16u(gb); + } + + cipher_init(c->cipher, c->ciph_type, c->key, c->subkey); + ret = ath_init(c->ath, c->ath_type, avctx->sample_rate); if (ret < 0) return ret; @@ -243,11 +340,36 @@ static av_cold int decode_init(AVCodecContext *avctx) return AVERROR_INVALIDDATA; } + return 0; +} + +static av_cold int decode_init(AVCodecContext *avctx) +{ + HCAContext *c = avctx->priv_data; + float scale = 1.f / 8.f; + int ret; + + avctx->sample_fmt = AV_SAMPLE_FMT_FLTP; + c->crc_table = av_crc_get_table(AV_CRC_16_ANSI); + + if (avctx->ch_layout.nb_channels <= 0 || avctx->ch_layout.nb_channels > FF_ARRAY_ELEMS(c->ch)) + return AVERROR(EINVAL); + c->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT); if (!c->fdsp) return AVERROR(ENOMEM); - return av_tx_init(&c->tx_ctx, &c->tx_fn, AV_TX_FLOAT_MDCT, 1, 128, &scale, 0); + ret = av_tx_init(&c->tx_ctx, &c->tx_fn, AV_TX_FLOAT_MDCT, 1, 128, &scale, 0); + if (ret < 0) + return ret; + + if (avctx->extradata_size != 0 && avctx->extradata_size < 36) + return AVERROR_INVALIDDATA; + + if (!avctx->extradata_size) + return 0; + + return init_hca(avctx, avctx->extradata, avctx->extradata_size); } static void run_imdct(HCAContext *c, ChannelContext *ch, int index, float *out) @@ -273,8 +395,8 @@ static void apply_intensity_stereo(HCAContext *s, ChannelContext *ch1, ChannelCo return; for (int i = 0; i < band_count; i++) { - *(c2++) = *c1 * ratio_r; - *(c1++) *= ratio_l; + c2[i] = c1[i] * ratio_r; + c1[i] *= ratio_l; } } @@ -299,6 +421,10 @@ static void reconstruct_hfr(HCAContext *s, ChannelContext *ch, static void dequantize_coefficients(HCAContext *c, ChannelContext *ch, GetBitContext *gb) { + const float *base = ch->base; + float *factors = ch->factors; + float *out = ch->imdct_in; + for (int i = 0; i < ch->count; i++) { unsigned scale = ch->scale[i]; int nb_bits = max_bits_table[scale]; @@ -315,10 +441,11 @@ static void dequantize_coefficients(HCAContext *c, ChannelContext *ch, skip_bits_long(gb, quant_spectrum_bits[value] - nb_bits); factor = quant_spectrum_value[value]; } - ch->imdct_in[i] = factor * ch->base[i]; + factors[i] = factor; } - memset(ch->imdct_in + ch->count, 0, sizeof(ch->imdct_in) - ch->count * sizeof(ch->imdct_in[0])); + memset(factors + ch->count, 0, 512 - ch->count * sizeof(*factors)); + c->fdsp->vector_fmul(out, factors, base, 128); } static void unpack(HCAContext *c, ChannelContext *ch, @@ -385,16 +512,44 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { HCAContext *c = avctx->priv_data; - int ch, ret, packed_noise_level; + int ch, offset = 0, ret, packed_noise_level; GetBitContext gb0, *const gb = &gb0; float **samples; + if (avpkt->size <= 8) + return AVERROR_INVALIDDATA; + + if (AV_RN16(avpkt->data) != 0xFFFF) { + if ((AV_RL32(avpkt->data)) != MKTAG('H','C','A',0)) { + return AVERROR_INVALIDDATA; + } else if (AV_RB16(avpkt->data + 6) <= avpkt->size) { + ret = init_hca(avctx, avpkt->data, AV_RB16(avpkt->data + 6)); + if (ret < 0) + return ret; + offset = AV_RB16(avpkt->data + 6); + if (offset == avpkt->size) + return avpkt->size; + } else { + return AVERROR_INVALIDDATA; + } + } + + if (c->key || c->subkey) { + uint8_t *data, *cipher = c->cipher; + + if ((ret = av_packet_make_writable(avpkt)) < 0) + return ret; + data = avpkt->data; + for (int n = 0; n < avpkt->size; n++) + data[n] = cipher[data[n]]; + } + if (avctx->err_recognition & AV_EF_CRCCHECK) { - if (av_crc(c->crc_table, 0, avpkt->data, avpkt->size)) + if (av_crc(c->crc_table, 0, avpkt->data + offset, avpkt->size - offset)) return AVERROR_INVALIDDATA; } - if ((ret = init_get_bits8(gb, avpkt->data, avpkt->size)) < 0) + if ((ret = init_get_bits8(gb, avpkt->data + offset, avpkt->size - offset)) < 0) return ret; if (get_bits(gb, 16) != 0xFFFF) diff --git a/arm/android/third_party/ffmpeg/libavcodec/hevc_ps.c b/arm/android/third_party/ffmpeg/libavcodec/hevc_ps.c index 1db2d3a2..7507d2bf 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/hevc_ps.c +++ b/arm/android/third_party/ffmpeg/libavcodec/hevc_ps.c @@ -250,15 +250,15 @@ static int decode_profile_tier_level(GetBitContext *gb, AVCodecContext *avctx, ptl->profile_space = get_bits(gb, 2); ptl->tier_flag = get_bits1(gb); ptl->profile_idc = get_bits(gb, 5); - if (ptl->profile_idc == FF_PROFILE_HEVC_MAIN) + if (ptl->profile_idc == AV_PROFILE_HEVC_MAIN) av_log(avctx, AV_LOG_DEBUG, "Main profile bitstream\n"); - else if (ptl->profile_idc == FF_PROFILE_HEVC_MAIN_10) + else if (ptl->profile_idc == AV_PROFILE_HEVC_MAIN_10) av_log(avctx, AV_LOG_DEBUG, "Main 10 profile bitstream\n"); - else if (ptl->profile_idc == FF_PROFILE_HEVC_MAIN_STILL_PICTURE) + else if (ptl->profile_idc == AV_PROFILE_HEVC_MAIN_STILL_PICTURE) av_log(avctx, AV_LOG_DEBUG, "Main Still Picture profile bitstream\n"); - else if (ptl->profile_idc == FF_PROFILE_HEVC_REXT) + else if (ptl->profile_idc == AV_PROFILE_HEVC_REXT) av_log(avctx, AV_LOG_DEBUG, "Range Extension profile bitstream\n"); - else if (ptl->profile_idc == FF_PROFILE_HEVC_SCC) + else if (ptl->profile_idc == AV_PROFILE_HEVC_SCC) av_log(avctx, AV_LOG_DEBUG, "Screen Content Coding Extension profile bitstream\n"); else av_log(avctx, AV_LOG_WARNING, "Unknown HEVC profile: %d\n", ptl->profile_idc); @@ -406,12 +406,11 @@ static int decode_hrd(GetBitContext *gb, int common_inf_present, for (int i = 0; i < max_sublayers; i++) { hdr->flags.fixed_pic_rate_general_flag = get_bits1(gb); - hdr->cpb_cnt_minus1[i] = 1; - if (!hdr->flags.fixed_pic_rate_general_flag) hdr->flags.fixed_pic_rate_within_cvs_flag = get_bits1(gb); - if (hdr->flags.fixed_pic_rate_within_cvs_flag) + if (hdr->flags.fixed_pic_rate_within_cvs_flag || + hdr->flags.fixed_pic_rate_general_flag) hdr->elemental_duration_in_tc_minus1[i] = get_ue_golomb_long(gb); else hdr->flags.low_delay_hrd_flag = get_bits1(gb); @@ -426,11 +425,11 @@ static int decode_hrd(GetBitContext *gb, int common_inf_present, } if (hdr->flags.nal_hrd_parameters_present_flag) - decode_sublayer_hrd(gb, hdr->cpb_cnt_minus1[i], &hdr->nal_params[i], + decode_sublayer_hrd(gb, hdr->cpb_cnt_minus1[i]+1, &hdr->nal_params[i], hdr->flags.sub_pic_hrd_params_present_flag); if (hdr->flags.vcl_hrd_parameters_present_flag) - decode_sublayer_hrd(gb, hdr->cpb_cnt_minus1[i], &hdr->vcl_params[i], + decode_sublayer_hrd(gb, hdr->cpb_cnt_minus1[i]+1, &hdr->vcl_params[i], hdr->flags.sub_pic_hrd_params_present_flag); } @@ -1968,7 +1967,7 @@ int ff_hevc_decode_nal_pps(GetBitContext *gb, AVCodecContext *avctx, pps->pps_scc_extension_flag = get_bits1(gb); skip_bits(gb, 4); // pps_extension_4bits - if (sps->ptl.general_ptl.profile_idc >= FF_PROFILE_HEVC_REXT && pps->pps_range_extensions_flag) { + if (sps->ptl.general_ptl.profile_idc >= AV_PROFILE_HEVC_REXT && pps->pps_range_extensions_flag) { if ((ret = pps_range_extensions(gb, avctx, pps, sps)) < 0) goto err; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/hevc_refs.c b/arm/android/third_party/ffmpeg/libavcodec/hevc_refs.c index 3aa8e199..c5c1203e 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/hevc_refs.c +++ b/arm/android/third_party/ffmpeg/libavcodec/hevc_refs.c @@ -118,16 +118,10 @@ static HEVCFrame *alloc_frame(HEVCContext *s) (s->sei.picture_timing.picture_struct == AV_PICTURE_STRUCTURE_BOTTOM_FIELD)) frame->frame->flags |= AV_FRAME_FLAG_INTERLACED; - if (s->avctx->hwaccel) { - const AVHWAccel *hwaccel = s->avctx->hwaccel; - av_assert0(!frame->hwaccel_picture_private); - if (hwaccel->frame_priv_data_size) { - frame->hwaccel_priv_buf = ff_hwaccel_frame_priv_alloc(s->avctx, hwaccel); - if (!frame->hwaccel_priv_buf) - goto fail; - frame->hwaccel_picture_private = frame->hwaccel_priv_buf->data; - } - } + ret = ff_hwaccel_frame_priv_alloc(s->avctx, &frame->hwaccel_picture_private, + &frame->hwaccel_priv_buf); + if (ret < 0) + goto fail; return frame; fail: diff --git a/arm/android/third_party/ffmpeg/libavcodec/hevc_sei.c b/arm/android/third_party/ffmpeg/libavcodec/hevc_sei.c index 3c6bde1b..351e6997 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/hevc_sei.c +++ b/arm/android/third_party/ffmpeg/libavcodec/hevc_sei.c @@ -49,52 +49,6 @@ static int decode_nal_sei_decoded_picture_hash(HEVCSEIPictureHash *s, return 0; } -static int decode_nal_sei_mastering_display_info(HEVCSEIMasteringDisplay *s, - GetByteContext *gb) -{ - int i; - - if (bytestream2_get_bytes_left(gb) < 24) - return AVERROR_INVALIDDATA; - - // Mastering primaries - for (i = 0; i < 3; i++) { - s->display_primaries[i][0] = bytestream2_get_be16u(gb); - s->display_primaries[i][1] = bytestream2_get_be16u(gb); - } - // White point (x, y) - s->white_point[0] = bytestream2_get_be16u(gb); - s->white_point[1] = bytestream2_get_be16u(gb); - - // Max and min luminance of mastering display - s->max_luminance = bytestream2_get_be32u(gb); - s->min_luminance = bytestream2_get_be32u(gb); - - // As this SEI message comes before the first frame that references it, - // initialize the flag to 2 and decrement on IRAP access unit so it - // persists for the coded video sequence (e.g., between two IRAPs) - s->present = 2; - - return 0; -} - -static int decode_nal_sei_content_light_info(HEVCSEIContentLight *s, - GetByteContext *gb) -{ - if (bytestream2_get_bytes_left(gb) < 4) - return AVERROR_INVALIDDATA; - - // Max and average light levels - s->max_content_light_level = bytestream2_get_be16u(gb); - s->max_pic_average_light_level = bytestream2_get_be16u(gb); - // As this SEI message comes before the first frame that references it, - // initialize the flag to 2 and decrement on IRAP access unit so it - // persists for the coded video sequence (e.g., between two IRAPs) - s->present = 2; - - return 0; -} - static int decode_nal_sei_pic_timing(HEVCSEI *s, GetBitContext *gb, const HEVCParamSets *ps, void *logctx) { @@ -206,10 +160,6 @@ static int decode_nal_sei_prefix(GetBitContext *gb, GetByteContext *gbyte, return decode_nal_sei_decoded_picture_hash(&s->picture_hash, gbyte); case SEI_TYPE_PIC_TIMING: return decode_nal_sei_pic_timing(s, gb, ps, logctx); - case SEI_TYPE_MASTERING_DISPLAY_COLOUR_VOLUME: - return decode_nal_sei_mastering_display_info(&s->mastering_display, gbyte); - case SEI_TYPE_CONTENT_LIGHT_LEVEL_INFO: - return decode_nal_sei_content_light_info(&s->content_light, gbyte); case SEI_TYPE_ACTIVE_PARAMETER_SETS: return decode_nal_sei_active_parameter_sets(s, gb, logctx); case SEI_TYPE_TIME_CODE: diff --git a/arm/android/third_party/ffmpeg/libavcodec/hevc_sei.h b/arm/android/third_party/ffmpeg/libavcodec/hevc_sei.h index 4189f5e6..a23a64ec 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/hevc_sei.h +++ b/arm/android/third_party/ffmpeg/libavcodec/hevc_sei.h @@ -53,20 +53,6 @@ typedef struct HEVCSEIPictureTiming { int picture_struct; } HEVCSEIPictureTiming; -typedef struct HEVCSEIMasteringDisplay { - int present; - uint16_t display_primaries[3][2]; - uint16_t white_point[2]; - uint32_t max_luminance; - uint32_t min_luminance; -} HEVCSEIMasteringDisplay; - -typedef struct HEVCSEIContentLight { - int present; - uint16_t max_content_light_level; - uint16_t max_pic_average_light_level; -} HEVCSEIContentLight; - typedef struct HEVCSEIAlternativeTransfer { int present; int preferred_transfer_characteristics; @@ -96,8 +82,6 @@ typedef struct HEVCSEI { H2645SEI common; HEVCSEIPictureHash picture_hash; HEVCSEIPictureTiming picture_timing; - HEVCSEIMasteringDisplay mastering_display; - HEVCSEIContentLight content_light; int active_seq_parameter_set_id; HEVCSEITimeCode timecode; } HEVCSEI; diff --git a/arm/android/third_party/ffmpeg/libavcodec/hevcdec.c b/arm/android/third_party/ffmpeg/libavcodec/hevcdec.c index fcf19b4e..2be62ddf 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/hevcdec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/hevcdec.c @@ -31,7 +31,6 @@ #include "libavutil/display.h" #include "libavutil/film_grain_params.h" #include "libavutil/internal.h" -#include "libavutil/mastering_display_metadata.h" #include "libavutil/md5.h" #include "libavutil/opt.h" #include "libavutil/pixdesc.h" @@ -47,6 +46,7 @@ #include "hevc_data.h" #include "hevc_parse.h" #include "hevcdec.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "internal.h" #include "profiles.h" @@ -521,7 +521,7 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps) *fmt++ = sps->pix_fmt; *fmt = AV_PIX_FMT_NONE; - return ff_thread_get_format(s->avctx, pix_fmts); + return ff_get_format(s->avctx, pix_fmts); } static int set_sps(HEVCContext *s, const HEVCSPS *sps, @@ -1563,7 +1563,8 @@ static void luma_mc_uni(HEVCLocalContext *lc, uint8_t *dst, ptrdiff_t dststride, 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) { + y_off >= pic_height - block_h - QPEL_EXTRA_AFTER || + ref == s->frame) { const ptrdiff_t 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); @@ -1713,6 +1714,7 @@ static void chroma_mc_uni(HEVCLocalContext *lc, uint8_t *dst0, intptr_t my = av_mod_uintp2(mv->y, 2 + vshift); intptr_t _mx = mx << (1 - hshift); intptr_t _my = my << (1 - vshift); + int emu = src0 == s->frame->data[1] || src0 == s->frame->data[2]; x_off += mv->x >> (2 + hshift); y_off += mv->y >> (2 + vshift); @@ -1720,7 +1722,8 @@ static void chroma_mc_uni(HEVCLocalContext *lc, uint8_t *dst0, 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) { + y_off >= pic_height - block_h - EPEL_EXTRA_AFTER || + emu) { 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 * @@ -2761,73 +2764,15 @@ static int set_side_data(HEVCContext *s) AVFrame *out = s->ref->frame; int ret; - // Decrement the mastering display flag when IRAP frame has no_rasl_output_flag=1 - // so the side data persists for the entire coded video sequence. - if (s->sei.mastering_display.present > 0 && - IS_IRAP(s) && s->no_rasl_output_flag) { - s->sei.mastering_display.present--; - } - if (s->sei.mastering_display.present) { - // HEVC uses a g,b,r ordering, which we convert to a more natural r,g,b - const int mapping[3] = {2, 0, 1}; - const int chroma_den = 50000; - const int luma_den = 10000; - int i; - AVMasteringDisplayMetadata *metadata = - av_mastering_display_metadata_create_side_data(out); - if (!metadata) - return AVERROR(ENOMEM); + // Decrement the mastering display and content light level flag when IRAP + // frame has no_rasl_output_flag=1 so the side data persists for the entire + // coded video sequence. + if (IS_IRAP(s) && s->no_rasl_output_flag) { + if (s->sei.common.mastering_display.present > 0) + s->sei.common.mastering_display.present--; - for (i = 0; i < 3; i++) { - const int j = mapping[i]; - metadata->display_primaries[i][0].num = s->sei.mastering_display.display_primaries[j][0]; - metadata->display_primaries[i][0].den = chroma_den; - metadata->display_primaries[i][1].num = s->sei.mastering_display.display_primaries[j][1]; - metadata->display_primaries[i][1].den = chroma_den; - } - metadata->white_point[0].num = s->sei.mastering_display.white_point[0]; - metadata->white_point[0].den = chroma_den; - metadata->white_point[1].num = s->sei.mastering_display.white_point[1]; - metadata->white_point[1].den = chroma_den; - - metadata->max_luminance.num = s->sei.mastering_display.max_luminance; - metadata->max_luminance.den = luma_den; - metadata->min_luminance.num = s->sei.mastering_display.min_luminance; - metadata->min_luminance.den = luma_den; - metadata->has_luminance = 1; - metadata->has_primaries = 1; - - av_log(s->avctx, AV_LOG_DEBUG, "Mastering Display Metadata:\n"); - av_log(s->avctx, AV_LOG_DEBUG, - "r(%5.4f,%5.4f) g(%5.4f,%5.4f) b(%5.4f %5.4f) wp(%5.4f, %5.4f)\n", - av_q2d(metadata->display_primaries[0][0]), - av_q2d(metadata->display_primaries[0][1]), - av_q2d(metadata->display_primaries[1][0]), - av_q2d(metadata->display_primaries[1][1]), - av_q2d(metadata->display_primaries[2][0]), - av_q2d(metadata->display_primaries[2][1]), - av_q2d(metadata->white_point[0]), av_q2d(metadata->white_point[1])); - av_log(s->avctx, AV_LOG_DEBUG, - "min_luminance=%f, max_luminance=%f\n", - av_q2d(metadata->min_luminance), av_q2d(metadata->max_luminance)); - } - // Decrement the mastering display flag when IRAP frame has no_rasl_output_flag=1 - // so the side data persists for the entire coded video sequence. - if (s->sei.content_light.present > 0 && - IS_IRAP(s) && s->no_rasl_output_flag) { - s->sei.content_light.present--; - } - if (s->sei.content_light.present) { - AVContentLightMetadata *metadata = - av_content_light_metadata_create_side_data(out); - if (!metadata) - return AVERROR(ENOMEM); - metadata->MaxCLL = s->sei.content_light.max_content_light_level; - metadata->MaxFALL = s->sei.content_light.max_pic_average_light_level; - - av_log(s->avctx, AV_LOG_DEBUG, "Content Light Level Metadata:\n"); - av_log(s->avctx, AV_LOG_DEBUG, "MaxCLL=%d, MaxFALL=%d\n", - metadata->MaxCLL, metadata->MaxFALL); + if (s->sei.common.content_light.present > 0) + s->sei.common.content_light.present--; } ret = ff_h2645_sei_to_frame(out, &s->sei.common, AV_CODEC_ID_HEVC, NULL, @@ -2939,6 +2884,14 @@ static int hevc_frame_start(HEVCContext *s) !(s->avctx->export_side_data & AV_CODEC_EXPORT_DATA_FILM_GRAIN) && !s->avctx->hwaccel; + if (s->ref->needs_fg && + !ff_h274_film_grain_params_supported(s->sei.common.film_grain_characteristics.model_id, + s->ref->frame->format)) { + av_log_once(s->avctx, AV_LOG_WARNING, AV_LOG_DEBUG, &s->film_grain_warning_shown, + "Unsupported film grain parameters. Ignoring film grain.\n"); + s->ref->needs_fg = 0; + } + if (s->ref->needs_fg) { s->ref->frame_grain->format = s->ref->frame->format; s->ref->frame_grain->width = s->ref->frame->width; @@ -2977,19 +2930,14 @@ static int hevc_frame_end(HEVCContext *s) { HEVCFrame *out = s->ref; const AVFrameSideData *sd; - int ret; + av_unused int ret; if (out->needs_fg) { sd = av_frame_get_side_data(out->frame, AV_FRAME_DATA_FILM_GRAIN_PARAMS); av_assert0(out->frame_grain->buf[0] && sd); ret = ff_h274_apply_film_grain(out->frame_grain, out->frame, &s->h274db, (AVFilmGrainParams *) sd->data); - - if (ret < 0) { - av_log(s->avctx, AV_LOG_WARNING, "Failed synthesizing film " - "grain, ignoring: %s\n", av_err2str(ret)); - out->needs_fg = 0; - } + av_assert1(ret >= 0); } return 0; @@ -3007,11 +2955,9 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal) switch (s->nal_unit_type) { case HEVC_NAL_VPS: - if (s->avctx->hwaccel && s->avctx->hwaccel->decode_params) { - ret = s->avctx->hwaccel->decode_params(s->avctx, - nal->type, - nal->raw_data, - nal->raw_size); + if (FF_HW_HAS_CB(s->avctx, decode_params)) { + ret = FF_HW_CALL(s->avctx, decode_params, + nal->type, nal->raw_data, nal->raw_size); if (ret < 0) goto fail; } @@ -3020,11 +2966,9 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal) goto fail; break; case HEVC_NAL_SPS: - if (s->avctx->hwaccel && s->avctx->hwaccel->decode_params) { - ret = s->avctx->hwaccel->decode_params(s->avctx, - nal->type, - nal->raw_data, - nal->raw_size); + if (FF_HW_HAS_CB(s->avctx, decode_params)) { + ret = FF_HW_CALL(s->avctx, decode_params, + nal->type, nal->raw_data, nal->raw_size); if (ret < 0) goto fail; } @@ -3034,11 +2978,9 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal) goto fail; break; case HEVC_NAL_PPS: - if (s->avctx->hwaccel && s->avctx->hwaccel->decode_params) { - ret = s->avctx->hwaccel->decode_params(s->avctx, - nal->type, - nal->raw_data, - nal->raw_size); + if (FF_HW_HAS_CB(s->avctx, decode_params)) { + ret = FF_HW_CALL(s->avctx, decode_params, + nal->type, nal->raw_data, nal->raw_size); if (ret < 0) goto fail; } @@ -3048,11 +2990,9 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal) break; case HEVC_NAL_SEI_PREFIX: case HEVC_NAL_SEI_SUFFIX: - if (s->avctx->hwaccel && s->avctx->hwaccel->decode_params) { - ret = s->avctx->hwaccel->decode_params(s->avctx, - nal->type, - nal->raw_data, - nal->raw_size); + if (FF_HW_HAS_CB(s->avctx, decode_params)) { + ret = FF_HW_CALL(s->avctx, decode_params, + nal->type, nal->raw_data, nal->raw_size); if (ret < 0) goto fail; } @@ -3138,17 +3078,17 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal) } if (s->sh.first_slice_in_pic_flag && s->avctx->hwaccel) { - ret = s->avctx->hwaccel->start_frame(s->avctx, NULL, 0); + ret = FF_HW_CALL(s->avctx, start_frame, NULL, 0); if (ret < 0) goto fail; } if (s->avctx->hwaccel) { - ret = s->avctx->hwaccel->decode_slice(s->avctx, nal->raw_data, nal->raw_size); + ret = FF_HW_CALL(s->avctx, decode_slice, nal->raw_data, nal->raw_size); if (ret < 0) goto fail; } else { - if (s->avctx->profile == FF_PROFILE_HEVC_SCC) { + if (s->avctx->profile == AV_PROFILE_HEVC_SCC) { av_log(s->avctx, AV_LOG_ERROR, "SCC profile is not yet implemented in hevc native decoder.\n"); ret = AVERROR_PATCHWELCOME; @@ -3412,7 +3352,7 @@ static int hevc_decode_frame(AVCodecContext *avctx, AVFrame *rframe, return ret; if (avctx->hwaccel) { - if (s->ref && (ret = avctx->hwaccel->end_frame(avctx)) < 0) { + if (s->ref && (ret = FF_HW_SIMPLE_CALL(avctx, end_frame)) < 0) { av_log(avctx, AV_LOG_ERROR, "hardware accelerator failed to decode picture\n"); ff_hevc_unref_frame(s, s->ref, ~0); @@ -3637,6 +3577,8 @@ static int hevc_update_thread_context(AVCodecContext *dst, s->threads_number = s0->threads_number; s->threads_type = s0->threads_type; + s->film_grain_warning_shown = s0->film_grain_warning_shown; + if (s0->eos) { s->seq_decode = (s->seq_decode + 1) & HEVC_SEQUENCE_COUNTER_MASK; s->max_ra = INT_MAX; @@ -3667,8 +3609,8 @@ static int hevc_update_thread_context(AVCodecContext *dst, s->sei.common.frame_packing = s0->sei.common.frame_packing; s->sei.common.display_orientation = s0->sei.common.display_orientation; s->sei.common.alternative_transfer = s0->sei.common.alternative_transfer; - s->sei.mastering_display = s0->sei.mastering_display; - s->sei.content_light = s0->sei.content_light; + s->sei.common.mastering_display = s0->sei.common.mastering_display; + s->sei.common.content_light = s0->sei.common.content_light; ret = export_stream_params_from_sei(s); if (ret < 0) @@ -3728,8 +3670,8 @@ static void hevc_decode_flush(AVCodecContext *avctx) s->max_ra = INT_MAX; s->eos = 1; - if (avctx->hwaccel && avctx->hwaccel->flush) - avctx->hwaccel->flush(avctx); + if (FF_HW_HAS_CB(avctx, flush)) + FF_HW_SIMPLE_CALL(avctx, flush); } #define OFFSET(x) offsetof(HEVCContext, x) diff --git a/arm/android/third_party/ffmpeg/libavcodec/hevcdec.h b/arm/android/third_party/ffmpeg/libavcodec/hevcdec.h index 94609e46..9b232df6 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/hevcdec.h +++ b/arm/android/third_party/ffmpeg/libavcodec/hevcdec.h @@ -596,6 +596,8 @@ typedef struct HEVCContext { int nal_length_size; ///< Number of bytes used for nal length (1, 2 or 4) int nuh_layer_id; + int film_grain_warning_shown; + AVBufferRef *rpu_buf; ///< 0 or 1 Dolby Vision RPUs. DOVIContext dovi_ctx; ///< Dolby Vision decoding context } HEVCContext; diff --git a/arm/android/third_party/ffmpeg/libavcodec/hevcpred_template.c b/arm/android/third_party/ffmpeg/libavcodec/hevcpred_template.c index 16d1c7f3..46bd8065 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/hevcpred_template.c +++ b/arm/android/third_party/ffmpeg/libavcodec/hevcpred_template.c @@ -213,13 +213,10 @@ do { \ j = 0; while (j < size_max_x && !IS_INTRA(j, -1)) j++; - if (j > 0) - if (cand_up_left) { - EXTEND_LEFT_CIP(top, j, j + 1); - } else { - EXTEND_LEFT_CIP(top, j, j); - top[-1] = top[0]; - } + if (j > 0) { + EXTEND_LEFT_CIP(top, j, j); + top[-1] = top[0]; + } left[-1] = top[-1]; } left[-1] = top[-1]; diff --git a/arm/android/third_party/ffmpeg/libavcodec/hq_hqa.c b/arm/android/third_party/ffmpeg/libavcodec/hq_hqa.c index db0ac7d9..0df7995f 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/hq_hqa.c +++ b/arm/android/third_party/ffmpeg/libavcodec/hq_hqa.c @@ -376,8 +376,8 @@ static av_cold int hq_hqa_decode_close(AVCodecContext *avctx) { HQContext *ctx = avctx->priv_data; - ff_free_vlc(&ctx->hq_ac_vlc); - ff_free_vlc(&ctx->hqa_cbp_vlc); + ff_vlc_free(&ctx->hq_ac_vlc); + ff_vlc_free(&ctx->hqa_cbp_vlc); return 0; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/hq_hqadata.c b/arm/android/third_party/ffmpeg/libavcodec/hq_hqadata.c index 56470ead..438bdf09 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/hq_hqadata.c +++ b/arm/android/third_party/ffmpeg/libavcodec/hq_hqadata.c @@ -8367,11 +8367,11 @@ const HQProfile ff_hq_profile[NUM_HQ_PROFILES] = { av_cold int ff_hq_init_vlcs(HQContext *c) { - int ret = init_vlc(&c->hqa_cbp_vlc, 5, FF_ARRAY_ELEMS(cbp_vlc_lens), + int ret = vlc_init(&c->hqa_cbp_vlc, 5, FF_ARRAY_ELEMS(cbp_vlc_lens), cbp_vlc_lens, 1, 1, cbp_vlc_bits, 1, 1, 0); if (ret < 0) return ret; - return init_vlc(&c->hq_ac_vlc, 9, NUM_HQ_AC_ENTRIES, + return vlc_init(&c->hq_ac_vlc, 9, NUM_HQ_AC_ENTRIES, hq_ac_bits, 1, 1, hq_ac_codes, 2, 2, 0); } diff --git a/arm/android/third_party/ffmpeg/libavcodec/hqx.c b/arm/android/third_party/ffmpeg/libavcodec/hqx.c index 6554b15e..51099aa6 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/hqx.c +++ b/arm/android/third_party/ffmpeg/libavcodec/hqx.c @@ -517,9 +517,9 @@ static av_cold int hqx_decode_close(AVCodecContext *avctx) int i; HQXContext *ctx = avctx->priv_data; - ff_free_vlc(&ctx->cbp_vlc); + ff_vlc_free(&ctx->cbp_vlc); for (i = 0; i < 3; i++) { - ff_free_vlc(&ctx->dc_vlc[i]); + ff_vlc_free(&ctx->dc_vlc[i]); } return 0; diff --git a/arm/android/third_party/ffmpeg/libavcodec/hqxvlc.c b/arm/android/third_party/ffmpeg/libavcodec/hqxvlc.c index 7ab24276..1eeda4fc 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/hqxvlc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/hqxvlc.c @@ -2140,7 +2140,7 @@ const HQXAC ff_hqx_ac[NUM_HQX_AC] = { #define INIT_DC_TABLE(idx, name) \ do { \ - ret = init_vlc(&ctx->dc_vlc[idx], HQX_DC_VLC_BITS, \ + ret = vlc_init(&ctx->dc_vlc[idx], HQX_DC_VLC_BITS, \ FF_ARRAY_ELEMS(name ## _vlc_lens), \ name ## _vlc_lens, 1, 1, \ name ## _vlc_bits, 2, 2, 0); \ @@ -2150,7 +2150,7 @@ const HQXAC ff_hqx_ac[NUM_HQX_AC] = { av_cold int ff_hqx_init_vlcs(HQXContext *ctx) { - int ret = init_vlc(&ctx->cbp_vlc, HQX_CBP_VLC_BITS, FF_ARRAY_ELEMS(cbp_vlc_lens), + int ret = vlc_init(&ctx->cbp_vlc, HQX_CBP_VLC_BITS, FF_ARRAY_ELEMS(cbp_vlc_lens), cbp_vlc_lens, 1, 1, cbp_vlc_bits, 1, 1, 0); if (ret < 0) return ret; diff --git a/arm/android/third_party/ffmpeg/libavcodec/huffman.c b/arm/android/third_party/ffmpeg/libavcodec/huffman.c index 99aa39c5..d47fe100 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/huffman.c +++ b/arm/android/third_party/ffmpeg/libavcodec/huffman.c @@ -148,7 +148,7 @@ static int build_huff_tree(VLC *vlc, Node *nodes, int head, int flags, int nb_bi get_tree_codes(bits, lens, xlat, nodes, head, 0, 0, &pos, no_zero_count); - return ff_init_vlc_sparse(vlc, nb_bits, pos, lens, 2, 2, bits, 4, 4, xlat, 1, 1, 0); + return ff_vlc_init_sparse(vlc, nb_bits, pos, lens, 2, 2, bits, 4, 4, xlat, 1, 1, 0); } diff --git a/arm/android/third_party/ffmpeg/libavcodec/huffyuvdec.c b/arm/android/third_party/ffmpeg/libavcodec/huffyuvdec.c index c9fcec30..9e9047c5 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/huffyuvdec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/huffyuvdec.c @@ -42,6 +42,7 @@ #include "huffyuvdsp.h" #include "lossless_videodsp.h" #include "thread.h" +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/pixdesc.h" @@ -168,8 +169,9 @@ static int generate_joint_tables(HYuvDecContext *s) len = (uint8_t *)(bits + (1 << VLC_BITS)); if (s->bitstream_bpp < 24 || s->version > 2) { + int count = 1 + s->alpha + 2 * s->chroma; int p, i, y, u; - for (p = 0; p < 4; p++) { + for (p = 0; p < count; p++) { int p0 = s->version > 2 ? p : 0; for (i = y = 0; y < s->vlc_n; y++) { int len0 = s->len[p0][y]; @@ -191,8 +193,8 @@ static int generate_joint_tables(HYuvDecContext *s) i++; } } - ff_free_vlc(&s->vlc[4 + p]); - if ((ret = ff_init_vlc_sparse(&s->vlc[4 + p], VLC_BITS, i, len, 1, 1, + ff_vlc_free(&s->vlc[4 + p]); + if ((ret = ff_vlc_init_sparse(&s->vlc[4 + p], VLC_BITS, i, len, 1, 1, bits, 2, 2, symbols, 2, 2, 0)) < 0) goto out; } @@ -235,8 +237,8 @@ static int generate_joint_tables(HYuvDecContext *s) } } } - ff_free_vlc(&s->vlc[4]); - if ((ret = init_vlc(&s->vlc[4], VLC_BITS, i, len, 1, 1, + ff_vlc_free(&s->vlc[4]); + if ((ret = vlc_init(&s->vlc[4], VLC_BITS, i, len, 1, 1, bits, 2, 2, 0)) < 0) goto out; } @@ -263,8 +265,8 @@ static int read_huffman_tables(HYuvDecContext *s, const uint8_t *src, int length return ret; if ((ret = ff_huffyuv_generate_bits_table(s->bits[i], s->len[i], s->vlc_n)) < 0) return ret; - ff_free_vlc(&s->vlc[i]); - if ((ret = init_vlc(&s->vlc[i], VLC_BITS, s->vlc_n, s->len[i], 1, 1, + ff_vlc_free(&s->vlc[i]); + if ((ret = vlc_init(&s->vlc[i], VLC_BITS, s->vlc_n, s->len[i], 1, 1, s->bits[i], 4, 4, 0)) < 0) return ret; } @@ -303,8 +305,8 @@ static int read_old_huffman_tables(HYuvDecContext *s) memcpy(s->len[2], s->len[1], 256 * sizeof(uint8_t)); for (i = 0; i < 4; i++) { - ff_free_vlc(&s->vlc[i]); - if ((ret = init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1, + ff_vlc_free(&s->vlc[i]); + if ((ret = vlc_init(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1, s->bits[i], 4, 4, 0)) < 0) return ret; } @@ -324,7 +326,7 @@ static av_cold int decode_end(AVCodecContext *avctx) av_freep(&s->bitstream_buffer); for (i = 0; i < 8; i++) - ff_free_vlc(&s->vlc[i]); + ff_vlc_free(&s->vlc[i]); return 0; } @@ -755,7 +757,7 @@ static void decode_plane_bitstream(HYuvDecContext *s, int width, int plane) } } if( width&1 && get_bits_left(&s->gb)>0 ) { - int dst = get_vlc2(&s->gb, s->vlc[plane].table, VLC_BITS, 3)<<2; + int dst = (unsigned)get_vlc2(&s->gb, s->vlc[plane].table, VLC_BITS, 3)<<2; s->temp16[0][width-1] = dst + get_bits(&s->gb, 2); } } diff --git a/arm/android/third_party/ffmpeg/libavcodec/huffyuvenc.c b/arm/android/third_party/ffmpeg/libavcodec/huffyuvenc.c index 72d6246e..b02b3c7a 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/huffyuvenc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/huffyuvenc.c @@ -39,6 +39,7 @@ #include "huffyuvencdsp.h" #include "lossless_videoencdsp.h" #include "put_bits.h" +#include "libavutil/emms.h" #include "libavutil/opt.h" #include "libavutil/pixdesc.h" diff --git a/arm/android/third_party/ffmpeg/libavcodec/hwaccel_internal.h b/arm/android/third_party/ffmpeg/libavcodec/hwaccel_internal.h new file mode 100644 index 00000000..edfe2831 --- /dev/null +++ b/arm/android/third_party/ffmpeg/libavcodec/hwaccel_internal.h @@ -0,0 +1,179 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * Header providing the internals of AVHWAccel. + */ + +#ifndef AVCODEC_HWACCEL_INTERNAL_H +#define AVCODEC_HWACCEL_INTERNAL_H + +#include + +#include "avcodec.h" + +#define HWACCEL_CAP_ASYNC_SAFE (1 << 0) +#define HWACCEL_CAP_THREAD_SAFE (1 << 1) + +typedef struct FFHWAccel { + /** + * The public AVHWAccel. See avcodec.h for it. + */ + AVHWAccel p; + + /** + * Allocate a custom buffer + */ + int (*alloc_frame)(AVCodecContext *avctx, AVFrame *frame); + + /** + * Called at the beginning of each frame or field picture. + * + * Meaningful frame information (codec specific) is guaranteed to + * be parsed at this point. This function is mandatory. + * + * Note that buf can be NULL along with buf_size set to 0. + * Otherwise, this means the whole frame is available at this point. + * + * @param avctx the codec context + * @param buf the frame data buffer base + * @param buf_size the size of the frame in bytes + * @return zero if successful, a negative value otherwise + */ + int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size); + + /** + * Callback for parameter data (SPS/PPS/VPS etc). + * + * Useful for hardware decoders which keep persistent state about the + * video parameters, and need to receive any changes to update that state. + * + * @param avctx the codec context + * @param type the nal unit type + * @param buf the nal unit data buffer + * @param buf_size the size of the nal unit in bytes + * @return zero if successful, a negative value otherwise + */ + int (*decode_params)(AVCodecContext *avctx, int type, const uint8_t *buf, uint32_t buf_size); + + /** + * Callback for each slice. + * + * Meaningful slice information (codec specific) is guaranteed to + * be parsed at this point. This function is mandatory. + * + * @param avctx the codec context + * @param buf the slice data buffer base + * @param buf_size the size of the slice in bytes + * @return zero if successful, a negative value otherwise + */ + int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size); + + /** + * Called at the end of each frame or field picture. + * + * The whole picture is parsed at this point and can now be sent + * to the hardware accelerator. This function is mandatory. + * + * @param avctx the codec context + * @return zero if successful, a negative value otherwise + */ + int (*end_frame)(AVCodecContext *avctx); + + /** + * Size of per-frame hardware accelerator private data. + * + * Private data is allocated with av_mallocz() before + * AVCodecContext.get_buffer() and deallocated after + * AVCodecContext.release_buffer(). + */ + int frame_priv_data_size; + + /** + * Size of the private data to allocate in + * AVCodecInternal.hwaccel_priv_data. + */ + int priv_data_size; + + /** + * Internal hwaccel capabilities. + */ + int caps_internal; + + /** + * Initialize the hwaccel private data. + * + * This will be called from ff_get_format(), after hwaccel and + * hwaccel_context are set and the hwaccel private data in AVCodecInternal + * is allocated. + */ + int (*init)(AVCodecContext *avctx); + + /** + * Uninitialize the hwaccel private data. + * + * This will be called from get_format() or avcodec_close(), after hwaccel + * and hwaccel_context are already uninitialized. + */ + int (*uninit)(AVCodecContext *avctx); + + /** + * Fill the given hw_frames context with current codec parameters. Called + * from get_format. Refer to avcodec_get_hw_frames_parameters() for + * details. + * + * This CAN be called before AVHWAccel.init is called, and you must assume + * that avctx->hwaccel_priv_data is invalid. + */ + int (*frame_params)(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx); + + /** + * Copy necessary context variables from a previous thread context to the current one. + * For thread-safe hwaccels only. + */ + int (*update_thread_context)(AVCodecContext *dst, const AVCodecContext *src); + + /** + * Callback to free the hwaccel-specific frame data. + * + * @param hwctx a pointer to an AVHWDeviceContext. + * @param data the per-frame hardware accelerator private data to be freed. + */ + void (*free_frame_priv)(void *hwctx, uint8_t *data); + + /** + * Callback to flush the hwaccel state. + */ + void (*flush)(AVCodecContext *avctx); +} FFHWAccel; + +static inline const FFHWAccel *ffhwaccel(const AVHWAccel *codec) +{ + return (const FFHWAccel*)codec; +} + +#define FF_HW_CALL(avctx, function, ...) \ + (ffhwaccel((avctx)->hwaccel)->function((avctx), __VA_ARGS__)) + +#define FF_HW_SIMPLE_CALL(avctx, function) \ + (ffhwaccel((avctx)->hwaccel)->function(avctx)) + +#define FF_HW_HAS_CB(avctx, function) \ + ((avctx)->hwaccel && ffhwaccel((avctx)->hwaccel)->function) + +#endif /* AVCODEC_HWACCEL_INTERNAL */ diff --git a/arm/android/third_party/ffmpeg/libavcodec/hwaccels.h b/arm/android/third_party/ffmpeg/libavcodec/hwaccels.h index 48dfc17f..c4630718 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/hwaccels.h +++ b/arm/android/third_party/ffmpeg/libavcodec/hwaccels.h @@ -19,70 +19,68 @@ #ifndef AVCODEC_HWACCELS_H #define AVCODEC_HWACCELS_H -#include "avcodec.h" - -extern const AVHWAccel ff_av1_d3d11va_hwaccel; -extern const AVHWAccel ff_av1_d3d11va2_hwaccel; -extern const AVHWAccel ff_av1_dxva2_hwaccel; -extern const AVHWAccel ff_av1_nvdec_hwaccel; -extern const AVHWAccel ff_av1_vaapi_hwaccel; -extern const AVHWAccel ff_av1_vdpau_hwaccel; -extern const AVHWAccel ff_av1_vulkan_hwaccel; -extern const AVHWAccel ff_h263_vaapi_hwaccel; -extern const AVHWAccel ff_h263_videotoolbox_hwaccel; -extern const AVHWAccel ff_h264_d3d11va_hwaccel; -extern const AVHWAccel ff_h264_d3d11va2_hwaccel; -extern const AVHWAccel ff_h264_dxva2_hwaccel; -extern const AVHWAccel ff_h264_nvdec_hwaccel; -extern const AVHWAccel ff_h264_vaapi_hwaccel; -extern const AVHWAccel ff_h264_vdpau_hwaccel; -extern const AVHWAccel ff_h264_videotoolbox_hwaccel; -extern const AVHWAccel ff_h264_vulkan_hwaccel; -extern const AVHWAccel ff_hevc_d3d11va_hwaccel; -extern const AVHWAccel ff_hevc_d3d11va2_hwaccel; -extern const AVHWAccel ff_hevc_dxva2_hwaccel; -extern const AVHWAccel ff_hevc_nvdec_hwaccel; -extern const AVHWAccel ff_hevc_vaapi_hwaccel; -extern const AVHWAccel ff_hevc_vdpau_hwaccel; -extern const AVHWAccel ff_hevc_videotoolbox_hwaccel; -extern const AVHWAccel ff_hevc_vulkan_hwaccel; -extern const AVHWAccel ff_mjpeg_nvdec_hwaccel; -extern const AVHWAccel ff_mjpeg_vaapi_hwaccel; -extern const AVHWAccel ff_mpeg1_nvdec_hwaccel; -extern const AVHWAccel ff_mpeg1_vdpau_hwaccel; -extern const AVHWAccel ff_mpeg1_videotoolbox_hwaccel; -extern const AVHWAccel ff_mpeg2_d3d11va_hwaccel; -extern const AVHWAccel ff_mpeg2_d3d11va2_hwaccel; -extern const AVHWAccel ff_mpeg2_nvdec_hwaccel; -extern const AVHWAccel ff_mpeg2_dxva2_hwaccel; -extern const AVHWAccel ff_mpeg2_vaapi_hwaccel; -extern const AVHWAccel ff_mpeg2_vdpau_hwaccel; -extern const AVHWAccel ff_mpeg2_videotoolbox_hwaccel; -extern const AVHWAccel ff_mpeg4_nvdec_hwaccel; -extern const AVHWAccel ff_mpeg4_vaapi_hwaccel; -extern const AVHWAccel ff_mpeg4_vdpau_hwaccel; -extern const AVHWAccel ff_mpeg4_videotoolbox_hwaccel; -extern const AVHWAccel ff_prores_videotoolbox_hwaccel; -extern const AVHWAccel ff_vc1_d3d11va_hwaccel; -extern const AVHWAccel ff_vc1_d3d11va2_hwaccel; -extern const AVHWAccel ff_vc1_dxva2_hwaccel; -extern const AVHWAccel ff_vc1_nvdec_hwaccel; -extern const AVHWAccel ff_vc1_vaapi_hwaccel; -extern const AVHWAccel ff_vc1_vdpau_hwaccel; -extern const AVHWAccel ff_vp8_nvdec_hwaccel; -extern const AVHWAccel ff_vp8_vaapi_hwaccel; -extern const AVHWAccel ff_vp9_d3d11va_hwaccel; -extern const AVHWAccel ff_vp9_d3d11va2_hwaccel; -extern const AVHWAccel ff_vp9_dxva2_hwaccel; -extern const AVHWAccel ff_vp9_nvdec_hwaccel; -extern const AVHWAccel ff_vp9_vaapi_hwaccel; -extern const AVHWAccel ff_vp9_vdpau_hwaccel; -extern const AVHWAccel ff_vp9_videotoolbox_hwaccel; -extern const AVHWAccel ff_wmv3_d3d11va_hwaccel; -extern const AVHWAccel ff_wmv3_d3d11va2_hwaccel; -extern const AVHWAccel ff_wmv3_dxva2_hwaccel; -extern const AVHWAccel ff_wmv3_nvdec_hwaccel; -extern const AVHWAccel ff_wmv3_vaapi_hwaccel; -extern const AVHWAccel ff_wmv3_vdpau_hwaccel; +extern const struct FFHWAccel ff_av1_d3d11va_hwaccel; +extern const struct FFHWAccel ff_av1_d3d11va2_hwaccel; +extern const struct FFHWAccel ff_av1_dxva2_hwaccel; +extern const struct FFHWAccel ff_av1_nvdec_hwaccel; +extern const struct FFHWAccel ff_av1_vaapi_hwaccel; +extern const struct FFHWAccel ff_av1_vdpau_hwaccel; +extern const struct FFHWAccel ff_av1_vulkan_hwaccel; +extern const struct FFHWAccel ff_h263_vaapi_hwaccel; +extern const struct FFHWAccel ff_h263_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_h264_d3d11va_hwaccel; +extern const struct FFHWAccel ff_h264_d3d11va2_hwaccel; +extern const struct FFHWAccel ff_h264_dxva2_hwaccel; +extern const struct FFHWAccel ff_h264_nvdec_hwaccel; +extern const struct FFHWAccel ff_h264_vaapi_hwaccel; +extern const struct FFHWAccel ff_h264_vdpau_hwaccel; +extern const struct FFHWAccel ff_h264_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_h264_vulkan_hwaccel; +extern const struct FFHWAccel ff_hevc_d3d11va_hwaccel; +extern const struct FFHWAccel ff_hevc_d3d11va2_hwaccel; +extern const struct FFHWAccel ff_hevc_dxva2_hwaccel; +extern const struct FFHWAccel ff_hevc_nvdec_hwaccel; +extern const struct FFHWAccel ff_hevc_vaapi_hwaccel; +extern const struct FFHWAccel ff_hevc_vdpau_hwaccel; +extern const struct FFHWAccel ff_hevc_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_hevc_vulkan_hwaccel; +extern const struct FFHWAccel ff_mjpeg_nvdec_hwaccel; +extern const struct FFHWAccel ff_mjpeg_vaapi_hwaccel; +extern const struct FFHWAccel ff_mpeg1_nvdec_hwaccel; +extern const struct FFHWAccel ff_mpeg1_vdpau_hwaccel; +extern const struct FFHWAccel ff_mpeg1_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_mpeg2_d3d11va_hwaccel; +extern const struct FFHWAccel ff_mpeg2_d3d11va2_hwaccel; +extern const struct FFHWAccel ff_mpeg2_dxva2_hwaccel; +extern const struct FFHWAccel ff_mpeg2_nvdec_hwaccel; +extern const struct FFHWAccel ff_mpeg2_vaapi_hwaccel; +extern const struct FFHWAccel ff_mpeg2_vdpau_hwaccel; +extern const struct FFHWAccel ff_mpeg2_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_mpeg4_nvdec_hwaccel; +extern const struct FFHWAccel ff_mpeg4_vaapi_hwaccel; +extern const struct FFHWAccel ff_mpeg4_vdpau_hwaccel; +extern const struct FFHWAccel ff_mpeg4_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_prores_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_vc1_d3d11va_hwaccel; +extern const struct FFHWAccel ff_vc1_d3d11va2_hwaccel; +extern const struct FFHWAccel ff_vc1_dxva2_hwaccel; +extern const struct FFHWAccel ff_vc1_nvdec_hwaccel; +extern const struct FFHWAccel ff_vc1_vaapi_hwaccel; +extern const struct FFHWAccel ff_vc1_vdpau_hwaccel; +extern const struct FFHWAccel ff_vp8_nvdec_hwaccel; +extern const struct FFHWAccel ff_vp8_vaapi_hwaccel; +extern const struct FFHWAccel ff_vp9_d3d11va_hwaccel; +extern const struct FFHWAccel ff_vp9_d3d11va2_hwaccel; +extern const struct FFHWAccel ff_vp9_dxva2_hwaccel; +extern const struct FFHWAccel ff_vp9_nvdec_hwaccel; +extern const struct FFHWAccel ff_vp9_vaapi_hwaccel; +extern const struct FFHWAccel ff_vp9_vdpau_hwaccel; +extern const struct FFHWAccel ff_vp9_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_wmv3_d3d11va_hwaccel; +extern const struct FFHWAccel ff_wmv3_d3d11va2_hwaccel; +extern const struct FFHWAccel ff_wmv3_dxva2_hwaccel; +extern const struct FFHWAccel ff_wmv3_nvdec_hwaccel; +extern const struct FFHWAccel ff_wmv3_vaapi_hwaccel; +extern const struct FFHWAccel ff_wmv3_vdpau_hwaccel; #endif /* AVCODEC_HWACCELS_H */ diff --git a/arm/android/third_party/ffmpeg/libavcodec/hwconfig.h b/arm/android/third_party/ffmpeg/libavcodec/hwconfig.h index e8c61861..e164722a 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/hwconfig.h +++ b/arm/android/third_party/ffmpeg/libavcodec/hwconfig.h @@ -22,11 +22,6 @@ #include "avcodec.h" #include "hwaccels.h" - -#define HWACCEL_CAP_ASYNC_SAFE (1 << 0) -#define HWACCEL_CAP_THREAD_SAFE (1 << 1) - - typedef struct AVCodecHWConfigInternal { /** * This is the structure which will be returned to the user by @@ -37,7 +32,7 @@ typedef struct AVCodecHWConfigInternal { * If this configuration uses a hwaccel, a pointer to it. * If not, NULL. */ - const AVHWAccel *hwaccel; + const struct FFHWAccel *hwaccel; } AVCodecHWConfigInternal; void ff_hwaccel_uninit(AVCodecContext *avctx); diff --git a/arm/android/third_party/ffmpeg/libavcodec/idctdsp.h b/arm/android/third_party/ffmpeg/libavcodec/idctdsp.h index 72244633..c840a518 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/idctdsp.h +++ b/arm/android/third_party/ffmpeg/libavcodec/idctdsp.h @@ -19,11 +19,12 @@ #ifndef AVCODEC_IDCTDSP_H #define AVCODEC_IDCTDSP_H +#include #include #include "config.h" -#include "avcodec.h" +struct AVCodecContext; enum idct_permutation_type { FF_IDCT_PERM_NONE, @@ -95,23 +96,23 @@ void ff_put_pixels_clamped_c(const int16_t *block, uint8_t *av_restrict pixels, void ff_add_pixels_clamped_c(const int16_t *block, uint8_t *av_restrict pixels, ptrdiff_t line_size); -void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx); +void ff_idctdsp_init(IDCTDSPContext *c, struct AVCodecContext *avctx); -void ff_idctdsp_init_aarch64(IDCTDSPContext *c, AVCodecContext *avctx, +void ff_idctdsp_init_aarch64(IDCTDSPContext *c, struct AVCodecContext *avctx, unsigned high_bit_depth); -void ff_idctdsp_init_alpha(IDCTDSPContext *c, AVCodecContext *avctx, +void ff_idctdsp_init_alpha(IDCTDSPContext *c, struct AVCodecContext *avctx, unsigned high_bit_depth); -void ff_idctdsp_init_arm(IDCTDSPContext *c, AVCodecContext *avctx, +void ff_idctdsp_init_arm(IDCTDSPContext *c, struct AVCodecContext *avctx, unsigned high_bit_depth); -void ff_idctdsp_init_ppc(IDCTDSPContext *c, AVCodecContext *avctx, +void ff_idctdsp_init_ppc(IDCTDSPContext *c, struct AVCodecContext *avctx, unsigned high_bit_depth); -void ff_idctdsp_init_riscv(IDCTDSPContext *c, AVCodecContext *avctx, +void ff_idctdsp_init_riscv(IDCTDSPContext *c, struct AVCodecContext *avctx, unsigned high_bit_depth); -void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx, +void ff_idctdsp_init_x86(IDCTDSPContext *c, struct AVCodecContext *avctx, unsigned high_bit_depth); -void ff_idctdsp_init_mips(IDCTDSPContext *c, AVCodecContext *avctx, +void ff_idctdsp_init_mips(IDCTDSPContext *c, struct AVCodecContext *avctx, unsigned high_bit_depth); -void ff_idctdsp_init_loongarch(IDCTDSPContext *c, AVCodecContext *avctx, +void ff_idctdsp_init_loongarch(IDCTDSPContext *c, struct AVCodecContext *avctx, unsigned high_bit_depth); #endif /* AVCODEC_IDCTDSP_H */ diff --git a/arm/android/third_party/ffmpeg/libavcodec/iirfilter.c b/arm/android/third_party/ffmpeg/libavcodec/iirfilter.c index 903d64e8..727a3704 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/iirfilter.c +++ b/arm/android/third_party/ffmpeg/libavcodec/iirfilter.c @@ -26,8 +26,12 @@ #include +#include "config.h" + #include "libavutil/attributes.h" #include "libavutil/common.h" +#include "libavutil/log.h" +#include "libavutil/mem.h" #include "iirfilter.h" diff --git a/arm/android/third_party/ffmpeg/libavcodec/imc.c b/arm/android/third_party/ffmpeg/libavcodec/imc.c index 174332de..754ceff9 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/imc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/imc.c @@ -176,10 +176,10 @@ static av_cold void imc_init_static(void) for (int j = 0; j < 4; j++) { huffman_vlc[i][j].table = &vlc_tables[offset]; huffman_vlc[i][j].table_allocated = VLC_TABLES_SIZE - offset; - ff_init_vlc_from_lengths(&huffman_vlc[i][j], IMC_VLC_BITS, imc_huffman_sizes[i], + ff_vlc_init_from_lengths(&huffman_vlc[i][j], IMC_VLC_BITS, imc_huffman_sizes[i], imc_huffman_lens[i][j], 1, imc_huffman_syms[i][j], 1, 1, - 0, INIT_VLC_STATIC_OVERLONG, NULL); + 0, VLC_INIT_STATIC_OVERLONG, NULL); offset += huffman_vlc[i][j].table_size; } } @@ -1038,6 +1038,7 @@ const FFCodec ff_imc_decoder = { .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; #endif #if CONFIG_IAC_DECODER @@ -1054,5 +1055,6 @@ const FFCodec ff_iac_decoder = { .p.capabilities = AV_CODEC_CAP_DR1, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; #endif diff --git a/arm/android/third_party/ffmpeg/libavcodec/imm4.c b/arm/android/third_party/ffmpeg/libavcodec/imm4.c index b95ad869..d4011b33 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/imm4.c +++ b/arm/android/third_party/ffmpeg/libavcodec/imm4.c @@ -453,8 +453,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, if (ret < 0) return ret; - av_frame_unref(s->prev_frame); - if ((ret = av_frame_ref(s->prev_frame, frame)) < 0) + if ((ret = av_frame_replace(s->prev_frame, frame)) < 0) return ret; } else { if (!s->prev_frame->data[0]) { @@ -474,18 +473,18 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, static av_cold void imm4_init_static_data(void) { - INIT_VLC_STATIC_FROM_LENGTHS(&cbplo_tab, CBPLO_VLC_BITS, FF_ARRAY_ELEMS(cbplo), + VLC_INIT_STATIC_FROM_LENGTHS(&cbplo_tab, CBPLO_VLC_BITS, FF_ARRAY_ELEMS(cbplo), &cbplo[0][1], 2, &cbplo[0][0], 2, 1, 0, 0, 1 << CBPLO_VLC_BITS); - INIT_VLC_SPARSE_STATIC(&cbphi_tab, CBPHI_VLC_BITS, FF_ARRAY_ELEMS(cbphi_bits), + VLC_INIT_SPARSE_STATIC(&cbphi_tab, CBPHI_VLC_BITS, FF_ARRAY_ELEMS(cbphi_bits), cbphi_bits, 1, 1, cbphi_codes, 1, 1, NULL, 0, 0, 64); - INIT_VLC_STATIC_FROM_LENGTHS(&blktype_tab, BLKTYPE_VLC_BITS, FF_ARRAY_ELEMS(blktype), + VLC_INIT_STATIC_FROM_LENGTHS(&blktype_tab, BLKTYPE_VLC_BITS, FF_ARRAY_ELEMS(blktype), &blktype[0][1], 2, &blktype[0][0], 2, 1, 0, 0, 1 << BLKTYPE_VLC_BITS); - INIT_VLC_STATIC_FROM_LENGTHS(&block_tab, BLOCK_VLC_BITS, FF_ARRAY_ELEMS(block_bits), + VLC_INIT_STATIC_FROM_LENGTHS(&block_tab, BLOCK_VLC_BITS, FF_ARRAY_ELEMS(block_bits), block_bits, 1, block_symbols, 2, 2, 0, 0, 1 << BLOCK_VLC_BITS); } diff --git a/arm/android/third_party/ffmpeg/libavcodec/indeo2.c b/arm/android/third_party/ffmpeg/libavcodec/indeo2.c index dd88ebf7..2f643206 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/indeo2.c +++ b/arm/android/third_party/ffmpeg/libavcodec/indeo2.c @@ -226,9 +226,9 @@ static int ir2_decode_frame(AVCodecContext *avctx, AVFrame *picture, static av_cold void ir2_init_static(void) { - INIT_VLC_STATIC_FROM_LENGTHS(&ir2_vlc, CODE_VLC_BITS, IR2_CODES, + VLC_INIT_STATIC_FROM_LENGTHS(&ir2_vlc, CODE_VLC_BITS, IR2_CODES, &ir2_tab[0][1], 2, &ir2_tab[0][0], 2, 1, - 0, INIT_VLC_OUTPUT_LE, 1 << CODE_VLC_BITS); + 0, VLC_INIT_OUTPUT_LE, 1 << CODE_VLC_BITS); } static av_cold int ir2_decode_init(AVCodecContext *avctx) diff --git a/arm/android/third_party/ffmpeg/libavcodec/internal.h b/arm/android/third_party/ffmpeg/libavcodec/internal.h index 4dce9f6f..83e0bc3f 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/internal.h +++ b/arm/android/third_party/ffmpeg/libavcodec/internal.h @@ -157,15 +157,6 @@ int ff_match_2uint16(const uint16_t (*tab)[2], int size, int a, int b); unsigned int ff_toupper4(unsigned int x); -void ff_color_frame(AVFrame *frame, const int color[4]); - -/** - * Maximum size in bytes of extradata. - * 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) - AV_INPUT_BUFFER_PADDING_SIZE) - /** * 2^(x) for integer x * @return correctly rounded float @@ -189,11 +180,6 @@ int avpriv_h264_has_num_reorder_frames(AVCodecContext *avctx); int avpriv_codec_get_cap_skip_frame_fill_param(const AVCodec *codec); -/** - * Add a CPB properties side data to an encoding context. - */ -AVCPBProperties *ff_add_cpb_side_data(AVCodecContext *avctx); - /** * Check AVFrame for S12M timecode side data and allocate and fill TC SEI message with timecode info * @@ -216,16 +202,4 @@ int ff_alloc_timecode_sei(const AVFrame *frame, AVRational rate, size_t prefix_l */ int64_t ff_guess_coded_bitrate(AVCodecContext *avctx); -/** - * Check if a value is in the list. If not, return the default value - * - * @param ctx Context for the log msg - * @param val_name Name of the checked value, for log msg - * @param array_valid_values Array of valid int, ended with INT_MAX - * @param default_value Value return if checked value is not in the array - * @return Value or default_value. - */ -int ff_int_from_list_or_default(void *ctx, const char * val_name, int val, - const int * array_valid_values, int default_value); - #endif /* AVCODEC_INTERNAL_H */ diff --git a/arm/android/third_party/ffmpeg/libavcodec/interplayvideo.c b/arm/android/third_party/ffmpeg/libavcodec/interplayvideo.c index 1f0414bb..9c13707f 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/interplayvideo.c +++ b/arm/android/third_party/ffmpeg/libavcodec/interplayvideo.c @@ -1340,9 +1340,8 @@ FF_ENABLE_DEPRECATION_WARNINGS *got_frame = send_buffer; /* shuffle frames */ - av_frame_unref(s->second_last_frame); FFSWAP(AVFrame*, s->second_last_frame, s->last_frame); - if ((ret = av_frame_ref(s->last_frame, frame)) < 0) + if ((ret = av_frame_replace(s->last_frame, frame)) < 0) return ret; /* report that the buffer was completely consumed */ diff --git a/arm/android/third_party/ffmpeg/libavcodec/intrax8.c b/arm/android/third_party/ffmpeg/libavcodec/intrax8.c index c5c67272..0d90e370 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/intrax8.c +++ b/arm/android/third_party/ffmpeg/libavcodec/intrax8.c @@ -56,8 +56,8 @@ static av_cold void x8_init_vlc(VLC *vlc, int nb_bits, int nb_codes, vlc->table = &vlc_buf[*offset]; vlc->table_allocated = VLC_BUFFER_SIZE - *offset; - ff_init_vlc_from_lengths(vlc, nb_bits, nb_codes, &table[0][1], 2, - &table[0][0], 2, 1, 0, INIT_VLC_STATIC_OVERLONG, NULL); + ff_vlc_init_from_lengths(vlc, nb_bits, nb_codes, &table[0][1], 2, + &table[0][0], 2, 1, 0, VLC_INIT_STATIC_OVERLONG, NULL); *offset += vlc->table_size; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/ituh263dec.c b/arm/android/third_party/ffmpeg/libavcodec/ituh263dec.c index c7c0a549..80fd78dd 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/ituh263dec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/ituh263dec.c @@ -110,25 +110,25 @@ static VLC cbpc_b_vlc; static av_cold void h263_decode_init_vlc(void) { - INIT_VLC_STATIC(&ff_h263_intra_MCBPC_vlc, INTRA_MCBPC_VLC_BITS, 9, + VLC_INIT_STATIC(&ff_h263_intra_MCBPC_vlc, INTRA_MCBPC_VLC_BITS, 9, ff_h263_intra_MCBPC_bits, 1, 1, ff_h263_intra_MCBPC_code, 1, 1, 72); - INIT_VLC_STATIC(&ff_h263_inter_MCBPC_vlc, INTER_MCBPC_VLC_BITS, 28, + VLC_INIT_STATIC(&ff_h263_inter_MCBPC_vlc, INTER_MCBPC_VLC_BITS, 28, ff_h263_inter_MCBPC_bits, 1, 1, ff_h263_inter_MCBPC_code, 1, 1, 198); - INIT_VLC_STATIC(&ff_h263_cbpy_vlc, CBPY_VLC_BITS, 16, + VLC_INIT_STATIC(&ff_h263_cbpy_vlc, CBPY_VLC_BITS, 16, &ff_h263_cbpy_tab[0][1], 2, 1, &ff_h263_cbpy_tab[0][0], 2, 1, 64); - INIT_VLC_STATIC(&ff_h263_mv_vlc, H263_MV_VLC_BITS, 33, + VLC_INIT_STATIC(&ff_h263_mv_vlc, H263_MV_VLC_BITS, 33, &ff_mvtab[0][1], 2, 1, &ff_mvtab[0][0], 2, 1, 538); ff_h263_init_rl_inter(); - INIT_VLC_RL(ff_h263_rl_inter, 554); + VLC_INIT_RL(ff_h263_rl_inter, 554); INIT_FIRST_VLC_RL(ff_rl_intra_aic, 554); - INIT_VLC_STATIC(&h263_mbtype_b_vlc, H263_MBTYPE_B_VLC_BITS, 15, + VLC_INIT_STATIC(&h263_mbtype_b_vlc, H263_MBTYPE_B_VLC_BITS, 15, &ff_h263_mbtype_b_tab[0][1], 2, 1, &ff_h263_mbtype_b_tab[0][0], 2, 1, 80); - INIT_VLC_STATIC(&cbpc_b_vlc, CBPC_B_VLC_BITS, 4, + VLC_INIT_STATIC(&cbpc_b_vlc, CBPC_B_VLC_BITS, 4, &ff_cbpc_b_tab[0][1], 2, 1, &ff_cbpc_b_tab[0][0], 2, 1, 8); } diff --git a/arm/android/third_party/ffmpeg/libavcodec/ivi.c b/arm/android/third_party/ffmpeg/libavcodec/ivi.c index 43f3cb1d..60769664 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/ivi.c +++ b/arm/android/third_party/ffmpeg/libavcodec/ivi.c @@ -154,8 +154,8 @@ static int ivi_create_huff_from_desc(const IVIHuffDesc *cb, VLC *vlc, int flag) }//for i /* number of codewords = pos */ - return init_vlc(vlc, IVI_VLC_BITS, pos, bits, 1, 1, codewords, 2, 2, - (flag ? INIT_VLC_USE_NEW_STATIC : 0) | INIT_VLC_OUTPUT_LE); + return vlc_init(vlc, IVI_VLC_BITS, pos, bits, 1, 1, codewords, 2, 2, + (flag ? VLC_INIT_USE_STATIC : 0) | VLC_INIT_OUTPUT_LE); } static av_cold void ivi_init_static_vlc(void) @@ -237,7 +237,7 @@ int ff_ivi_dec_huff_desc(GetBitContext *gb, int desc_coded, int which_tab, ivi_huff_desc_copy(&huff_tab->cust_desc, &new_huff); if (huff_tab->cust_tab.table) - ff_free_vlc(&huff_tab->cust_tab); + ff_vlc_free(&huff_tab->cust_tab); result = ivi_create_huff_from_desc(&huff_tab->cust_desc, &huff_tab->cust_tab, 0); if (result) { @@ -277,7 +277,7 @@ static av_cold void ivi_free_buffers(IVIPlaneDesc *planes) av_freep(&band->bufs[3]); if (band->blk_vlc.cust_tab.table) - ff_free_vlc(&band->blk_vlc.cust_tab); + ff_vlc_free(&band->blk_vlc.cust_tab); for (t = 0; t < band->num_tiles; t++) av_freep(&band->tiles[t].mbs); av_freep(&band->tiles); @@ -1215,10 +1215,10 @@ av_cold int ff_ivi_decode_close(AVCodecContext *avctx) ivi_free_buffers(&ctx->planes[0]); if (ctx->mb_vlc.cust_tab.table) - ff_free_vlc(&ctx->mb_vlc.cust_tab); + ff_vlc_free(&ctx->mb_vlc.cust_tab); if (ctx->blk_vlc.cust_tab.table) - ff_free_vlc(&ctx->blk_vlc.cust_tab); + ff_vlc_free(&ctx->blk_vlc.cust_tab); av_frame_free(&ctx->p_frame); diff --git a/arm/android/third_party/ffmpeg/libavcodec/jfdctfst.c b/arm/android/third_party/ffmpeg/libavcodec/jfdctfst.c index 805e0580..946b12f3 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/jfdctfst.c +++ b/arm/android/third_party/ffmpeg/libavcodec/jfdctfst.c @@ -68,7 +68,7 @@ #include #include "libavutil/attributes.h" -#include "dct.h" +#include "fdctdsp.h" #define DCTSIZE 8 #define GLOBAL(x) x diff --git a/arm/android/third_party/ffmpeg/libavcodec/jfdctint_template.c b/arm/android/third_party/ffmpeg/libavcodec/jfdctint_template.c index 67fb77b5..ca17300c 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/jfdctint_template.c +++ b/arm/android/third_party/ffmpeg/libavcodec/jfdctint_template.c @@ -60,7 +60,7 @@ */ #include "libavutil/common.h" -#include "dct.h" +#include "fdctdsp.h" #include "bit_depth_template.c" diff --git a/arm/android/third_party/ffmpeg/libavcodec/jni.c b/arm/android/third_party/ffmpeg/libavcodec/jni.c index 85dcf2ab..ae6490de 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/jni.c +++ b/arm/android/third_party/ffmpeg/libavcodec/jni.c @@ -34,8 +34,8 @@ #include "libavutil/log.h" #include "ffjni.h" -void *java_vm; -pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; +static void *java_vm; +static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; int av_jni_set_java_vm(void *vm, void *log_ctx) { diff --git a/arm/android/third_party/ffmpeg/libavcodec/jpeg2000dec.c b/arm/android/third_party/ffmpeg/libavcodec/jpeg2000dec.c index d6f2a593..eda959e5 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/jpeg2000dec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/jpeg2000dec.c @@ -308,12 +308,12 @@ static int get_siz(Jpeg2000DecoderContext *s) dimy = FFMAX(dimy, ff_jpeg2000_ceildiv(o_dimy, s->cdy[i])); } - ret = ff_set_dimensions(s->avctx, dimx, dimy); + ret = ff_set_dimensions(s->avctx, dimx << s->avctx->lowres, dimy << s->avctx->lowres); if (ret < 0) return ret; - if (s->avctx->profile == FF_PROFILE_JPEG2000_DCINEMA_2K || - s->avctx->profile == FF_PROFILE_JPEG2000_DCINEMA_4K) { + if (s->avctx->profile == AV_PROFILE_JPEG2000_DCINEMA_2K || + s->avctx->profile == AV_PROFILE_JPEG2000_DCINEMA_4K) { possible_fmts = xyz_pix_fmts; possible_fmts_nb = FF_ARRAY_ELEMS(xyz_pix_fmts); } else { @@ -2426,6 +2426,14 @@ static av_cold int jpeg2000_decode_init(AVCodecContext *avctx) { Jpeg2000DecoderContext *s = avctx->priv_data; + if (avctx->lowres) + av_log(avctx, AV_LOG_WARNING, "lowres is overriden by reduction_factor but set anyway\n"); + if (!s->reduction_factor && avctx->lowres < JPEG2000_MAX_RESLEVELS) { + s->reduction_factor = avctx->lowres; + } + if (avctx->lowres != s->reduction_factor && avctx->lowres) + return AVERROR(EINVAL); + ff_jpeg2000dsp_init(&s->dsp); ff_jpeg2000_init_tier1_luts(); diff --git a/arm/android/third_party/ffmpeg/libavcodec/jpeg2000htdec.c b/arm/android/third_party/ffmpeg/libavcodec/jpeg2000htdec.c index 4c4e5471..2c4cea5d 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/jpeg2000htdec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/jpeg2000htdec.c @@ -144,36 +144,20 @@ static void jpeg2000_init_mel_decoder(MelDecoderState *mel_state) static int jpeg2000_bitbuf_refill_backwards(StateVars *buffer, const uint8_t *array) { uint64_t tmp = 0; - int32_t position = buffer->pos; + int32_t position = buffer->pos - 4; uint32_t new_bits = 32; if (buffer->bits_left >= 32) return 0; // enough data, no need to pull in more bits - /** - * We are reading bytes from end to start and need to handle being close to - * the end. Subtracting by 4 means we will read some of the bytes of the MEL - * byte stream since the MEL byte stream ends at the start of the VLC byte - * stream. This is okay as they are masked away since we check for cases - * where that occurs (when the position is less than 4). - */ - position -= 4; - - tmp = AV_RB32(&array[position + 1]); - - if (buffer->pos < 4){ - /* mask un-needed bits if we are close to input end */ - uint64_t mask = (1ull << (buffer->pos + 1) * 8) - 1; - tmp &= mask; - } - /** * Unstuff bits. Load a temporary byte, which precedes the position we * currently at, to ensure that we can also un-stuff if the stuffed bit is * the bottom most bits. */ - tmp <<= 8; - tmp |= array[buffer->pos + 1]; + + for(int i = FFMAX(0, position + 1); i <= buffer->pos + 1; i++) + tmp = 256*tmp + array[i]; if ((tmp & 0x7FFF000000) > 0x7F8F000000) { tmp &= 0x7FFFFFFFFF; @@ -1174,8 +1158,8 @@ ff_jpeg2000_decode_htj2k(const Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c int ret; /* Temporary buffers */ - int32_t *sample_buf; - uint8_t *block_states; + int32_t *sample_buf = NULL; + uint8_t *block_states = NULL; int32_t n, val; // Post-processing diff --git a/arm/android/third_party/ffmpeg/libavcodec/jpegls.c b/arm/android/third_party/ffmpeg/libavcodec/jpegls.c index cc598f3c..7b4bc30e 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/jpegls.c +++ b/arm/android/third_party/ffmpeg/libavcodec/jpegls.c @@ -28,6 +28,7 @@ #include #include "libavutil/internal.h" #include "libavutil/intmath.h" +#include "libavutil/log.h" #include "jpegls.h" void ff_jpegls_init_state(JLSState *state) diff --git a/arm/android/third_party/ffmpeg/libavcodec/jpegxl.h b/arm/android/third_party/ffmpeg/libavcodec/jpegxl.h new file mode 100644 index 00000000..66a6be35 --- /dev/null +++ b/arm/android/third_party/ffmpeg/libavcodec/jpegxl.h @@ -0,0 +1,94 @@ +/* + * JPEG XL Common Header Definitions + * Copyright (c) 2023 Leo Izen + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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_JPEGXL_H +#define AVCODEC_JPEGXL_H + +#define FF_JPEGXL_CODESTREAM_SIGNATURE_LE 0x0aff +#define FF_JPEGXL_CONTAINER_SIGNATURE_LE 0x204c584a0c000000 +#define FF_JPEGXL_CODESTREAM_SIGNATURE_BE 0xff0a +#define FF_JPEGXL_CONTAINER_SIGNATURE_BE 0x0000000c4a584c20 + +typedef enum FFJXLFrameEncoding { + JPEGXL_ENC_VARDCT, + JPEGXL_ENC_MODULAR +} FFJXLFrameEncoding; + +typedef enum FFJXLFrameType { + JPEGXL_FRAME_REGULAR, + JPEGXL_FRAME_LF, + JPEGXL_FRAME_REFERENCE_ONLY, + JPEGXL_FRAME_SKIP_PROGRESSIVE +} FFJXLFrameType; + +typedef enum FFJXLBlendMode { + JPEGXL_BM_REPLACE, + JPEGXL_BM_ADD, + JPEGXL_BM_BLEND, + JPEGXL_BM_MULADD, + JPEGXL_BM_MUL +} FFJXLBlendMode; + +typedef enum FFJXLExtraChannelType { + JPEGXL_CT_ALPHA = 0, + JPEGXL_CT_DEPTH, + JPEGXL_CT_SPOT_COLOR, + JPEGXL_CT_SELECTION_MASK, + JPEGXL_CT_BLACK, + JPEGXL_CT_CFA, + JPEGXL_CT_THERMAL, + JPEGXL_CT_NON_OPTIONAL = 15, + JPEGXL_CT_OPTIONAL +} FFJXLExtraChannelType; + +typedef enum FFJXLColorSpace { + JPEGXL_CS_RGB = 0, + JPEGXL_CS_GRAY, + JPEGXL_CS_XYB, + JPEGXL_CS_UNKNOWN +} FFJXLColorSpace; + +typedef enum FFJXLWhitePoint { + JPEGXL_WP_D65 = 1, + JPEGXL_WP_CUSTOM, + JPEGXL_WP_E = 10, + JPEGXL_WP_DCI = 11 +} FFJXLWhitePoint; + +typedef enum FFJXLPrimaries { + JPEGXL_PR_SRGB = 1, + JPEGXL_PR_CUSTOM, + JPEGXL_PR_2100 = 9, + JPEGXL_PR_P3 = 11, +} FFJXLPrimaries; + +typedef enum FFJXLTransferCharacteristic { + JPEGXL_TR_BT709 = 1, + JPEGXL_TR_UNKNOWN, + JPEGXL_TR_LINEAR = 8, + JPEGXL_TR_SRGB = 13, + JPEGXL_TR_PQ = 16, + JPEGXL_TR_DCI, + JPEGXL_TR_HLG, + JPEGXL_TR_GAMMA = 1 << 24, +} FFJXLTransferCharacteristic; + +#endif /* AVCODEC_JPEGXL_H */ diff --git a/arm/android/third_party/ffmpeg/libavcodec/jpegxl_parse.c b/arm/android/third_party/ffmpeg/libavcodec/jpegxl_parse.c new file mode 100644 index 00000000..eb28e808 --- /dev/null +++ b/arm/android/third_party/ffmpeg/libavcodec/jpegxl_parse.c @@ -0,0 +1,520 @@ +/* + * JPEG XL Header Parser + * Copyright (c) 2023 Leo Izen + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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 + +#include "bytestream.h" +#define UNCHECKED_BITSTREAM_READER 0 +#define BITSTREAM_READER_LE +#include "get_bits.h" +#include "jpegxl.h" +#include "jpegxl_parse.h" + +/* read a U32(c_i + u(u_i)) */ +static av_always_inline uint32_t jxl_u32(GetBitContext *gb, + uint32_t c0, uint32_t c1, uint32_t c2, uint32_t c3, + uint32_t u0, uint32_t u1, uint32_t u2, uint32_t u3) +{ + const uint32_t constants[4] = {c0, c1, c2, c3}; + const uint32_t ubits [4] = {u0, u1, u2, u3}; + uint32_t ret, choice = get_bits(gb, 2); + + ret = constants[choice]; + if (ubits[choice]) + ret += get_bits_long(gb, ubits[choice]); + + return ret; +} + +static av_always_inline uint32_t jxl_enum(GetBitContext *gb) +{ + return jxl_u32(gb, 0, 1, 2, 18, 0, 0, 4, 6); +} + +/* read a U64() */ +static uint64_t jxl_u64(GetBitContext *gb) +{ + uint64_t shift = 12, ret; + + switch (get_bits(gb, 2)) { + case 1: + ret = 1 + get_bits(gb, 4); + break; + case 2: + ret = 17 + get_bits(gb, 8); + break; + case 3: + ret = get_bits(gb, 12); + while (get_bits1(gb)) { + if (shift < 60) { + ret |= (uint64_t)get_bits(gb, 8) << shift; + shift += 8; + } else { + ret |= (uint64_t)get_bits(gb, 4) << shift; + break; + } + } + break; + default: + ret = 0; + } + + return ret; +} + +static uint32_t jpegxl_width_from_ratio(uint32_t height, int ratio) +{ + uint64_t height64 = height; /* avoid integer overflow */ + switch (ratio) { + case 1: + return height; + case 2: + return (uint32_t)((height64 * 12) / 10); + case 3: + return (uint32_t)((height64 * 4) / 3); + case 4: + return (uint32_t)((height64 * 3) / 2); + case 5: + return (uint32_t)((height64 * 16) / 9); + case 6: + return (uint32_t)((height64 * 5) / 4); + case 7: + return (uint32_t)(height64 * 2); + default: + break; + } + + return 0; /* manual width */ +} + +/** + * validate a Jpeg XL Size Header + * @return >= 0 upon valid size, < 0 upon invalid size found + */ +static int jpegxl_read_size_header(GetBitContext *gb, FFJXLMetadata *meta, int validate) +{ + uint32_t width, height; + + if (get_bits1(gb)) { + /* small size header */ + height = (get_bits(gb, 5) + 1) << 3; + width = jpegxl_width_from_ratio(height, get_bits(gb, 3)); + if (!width) + width = (get_bits(gb, 5) + 1) << 3; + } else { + /* large size header */ + height = 1 + jxl_u32(gb, 0, 0, 0, 0, 9, 13, 18, 30); + width = jpegxl_width_from_ratio(height, get_bits(gb, 3)); + if (!width) + width = 1 + jxl_u32(gb, 0, 0, 0, 0, 9, 13, 18, 30); + } + if (validate && (width > (1 << 18) || height > (1 << 18) + || (width >> 4) * (height >> 4) > (1 << 20))) + return AVERROR_INVALIDDATA; + + if (meta) { + meta->width = meta->coded_width = width; + meta->height = meta->coded_height = height; + } + + return 0; +} + +/** + * validate a Jpeg XL Preview Header + * @return >= 0 upon valid size, < 0 upon invalid size found + */ +static int jpegxl_read_preview_header(GetBitContext *gb, int validate) +{ + uint32_t width, height; + + if (get_bits1(gb)) { + /* coded height and width divided by eight */ + height = jxl_u32(gb, 16, 32, 1, 33, 0, 0, 5, 9) << 3; + width = jpegxl_width_from_ratio(height, get_bits(gb, 3)); + if (!width) + width = jxl_u32(gb, 16, 32, 1, 33, 0, 0, 5, 9) << 3; + } else { + /* full height and width coded */ + height = jxl_u32(gb, 1, 65, 321, 1345, 6, 8, 10, 12); + width = jpegxl_width_from_ratio(height, get_bits(gb, 3)); + if (!width) + width = jxl_u32(gb, 1, 65, 321, 1345, 6, 8, 10, 12); + } + if (validate && (width > 4096 || height > 4096)) + return AVERROR_INVALIDDATA; + + return 0; +} + +/** + * get a Jpeg XL BitDepth Header. These cannot be invalid. + */ +static void jpegxl_get_bit_depth(GetBitContext *gb, FFJXLMetadata *meta) +{ + int bit_depth; + if (get_bits1(gb)) { + /* float samples */ + bit_depth = jxl_u32(gb, 32, 16, 24, 1, 0, 0, 0, 6); /* mantissa */ + skip_bits_long(gb, 4); /* exponent */ + } else { + /* integer samples */ + bit_depth = jxl_u32(gb, 8, 10, 12, 1, 0, 0, 0, 6); + } + if (meta) + meta->bit_depth = bit_depth; +} + +/** + * validate a Jpeg XL Extra Channel Info bundle + * @return >= 0 upon valid, < 0 upon invalid + */ +static int jpegxl_read_extra_channel_info(GetBitContext *gb, FFJXLMetadata *meta, int validate) +{ + int default_alpha = get_bits1(gb); + uint32_t type, name_len = 0; + + if (!default_alpha) { + type = jxl_enum(gb); + if (validate && type > 63) + return AVERROR_INVALIDDATA; /* enum types cannot be 64+ */ + if (validate && validate < 10 && type == JPEGXL_CT_BLACK) + return AVERROR_INVALIDDATA; + jpegxl_get_bit_depth(gb, NULL); + jxl_u32(gb, 0, 3, 4, 1, 0, 0, 0, 3); /* dim-shift */ + /* max of name_len is 1071 = 48 + 2^10 - 1 */ + name_len = 8 * jxl_u32(gb, 0, 0, 16, 48, 0, 4, 5, 10); + } else { + type = JPEGXL_CT_ALPHA; + } + + if (get_bits_left(gb) < name_len) + return AVERROR_BUFFER_TOO_SMALL; + + /* skip over the name */ + skip_bits_long(gb, name_len); + + if (!default_alpha && type == JPEGXL_CT_ALPHA) + skip_bits1(gb); + + if (type == JPEGXL_CT_SPOT_COLOR) + skip_bits_long(gb, 16 * 4); + + if (type == JPEGXL_CT_CFA) + jxl_u32(gb, 1, 0, 3, 19, 0, 2, 4, 8); + + if (meta && type == JPEGXL_CT_ALPHA) + meta->have_alpha = 1; + + return 0; +} + +static int jpegxl_skip_extensions(GetBitContext *gb) +{ + uint64_t extensions = jxl_u64(gb), extensions_len = 0; + + if (get_bits_left(gb) <= 0) + return AVERROR_BUFFER_TOO_SMALL; + + if (!extensions) + return 0; + + for (int i = 0; i < 64; i++) { + if (extensions & (UINT64_C(1) << i)) + extensions_len += jxl_u64(gb); + if (get_bits_left(gb) <= 0) + return AVERROR_BUFFER_TOO_SMALL; + } + + if (extensions_len > INT_MAX || get_bits_left(gb) <= extensions_len) + return AVERROR_BUFFER_TOO_SMALL; + + skip_bits_long(gb, extensions_len); + + return 0; +} + +int ff_jpegxl_parse_codestream_header(const uint8_t *buf, int buflen, FFJXLMetadata *meta, int validate) +{ + GetBitContext gbi, *gb = &gbi; + + int all_default, extra_fields = 0; + int xyb_encoded = 1, have_icc_profile = 0; + int animation_offset = 0, have_timecodes = 0; + + FFJXLPrimaries primaries = JPEGXL_PR_SRGB; + FFJXLTransferCharacteristic trc = JPEGXL_TR_SRGB + (1U << 24); + FFJXLWhitePoint white_point = JPEGXL_WP_D65; + FFJXLColorSpace color_space = JPEGXL_CS_RGB; + + AVRational tb; + uint32_t num_extra_channels = 0; + int ret; + + ret = init_get_bits8(gb, buf, buflen); + if (ret < 0) + return ret; + + if (get_bits(gb, 16) != FF_JPEGXL_CODESTREAM_SIGNATURE_LE && validate) + return AVERROR_INVALIDDATA; + + ret = jpegxl_read_size_header(gb, meta, validate); + if (ret < 0) + return ret; + + all_default = get_bits1(gb); + if (!all_default) + extra_fields = get_bits1(gb); + + if (extra_fields) { + int orientation = get_bits(gb, 3); + if (orientation > 3 && meta) + FFSWAP(uint32_t, meta->width, meta->height); + + /* + * intrinstic size + * any size header here is valid, but as it + * is variable length we have to read it + */ + if (get_bits1(gb)) + jpegxl_read_size_header(gb, NULL, 0); + + /* preview header */ + if (get_bits1(gb)) { + ret = jpegxl_read_preview_header(gb, 0); + if (ret < 0) + return ret; + } + + /* animation header */ + if (get_bits1(gb)) { + animation_offset = get_bits_count(gb); + tb.den = jxl_u32(gb, 100, 1000, 1, 1, 0, 0, 10, 30); + tb.num = jxl_u32(gb, 1, 1001, 1, 1, 0, 0, 8, 10); + jxl_u32(gb, 0, 0, 0, 0, 0, 3, 16, 32); + have_timecodes = get_bits1(gb); + } + } + + if (animation_offset && meta) { + meta->animation_offset = animation_offset; + meta->timebase = tb; + meta->have_timecodes = have_timecodes; + } + + if (get_bits_left(gb) <= 0) + return AVERROR_BUFFER_TOO_SMALL; + + if (!all_default) { + jpegxl_get_bit_depth(gb, meta); + + /* modular_16bit_buffers must equal 1 */ + if (!get_bits1(gb) && validate && validate < 10) + return AVERROR_INVALIDDATA; + + num_extra_channels = jxl_u32(gb, 0, 1, 2, 1, 0, 0, 4, 12); + if (num_extra_channels > 4 && validate && validate < 10) + return AVERROR_INVALIDDATA; + for (uint32_t i = 0; i < num_extra_channels; i++) { + ret = jpegxl_read_extra_channel_info(gb, meta, validate); + if (ret < 0) + return ret; + if (get_bits_left(gb) <= 0) + return AVERROR_BUFFER_TOO_SMALL; + } + + xyb_encoded = get_bits1(gb); + + /* color encoding bundle */ + if (!get_bits1(gb)) { + have_icc_profile = get_bits1(gb); + color_space = jxl_enum(gb); + if (color_space > 63 && validate) + return AVERROR_INVALIDDATA; + if (!have_icc_profile) { + if (color_space != JPEGXL_CS_XYB) { + white_point = jxl_enum(gb); + if (white_point > 63 && validate) + return AVERROR_INVALIDDATA; + if (white_point == JPEGXL_WP_CUSTOM) { + /* ux and uy values */ + jxl_u32(gb, 0, 524288, 1048576, 2097152, 19, 19, 20, 21); + jxl_u32(gb, 0, 524288, 1048576, 2097152, 19, 19, 20, 21); + } + if (color_space != JPEGXL_CS_GRAY) { + /* primaries */ + primaries = jxl_enum(gb); + if (primaries > 63 && validate) + return AVERROR_INVALIDDATA; + if (primaries == JPEGXL_PR_CUSTOM) { + /* ux/uy values for r,g,b */ + for (int i = 0; i < 6; i++) { + jxl_u32(gb, 0, 524288, 1048576, 2097152, 19, 19, 20, 21); + if (get_bits_left(gb) <= 0) + return AVERROR_BUFFER_TOO_SMALL; + } + } + } + } + + /* transfer characteristics */ + if (get_bits1(gb)) { + /* gamma */ + trc = get_bits(gb, 24); + } else { + /* transfer function */ + trc = jxl_enum(gb); + if (trc > 63 && validate) + return AVERROR_INVALIDDATA; + trc += (1U << 24); + } + + /* rendering intent */ + if (jxl_enum(gb) > 63 && validate) + return AVERROR_INVALIDDATA; + } + } + + /* tone mapping bundle */ + if (extra_fields && !get_bits1(gb)) + skip_bits_long(gb, 16 + 16 + 1 + 16); + + ret = jpegxl_skip_extensions(gb); + if (ret < 0) + return ret; + } + + if (meta) { + meta->xyb_encoded = xyb_encoded; + meta->have_icc_profile = have_icc_profile; + meta->csp = color_space; + meta->primaries = primaries; + meta->wp = white_point; + meta->trc = trc; + if (!meta->bit_depth) + meta->bit_depth = 8; + meta->num_extra_channels = num_extra_channels; + } + + /* default transform */ + if (!get_bits1(gb)) { + /* opsin inverse matrix */ + if (xyb_encoded && !get_bits1(gb)) + skip_bits_long(gb, 16 * 16); + /* cw_mask and default weights */ + if (get_bits1(gb)) + skip_bits_long(gb, 16 * 15); + if (get_bits1(gb)) + skip_bits_long(gb, 16 * 55); + if (get_bits1(gb)) + skip_bits_long(gb, 16 * 210); + } + + if (!have_icc_profile) { + int bits_remaining = 7 - ((get_bits_count(gb) - 1) & 0x7); + if (bits_remaining && get_bits(gb, bits_remaining)) + return AVERROR_INVALIDDATA; + } + + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + + return get_bits_count(gb); +} + +/* + * copies as much of the codestream into the buffer as possible + * pass a shorter buflen to request less + * returns the number of bytes consumed from input, may be greater than input_len + * if the input doesn't end on an ISOBMFF-box boundary + */ +int ff_jpegxl_collect_codestream_header(const uint8_t *input_buffer, int input_len, + uint8_t *buffer, int buflen, int *copied) +{ + GetByteContext gb; + int pos = 0, last_box = 0; + bytestream2_init(&gb, input_buffer, input_len); + + while (1) { + uint64_t size; + uint32_t tag; + int head_size = 8; + + if (bytestream2_get_bytes_left(&gb) < 8) + return AVERROR_BUFFER_TOO_SMALL; + + size = bytestream2_get_be32(&gb); + if (size == 1) { + if (bytestream2_get_bytes_left(&gb) < 12) + return AVERROR_BUFFER_TOO_SMALL; + size = bytestream2_get_be64(&gb); + head_size = 16; + } + /* invalid ISOBMFF size */ + if (size && size <= head_size) + return AVERROR_INVALIDDATA; + if (size) + size -= head_size; + + tag = bytestream2_get_le32(&gb); + + if (tag == MKTAG('j','x','l','p')) { + uint32_t idx; + if (bytestream2_get_bytes_left(&gb) < 4) + return AVERROR_BUFFER_TOO_SMALL; + idx = bytestream2_get_be32(&gb); + if (idx >= UINT32_C(0x80000000)) + last_box = 1; + if (size) { + if (size <= 4) + return AVERROR_INVALIDDATA; + size -= 4; + } + } + if (tag == MKTAG('j','x','l','c')) + last_box = 1; + + /* + * size = 0 means "until EOF". this is legal but uncommon + * here we just set it to the remaining size of the probe buffer + */ + if (!size) + size = bytestream2_get_bytes_left(&gb); + else + pos += size + head_size; + + if (tag == MKTAG('j','x','l','c') || tag == MKTAG('j','x','l','p')) { + if (size > buflen - *copied) + size = buflen - *copied; + /* + * arbitrary chunking of the payload makes this memcpy hard to avoid + * in practice this will only be performed one or two times at most + */ + *copied += bytestream2_get_buffer(&gb, buffer + *copied, size); + } else { + bytestream2_skip(&gb, size); + } + if (last_box || bytestream2_get_bytes_left(&gb) <= 0 || *copied >= buflen) + break; + } + + return pos; +} diff --git a/arm/android/third_party/ffmpeg/libavcodec/jpegxl_parse.h b/arm/android/third_party/ffmpeg/libavcodec/jpegxl_parse.h new file mode 100644 index 00000000..0602f4d4 --- /dev/null +++ b/arm/android/third_party/ffmpeg/libavcodec/jpegxl_parse.h @@ -0,0 +1,72 @@ +/* + * JPEG XL Header Parser + * Copyright (c) 2023 Leo Izen + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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_JPEGXL_PARSE_H +#define AVCODEC_JPEGXL_PARSE_H + +#include + +#include "libavutil/rational.h" + +#include "jpegxl.h" + +typedef struct FFJXLMetadata { + uint32_t width; + uint32_t height; + uint32_t coded_width; + uint32_t coded_height; + int bit_depth; + int have_alpha; + /* + * offset, in bits, of the animation header + * zero if not animated + */ + int animation_offset; + AVRational timebase; + FFJXLColorSpace csp; + FFJXLWhitePoint wp; + FFJXLPrimaries primaries; + FFJXLTransferCharacteristic trc; + + /* used by the parser */ + int xyb_encoded; + int have_icc_profile; + int have_timecodes; + uint32_t num_extra_channels; +} FFJXLMetadata; + +/* + * copies as much of the codestream into the buffer as possible + * pass a shorter buflen to request less + * returns the number of bytes consumed from input, may be greater than input_len + * if the input doesn't end on an ISOBMFF-box boundary + */ +int ff_jpegxl_collect_codestream_header(const uint8_t *input_buffer, int input_len, + uint8_t *buffer, int buflen, int *copied); + +/* + * Parse the codestream header with the provided buffer. Returns negative upon failure, + * or the number of bits consumed upon success. + * The FFJXLMetadata parameter may be NULL, in which case it's ignored. + */ +int ff_jpegxl_parse_codestream_header(const uint8_t *buf, int buflen, FFJXLMetadata *meta, int validate); + +#endif /* AVCODEC_JPEGXL_PARSE_H */ diff --git a/arm/android/third_party/ffmpeg/libavcodec/jpegxl_parser.c b/arm/android/third_party/ffmpeg/libavcodec/jpegxl_parser.c new file mode 100644 index 00000000..d25a1b6e --- /dev/null +++ b/arm/android/third_party/ffmpeg/libavcodec/jpegxl_parser.c @@ -0,0 +1,1472 @@ +/** + * JPEG XL parser + * Copyright (c) 2023 Leo Izen + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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 +#include +#include + +#include "libavutil/attributes.h" +#include "libavutil/error.h" +#include "libavutil/intmath.h" +#include "libavutil/macros.h" +#include "libavutil/mem.h" +#include "libavutil/pixfmt.h" + +#include "bytestream.h" +#include "codec_id.h" +#define UNCHECKED_BITSTREAM_READER 0 +#define BITSTREAM_READER_LE +#include "get_bits.h" +#include "jpegxl.h" +#include "jpegxl_parse.h" +#include "parser.h" +#include "vlc.h" + +#define JXL_FLAG_NOISE 1 +#define JXL_FLAG_PATCHES 2 +#define JXL_FLAG_SPLINES 16 +#define JXL_FLAG_USE_LF_FRAME 32 +#define JXL_FLAG_SKIP_ADAPTIVE_LF_SMOOTH 128 + +#define clog1p(x) (ff_log2(x) + !!(x)) +#define unpack_signed(x) (((x) & 1 ? -(x)-1 : (x))/2) +#define div_ceil(x, y) (((x) - 1) / (y) + 1) +#define vlm(a,b) {.sym = (a), .len = (b)} + +typedef struct JXLHybridUintConf { + int split_exponent; + uint32_t msb_in_token; + uint32_t lsb_in_token; +} JXLHybridUintConf; + +typedef struct JXLSymbolDistribution { + JXLHybridUintConf config; + int log_bucket_size; + /* this is the actual size of the alphabet */ + int alphabet_size; + /* ceil(log(alphabet_size)) */ + int log_alphabet_size; + + /* for prefix code distributions */ + VLC vlc; + /* in case bits == 0 */ + uint32_t default_symbol; + + /* + * each (1 << log_alphabet_size) length + * with log_alphabet_size <= 8 + */ + /* frequencies associated with this Distribution */ + uint32_t freq[258]; + /* cutoffs for using the symbol table */ + uint16_t cutoffs[258]; + /* the symbol table for this distribution */ + uint16_t symbols[258]; + /* the offset for symbols */ + uint16_t offsets[258]; + + /* if this distribution contains only one symbol this is its index */ + int uniq_pos; +} JXLSymbolDistribution; + +typedef struct JXLDistributionBundle { + /* lz77 flags */ + int lz77_enabled; + uint32_t lz77_min_symbol; + uint32_t lz77_min_length; + JXLHybridUintConf lz_len_conf; + + /* one entry for each distribution */ + uint8_t *cluster_map; + /* length of cluster_map */ + int num_dist; + + /* one for each cluster */ + JXLSymbolDistribution *dists; + int num_clusters; + + /* whether to use brotli prefixes or ans */ + int use_prefix_code; + /* bundle log alphabet size, dist ones may be smaller */ + int log_alphabet_size; +} JXLDistributionBundle; + +typedef struct JXLEntropyDecoder { + + /* state is a positive 32-bit integer, or -1 if unset */ + int64_t state; + + /* lz77 values */ + uint32_t num_to_copy; + uint32_t copy_pos; + uint32_t num_decoded; + + /* length is (1 << 20) */ + /* if lz77 is enabled for this bundle */ + /* if lz77 is disabled it's NULL */ + uint32_t *window; + + /* primary bundle associated with this distribution */ + JXLDistributionBundle bundle; + + /* for av_log */ + void *logctx; +} JXLEntropyDecoder; + +typedef struct JXLFrame { + FFJXLFrameType type; + FFJXLFrameEncoding encoding; + + int is_last; + int full_frame; + + uint32_t total_length; + uint32_t body_length; +} JXLFrame; + +typedef struct JXLCodestream { + FFJXLMetadata meta; + JXLFrame frame; +} JXLCodestream; + +typedef struct JXLParseContext { + ParseContext pc; + JXLCodestream codestream; + + /* using ISOBMFF-based container */ + int container; + int skip; + int copied; + int collected_size; + int codestream_length; + int skipped_icc; + int next; + + uint8_t cs_buffer[4096]; +} JXLParseContext; + +/* used for reading brotli prefixes */ +static const VLCElem level0_table[16] = { + vlm(0, 2), vlm(4, 2), vlm(3, 2), vlm(2, 3), vlm(0, 2), vlm(4, 2), vlm(3, 2), vlm(1, 4), + vlm(0, 2), vlm(4, 2), vlm(3, 2), vlm(2, 3), vlm(0, 2), vlm(4, 2), vlm(3, 2), vlm(5, 4), +}; + +/* prefix table for populating ANS distribution */ +static const VLCElem dist_prefix_table[128] = { + vlm(10, 3), vlm(12, 7), vlm(7, 3), vlm(3, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(5, 4), + vlm(10, 3), vlm(4, 4), vlm(7, 3), vlm(1, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(2, 4), + vlm(10, 3), vlm(0, 5), vlm(7, 3), vlm(3, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(5, 4), + vlm(10, 3), vlm(4, 4), vlm(7, 3), vlm(1, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(2, 4), + vlm(10, 3), vlm(11, 6), vlm(7, 3), vlm(3, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(5, 4), + vlm(10, 3), vlm(4, 4), vlm(7, 3), vlm(1, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(2, 4), + vlm(10, 3), vlm(0, 5), vlm(7, 3), vlm(3, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(5, 4), + vlm(10, 3), vlm(4, 4), vlm(7, 3), vlm(1, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(2, 4), + vlm(10, 3), vlm(13, 7), vlm(7, 3), vlm(3, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(5, 4), + vlm(10, 3), vlm(4, 4), vlm(7, 3), vlm(1, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(2, 4), + vlm(10, 3), vlm(0, 5), vlm(7, 3), vlm(3, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(5, 4), + vlm(10, 3), vlm(4, 4), vlm(7, 3), vlm(1, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(2, 4), + vlm(10, 3), vlm(11, 6), vlm(7, 3), vlm(3, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(5, 4), + vlm(10, 3), vlm(4, 4), vlm(7, 3), vlm(1, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(2, 4), + vlm(10, 3), vlm(0, 5), vlm(7, 3), vlm(3, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(5, 4), + vlm(10, 3), vlm(4, 4), vlm(7, 3), vlm(1, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(2, 4), +}; + +static const uint8_t prefix_codelen_map[18] = { + 1, 2, 3, 4, 0, 5, 17, 6, 16, 7, 8, 9, 10, 11, 12, 13, 14, 15, +}; + +/** + * Read a variable-length 8-bit integer. + * Used when populating the ANS frequency tables. + */ +static av_always_inline uint8_t jxl_u8(GetBitContext *gb) +{ + int n; + if (!get_bits1(gb)) + return 0; + n = get_bits(gb, 3); + + return get_bitsz(gb, n) | (1 << n); +} + +/* read a U32(c_i + u(u_i)) */ +static av_always_inline uint32_t jxl_u32(GetBitContext *gb, + uint32_t c0, uint32_t c1, uint32_t c2, uint32_t c3, + uint32_t u0, uint32_t u1, uint32_t u2, uint32_t u3) +{ + const uint32_t constants[4] = {c0, c1, c2, c3}; + const uint32_t ubits [4] = {u0, u1, u2, u3}; + uint32_t ret, choice = get_bits(gb, 2); + + ret = constants[choice]; + if (ubits[choice]) + ret += get_bits_long(gb, ubits[choice]); + + return ret; +} + +/* read a U64() */ +static uint64_t jxl_u64(GetBitContext *gb) +{ + uint64_t shift = 12, ret; + + switch (get_bits(gb, 2)) { + case 1: + ret = 1 + get_bits(gb, 4); + break; + case 2: + ret = 17 + get_bits(gb, 8); + break; + case 3: + ret = get_bits(gb, 12); + while (get_bits1(gb)) { + if (shift < 60) { + ret |= (uint64_t)get_bits(gb, 8) << shift; + shift += 8; + } else { + ret |= (uint64_t)get_bits(gb, 4) << shift; + break; + } + } + break; + default: + ret = 0; + } + + return ret; +} + +static int read_hybrid_uint_conf(GetBitContext *gb, JXLHybridUintConf *conf, int log_alphabet_size) +{ + conf->split_exponent = get_bitsz(gb, clog1p(log_alphabet_size)); + if (conf->split_exponent == log_alphabet_size) { + conf->msb_in_token = conf->lsb_in_token = 0; + return 0; + } + + conf->msb_in_token = get_bitsz(gb, clog1p(conf->split_exponent)); + if (conf->msb_in_token > conf->split_exponent) + return AVERROR_INVALIDDATA; + conf->lsb_in_token = get_bitsz(gb, clog1p(conf->split_exponent - conf->msb_in_token)); + if (conf->msb_in_token + conf->lsb_in_token > conf->split_exponent) + return AVERROR_INVALIDDATA; + + return 0; +} + +static int read_hybrid_uint(GetBitContext *gb, const JXLHybridUintConf *conf, uint32_t token, uint32_t *hybrid_uint) +{ + uint32_t n, low, split = 1 << conf->split_exponent; + + if (token < split) { + *hybrid_uint = token; + return 0; + } + + n = conf->split_exponent - conf->lsb_in_token - conf->msb_in_token + + ((token - split) >> (conf->msb_in_token + conf->lsb_in_token)); + if (n >= 32) + return AVERROR_INVALIDDATA; + low = token & ((1 << conf->lsb_in_token) - 1); + token >>= conf->lsb_in_token; + token &= (1 << conf->msb_in_token) - 1; + token |= 1 << conf->msb_in_token; + *hybrid_uint = (((token << n) | get_bits_long(gb, n)) << conf->lsb_in_token ) | low; + + return 0; +} + +static inline uint32_t read_prefix_symbol(GetBitContext *gb, const JXLSymbolDistribution *dist) +{ + if (!dist->vlc.bits) + return dist->default_symbol; + + return get_vlc2(gb, dist->vlc.table, dist->vlc.bits, 1); +} + +static uint32_t read_ans_symbol(GetBitContext *gb, JXLEntropyDecoder *dec, const JXLSymbolDistribution *dist) +{ + uint32_t index, i, pos, symbol, offset; + + if (dec->state < 0) + dec->state = get_bits_long(gb, 32); + + index = dec->state & 0xFFF; + i = index >> dist->log_bucket_size; + pos = index & ((1 << dist->log_bucket_size) - 1); + symbol = pos >= dist->cutoffs[i] ? dist->symbols[i] : i; + offset = pos >= dist->cutoffs[i] ? dist->offsets[i] + pos : pos; + dec->state = dist->freq[symbol] * (dec->state >> 12) + offset; + if (dec->state < (1 << 16)) + dec->state = (dec->state << 16) | get_bits(gb, 16); + dec->state &= 0xFFFFFFFF; + + return symbol; +} + +static int decode_hybrid_varlen_uint(GetBitContext *gb, JXLEntropyDecoder *dec, + const JXLDistributionBundle *bundle, + uint32_t context, uint32_t *hybrid_uint) +{ + int ret; + uint32_t token, distance; + const JXLSymbolDistribution *dist; + + if (dec->num_to_copy > 0) { + *hybrid_uint = dec->window[dec->copy_pos++ & 0xFFFFF]; + dec->num_to_copy--; + dec->window[dec->num_decoded++ & 0xFFFFF] = *hybrid_uint; + return 0; + } + + if (context >= bundle->num_dist) + return AVERROR(EINVAL); + if (bundle->cluster_map[context] >= bundle->num_clusters) + return AVERROR_INVALIDDATA; + + dist = &bundle->dists[bundle->cluster_map[context]]; + if (bundle->use_prefix_code) + token = read_prefix_symbol(gb, dist); + else + token = read_ans_symbol(gb, dec, dist); + + if (bundle->lz77_enabled && token >= bundle->lz77_min_symbol) { + const JXLSymbolDistribution *lz77dist = &bundle->dists[bundle->cluster_map[bundle->num_dist - 1]]; + ret = read_hybrid_uint(gb, &bundle->lz_len_conf, token - bundle->lz77_min_symbol, &dec->num_to_copy); + if (ret < 0) + return ret; + dec->num_to_copy += bundle->lz77_min_length; + if (bundle->use_prefix_code) + token = read_prefix_symbol(gb, lz77dist); + else + token = read_ans_symbol(gb, dec, lz77dist); + ret = read_hybrid_uint(gb, &lz77dist->config, token, &distance); + if (ret < 0) + return ret; + distance++; + distance = FFMIN3(distance, dec->num_decoded, 1 << 20); + dec->copy_pos = dec->num_decoded - distance; + return decode_hybrid_varlen_uint(gb, dec, bundle, context, hybrid_uint); + } + ret = read_hybrid_uint(gb, &dist->config, token, hybrid_uint); + if (ret < 0) + return ret; + if (bundle->lz77_enabled) + dec->window[dec->num_decoded++ & 0xFFFFF] = *hybrid_uint; + + return 0; +} + +static int populate_distribution(GetBitContext *gb, JXLSymbolDistribution *dist, int log_alphabet_size) +{ + int len = 0, shift, omit_log = -1, omit_pos = -1; + int prev = 0, num_same = 0; + uint32_t total_count = 0; + uint8_t logcounts[258] = { 0 }; + uint8_t same[258] = { 0 }; + dist->uniq_pos = -1; + + if (get_bits1(gb)) { + /* simple code */ + dist->alphabet_size = 256; + if (get_bits1(gb)) { + uint8_t v1 = jxl_u8(gb); + uint8_t v2 = jxl_u8(gb); + if (v1 == v2) + return AVERROR_INVALIDDATA; + dist->freq[v1] = get_bits(gb, 12); + dist->freq[v2] = (1 << 12) - dist->freq[v1]; + if (!dist->freq[v1]) + dist->uniq_pos = v2; + } else { + uint8_t x = jxl_u8(gb); + dist->freq[x] = 1 << 12; + dist->uniq_pos = x; + } + return 0; + } + + if (get_bits1(gb)) { + /* flat code */ + dist->alphabet_size = jxl_u8(gb) + 1; + for (int i = 0; i < dist->alphabet_size; i++) + dist->freq[i] = (1 << 12) / dist->alphabet_size; + for (int i = 0; i < (1 << 12) % dist->alphabet_size; i++) + dist->freq[i]++; + return 0; + } + + do { + if (!get_bits1(gb)) + break; + } while (++len < 3); + + shift = (get_bitsz(gb, len) | (1 << len)) - 1; + if (shift > 13) + return AVERROR_INVALIDDATA; + + dist->alphabet_size = jxl_u8(gb) + 3; + for (int i = 0; i < dist->alphabet_size; i++) { + logcounts[i] = get_vlc2(gb, dist_prefix_table, 7, 1); + if (logcounts[i] == 13) { + int rle = jxl_u8(gb); + same[i] = rle + 5; + i += rle + 3; + continue; + } + if (logcounts[i] > omit_log) { + omit_log = logcounts[i]; + omit_pos = i; + } + } + if (omit_pos < 0 || omit_pos + 1 < dist->alphabet_size && logcounts[omit_pos + 1] == 13) + return AVERROR_INVALIDDATA; + + for (int i = 0; i < dist->alphabet_size; i++) { + if (same[i]) { + num_same = same[i] - 1; + prev = i > 0 ? dist->freq[i - 1] : 0; + } + if (num_same) { + dist->freq[i] = prev; + num_same--; + } else { + if (i == omit_pos || !logcounts[i]) + continue; + if (logcounts[i] == 1) { + dist->freq[i] = 1; + } else { + int bitcount = FFMIN(FFMAX(0, shift - ((12 - logcounts[i] + 1) >> 1)), logcounts[i] - 1); + dist->freq[i] = (1 << (logcounts[i] - 1)) + (get_bitsz(gb, bitcount) << (logcounts[i] - 1 - bitcount)); + } + } + total_count += dist->freq[i]; + } + dist->freq[omit_pos] = (1 << 12) - total_count; + + return 0; +} + +static void dist_bundle_close(JXLDistributionBundle *bundle) +{ + if (bundle->use_prefix_code && bundle->dists) + for (int i = 0; i < bundle->num_clusters; i++) + ff_vlc_free(&bundle->dists[i].vlc); + av_freep(&bundle->dists); + av_freep(&bundle->cluster_map); +} + + +static int read_distribution_bundle(GetBitContext *gb, JXLEntropyDecoder *dec, + JXLDistributionBundle *bundle, int num_dist, int disallow_lz77); + +static int read_dist_clustering(GetBitContext *gb, JXLEntropyDecoder *dec, JXLDistributionBundle *bundle) +{ + int ret; + + bundle->cluster_map = av_malloc(bundle->num_dist); + if (!bundle->cluster_map) + return AVERROR(ENOMEM); + + if (bundle->num_dist == 1) { + bundle->cluster_map[0] = 0; + bundle->num_clusters = 1; + return 0; + } + + if (get_bits1(gb)) { + /* simple clustering */ + uint32_t nbits = get_bits(gb, 2); + for (int i = 0; i < bundle->num_dist; i++) + bundle->cluster_map[i] = get_bitsz(gb, nbits); + } else { + /* complex clustering */ + int use_mtf = get_bits1(gb); + JXLDistributionBundle nested = { 0 }; + /* num_dist == 1 prevents this from recursing again */ + ret = read_distribution_bundle(gb, dec, &nested, 1, bundle->num_dist <= 2); + if (ret < 0) { + dist_bundle_close(&nested); + return ret; + } + for (int i = 0; i < bundle->num_dist; i++) { + uint32_t clust; + ret = decode_hybrid_varlen_uint(gb, dec, &nested, 0, &clust); + if (ret < 0) { + dist_bundle_close(&nested); + return ret; + } + bundle->cluster_map[i] = clust; + } + dec->state = -1; + /* it's not going to necessarily be zero after reading */ + dec->num_to_copy = 0; + dist_bundle_close(&nested); + if (use_mtf) { + uint8_t mtf[256]; + for (int i = 0; i < 256; i++) + mtf[i] = i; + for (int i = 0; i < bundle->num_dist; i++) { + int index = bundle->cluster_map[i]; + bundle->cluster_map[i] = mtf[index]; + if (index) { + int value = mtf[index]; + for (int j = index; j > 0; j--) + mtf[j] = mtf[j - 1]; + mtf[0] = value; + } + } + } + } + for (int i = 0; i < bundle->num_dist; i++) { + if (bundle->cluster_map[i] >= bundle->num_clusters) + bundle->num_clusters = bundle->cluster_map[i] + 1; + } + + if (bundle->num_clusters > bundle->num_dist) + return AVERROR_INVALIDDATA; + + return 0; +} + +static int gen_alias_map(JXLEntropyDecoder *dec, JXLSymbolDistribution *dist, int log_alphabet_size) +{ + uint32_t bucket_size, table_size; + uint8_t overfull[256], underfull[256]; + int overfull_pos = 0, underfull_pos = 0; + dist->log_bucket_size = 12 - log_alphabet_size; + bucket_size = 1 << dist->log_bucket_size; + table_size = 1 << log_alphabet_size; + + if (dist->uniq_pos >= 0) { + for (int i = 0; i < table_size; i++) { + dist->symbols[i] = dist->uniq_pos; + dist->offsets[i] = bucket_size * i; + dist->cutoffs[i] = 0; + } + return 0; + } + + for (int i = 0; i < dist->alphabet_size; i++) { + dist->cutoffs[i] = dist->freq[i]; + dist->symbols[i] = i; + if (dist->cutoffs[i] > bucket_size) + overfull[overfull_pos++] = i; + else if (dist->cutoffs[i] < bucket_size) + underfull[underfull_pos++] = i; + } + + for (int i = dist->alphabet_size; i < table_size; i++) { + dist->cutoffs[i] = 0; + underfull[underfull_pos++] = i; + } + + while (overfull_pos) { + int o, u, by; + /* this should be impossible */ + if (!underfull_pos) + return AVERROR_INVALIDDATA; + u = underfull[--underfull_pos]; + o = overfull[--overfull_pos]; + by = bucket_size - dist->cutoffs[u]; + dist->cutoffs[o] -= by; + dist->symbols[u] = o; + dist->offsets[u] = dist->cutoffs[o]; + if (dist->cutoffs[o] < bucket_size) + underfull[underfull_pos++] = o; + else if (dist->cutoffs[o] > bucket_size) + overfull[overfull_pos++] = o; + } + + for (int i = 0; i < table_size; i++) { + if (dist->cutoffs[i] == bucket_size) { + dist->symbols[i] = i; + dist->offsets[i] = 0; + dist->cutoffs[i] = 0; + } else { + dist->offsets[i] -= dist->cutoffs[i]; + } + } + + return 0; +} + +static int read_simple_vlc_prefix(GetBitContext *gb, JXLEntropyDecoder *dec, JXLSymbolDistribution *dist) +{ + int nsym, tree_select, bits; + + int8_t lens[4]; + int16_t symbols[4]; + + nsym = 1 + get_bits(gb, 2); + for (int i = 0; i < nsym; i++) + symbols[i] = get_bitsz(gb, dist->log_alphabet_size); + if (nsym == 4) + tree_select = get_bits1(gb); + switch (nsym) { + case 1: + dist->vlc.bits = 0; + dist->default_symbol = symbols[0]; + return 0; + case 2: + bits = 1; + lens[0] = 1, lens[1] = 1, lens[2] = 0, lens[3] = 0; + if (symbols[1] < symbols[0]) + FFSWAP(int16_t, symbols[0], symbols[1]); + break; + case 3: + bits = 2; + lens[0] = 1, lens[1] = 2, lens[2] = 2, lens[3] = 0; + if (symbols[2] < symbols[1]) + FFSWAP(int16_t, symbols[1], symbols[2]); + break; + case 4: + if (tree_select) { + bits = 3; + lens[0] = 1, lens[1] = 2, lens[2] = 3, lens[3] = 3; + if (symbols[3] < symbols[2]) + FFSWAP(int16_t, symbols[2], symbols[3]); + } else { + bits = 2; + lens[0] = 2, lens[1] = 2, lens[2] = 2, lens[3] = 2; + while (1) { + if (symbols[1] < symbols[0]) + FFSWAP(int16_t, symbols[0], symbols[1]); + if (symbols[3] < symbols[2]) + FFSWAP(int16_t, symbols[2], symbols[3]); + if (symbols[1] <= symbols[2]) + break; + FFSWAP(int16_t, symbols[1], symbols[2]); + } + } + break; + default: + // Challenge Complete! How did we get here? + return AVERROR_BUG; + } + + return ff_vlc_init_from_lengths(&dist->vlc, bits, nsym, lens, 1, symbols, + 2, 2, 0, VLC_INIT_LE, dec->logctx); +} + +static int read_vlc_prefix(GetBitContext *gb, JXLEntropyDecoder *dec, JXLSymbolDistribution *dist) +{ + int8_t level1_lens[18] = { 0 }; + int8_t level1_lens_s[18] = { 0 }; + int16_t level1_syms[18] = { 0 }; + uint32_t level1_codecounts[19] = { 0 }; + uint8_t *buf = NULL; + int8_t *level2_lens, *level2_lens_s; + int16_t *level2_syms; + uint32_t *level2_codecounts; + + int repeat_count_prev = 0, repeat_count_zero = 0, prev = 8; + int total_code = 0, len, hskip, num_codes = 0, ret; + + VLC level1_vlc; + + if (dist->alphabet_size == 1) { + dist->vlc.bits = 0; + dist->default_symbol = 0; + return 0; + } + + hskip = get_bits(gb, 2); + if (hskip == 1) + return read_simple_vlc_prefix(gb, dec, dist); + + level1_codecounts[0] = hskip; + for (int i = hskip; i < 18; i++) { + len = level1_lens[prefix_codelen_map[i]] = get_vlc2(gb, level0_table, 4, 1); + level1_codecounts[len]++; + if (len) { + total_code += (32 >> len); + num_codes++; + } + if (total_code >= 32) { + level1_codecounts[0] += 18 - i - 1; + break; + } + } + + if (total_code != 32 && num_codes >= 2 || num_codes < 1) + return AVERROR_INVALIDDATA; + + for (int i = 1; i < 19; i++) + level1_codecounts[i] += level1_codecounts[i - 1]; + + for (int i = 17; i >= 0; i--) { + int idx = --level1_codecounts[level1_lens[i]]; + level1_lens_s[idx] = level1_lens[i]; + level1_syms[idx] = i; + } + + ret = ff_vlc_init_from_lengths(&level1_vlc, 5, 18, level1_lens_s, 1, level1_syms, 2, 2, + 0, VLC_INIT_LE, dec->logctx); + if (ret < 0) + goto end; + + buf = av_calloc(1, 262148); // 32768 * 8 + 4 + if (!buf) { + ret = AVERROR(ENOMEM); + goto end; + } + + level2_lens = (int8_t *)buf; + level2_lens_s = (int8_t *)(buf + 32768); + level2_syms = (int16_t *)(buf + 65536); + level2_codecounts = (uint32_t *)(buf + 131072); + + total_code = 0; + for (int i = 0; i < dist->alphabet_size; i++) { + len = get_vlc2(gb, level1_vlc.table, 5, 1); + if (len == 16) { + int extra = 3 + get_bits(gb, 2); + if (repeat_count_prev) + extra = 4 * (repeat_count_prev - 2) - repeat_count_prev + extra; + for (int j = 0; j < extra; j++) + level2_lens[i + j] = prev; + total_code += (32768 >> prev) * extra; + i += extra - 1; + repeat_count_prev += extra; + repeat_count_zero = 0; + level2_codecounts[prev] += extra; + } else if (len == 17) { + int extra = 3 + get_bits(gb, 3); + if (repeat_count_zero > 0) + extra = 8 * (repeat_count_zero - 2) - repeat_count_zero + extra; + i += extra - 1; + repeat_count_prev = 0; + repeat_count_zero += extra; + level2_codecounts[0] += extra; + } else { + level2_lens[i] = len; + repeat_count_prev = repeat_count_zero = 0; + if (len) { + total_code += (32768 >> len); + prev = len; + } + level2_codecounts[len]++; + } + if (total_code >= 32768) { + level2_codecounts[0] += dist->alphabet_size - i - 1; + break; + } + } + + if (total_code != 32768 && level2_codecounts[0] < dist->alphabet_size - 1) + return AVERROR_INVALIDDATA; + + for (int i = 1; i < dist->alphabet_size + 1; i++) + level2_codecounts[i] += level2_codecounts[i - 1]; + + for (int i = dist->alphabet_size - 1; i >= 0; i--) { + int idx = --level2_codecounts[level2_lens[i]]; + level2_lens_s[idx] = level2_lens[i]; + level2_syms[idx] = i; + } + + ret = ff_vlc_init_from_lengths(&dist->vlc, 15, dist->alphabet_size, level2_lens_s, + 1, level2_syms, 2, 2, 0, VLC_INIT_LE, dec->logctx); + +end: + av_freep(&buf); + ff_vlc_free(&level1_vlc); + + return ret; +} + +static int read_distribution_bundle(GetBitContext *gb, JXLEntropyDecoder *dec, + JXLDistributionBundle *bundle, int num_dist, int disallow_lz77) +{ + int ret; + + if (num_dist <= 0) + return AVERROR(EINVAL); + + bundle->num_dist = num_dist; + bundle->lz77_enabled = get_bits1(gb); + if (bundle->lz77_enabled) { + if (disallow_lz77) + return AVERROR_INVALIDDATA; + bundle->lz77_min_symbol = jxl_u32(gb, 224, 512, 4096, 8, 0, 0, 0, 15); + bundle->lz77_min_length = jxl_u32(gb, 3, 4, 5, 9, 0, 0, 2, 8); + bundle->num_dist++; + ret = read_hybrid_uint_conf(gb, &bundle->lz_len_conf, 8); + if (ret < 0) + return ret; + } + + if (bundle->lz77_enabled && !dec->window) { + dec->window = av_malloc_array(1 << 20, sizeof(uint32_t)); + if (!dec->window) + return AVERROR(ENOMEM); + } + + ret = read_dist_clustering(gb, dec, bundle); + if (ret < 0) + return ret; + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + + bundle->dists = av_calloc(bundle->num_clusters, sizeof(JXLSymbolDistribution)); + if (!bundle->dists) + return AVERROR(ENOMEM); + + bundle->use_prefix_code = get_bits1(gb); + bundle->log_alphabet_size = bundle->use_prefix_code ? 15 : 5 + get_bits(gb, 2); + + for (int i = 0; i < bundle->num_clusters; i++) { + ret = read_hybrid_uint_conf(gb, &bundle->dists[i].config, bundle->log_alphabet_size); + if (ret < 0) + return ret; + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + } + + if (bundle->use_prefix_code) { + for (int i = 0; i < bundle->num_clusters; i++) { + JXLSymbolDistribution *dist = &bundle->dists[i]; + if (get_bits1(gb)) { + int n = get_bits(gb, 4); + dist->alphabet_size = 1 + (1 << n) + get_bitsz(gb, n); + } else { + dist->alphabet_size = 1; + } + dist->log_alphabet_size = clog1p(dist->alphabet_size - 1); + } + for (int i = 0; i < bundle->num_clusters; i++) { + ret = read_vlc_prefix(gb, dec, &bundle->dists[i]); + if (ret < 0) + return ret; + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + } + } else { + for (int i = 0; i < bundle->num_clusters; i++) { + ret = populate_distribution(gb, &bundle->dists[i], bundle->log_alphabet_size); + if (ret < 0) + return ret; + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + } + for (int i = 0; i < bundle->num_clusters; i++) { + ret = gen_alias_map(dec, &bundle->dists[i], bundle->log_alphabet_size); + if (ret < 0) + return ret; + } + } + + return 0; +} + +static void entropy_decoder_close(JXLEntropyDecoder *dec) +{ + if (!dec) + return; + av_freep(&dec->window); + dist_bundle_close(&dec->bundle); +} + +static int entropy_decoder_init(void *avctx, GetBitContext *gb, JXLEntropyDecoder *dec, int num_dist) +{ + int ret; + + memset(dec, 0, sizeof(*dec)); + dec->logctx = avctx; + dec->state = -1; + + ret = read_distribution_bundle(gb, dec, &dec->bundle, num_dist, 0); + if (ret < 0) { + entropy_decoder_close(dec); + return ret; + } + + return 0; +} + +static int64_t entropy_decoder_read_symbol(GetBitContext *gb, JXLEntropyDecoder *dec, uint32_t context) +{ + int ret; + uint32_t hybrid_uint; + + ret = decode_hybrid_varlen_uint(gb, dec, &dec->bundle, context, &hybrid_uint); + if (ret < 0) + return ret; + + return hybrid_uint; +} + +static inline uint32_t icc_context(uint64_t i, uint32_t b1, uint32_t b2) +{ + uint32_t p1, p2; + if (i <= 128) + return 0; + if (b1 >= 'a' && b1 <= 'z' || b1 >= 'A' && b1 <= 'Z') + p1 = 0; + else if (b1 >= '0' && b1 <= '9' || b1 == '.' || b1 == ',') + p1 = 1; + else if (b1 <= 1) + p1 = b1 + 2; + else if (b1 > 1 && b1 < 16) + p1 = 4; + else if (b1 > 240 && b1 < 255) + p1 = 5; + else if (b1 == 255) + p1 = 6; + else + p1 = 7; + + if (b2 >= 'a' && b2 <= 'z' || b2 >= 'A' && b2 <= 'Z') + p2 = 0; + else if (b2 >= '0' && b2 <= '9' || b2 == '.' || b2 == ',') + p2 = 1; + else if (b2 < 16) + p2 = 2; + else if (b2 > 240) + p2 = 3; + else + p2 = 4; + + return 1 + p1 + p2 * 8; +} + +static inline uint32_t toc_context(uint32_t x) +{ + return FFMIN(7, clog1p(x)); +} + +static void populate_fields(AVCodecParserContext *s, AVCodecContext *avctx, const FFJXLMetadata *meta) +{ + s->width = meta->width; + s->height = meta->height; + + switch (meta->csp) { + case JPEGXL_CS_RGB: + case JPEGXL_CS_XYB: + avctx->colorspace = AVCOL_SPC_RGB; + break; + default: + avctx->colorspace = AVCOL_SPC_UNSPECIFIED; + } + + if (meta->wp == JPEGXL_WP_D65) { + switch (meta->primaries) { + case JPEGXL_PR_SRGB: + avctx->color_primaries = AVCOL_PRI_BT709; + break; + case JPEGXL_PR_P3: + avctx->color_primaries = AVCOL_PRI_SMPTE432; + break; + case JPEGXL_PR_2100: + avctx->color_primaries = AVCOL_PRI_BT2020; + break; + default: + avctx->color_primaries = AVCOL_PRI_UNSPECIFIED; + } + } else if (meta->wp == JPEGXL_WP_DCI && meta->primaries == JPEGXL_PR_P3) { + avctx->color_primaries = AVCOL_PRI_SMPTE431; + } else { + avctx->color_primaries = AVCOL_PRI_UNSPECIFIED; + } + + if (meta->trc > JPEGXL_TR_GAMMA) { + FFJXLTransferCharacteristic trc = meta->trc - JPEGXL_TR_GAMMA; + switch (trc) { + case JPEGXL_TR_BT709: + avctx->color_trc = AVCOL_TRC_BT709; + break; + case JPEGXL_TR_LINEAR: + avctx->color_trc = AVCOL_TRC_LINEAR; + break; + case JPEGXL_TR_SRGB: + avctx->color_trc = AVCOL_TRC_IEC61966_2_1; + break; + case JPEGXL_TR_PQ: + avctx->color_trc = AVCOL_TRC_SMPTEST2084; + break; + case JPEGXL_TR_DCI: + avctx->color_trc = AVCOL_TRC_SMPTE428; + break; + case JPEGXL_TR_HLG: + avctx->color_trc = AVCOL_TRC_ARIB_STD_B67; + break; + default: + avctx->color_trc = AVCOL_TRC_UNSPECIFIED; + } + } else if (meta->trc > 0) { + if (meta->trc > 45355 && meta->trc < 45555) + avctx->color_trc = AVCOL_TRC_GAMMA22; + else if (meta->trc > 35614 && meta->trc < 35814) + avctx->color_trc = AVCOL_TRC_GAMMA28; + else + avctx->color_trc = AVCOL_TRC_UNSPECIFIED; + } else { + avctx->color_trc = AVCOL_TRC_UNSPECIFIED; + } + + if (meta->csp == JPEGXL_CS_GRAY) { + if (meta->bit_depth <= 8) + s->format = meta->have_alpha ? AV_PIX_FMT_YA8 : AV_PIX_FMT_GRAY8; + else if (meta->bit_depth <= 16) + s->format = meta->have_alpha ? AV_PIX_FMT_YA16 : AV_PIX_FMT_GRAY16; + else + s->format = meta->have_alpha ? AV_PIX_FMT_NONE : AV_PIX_FMT_GRAYF32; + } else { + if (meta->bit_depth <= 8) + s->format = meta->have_alpha ? AV_PIX_FMT_RGBA : AV_PIX_FMT_RGB24; + else if (meta->bit_depth <= 16) + s->format = meta->have_alpha ? AV_PIX_FMT_RGBA64 : AV_PIX_FMT_RGB48; + else + s->format = meta->have_alpha ? AV_PIX_FMT_RGBAF32 : AV_PIX_FMT_RGBF32; + } +} + +static int skip_icc_profile(void *avctx, JXLParseContext *ctx, GetBitContext *gb) +{ + int64_t ret; + uint32_t last = 0, last2 = 0; + JXLEntropyDecoder dec; + uint64_t enc_size = jxl_u64(gb); + + if (!enc_size) + return AVERROR_INVALIDDATA; + + ret = entropy_decoder_init(avctx, gb, &dec, 41); + if (ret < 0) + return ret; + + if (get_bits_left(gb) < 0) { + entropy_decoder_close(&dec); + return AVERROR_BUFFER_TOO_SMALL; + } + + for (uint64_t read = 0; read < enc_size; read++) { + ret = entropy_decoder_read_symbol(gb, &dec, icc_context(read, last, last2)); + if (ret < 0 || get_bits_left(gb) < 0) { + entropy_decoder_close(&dec); + return ret < 0 ? ret : AVERROR_BUFFER_TOO_SMALL; + } + last2 = last; + last = ret; + } + + entropy_decoder_close(&dec); + + return 0; +} + +static int skip_extensions(GetBitContext *gb) +{ + uint64_t extensions = jxl_u64(gb), extensions_len = 0; + + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + + if (!extensions) + return 0; + + for (int i = 0; i < 64; i++) { + if (extensions & (UINT64_C(1) << i)) + extensions_len += jxl_u64(gb); + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + } + + if (extensions_len > INT_MAX || get_bits_left(gb) < extensions_len) + return AVERROR_BUFFER_TOO_SMALL; + + skip_bits_long(gb, extensions_len); + + return 0; +} + +static int parse_frame_header(void *avctx, JXLParseContext *ctx, GetBitContext *gb) +{ + int all_default, do_yCbCr = 0, num_passes = 1, ret; + int group_size_shift = 1, lf_level = 0, save_as_ref = 0; + int have_crop = 0, full_frame = 1, resets_canvas = 1, upsampling = 1; + JXLFrame *frame = &ctx->codestream.frame; + const FFJXLMetadata *meta = &ctx->codestream.meta; + int32_t x0 = 0, y0 = 0; + uint32_t duration = 0, width = meta->coded_width, height = meta->coded_height; + uint32_t name_len, num_groups, num_lf_groups, group_dim, lf_group_dim, toc_count; + uint64_t flags = 0; + int start_len = get_bits_count(gb); + + memset(frame, 0, sizeof(*frame)); + frame->is_last = 1; + + all_default = get_bits1(gb); + if (!all_default) { + frame->type = get_bits(gb, 2); + frame->encoding = get_bits1(gb); + flags = jxl_u64(gb); + if (!meta->xyb_encoded) + do_yCbCr = get_bits1(gb); + if (!(flags & JXL_FLAG_USE_LF_FRAME)) { + if (do_yCbCr) + skip_bits(gb, 6); // jpeg upsampling + upsampling = jxl_u32(gb, 1, 2, 4, 8, 0, 0, 0, 0); + skip_bits_long(gb, 2 * meta->num_extra_channels); + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + } + if (frame->encoding == JPEGXL_ENC_MODULAR) + group_size_shift = get_bits(gb, 2); + else if (meta->xyb_encoded) + skip_bits(gb, 6); // xqm and bqm scales + if (frame->type != JPEGXL_FRAME_REFERENCE_ONLY) { + num_passes = jxl_u32(gb, 1, 2, 3, 4, 0, 0, 0, 3); + if (num_passes != 1) { + int num_ds = jxl_u32(gb, 0, 1, 2, 3, 0, 0, 0, 1); + skip_bits(gb, 2 * (num_passes - 1)); // shift + skip_bits(gb, 2 * num_ds); // downsample + for (int i = 0; i < num_ds; i++) + jxl_u32(gb, 0, 1, 2, 0, 0, 0, 0, 3); + } + } + if (frame->type == JPEGXL_FRAME_LF) + lf_level = 1 + get_bits(gb, 2); + else + have_crop = get_bits1(gb); + if (have_crop) { + if (frame->type != JPEGXL_FRAME_REFERENCE_ONLY) { + uint32_t ux0 = jxl_u32(gb, 0, 256, 2304, 18688, 8, 11, 14, 30); + uint32_t uy0 = jxl_u32(gb, 0, 256, 2304, 18688, 8, 11, 14, 30); + x0 = unpack_signed(ux0); + y0 = unpack_signed(uy0); + } + width = jxl_u32(gb, 0, 256, 2304, 18688, 8, 11, 14, 30); + height = jxl_u32(gb, 0, 256, 2304, 18688, 8, 11, 14, 30); + full_frame = x0 <= 0 && y0 <= 0 && width + x0 >= meta->coded_width + && height + y0 >= meta->coded_height; + } + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + if (frame->type == JPEGXL_FRAME_REGULAR || frame->type == JPEGXL_FRAME_SKIP_PROGRESSIVE) { + for (int i = 0; i <= meta->num_extra_channels; i++) { + int mode = jxl_u32(gb, 0, 1, 2, 3, 0, 0, 0, 2); + if (meta->num_extra_channels && (mode == JPEGXL_BM_BLEND || mode == JPEGXL_BM_MULADD)) + jxl_u32(gb, 0, 1, 2, 3, 0, 0, 0, 2); + if (meta->num_extra_channels && (mode == JPEGXL_BM_BLEND || mode == JPEGXL_BM_MULADD + || mode == JPEGXL_BM_MUL)) + skip_bits1(gb); + if (!i) + resets_canvas = mode == JPEGXL_BM_REPLACE && full_frame; + if (!resets_canvas) + skip_bits(gb, 2); + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + } + if (meta->animation_offset) + duration = jxl_u32(gb, 0, 1, 0, 0, 0, 0, 8, 32); + if (meta->have_timecodes) + skip_bits_long(gb, 32); + frame->is_last = get_bits1(gb); + } else { + frame->is_last = 0; + } + if (frame->type != JPEGXL_FRAME_LF && !frame->is_last) + save_as_ref = get_bits(gb, 2); + if (frame->type == JPEGXL_FRAME_REFERENCE_ONLY || + (resets_canvas && !frame->is_last && (!duration || save_as_ref) + && frame->type != JPEGXL_FRAME_LF)) + skip_bits1(gb); // save before color transform + name_len = 8 * jxl_u32(gb, 0, 0, 16, 48, 0, 4, 5, 10); + if (get_bits_left(gb) < name_len) + return AVERROR_BUFFER_TOO_SMALL; + skip_bits_long(gb, name_len); + } + + if (!all_default) { + int restd = get_bits1(gb), gab = 1; + if (!restd) + gab = get_bits1(gb); + if (gab && !restd && get_bits1(gb)) + // gab custom + skip_bits_long(gb, 16 * 6); + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + if (!restd) { + int epf = get_bits(gb, 2); + if (epf) { + if (frame->encoding == JPEGXL_ENC_VARDCT && get_bits1(gb)) { + skip_bits_long(gb, 16 * 8); // custom epf sharpness + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + } + if (get_bits1(gb)) { + skip_bits_long(gb, 3 * 16 + 32); // custom epf weight + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + } + if (get_bits1(gb)) { // custom epf sigma + if (frame->encoding == JPEGXL_ENC_VARDCT) + skip_bits(gb, 16); + skip_bits_long(gb, 16 * 3); + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + } + if (frame->encoding == JPEGXL_ENC_MODULAR) + skip_bits(gb, 16); + } + ret = skip_extensions(gb); + if (ret < 0) + return ret; + } + ret = skip_extensions(gb); + if (ret < 0) + return ret; + } + + width = div_ceil(div_ceil(width, upsampling), 1 << (3 * lf_level)); + height = div_ceil(div_ceil(height, upsampling), 1 << (3 * lf_level)); + group_dim = 128 << group_size_shift; + lf_group_dim = group_dim << 3; + num_groups = div_ceil(width, group_dim) * div_ceil(height, group_dim); + num_lf_groups = div_ceil(width, lf_group_dim) * div_ceil(height, lf_group_dim); + if (num_groups == 1 && num_passes == 1) + toc_count = 1; + else + toc_count = 2 + num_lf_groups + num_groups * num_passes; + + // permuted toc + if (get_bits1(gb)) { + JXLEntropyDecoder dec; + uint32_t end, lehmer = 0; + ret = entropy_decoder_init(avctx, gb, &dec, 8); + if (ret < 0) + return ret; + if (get_bits_left(gb) < 0) { + entropy_decoder_close(&dec); + return AVERROR_BUFFER_TOO_SMALL; + } + end = entropy_decoder_read_symbol(gb, &dec, toc_context(toc_count)); + if (end > toc_count) { + entropy_decoder_close(&dec); + return AVERROR_INVALIDDATA; + } + for (uint32_t i = 0; i < end; i++) { + lehmer = entropy_decoder_read_symbol(gb, &dec, toc_context(lehmer)); + if (get_bits_left(gb) < 0) { + entropy_decoder_close(&dec); + return AVERROR_BUFFER_TOO_SMALL; + } + } + entropy_decoder_close(&dec); + } + align_get_bits(gb); + + for (uint32_t i = 0; i < toc_count; i++) { + frame->body_length += 8 * jxl_u32(gb, 0, 1024, 17408, 4211712, 10, 14, 22, 30); + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + } + align_get_bits(gb); + + frame->total_length = frame->body_length + get_bits_count(gb) - start_len; + + return 0; +} + +static int skip_boxes(JXLParseContext *ctx, const uint8_t *buf, int buf_size) +{ + GetByteContext gb; + + if (ctx->skip > buf_size) + return AVERROR_BUFFER_TOO_SMALL; + + buf += ctx->skip; + buf_size -= ctx->skip; + bytestream2_init(&gb, buf, buf_size); + + while (1) { + uint64_t size; + int head_size = 4; + + if (bytestream2_peek_le16(&gb) == FF_JPEGXL_CODESTREAM_SIGNATURE_LE) + break; + if (bytestream2_peek_le64(&gb) == FF_JPEGXL_CONTAINER_SIGNATURE_LE) + break; + + if (bytestream2_get_bytes_left(&gb) < 8) + return AVERROR_BUFFER_TOO_SMALL; + + size = bytestream2_get_be32(&gb); + if (size == 1) { + if (bytestream2_get_bytes_left(&gb) < 12) + return AVERROR_BUFFER_TOO_SMALL; + size = bytestream2_get_be64(&gb); + head_size = 12; + } + if (!size) + return AVERROR_INVALIDDATA; + /* invalid ISOBMFF size */ + if (size <= head_size + 4 || size > INT_MAX - ctx->skip) + return AVERROR_INVALIDDATA; + + ctx->skip += size; + bytestream2_skip(&gb, size - head_size); + if (bytestream2_get_bytes_left(&gb) <= 0) + return AVERROR_BUFFER_TOO_SMALL; + } + + return 0; +} + +static int try_parse(AVCodecParserContext *s, AVCodecContext *avctx, JXLParseContext *ctx, + const uint8_t *buf, int buf_size) +{ + int ret, cs_buflen, header_skip; + const uint8_t *cs_buffer; + GetBitContext gb; + + if (ctx->skip > buf_size) + return AVERROR_BUFFER_TOO_SMALL; + + buf += ctx->skip; + buf_size -= ctx->skip; + + if (ctx->container || AV_RL64(buf) == FF_JPEGXL_CONTAINER_SIGNATURE_LE) { + ctx->container = 1; + ret = ff_jpegxl_collect_codestream_header(buf, buf_size, ctx->cs_buffer, + sizeof(ctx->cs_buffer), &ctx->copied); + if (ret < 0) + return ret; + ctx->collected_size = ret; + if (!ctx->copied) { + ctx->skip += ret; + return AVERROR_BUFFER_TOO_SMALL; + } + cs_buffer = ctx->cs_buffer; + cs_buflen = FFMIN(sizeof(ctx->cs_buffer), ctx->copied); + } else { + cs_buffer = buf; + cs_buflen = buf_size; + } + + if (!ctx->codestream_length) { + header_skip = ff_jpegxl_parse_codestream_header(cs_buffer, cs_buflen, &ctx->codestream.meta, 0); + if (header_skip < 0) + return header_skip; + ctx->codestream_length = header_skip; + populate_fields(s, avctx, &ctx->codestream.meta); + } + + if (ctx->container) + return ctx->collected_size; + + ret = init_get_bits8(&gb, cs_buffer, cs_buflen); + if (ret < 0) + return ret; + + skip_bits_long(&gb, ctx->codestream_length); + + if (!ctx->skipped_icc && ctx->codestream.meta.have_icc_profile) { + ret = skip_icc_profile(avctx, ctx, &gb); + if (ret < 0) + return ret; + ctx->skipped_icc = 1; + align_get_bits(&gb); + ctx->codestream_length = get_bits_count(&gb); + } + + if (get_bits_left(&gb) <= 0) + return AVERROR_BUFFER_TOO_SMALL; + + while (1) { + ret = parse_frame_header(avctx, ctx, &gb); + if (ret < 0) + return ret; + ctx->codestream_length += ctx->codestream.frame.total_length; + if (ctx->codestream.frame.is_last) + return ctx->codestream_length / 8; + if (get_bits_left(&gb) <= ctx->codestream.frame.body_length) + return AVERROR_BUFFER_TOO_SMALL; + skip_bits_long(&gb, ctx->codestream.frame.body_length); + } +} + +static int jpegxl_parse(AVCodecParserContext *s, AVCodecContext *avctx, + const uint8_t **poutbuf, int *poutbuf_size, + const uint8_t *buf, int buf_size) +{ + JXLParseContext *ctx = s->priv_data; + int next = END_NOT_FOUND, ret; + + *poutbuf_size = 0; + *poutbuf = NULL; + + if (!ctx->pc.index) + goto flush; + + if ((!ctx->container || !ctx->codestream_length) && !ctx->next) { + ret = try_parse(s, avctx, ctx, ctx->pc.buffer, ctx->pc.index); + if (ret < 0) + goto flush; + ctx->next = ret; + if (ctx->container) + ctx->skip += ctx->next; + } + + if (ctx->container && ctx->next >= 0) { + ret = skip_boxes(ctx, ctx->pc.buffer, ctx->pc.index); + if (ret < 0) { + if (ret == AVERROR_INVALIDDATA) + ctx->next = -1; + goto flush; + } + ctx->next = ret + ctx->skip; + } + + if (ctx->next >= 0) + next = ctx->next - ctx->pc.index; + +flush: + if (next > buf_size) + next = END_NOT_FOUND; + + ret = ff_combine_frame(&ctx->pc, next, &buf, &buf_size); + if (ret < 0) + return buf_size; + + *poutbuf = buf; + *poutbuf_size = buf_size; + + ctx->codestream_length = 0; + ctx->collected_size = 0; + ctx->container = 0; + ctx->copied = 0; + ctx->skip = 0; + ctx->skipped_icc = 0; + ctx->next = 0; + memset(&ctx->codestream, 0, sizeof(ctx->codestream)); + + return next; +} + +const AVCodecParser ff_jpegxl_parser = { + .codec_ids = { AV_CODEC_ID_JPEGXL }, + .priv_data_size = sizeof(JXLParseContext), + .parser_parse = jpegxl_parse, + .parser_close = ff_parse_close, +}; diff --git a/arm/android/third_party/ffmpeg/libavcodec/kbdwin.c b/arm/android/third_party/ffmpeg/libavcodec/kbdwin.c index 163f9d52..ff7a7d61 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/kbdwin.c +++ b/arm/android/third_party/ffmpeg/libavcodec/kbdwin.c @@ -17,22 +17,27 @@ */ #include "libavutil/avassert.h" +#include "libavutil/error.h" +#include "libavutil/libm.h" #include "libavutil/mathematics.h" #include "libavutil/attributes.h" +#include "libavutil/mem.h" #include "kbdwin.h" -av_cold static void kbd_window_init(float *float_window, int *int_window, float alpha, int n) +av_cold static int kbd_window_init(float *float_window, int *int_window, float alpha, int n) { int i; double sum = 0.0, tmp; double scale = 0.0; - double temp[FF_KBD_WINDOW_MAX / 2 + 1]; + double temp_small[FF_KBD_WINDOW_MAX / 2 + 1]; + double *temp= n<=FF_KBD_WINDOW_MAX ? temp_small : av_malloc((n/2+1) * sizeof(*temp)); double alpha2 = 4 * (alpha * M_PI / n) * (alpha * M_PI / n); - av_assert0(n <= FF_KBD_WINDOW_MAX); + if (!temp) + return AVERROR(ENOMEM); for (i = 0; i <= n / 2; i++) { - tmp = i * (n - i) * alpha2; + tmp = alpha2 * i * (n - i); temp[i] = av_bessel_i0(sqrt(tmp)); scale += temp[i] * (1 + (i && i /** - * Maximum window size for ff_kbd_window_init. + * Maximum window size for avpriv_kbd_window_init. */ #define FF_KBD_WINDOW_MAX 1024 @@ -30,9 +30,11 @@ * Generate a Kaiser-Bessel Derived Window. * @param window pointer to half window * @param alpha determines window shape - * @param n size of half window, max FF_KBD_WINDOW_MAX + * @param n size of half window + * + * @return if n is larger than FF_KBD_WINDOW_MAX then AVERROR(ENOMEM) is possible */ -void ff_kbd_window_init(float *window, float alpha, int n); -void ff_kbd_window_init_fixed(int32_t *window, float alpha, int n); +int avpriv_kbd_window_init(float *window, float alpha, int n); +int avpriv_kbd_window_init_fixed(int32_t *window, float alpha, int n); #endif /* AVCODEC_KBDWIN_H */ diff --git a/arm/android/third_party/ffmpeg/libavcodec/lagarith.c b/arm/android/third_party/ffmpeg/libavcodec/lagarith.c index ebc1f761..9574f788 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/lagarith.c +++ b/arm/android/third_party/ffmpeg/libavcodec/lagarith.c @@ -27,6 +27,8 @@ #include +#include "libavutil/thread.h" + #include "avcodec.h" #include "codec_internal.h" #include "get_bits.h" @@ -35,6 +37,8 @@ #include "lossless_videodsp.h" #include "thread.h" +#define VLC_BITS 7 + enum LagarithFrameType { FRAME_RAW = 1, /**< uncompressed */ FRAME_U_RGB24 = 2, /**< unaligned RGB24 */ @@ -56,6 +60,35 @@ typedef struct LagarithContext { int zeros_rem; /**< number of zero bytes remaining to output */ } LagarithContext; +static VLC lag_tab; + +static const uint8_t lag_bits[] = { + 7, 7, 2, 7, 3, 4, 5, 6, 7, 7, 7, 7, 7, 6, 7, 4, 5, 7, 7, 7, 7, + 5, 6, 7, 7, 7, 7, 7, 7, 6, 7, 7, 7, 7, 7, 6, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, +}; + +static const uint8_t lag_codes[] = { + 0x01, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x05, + 0x08, 0x09, 0x0A, 0x0B, 0x0B, 0x0B, 0x0B, 0x10, 0x11, 0x12, 0x13, + 0x13, 0x13, 0x14, 0x15, 0x20, 0x21, 0x22, 0x23, 0x23, 0x24, 0x25, + 0x28, 0x29, 0x2A, 0x2B, 0x2B, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, + 0x48, 0x49, 0x4A, 0x4B, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, +}; + +static const uint8_t lag_symbols[] = { + 20, 12, 0, 12, 1, 2, 4, 7, 7, 28, 4, 25, 17, + 10, 17, 3, 6, 2, 23, 15, 15, 5, 9, 10, 31, 1, 22, + 14, 14, 8, 9, 30, 6, 27, 19, 11, 19, 0, 21, 13, 13, + 8, 29, 5, 26, 18, 18, 3, 24, 16, 16, 11, 32, +}; + +static av_cold void lag_init_static_data(void) +{ + VLC_INIT_SPARSE_STATIC(&lag_tab, VLC_BITS, FF_ARRAY_ELEMS(lag_bits), + lag_bits, 1, 1, lag_codes, 1, 1, lag_symbols, 1, 1, 128); +} + /** * Compute the 52-bit mantissa of 1/(double)denom. * This crazy format uses floats in an entropy coder and we have to match x86 @@ -101,23 +134,10 @@ static uint8_t lag_calc_zero_run(int8_t x) static int lag_decode_prob(GetBitContext *gb, uint32_t *value) { - static const uint8_t series[] = { 1, 2, 3, 5, 8, 13, 21 }; - int i; - int bit = 0; - int bits = 0; - int prevbit = 0; - unsigned val; + unsigned val, bits; - for (i = 0; i < 7; i++) { - if (prevbit && bit) - break; - prevbit = bit; - bit = get_bits1(gb); - if (bit && !prevbit) - bits += series[i]; - } - bits--; - if (bits < 0 || bits > 31) { + bits = get_vlc2(gb, lag_tab.table, VLC_BITS, 1); + if (bits > 31) { *value = 0; return AVERROR_INVALIDDATA; } else if (bits == 0) { @@ -146,17 +166,17 @@ static int lag_read_prob_header(lag_rac *rac, GetBitContext *gb) /* Read probabilities from bitstream */ for (i = 1; i < 257; i++) { if (lag_decode_prob(gb, &rac->prob[i]) < 0) { - av_log(rac->avctx, AV_LOG_ERROR, "Invalid probability encountered.\n"); + av_log(rac->logctx, AV_LOG_ERROR, "Invalid probability encountered.\n"); return AVERROR_INVALIDDATA; } if ((uint64_t)cumul_prob + rac->prob[i] > UINT_MAX) { - av_log(rac->avctx, AV_LOG_ERROR, "Integer overflow encountered in cumulative probability calculation.\n"); + av_log(rac->logctx, AV_LOG_ERROR, "Integer overflow encountered in cumulative probability calculation.\n"); return AVERROR_INVALIDDATA; } cumul_prob += rac->prob[i]; if (!rac->prob[i]) { if (lag_decode_prob(gb, &prob)) { - av_log(rac->avctx, AV_LOG_ERROR, "Invalid probability run encountered.\n"); + av_log(rac->logctx, AV_LOG_ERROR, "Invalid probability run encountered.\n"); return AVERROR_INVALIDDATA; } if (prob > 256 - i) @@ -169,7 +189,7 @@ static int lag_read_prob_header(lag_rac *rac, GetBitContext *gb) } if (!cumul_prob) { - av_log(rac->avctx, AV_LOG_ERROR, "All probabilities are 0!\n"); + av_log(rac->logctx, AV_LOG_ERROR, "All probabilities are 0!\n"); return AVERROR_INVALIDDATA; } @@ -187,7 +207,7 @@ static int lag_read_prob_header(lag_rac *rac, GetBitContext *gb) scaled_cumul_prob += rac->prob[i]; } if (scaled_cumul_prob <= 0) { - av_log(rac->avctx, AV_LOG_ERROR, "Scaled probabilities invalid\n"); + av_log(rac->logctx, AV_LOG_ERROR, "Scaled probabilities invalid\n"); return AVERROR_INVALIDDATA; } for (; i < 257; i++) { @@ -201,7 +221,7 @@ static int lag_read_prob_header(lag_rac *rac, GetBitContext *gb) cumulative_target = 1U << scale_factor; if (scaled_cumul_prob > cumulative_target) { - av_log(rac->avctx, AV_LOG_ERROR, + av_log(rac->logctx, AV_LOG_ERROR, "Scaled probabilities are larger than target!\n"); return AVERROR_INVALIDDATA; } @@ -443,7 +463,7 @@ static int lag_decode_arith_plane(LagarithContext *l, uint8_t *dst, const uint8_t *src_end = src + src_size; int ret; - rac.avctx = l->avctx; + rac.logctx = l->avctx; l->zeros = 0; if(src_size < 2) @@ -720,10 +740,12 @@ static int lag_decode_frame(AVCodecContext *avctx, AVFrame *p, static av_cold int lag_decode_init(AVCodecContext *avctx) { + static AVOnce init_static_once = AV_ONCE_INIT; LagarithContext *l = avctx->priv_data; l->avctx = avctx; ff_llviddsp_init(&l->llviddsp); + ff_thread_once(&init_static_once, lag_init_static_data); return 0; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/lagarithrac.h b/arm/android/third_party/ffmpeg/libavcodec/lagarithrac.h index a31b054d..2c8cb738 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/lagarithrac.h +++ b/arm/android/third_party/ffmpeg/libavcodec/lagarithrac.h @@ -32,11 +32,10 @@ #include #include "libavutil/intreadwrite.h" -#include "avcodec.h" #include "get_bits.h" typedef struct lag_rac { - AVCodecContext *avctx; + void *logctx; unsigned low; unsigned range; unsigned scale; /**< Number of bits of precision in range. */ diff --git a/arm/android/third_party/ffmpeg/libavcodec/lcldec.c b/arm/android/third_party/ffmpeg/libavcodec/lcldec.c index ed78d9d5..b4304618 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/lcldec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/lcldec.c @@ -167,7 +167,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; LclDecContext * const c = avctx->priv_data; - unsigned int pixel_ptr; + ptrdiff_t pixel_ptr; int row, col; unsigned char *encoded = avpkt->data, *outptr; uint8_t *y_out, *u_out, *v_out; @@ -231,16 +231,19 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, break; case COMP_MSZH_NOCOMP: { int bppx2; + int aligned_width = width; switch (c->imgtype) { case IMGTYPE_YUV111: case IMGTYPE_RGB24: bppx2 = 6; break; case IMGTYPE_YUV422: + aligned_width &= ~3; case IMGTYPE_YUV211: bppx2 = 4; break; case IMGTYPE_YUV411: + aligned_width &= ~3; case IMGTYPE_YUV420: bppx2 = 3; break; @@ -248,7 +251,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, bppx2 = 0; // will error out below break; } - if (len < ((width * height * bppx2) >> 1)) + if (len < ((aligned_width * height * bppx2) >> 1)) return AVERROR_INVALIDDATA; break; } @@ -314,8 +317,8 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, } break; case IMGTYPE_YUV422: + pixel_ptr = 0; for (row = 0; row < height; row++) { - pixel_ptr = row * width * 2; yq = uq = vq =0; for (col = 0; col < width/4; col++) { encoded[pixel_ptr] = yq -= encoded[pixel_ptr]; @@ -331,8 +334,8 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, } break; case IMGTYPE_YUV411: + pixel_ptr = 0; for (row = 0; row < height; row++) { - pixel_ptr = row * width / 2 * 3; yq = uq = vq =0; for (col = 0; col < width/4; col++) { encoded[pixel_ptr] = yq -= encoded[pixel_ptr]; diff --git a/arm/android/third_party/ffmpeg/libavcodec/libaomdec.c b/arm/android/third_party/ffmpeg/libavcodec/libaomdec.c index 767c216a..695d9010 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/libaomdec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/libaomdec.c @@ -78,17 +78,17 @@ static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img) if (img->bit_depth == 8) { avctx->pix_fmt = img->monochrome ? AV_PIX_FMT_GRAY8 : AV_PIX_FMT_YUV420P; - avctx->profile = FF_PROFILE_AV1_MAIN; + avctx->profile = AV_PROFILE_AV1_MAIN; return 0; } else if (img->bit_depth == 10) { avctx->pix_fmt = img->monochrome ? AV_PIX_FMT_GRAY10 : AV_PIX_FMT_YUV420P10; - avctx->profile = FF_PROFILE_AV1_MAIN; + avctx->profile = AV_PROFILE_AV1_MAIN; return 0; } else if (img->bit_depth == 12) { avctx->pix_fmt = img->monochrome ? AV_PIX_FMT_GRAY12 : AV_PIX_FMT_YUV420P12; - avctx->profile = FF_PROFILE_AV1_PROFESSIONAL; + avctx->profile = AV_PROFILE_AV1_PROFESSIONAL; return 0; } else { return AVERROR_INVALIDDATA; @@ -97,15 +97,15 @@ static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img) case AOM_IMG_FMT_I42216: if (img->bit_depth == 8) { avctx->pix_fmt = AV_PIX_FMT_YUV422P; - avctx->profile = FF_PROFILE_AV1_PROFESSIONAL; + avctx->profile = AV_PROFILE_AV1_PROFESSIONAL; return 0; } else if (img->bit_depth == 10) { avctx->pix_fmt = AV_PIX_FMT_YUV422P10; - avctx->profile = FF_PROFILE_AV1_PROFESSIONAL; + avctx->profile = AV_PROFILE_AV1_PROFESSIONAL; return 0; } else if (img->bit_depth == 12) { avctx->pix_fmt = AV_PIX_FMT_YUV422P12; - avctx->profile = FF_PROFILE_AV1_PROFESSIONAL; + avctx->profile = AV_PROFILE_AV1_PROFESSIONAL; return 0; } else { return AVERROR_INVALIDDATA; @@ -115,18 +115,18 @@ static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img) if (img->bit_depth == 8) { avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ? AV_PIX_FMT_GBRP : AV_PIX_FMT_YUV444P; - avctx->profile = FF_PROFILE_AV1_HIGH; + avctx->profile = AV_PROFILE_AV1_HIGH; return 0; } else if (img->bit_depth == 10) { avctx->pix_fmt = AV_PIX_FMT_YUV444P10; avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ? AV_PIX_FMT_GBRP10 : AV_PIX_FMT_YUV444P10; - avctx->profile = FF_PROFILE_AV1_HIGH; + avctx->profile = AV_PROFILE_AV1_HIGH; return 0; } else if (img->bit_depth == 12) { avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ? AV_PIX_FMT_GBRP12 : AV_PIX_FMT_YUV444P12; - avctx->profile = FF_PROFILE_AV1_PROFESSIONAL; + avctx->profile = AV_PROFILE_AV1_PROFESSIONAL; return 0; } else { return AVERROR_INVALIDDATA; diff --git a/arm/android/third_party/ffmpeg/libavcodec/libaomenc.c b/arm/android/third_party/ffmpeg/libavcodec/libaomenc.c index 16747e7e..aa800834 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/libaomenc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/libaomenc.c @@ -451,16 +451,16 @@ static int set_pix_fmt(AVCodecContext *avctx, aom_codec_caps_t codec_caps, enccfg->monochrome = 1; /* Fall-through */ case AV_PIX_FMT_YUV420P: - enccfg->g_profile = FF_PROFILE_AV1_MAIN; + enccfg->g_profile = AV_PROFILE_AV1_MAIN; *img_fmt = AOM_IMG_FMT_I420; return 0; case AV_PIX_FMT_YUV422P: - enccfg->g_profile = FF_PROFILE_AV1_PROFESSIONAL; + enccfg->g_profile = AV_PROFILE_AV1_PROFESSIONAL; *img_fmt = AOM_IMG_FMT_I422; return 0; case AV_PIX_FMT_YUV444P: case AV_PIX_FMT_GBRP: - enccfg->g_profile = FF_PROFILE_AV1_HIGH; + enccfg->g_profile = AV_PROFILE_AV1_HIGH; *img_fmt = AOM_IMG_FMT_I444; return 0; case AV_PIX_FMT_GRAY10: @@ -471,7 +471,7 @@ static int set_pix_fmt(AVCodecContext *avctx, aom_codec_caps_t codec_caps, case AV_PIX_FMT_YUV420P12: if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) { enccfg->g_profile = - enccfg->g_bit_depth == 10 ? FF_PROFILE_AV1_MAIN : FF_PROFILE_AV1_PROFESSIONAL; + enccfg->g_bit_depth == 10 ? AV_PROFILE_AV1_MAIN : AV_PROFILE_AV1_PROFESSIONAL; *img_fmt = AOM_IMG_FMT_I42016; *flags |= AOM_CODEC_USE_HIGHBITDEPTH; return 0; @@ -480,7 +480,7 @@ static int set_pix_fmt(AVCodecContext *avctx, aom_codec_caps_t codec_caps, case AV_PIX_FMT_YUV422P10: case AV_PIX_FMT_YUV422P12: if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) { - enccfg->g_profile = FF_PROFILE_AV1_PROFESSIONAL; + enccfg->g_profile = AV_PROFILE_AV1_PROFESSIONAL; *img_fmt = AOM_IMG_FMT_I42216; *flags |= AOM_CODEC_USE_HIGHBITDEPTH; return 0; @@ -492,7 +492,7 @@ static int set_pix_fmt(AVCodecContext *avctx, aom_codec_caps_t codec_caps, case AV_PIX_FMT_GBRP12: if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) { enccfg->g_profile = - enccfg->g_bit_depth == 10 ? FF_PROFILE_AV1_HIGH : FF_PROFILE_AV1_PROFESSIONAL; + enccfg->g_bit_depth == 10 ? AV_PROFILE_AV1_HIGH : AV_PROFILE_AV1_PROFESSIONAL; *img_fmt = AOM_IMG_FMT_I44416; *flags |= AOM_CODEC_USE_HIGHBITDEPTH; return 0; @@ -842,7 +842,7 @@ static av_cold int aom_init(AVCodecContext *avctx, /* 0-3: For non-zero values the encoder increasingly optimizes for reduced * complexity playback on low powered devices at the expense of encode * quality. */ - if (avctx->profile != FF_PROFILE_UNKNOWN) + if (avctx->profile != AV_PROFILE_UNKNOWN) enccfg.g_profile = avctx->profile; enccfg.g_error_resilient = ctx->error_resilient; @@ -1018,7 +1018,7 @@ static av_cold int aom_init(AVCodecContext *avctx, if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) ctx->rawimg.bit_depth = enccfg.g_bit_depth; - cpb_props = ff_add_cpb_side_data(avctx); + cpb_props = ff_encode_add_cpb_side_data(avctx); if (!cpb_props) return AVERROR(ENOMEM); @@ -1299,7 +1299,7 @@ static int aom_encode(AVCodecContext *avctx, AVPacket *pkt, duration = frame->duration; else if (avctx->framerate.num > 0 && avctx->framerate.den > 0) duration = av_rescale_q(1, av_inv_q(avctx->framerate), avctx->time_base); - else + else { FF_DISABLE_DEPRECATION_WARNINGS duration = #if FF_API_TICKS_PER_FRAME @@ -1307,6 +1307,7 @@ FF_DISABLE_DEPRECATION_WARNINGS #endif 1; FF_ENABLE_DEPRECATION_WARNINGS + } switch (frame->color_range) { case AVCOL_RANGE_MPEG: diff --git a/arm/android/third_party/ffmpeg/libavcodec/libaribb24.c b/arm/android/third_party/ffmpeg/libavcodec/libaribb24.c index e3e244be..29479e37 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/libaribb24.c +++ b/arm/android/third_party/ffmpeg/libavcodec/libaribb24.c @@ -49,13 +49,13 @@ static unsigned int get_profile_font_size(AVCodecContext *avctx) Libaribb24Context *b24 = avctx->priv_data; int profile = avctx->profile; - if (profile == FF_PROFILE_UNKNOWN) + if (profile == AV_PROFILE_UNKNOWN) profile = b24->default_profile; switch (profile) { - case FF_PROFILE_ARIB_PROFILE_A: + case AV_PROFILE_ARIB_PROFILE_A: return 36; - case FF_PROFILE_ARIB_PROFILE_C: + case AV_PROFILE_ARIB_PROFILE_C: return 18; default: return 0; @@ -75,15 +75,15 @@ static int libaribb24_generate_ass_header(AVCodecContext *avctx) unsigned int font_size = 0; int profile = avctx->profile; - if (profile == FF_PROFILE_UNKNOWN) + if (profile == AV_PROFILE_UNKNOWN) profile = b24->default_profile; switch (profile) { - case FF_PROFILE_ARIB_PROFILE_A: + case AV_PROFILE_ARIB_PROFILE_A: plane_width = 960; plane_height = 540; break; - case FF_PROFILE_ARIB_PROFILE_C: + case AV_PROFILE_ARIB_PROFILE_C: plane_width = 320; plane_height = 180; break; @@ -147,12 +147,12 @@ static int libaribb24_init(AVCodecContext *avctx) { Libaribb24Context *b24 = avctx->priv_data; void(* arib_dec_init)(arib_decoder_t* decoder) = NULL; - int ret_code = AVERROR_EXTERNAL; + int ret; int profile = avctx->profile; if (!(b24->lib_instance = arib_instance_new(avctx))) { av_log(avctx, AV_LOG_ERROR, "Failed to initialize libaribb24!\n"); - goto init_fail; + return AVERROR_EXTERNAL; } if (b24->aribb24_base_path) { @@ -165,46 +165,35 @@ static int libaribb24_init(AVCodecContext *avctx) if (!(b24->parser = arib_get_parser(b24->lib_instance))) { av_log(avctx, AV_LOG_ERROR, "Failed to initialize libaribb24 PES parser!\n"); - goto init_fail; + return AVERROR_EXTERNAL; } if (!(b24->decoder = arib_get_decoder(b24->lib_instance))) { av_log(avctx, AV_LOG_ERROR, "Failed to initialize libaribb24 decoder!\n"); - goto init_fail; + return AVERROR_EXTERNAL; } - if (profile == FF_PROFILE_UNKNOWN) + if (profile == AV_PROFILE_UNKNOWN) profile = b24->default_profile; switch (profile) { - case FF_PROFILE_ARIB_PROFILE_A: + case AV_PROFILE_ARIB_PROFILE_A: arib_dec_init = arib_initialize_decoder_a_profile; break; - case FF_PROFILE_ARIB_PROFILE_C: + case AV_PROFILE_ARIB_PROFILE_C: arib_dec_init = arib_initialize_decoder_c_profile; break; default: av_log(avctx, AV_LOG_ERROR, "Unknown or unsupported profile set!\n"); - ret_code = AVERROR(EINVAL); - goto init_fail; + return AVERROR(EINVAL); } arib_dec_init(b24->decoder); - if (libaribb24_generate_ass_header(avctx) < 0) { - ret_code = AVERROR(ENOMEM); - goto init_fail; - } + ret = libaribb24_generate_ass_header(avctx); + if (ret < 0) + return ret; return 0; - -init_fail: - if (b24->decoder) - arib_finalize_decoder(b24->decoder); - - if (b24->lib_instance) - arib_instance_destroy(b24->lib_instance); - - return ret_code; } static int libaribb24_close(AVCodecContext *avctx) @@ -227,7 +216,7 @@ static int libaribb24_handle_regions(AVCodecContext *avctx, AVSubtitle *sub) Libaribb24Context *b24 = avctx->priv_data; const arib_buf_region_t *region = arib_decoder_get_regions(b24->decoder); unsigned int profile_font_size = get_profile_font_size(avctx); - AVBPrint buf = { 0 }; + AVBPrint buf; int ret = 0; av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED); @@ -390,9 +379,9 @@ static const AVOption options[] = { { "aribb24-skip-ruby-text", "skip ruby text blocks during decoding", OFFSET(aribb24_skip_ruby), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, SD }, { "default_profile", "default profile to use if not specified in the stream parameters", - OFFSET(default_profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, FF_PROFILE_ARIB_PROFILE_C, SD, "profile" }, - {"a", "Profile A", 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_ARIB_PROFILE_A}, INT_MIN, INT_MAX, SD, "profile"}, - {"c", "Profile C", 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_ARIB_PROFILE_C}, INT_MIN, INT_MAX, SD, "profile"}, + OFFSET(default_profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, AV_PROFILE_ARIB_PROFILE_C, SD, "profile" }, + {"a", "Profile A", 0, AV_OPT_TYPE_CONST, {.i64 = AV_PROFILE_ARIB_PROFILE_A}, INT_MIN, INT_MAX, SD, "profile"}, + {"c", "Profile C", 0, AV_OPT_TYPE_CONST, {.i64 = AV_PROFILE_ARIB_PROFILE_C}, INT_MIN, INT_MAX, SD, "profile"}, { NULL } }; @@ -410,7 +399,7 @@ const FFCodec ff_libaribb24_decoder = { .p.id = AV_CODEC_ID_ARIB_CAPTION, .p.priv_class = &aribb24_class, .p.wrapper_name = "libaribb24", - .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_NOT_INIT_THREADSAFE, .priv_data_size = sizeof(Libaribb24Context), .init = libaribb24_init, .close = libaribb24_close, diff --git a/arm/android/third_party/ffmpeg/libavcodec/libaribcaption.c b/arm/android/third_party/ffmpeg/libavcodec/libaribcaption.c index 747ca8a2..8a8c8f8c 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/libaribcaption.c +++ b/arm/android/third_party/ffmpeg/libavcodec/libaribcaption.c @@ -452,7 +452,7 @@ static int aribcaption_trans_bitmap_subtitle(ARIBCaptionContext *ctx) goto fail; } - if (ctx->avctx->profile == FF_PROFILE_ARIB_PROFILE_C) { + if (ctx->avctx->profile == AV_PROFILE_ARIB_PROFILE_C) { /* ARIB TR-B14 version 3.8 Fascicle 1-(2/2) Volume 3 [Section 4] */ /* No position information is provided for profile C */ rect->x = (ctx->frame_width - rect->w) / 2; @@ -594,7 +594,7 @@ static int aribcaption_trans_ass_subtitle(ARIBCaptionContext *ctx) /* ARIB TR-B14 version 3.8 Fascicle 1-(2/2) Volume 3 [Section 4] */ /* No position information is provided for profile C */ - if (ctx->avctx->profile == FF_PROFILE_ARIB_PROFILE_C) + if (ctx->avctx->profile == AV_PROFILE_ARIB_PROFILE_C) single_rect = true; sub->format = 1; /* text */ @@ -606,7 +606,7 @@ static int aribcaption_trans_ass_subtitle(ARIBCaptionContext *ctx) av_bprint_init(&buf, ARIBC_BPRINT_SIZE_INIT, ARIBC_BPRINT_SIZE_MAX); - if (single_rect && ctx->avctx->profile != FF_PROFILE_ARIB_PROFILE_C) { + if (single_rect && ctx->avctx->profile != AV_PROFILE_ARIB_PROFILE_C) { int x, y, rx, ry; x = ctx->plane_width; y = ctx->plane_height; @@ -660,7 +660,7 @@ static int aribcaption_trans_ass_subtitle(ARIBCaptionContext *ctx) for (int j = 0; j < region->char_count; j++) { aribcc_caption_char_t *ch = ®ion->chars[j]; - if (ctx->avctx->profile != FF_PROFILE_ARIB_PROFILE_C) { + if (ctx->avctx->profile != AV_PROFILE_ARIB_PROFILE_C) { if (ch->char_horizontal_spacing != char_horizontal_spacing) { av_bprintf(&buf, "{\\fsp%d}", (region->is_ruby) ? ch->char_horizontal_spacing / 2 : @@ -960,14 +960,14 @@ static int aribcaption_init(AVCodecContext *avctx) ctx->avctx = avctx; switch (avctx->profile) { - case FF_PROFILE_ARIB_PROFILE_A: + case AV_PROFILE_ARIB_PROFILE_A: profile = ARIBCC_PROFILE_A; /* assume 960x540 at initial state */ ctx->plane_width = 960; ctx->plane_height = 540; ctx->font_size = 36; break; - case FF_PROFILE_ARIB_PROFILE_C: + case AV_PROFILE_ARIB_PROFILE_C: profile = ARIBCC_PROFILE_C; ctx->plane_width = 320; ctx->plane_height = 180; diff --git a/arm/android/third_party/ffmpeg/libavcodec/libfdk-aacenc.c b/arm/android/third_party/ffmpeg/libavcodec/libfdk-aacenc.c index e08c6a0c..d400ac2e 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/libfdk-aacenc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/libfdk-aacenc.c @@ -179,7 +179,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) AACENC_InfoStruct info = { 0 }; CHANNEL_MODE mode; AACENC_ERROR err; - int aot = FF_PROFILE_AAC_LOW + 1; + int aot = AV_PROFILE_AAC_LOW + 1; int sce = 0, cpe = 0; if ((err = aacEncOpen(&s->handle, 0, avctx->ch_layout.nb_channels)) != AACENC_OK) { @@ -188,7 +188,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) goto error; } - if (avctx->profile != FF_PROFILE_UNKNOWN) + if (avctx->profile != AV_PROFILE_UNKNOWN) aot = avctx->profile + 1; if ((err = aacEncoder_SetParam(s->handle, AACENC_AOT, aot)) != AACENC_OK) { @@ -197,7 +197,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) goto error; } - if (aot == FF_PROFILE_AAC_ELD + 1 && s->eld_sbr) { + if (aot == AV_PROFILE_AAC_ELD + 1 && s->eld_sbr) { if ((err = aacEncoder_SetParam(s->handle, AACENC_SBR_MODE, 1)) != AACENC_OK) { av_log(avctx, AV_LOG_ERROR, "Unable to enable SBR for ELD: %s\n", @@ -227,7 +227,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) case 2: #if FDKENC_VER_AT_LEAST(4, 0) // 4.0.0 // (profile + 1) to map from profile range to AOT range - if (aot == FF_PROFILE_AAC_ELD + 1 && s->eld_v2) { + if (aot == AV_PROFILE_AAC_ELD + 1 && s->eld_v2) { if ((err = aacEncoder_SetParam(s->handle, AACENC_CHANNELMODE, 128)) != AACENC_OK) { av_log(avctx, AV_LOG_ERROR, "Unable to enable ELDv2: %s\n", @@ -310,14 +310,14 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) } } else { if (avctx->bit_rate <= 0) { - if (avctx->profile == FF_PROFILE_AAC_HE_V2) { + if (avctx->profile == AV_PROFILE_AAC_HE_V2) { sce = 1; cpe = 0; } avctx->bit_rate = (96*sce + 128*cpe) * avctx->sample_rate / 44; - if (avctx->profile == FF_PROFILE_AAC_HE || - avctx->profile == FF_PROFILE_AAC_HE_V2 || - avctx->profile == FF_PROFILE_MPEG2_AAC_HE || + if (avctx->profile == AV_PROFILE_AAC_HE || + avctx->profile == AV_PROFILE_AAC_HE_V2 || + avctx->profile == AV_PROFILE_MPEG2_AAC_HE || s->eld_sbr) avctx->bit_rate /= 2; } @@ -544,12 +544,12 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, } static const AVProfile profiles[] = { - { FF_PROFILE_AAC_LOW, "LC" }, - { 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 }, + { AV_PROFILE_AAC_LOW, "LC" }, + { AV_PROFILE_AAC_HE, "HE-AAC" }, + { AV_PROFILE_AAC_HE_V2, "HE-AACv2" }, + { AV_PROFILE_AAC_LD, "LD" }, + { AV_PROFILE_AAC_ELD, "ELD" }, + { AV_PROFILE_UNKNOWN }, }; static const FFCodecDefault aac_encode_defaults[] = { diff --git a/arm/android/third_party/ffmpeg/libavcodec/libjxldec.c b/arm/android/third_party/ffmpeg/libavcodec/libjxldec.c index e45ac02c..002740d9 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/libjxldec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/libjxldec.c @@ -58,6 +58,7 @@ typedef struct LibJxlDecodeContext { int64_t frame_duration; int prev_is_last; AVRational timebase; + AVFrame *frame; } LibJxlDecodeContext; static int libjxl_init_jxl_decoder(AVCodecContext *avctx) @@ -104,6 +105,9 @@ static av_cold int libjxl_decode_init(AVCodecContext *avctx) ctx->avpkt = avctx->internal->in_pkt; ctx->pts = 0; + ctx->frame = av_frame_alloc(); + if (!ctx->frame) + return AVERROR(ENOMEM); return libjxl_init_jxl_decoder(avctx); } @@ -298,7 +302,7 @@ static int libjxl_color_encoding_event(AVCodecContext *avctx, AVFrame *frame) } avctx->color_range = frame->color_range = AVCOL_RANGE_JPEG; - if (ctx->jxl_pixfmt.num_channels >= 3) + if (ctx->basic_info.num_color_channels > 1) avctx->colorspace = AVCOL_SPC_RGB; avctx->color_primaries = AVCOL_PRI_UNSPECIFIED; avctx->color_trc = AVCOL_TRC_UNSPECIFIED; @@ -334,7 +338,7 @@ static int libjxl_color_encoding_event(AVCodecContext *avctx, AVFrame *frame) } /* all colors will be in-gamut so we want accurate colors */ jxl_color.rendering_intent = JXL_RENDERING_INTENT_RELATIVE; - jxl_color.color_space = avctx->colorspace == AVCOL_SPC_RGB ? JXL_COLOR_SPACE_RGB : JXL_COLOR_SPACE_GRAY; + jxl_color.color_space = ctx->basic_info.num_color_channels > 1 ? JXL_COLOR_SPACE_RGB : JXL_COLOR_SPACE_GRAY; jret = JxlDecoderSetPreferredColorProfile(ctx->decoder, &jxl_color); if (jret != JXL_DEC_SUCCESS) { av_log(avctx, AV_LOG_WARNING, "Unable to set fallback color encoding\n"); @@ -406,10 +410,6 @@ static int libjxl_receive_frame(AVCodecContext *avctx, AVFrame *frame) return AVERROR_INVALIDDATA; case JXL_DEC_NEED_MORE_INPUT: av_log(avctx, AV_LOG_DEBUG, "NEED_MORE_INPUT event emitted\n"); - if (!pkt->size) { - av_packet_unref(pkt); - return AVERROR(EAGAIN); - } continue; case JXL_DEC_BASIC_INFO: av_log(avctx, AV_LOG_DEBUG, "BASIC_INFO event emitted\n"); @@ -438,16 +438,19 @@ static int libjxl_receive_frame(AVCodecContext *avctx, AVFrame *frame) continue; case JXL_DEC_COLOR_ENCODING: av_log(avctx, AV_LOG_DEBUG, "COLOR_ENCODING event emitted\n"); - if ((ret = libjxl_color_encoding_event(avctx, frame)) < 0) + ret = libjxl_color_encoding_event(avctx, ctx->frame); + if (ret < 0) return ret; continue; case JXL_DEC_NEED_IMAGE_OUT_BUFFER: av_log(avctx, AV_LOG_DEBUG, "NEED_IMAGE_OUT_BUFFER event emitted\n"); - if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) + ret = ff_get_buffer(avctx, ctx->frame, 0); + if (ret < 0) return ret; - ctx->jxl_pixfmt.align = frame->linesize[0]; - if (JxlDecoderSetImageOutBuffer(ctx->decoder, &ctx->jxl_pixfmt, frame->data[0], frame->buf[0]->size) - != JXL_DEC_SUCCESS) { + ctx->jxl_pixfmt.align = ctx->frame->linesize[0]; + if (JxlDecoderSetImageOutBuffer(ctx->decoder, &ctx->jxl_pixfmt, + ctx->frame->data[0], ctx->frame->buf[0]->size) + != JXL_DEC_SUCCESS) { av_log(avctx, AV_LOG_ERROR, "Bad libjxl dec need image out buffer event\n"); return AVERROR_EXTERNAL; } @@ -461,8 +464,8 @@ static int libjxl_receive_frame(AVCodecContext *avctx, AVFrame *frame) case JXL_DEC_FRAME: av_log(avctx, AV_LOG_DEBUG, "FRAME event emitted\n"); if (!ctx->basic_info.have_animation || ctx->prev_is_last) { - frame->pict_type = AV_PICTURE_TYPE_I; - frame->flags |= AV_FRAME_FLAG_KEY; + ctx->frame->pict_type = AV_PICTURE_TYPE_I; + ctx->frame->flags |= AV_FRAME_FLAG_KEY; } if (ctx->basic_info.have_animation) { JxlFrameHeader header; @@ -481,20 +484,21 @@ static int libjxl_receive_frame(AVCodecContext *avctx, AVFrame *frame) /* full image is one frame, even if animated */ av_log(avctx, AV_LOG_DEBUG, "FULL_IMAGE event emitted\n"); if (ctx->iccp) { - AVFrameSideData *sd = av_frame_new_side_data_from_buf(frame, AV_FRAME_DATA_ICC_PROFILE, ctx->iccp); + AVFrameSideData *sd = av_frame_new_side_data_from_buf(ctx->frame, AV_FRAME_DATA_ICC_PROFILE, ctx->iccp); if (!sd) return AVERROR(ENOMEM); /* ownership is transfered, and it is not ref-ed */ ctx->iccp = NULL; } if (avctx->pkt_timebase.num) { - frame->pts = av_rescale_q(ctx->pts, ctx->timebase, avctx->pkt_timebase); - frame->duration = av_rescale_q(ctx->frame_duration, ctx->timebase, avctx->pkt_timebase); + ctx->frame->pts = av_rescale_q(ctx->pts, ctx->timebase, avctx->pkt_timebase); + ctx->frame->duration = av_rescale_q(ctx->frame_duration, ctx->timebase, avctx->pkt_timebase); } else { - frame->pts = ctx->pts; - frame->duration = ctx->frame_duration; + ctx->frame->pts = ctx->pts; + ctx->frame->duration = ctx->frame_duration; } ctx->pts += ctx->frame_duration; + av_frame_move_ref(frame, ctx->frame); return 0; case JXL_DEC_SUCCESS: av_log(avctx, AV_LOG_DEBUG, "SUCCESS event emitted\n"); @@ -525,6 +529,7 @@ static av_cold int libjxl_decode_close(AVCodecContext *avctx) JxlDecoderDestroy(ctx->decoder); ctx->decoder = NULL; av_buffer_unref(&ctx->iccp); + av_frame_free(&ctx->frame); return 0; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/libkvazaar.c b/arm/android/third_party/ffmpeg/libavcodec/libkvazaar.c index 2ef34dd8..0ebf3760 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/libkvazaar.c +++ b/arm/android/third_party/ffmpeg/libavcodec/libkvazaar.c @@ -221,9 +221,9 @@ static int libkvazaar_encode(AVCodecContext *avctx, frame->width / 2, 0 }; - av_image_copy(dst, dst_linesizes, - (const uint8_t **)frame->data, frame->linesize, - frame->format, frame->width, frame->height); + av_image_copy2(dst, dst_linesizes, + frame->data, frame->linesize, + frame->format, frame->width, frame->height); } input_pic->pts = frame->pts; diff --git a/arm/android/third_party/ffmpeg/libavcodec/libopenh264dec.c b/arm/android/third_party/ffmpeg/libavcodec/libopenh264dec.c index af53219b..7d650ae0 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/libopenh264dec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/libopenh264dec.c @@ -141,7 +141,8 @@ static int svc_decode_frame(AVCodecContext *avctx, AVFrame *avframe, linesize[0] = info.UsrData.sSystemBuffer.iStride[0]; linesize[1] = linesize[2] = info.UsrData.sSystemBuffer.iStride[1]; linesize[3] = 0; - av_image_copy(avframe->data, avframe->linesize, (const uint8_t **) ptrs, linesize, avctx->pix_fmt, avctx->width, avctx->height); + av_image_copy2(avframe->data, avframe->linesize, ptrs, linesize, + avctx->pix_fmt, avctx->width, avctx->height); avframe->pts = info.uiOutYuvTimeStamp; avframe->pkt_dts = AV_NOPTS_VALUE; diff --git a/arm/android/third_party/ffmpeg/libavcodec/libopenh264enc.c b/arm/android/third_party/ffmpeg/libavcodec/libopenh264enc.c index 5b59af6f..f518d089 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/libopenh264enc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/libopenh264enc.c @@ -61,11 +61,11 @@ typedef struct SVCContext { #define DEPRECATED AV_OPT_FLAG_DEPRECATED static const AVOption options[] = { { "loopfilter", "enable loop filter", OFFSET(loopfilter), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE }, - { "profile", "set profile restrictions", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, 0xffff, VE, "profile" }, + { "profile", "set profile restrictions", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, 0xffff, VE, "profile" }, #define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, { .i64 = value }, 0, 0, VE, "profile" - { PROFILE("constrained_baseline", FF_PROFILE_H264_CONSTRAINED_BASELINE) }, - { PROFILE("main", FF_PROFILE_H264_MAIN) }, - { PROFILE("high", FF_PROFILE_H264_HIGH) }, + { PROFILE("constrained_baseline", AV_PROFILE_H264_CONSTRAINED_BASELINE) }, + { PROFILE("main", AV_PROFILE_H264_MAIN) }, + { PROFILE("high", AV_PROFILE_H264_HIGH) }, #undef PROFILE { "max_nal_size", "set maximum NAL size in bytes", OFFSET(max_nal_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE }, { "allow_skip_frames", "allow skipping frames to hit the target bitrate", OFFSET(skip_frames), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, @@ -177,12 +177,12 @@ FF_ENABLE_DEPRECATION_WARNINGS param.iMultipleThreadIdc = avctx->thread_count; /* Allow specifying the libopenh264 profile through AVCodecContext. */ - if (FF_PROFILE_UNKNOWN == s->profile && - FF_PROFILE_UNKNOWN != avctx->profile) + if (AV_PROFILE_UNKNOWN == s->profile && + AV_PROFILE_UNKNOWN != avctx->profile) switch (avctx->profile) { - case FF_PROFILE_H264_HIGH: - case FF_PROFILE_H264_MAIN: - case FF_PROFILE_H264_CONSTRAINED_BASELINE: + case AV_PROFILE_H264_HIGH: + case AV_PROFILE_H264_MAIN: + case AV_PROFILE_H264_CONSTRAINED_BASELINE: s->profile = avctx->profile; break; default: @@ -191,34 +191,34 @@ FF_ENABLE_DEPRECATION_WARNINGS break; } - if (s->profile == FF_PROFILE_UNKNOWN && s->coder >= 0) - s->profile = s->coder == 0 ? FF_PROFILE_H264_CONSTRAINED_BASELINE : + if (s->profile == AV_PROFILE_UNKNOWN && s->coder >= 0) + s->profile = s->coder == 0 ? AV_PROFILE_H264_CONSTRAINED_BASELINE : #if OPENH264_VER_AT_LEAST(1, 8) - FF_PROFILE_H264_HIGH; + AV_PROFILE_H264_HIGH; #else - FF_PROFILE_H264_MAIN; + AV_PROFILE_H264_MAIN; #endif switch (s->profile) { - case FF_PROFILE_H264_HIGH: + case AV_PROFILE_H264_HIGH: av_log(avctx, AV_LOG_VERBOSE, "Using %s, " "select EProfileIdc PRO_HIGH in libopenh264.\n", param.iEntropyCodingModeFlag ? "CABAC" : "CAVLC"); break; - case FF_PROFILE_H264_MAIN: + case AV_PROFILE_H264_MAIN: av_log(avctx, AV_LOG_VERBOSE, "Using %s, " "select EProfileIdc PRO_MAIN in libopenh264.\n", param.iEntropyCodingModeFlag ? "CABAC" : "CAVLC"); break; - case FF_PROFILE_H264_CONSTRAINED_BASELINE: - case FF_PROFILE_UNKNOWN: - s->profile = FF_PROFILE_H264_CONSTRAINED_BASELINE; + case AV_PROFILE_H264_CONSTRAINED_BASELINE: + case AV_PROFILE_UNKNOWN: + s->profile = AV_PROFILE_H264_CONSTRAINED_BASELINE; param.iEntropyCodingModeFlag = 0; av_log(avctx, AV_LOG_VERBOSE, "Using CAVLC, " "select EProfileIdc PRO_BASELINE in libopenh264.\n"); break; default: - s->profile = FF_PROFILE_H264_CONSTRAINED_BASELINE; + s->profile = AV_PROFILE_H264_CONSTRAINED_BASELINE; param.iEntropyCodingModeFlag = 0; av_log(avctx, AV_LOG_WARNING, "Unsupported profile, " "select EProfileIdc PRO_BASELINE in libopenh264.\n"); @@ -353,7 +353,7 @@ FF_ENABLE_DEPRECATION_WARNINGS memcpy(avctx->extradata, fbi.sLayerInfo[0].pBsBuf, size); } - props = ff_add_cpb_side_data(avctx); + props = ff_encode_add_cpb_side_data(avctx); if (!props) return AVERROR(ENOMEM); props->max_bitrate = param.iMaxBitrate; diff --git a/arm/android/third_party/ffmpeg/libavcodec/libsvtav1.c b/arm/android/third_party/ffmpeg/libavcodec/libsvtav1.c index f2b73361..50151692 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/libsvtav1.c +++ b/arm/android/third_party/ffmpeg/libavcodec/libsvtav1.c @@ -236,10 +236,10 @@ static int config_enc_params(EbSvtAv1EncConfiguration *param, } #endif - if (avctx->profile != FF_PROFILE_UNKNOWN) + if (avctx->profile != AV_PROFILE_UNKNOWN) param->profile = avctx->profile; - if (avctx->level != FF_LEVEL_UNKNOWN) + if (avctx->level != AV_LEVEL_UNKNOWN) param->level = avctx->level; // gop_size == 1 case is handled when encoding each frame by setting @@ -310,12 +310,12 @@ FF_ENABLE_DEPRECATION_WARNINGS } if ((param->encoder_color_format == EB_YUV422 || param->encoder_bit_depth > 10) - && param->profile != FF_PROFILE_AV1_PROFESSIONAL ) { + && param->profile != AV_PROFILE_AV1_PROFESSIONAL ) { av_log(avctx, AV_LOG_WARNING, "Forcing Professional profile\n"); - param->profile = FF_PROFILE_AV1_PROFESSIONAL; - } else if (param->encoder_color_format == EB_YUV444 && param->profile != FF_PROFILE_AV1_HIGH) { + param->profile = AV_PROFILE_AV1_PROFESSIONAL; + } else if (param->encoder_color_format == EB_YUV444 && param->profile != AV_PROFILE_AV1_HIGH) { av_log(avctx, AV_LOG_WARNING, "Forcing High profile\n"); - param->profile = FF_PROFILE_AV1_HIGH; + param->profile = AV_PROFILE_AV1_HIGH; } avctx->bit_rate = param->rate_control_mode > 0 ? @@ -325,7 +325,7 @@ FF_ENABLE_DEPRECATION_WARNINGS FFMAX(avctx->bit_rate, avctx->rc_max_rate) / 1000LL; if (avctx->bit_rate || avctx->rc_max_rate || avctx->rc_buffer_size) { - AVCPBProperties *cpb_props = ff_add_cpb_side_data(avctx); + AVCPBProperties *cpb_props = ff_encode_add_cpb_side_data(avctx); if (!cpb_props) return AVERROR(ENOMEM); diff --git a/arm/android/third_party/ffmpeg/libavcodec/libvpxdec.c b/arm/android/third_party/ffmpeg/libavcodec/libvpxdec.c index f480545a..c6187fd5 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/libvpxdec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/libvpxdec.c @@ -127,26 +127,26 @@ static int set_pix_fmt(AVCodecContext *avctx, struct vpx_image *img, switch (img->fmt) { case VPX_IMG_FMT_I420: if (avctx->codec_id == AV_CODEC_ID_VP9) - avctx->profile = FF_PROFILE_VP9_0; + avctx->profile = AV_PROFILE_VP9_0; avctx->pix_fmt = has_alpha_channel ? AV_PIX_FMT_YUVA420P : AV_PIX_FMT_YUV420P; return 0; #if CONFIG_LIBVPX_VP9_DECODER case VPX_IMG_FMT_I422: - avctx->profile = FF_PROFILE_VP9_1; + avctx->profile = AV_PROFILE_VP9_1; avctx->pix_fmt = AV_PIX_FMT_YUV422P; return 0; case VPX_IMG_FMT_I440: - avctx->profile = FF_PROFILE_VP9_1; + avctx->profile = AV_PROFILE_VP9_1; avctx->pix_fmt = AV_PIX_FMT_YUV440P; return 0; case VPX_IMG_FMT_I444: - avctx->profile = FF_PROFILE_VP9_1; + avctx->profile = AV_PROFILE_VP9_1; avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ? AV_PIX_FMT_GBRP : AV_PIX_FMT_YUV444P; return 0; case VPX_IMG_FMT_I42016: - avctx->profile = FF_PROFILE_VP9_2; + avctx->profile = AV_PROFILE_VP9_2; if (img->bit_depth == 10) { avctx->pix_fmt = AV_PIX_FMT_YUV420P10; return 0; @@ -157,7 +157,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; + avctx->profile = AV_PROFILE_VP9_3; if (img->bit_depth == 10) { avctx->pix_fmt = AV_PIX_FMT_YUV422P10; return 0; @@ -168,7 +168,7 @@ static int set_pix_fmt(AVCodecContext *avctx, struct vpx_image *img, return AVERROR_INVALIDDATA; } case VPX_IMG_FMT_I44016: - avctx->profile = FF_PROFILE_VP9_3; + avctx->profile = AV_PROFILE_VP9_3; if (img->bit_depth == 10) { avctx->pix_fmt = AV_PIX_FMT_YUV440P10; return 0; @@ -179,7 +179,7 @@ static int set_pix_fmt(AVCodecContext *avctx, struct vpx_image *img, return AVERROR_INVALIDDATA; } case VPX_IMG_FMT_I44416: - avctx->profile = FF_PROFILE_VP9_3; + avctx->profile = AV_PROFILE_VP9_3; if (img->bit_depth == 10) { avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ? AV_PIX_FMT_GBRP10 : AV_PIX_FMT_YUV444P10; @@ -317,10 +317,8 @@ static int vpx_decode(AVCodecContext *avctx, AVFrame *picture, return AVERROR(ENOMEM); if (ctx->has_alpha_channel) { picture->buf[1] = av_buffer_ref(img_alpha->fb_priv); - if (!picture->buf[1]) { - av_frame_unref(picture); + if (!picture->buf[1]) return AVERROR(ENOMEM); - } } for (int i = 0; i < 4; i++) { picture->data[i] = planes[i]; @@ -329,8 +327,8 @@ static int vpx_decode(AVCodecContext *avctx, AVFrame *picture, } else { if ((ret = ff_get_buffer(avctx, picture, 0)) < 0) return ret; - av_image_copy(picture->data, picture->linesize, (const uint8_t**)planes, - linesizes, avctx->pix_fmt, img->d_w, img->d_h); + av_image_copy2(picture->data, picture->linesize, planes, + linesizes, avctx->pix_fmt, img->d_w, img->d_h); } *got_frame = 1; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/libvpxenc.c b/arm/android/third_party/ffmpeg/libavcodec/libvpxenc.c index 549ac55a..80988a26 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/libvpxenc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/libvpxenc.c @@ -1145,7 +1145,7 @@ static av_cold int vpx_init(AVCodecContext *avctx, /* 0-3: For non-zero values the encoder increasingly optimizes for reduced complexity playback on low powered devices at the expense of encode quality. */ - if (avctx->profile != FF_PROFILE_UNKNOWN) + if (avctx->profile != AV_PROFILE_UNKNOWN) enccfg.g_profile = avctx->profile; enccfg.g_error_resilient = ctx->error_resilient || ctx->flags & VP8F_ERROR_RESILIENT; @@ -1273,7 +1273,7 @@ static av_cold int vpx_init(AVCodecContext *avctx, ctx->rawimg.bit_depth = enccfg.g_bit_depth; #endif - cpb_props = ff_add_cpb_side_data(avctx); + cpb_props = ff_encode_add_cpb_side_data(avctx); if (!cpb_props) return AVERROR(ENOMEM); @@ -1830,7 +1830,7 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket *pkt, duration = frame->duration; else if (avctx->framerate.num > 0 && avctx->framerate.den > 0) duration = av_rescale_q(1, av_inv_q(avctx->framerate), avctx->time_base); - else + else { FF_DISABLE_DEPRECATION_WARNINGS duration = #if FF_API_TICKS_PER_FRAME @@ -1838,6 +1838,7 @@ FF_DISABLE_DEPRECATION_WARNINGS #endif 1; FF_ENABLE_DEPRECATION_WARNINGS + } res = vpx_codec_encode(&ctx->encoder, rawimg, timestamp, duration, flags, ctx->deadline); diff --git a/arm/android/third_party/ffmpeg/libavcodec/libx264.c b/arm/android/third_party/ffmpeg/libavcodec/libx264.c index 774c23da..a505b7eb 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/libx264.c +++ b/arm/android/third_party/ffmpeg/libavcodec/libx264.c @@ -30,6 +30,7 @@ #include "libavutil/stereo3d.h" #include "libavutil/time.h" #include "libavutil/intreadwrite.h" +#include "libavutil/video_hint.h" #include "avcodec.h" #include "codec_internal.h" #include "encode.h" @@ -48,6 +49,9 @@ // from x264.h, for quant_offsets, Macroblocks are 16x16 // blocks of pixels (with respect to the luma plane) #define MB_SIZE 16 +#define MB_LSIZE 4 +#define MB_FLOOR(x) ((x) >> (MB_LSIZE)) +#define MB_CEIL(x) MB_FLOOR((x) + (MB_SIZE - 1)) typedef struct X264Opaque { #if FF_API_REORDERED_OPAQUE @@ -123,6 +127,8 @@ typedef struct X264Context { * encounter a frame with ROI side data. */ int roi_warned; + + int mb_info; } X264Context; static void X264_log(void *p, int level, const char *fmt, va_list args) @@ -295,6 +301,7 @@ static void free_picture(x264_picture_t *pic) av_free(pic->extra_sei.payloads[i].payload); av_freep(&pic->extra_sei.payloads); av_freep(&pic->prop.quant_offsets); + av_freep(&pic->prop.mb_info); pic->extra_sei.num_payloads = 0; } @@ -320,6 +327,74 @@ static enum AVPixelFormat csp_to_pixfmt(int csp) return AV_PIX_FMT_NONE; } +static void av_always_inline mbinfo_compute_changed_coords(const AVVideoRect *rect, + int *min_x, + int *max_x, + int *min_y, + int *max_y) +{ + *min_y = MB_FLOOR(rect->y); + *max_y = MB_CEIL(rect->y + rect->height); + *min_x = MB_FLOOR(rect->x); + *max_x = MB_CEIL(rect->x + rect->width); +} + +static void av_always_inline mbinfo_compute_constant_coords(const AVVideoRect *rect, + int *min_x, + int *max_x, + int *min_y, + int *max_y) +{ + *min_y = MB_CEIL(rect->y); + *max_y = MB_FLOOR(rect->y + rect->height); + *min_x = MB_CEIL(rect->x); + *max_x = MB_FLOOR(rect->x + rect->width); +} + +static int setup_mb_info(AVCodecContext *ctx, x264_picture_t *pic, + const AVFrame *frame, + const AVVideoHint *info) +{ + int mb_width = (frame->width + MB_SIZE - 1) / MB_SIZE; + int mb_height = (frame->height + MB_SIZE - 1) / MB_SIZE; + + const AVVideoRect *mbinfo_rects; + int nb_rects; + uint8_t *mbinfo; + + mbinfo_rects = (const AVVideoRect *)av_video_hint_rects(info); + nb_rects = info->nb_rects; + + mbinfo = av_calloc(mb_width * mb_height, sizeof(*mbinfo)); + if (!mbinfo) + return AVERROR(ENOMEM); + +#define COMPUTE_MBINFO(mbinfo_filler_, mbinfo_marker_, compute_coords_fn_) \ + memset(mbinfo, mbinfo_filler_, sizeof(*mbinfo) * mb_width * mb_height); \ + \ + for (int i = 0; i < nb_rects; i++) { \ + int min_x, max_x, min_y, max_y; \ + \ + compute_coords_fn_(mbinfo_rects, &min_x, &max_x, &min_y, &max_y); \ + for (int mb_y = min_y; mb_y < max_y; ++mb_y) { \ + memset(mbinfo + mb_y * mb_width + min_x, mbinfo_marker_, max_x - min_x); \ + } \ + \ + mbinfo_rects++; \ + } \ + + if (info->type == AV_VIDEO_HINT_TYPE_CHANGED) { + COMPUTE_MBINFO(X264_MBINFO_CONSTANT, 0, mbinfo_compute_changed_coords); + } else /* if (info->type == AV_VIDEO_HINT_TYPE_CHANGED) */ { + COMPUTE_MBINFO(0, X264_MBINFO_CONSTANT, mbinfo_compute_constant_coords); + } + + pic->prop.mb_info = mbinfo; + pic->prop.mb_info_free = av_free; + + return 0; +} + static int setup_roi(AVCodecContext *ctx, x264_picture_t *pic, int bit_depth, const AVFrame *frame, const uint8_t *data, size_t size) { @@ -404,6 +479,7 @@ static int setup_frame(AVCodecContext *ctx, const AVFrame *frame, int64_t wallclock = 0; int bit_depth, ret; AVFrameSideData *sd; + AVFrameSideData *mbinfo_sd; *ppic = NULL; if (!frame) @@ -495,7 +571,7 @@ FF_ENABLE_DEPRECATION_WARNINGS sei->payloads[0].payload_size = sei_size; sei->payloads[0].payload = sei_data; - sei->payloads[0].payload_type = 4; + sei->payloads[0].payload_type = SEI_TYPE_USER_DATA_REGISTERED_ITU_T_T35; sei->num_payloads = 1; } } @@ -507,6 +583,17 @@ FF_ENABLE_DEPRECATION_WARNINGS goto fail; } + mbinfo_sd = av_frame_get_side_data(frame, AV_FRAME_DATA_VIDEO_HINT); + if (mbinfo_sd) { + int ret = setup_mb_info(ctx, pic, frame, (const AVVideoHint *)mbinfo_sd->data); + if (ret < 0) { + /* No need to fail here, this is not fatal. We just proceed with no + * mb_info and log a message */ + + av_log(ctx, AV_LOG_WARNING, "setup_mb_info failed with error: %s\n", av_err2str(ret)); + } + } + if (x4->udu_sei) { for (int j = 0; j < frame->nb_side_data; j++) { AVFrameSideData *side_data = frame->side_data[j]; @@ -977,22 +1064,22 @@ static av_cold int X264_init(AVCodecContext *avctx) /* Allow specifying the x264 profile through AVCodecContext. */ if (!x4->profile) switch (avctx->profile) { - case FF_PROFILE_H264_BASELINE: + case AV_PROFILE_H264_BASELINE: x4->profile = "baseline"; break; - case FF_PROFILE_H264_HIGH: + case AV_PROFILE_H264_HIGH: x4->profile = "high"; break; - case FF_PROFILE_H264_HIGH_10: + case AV_PROFILE_H264_HIGH_10: x4->profile = "high10"; break; - case FF_PROFILE_H264_HIGH_422: + case AV_PROFILE_H264_HIGH_422: x4->profile = "high422"; break; - case FF_PROFILE_H264_HIGH_444: + case AV_PROFILE_H264_HIGH_444: x4->profile = "high444"; break; - case FF_PROFILE_H264_MAIN: + case AV_PROFILE_H264_MAIN: x4->profile = "main"; break; default: @@ -1118,6 +1205,8 @@ FF_ENABLE_DEPRECATION_WARNINGS } } + x4->params.analyse.b_mb_info = x4->mb_info; + // update AVCodecContext with x264 parameters avctx->has_b_frames = x4->params.i_bframe ? x4->params.i_bframe_pyramid ? 2 : 1 : 0; @@ -1157,7 +1246,7 @@ FF_ENABLE_DEPRECATION_WARNINGS avctx->extradata_size = p - avctx->extradata; } - cpb_props = ff_add_cpb_side_data(avctx); + cpb_props = ff_encode_add_cpb_side_data(avctx); if (!cpb_props) return AVERROR(ENOMEM); cpb_props->buffer_size = x4->params.rc.i_vbv_buffer_size * 1000; @@ -1327,6 +1416,7 @@ static const AVOption options[] = { { "noise_reduction", "Noise reduction", OFFSET(noise_reduction), AV_OPT_TYPE_INT, { .i64 = -1 }, INT_MIN, INT_MAX, VE }, { "udu_sei", "Use user data unregistered SEI if available", OFFSET(udu_sei), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, { "x264-params", "Override the x264 configuration using a :-separated list of key=value parameters", OFFSET(x264_params), AV_OPT_TYPE_DICT, { 0 }, 0, 0, VE }, + { "mb_info", "Set mb_info data through AVSideData, only useful when used from the API", OFFSET(mb_info), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, { NULL }, }; diff --git a/arm/android/third_party/ffmpeg/libavcodec/libx265.c b/arm/android/third_party/ffmpeg/libavcodec/libx265.c index 873b3021..447e6da2 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/libx265.c +++ b/arm/android/third_party/ffmpeg/libavcodec/libx265.c @@ -395,7 +395,7 @@ FF_ENABLE_DEPRECATION_WARNINGS ctx->params->rc.vbvBufferSize = avctx->rc_buffer_size / 1000; ctx->params->rc.vbvMaxBitrate = avctx->rc_max_rate / 1000; - cpb_props = ff_add_cpb_side_data(avctx); + cpb_props = ff_encode_add_cpb_side_data(avctx); if (!cpb_props) return AVERROR(ENOMEM); cpb_props->buffer_size = ctx->params->rc.vbvBufferSize * 1000; diff --git a/arm/android/third_party/ffmpeg/libavcodec/magicyuv.c b/arm/android/third_party/ffmpeg/libavcodec/magicyuv.c index 7898cd5b..3573db0f 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/magicyuv.c +++ b/arm/android/third_party/ffmpeg/libavcodec/magicyuv.c @@ -34,6 +34,8 @@ #include "lossless_videodsp.h" #include "thread.h" +#define VLC_BITS 12 + typedef struct Slice { uint32_t start; uint32_t size; @@ -67,15 +69,20 @@ typedef struct MagicYUVContext { Slice *slices[4]; // slice bitstream positions for each plane unsigned int slices_size[4]; // slice sizes for each plane VLC vlc[4]; // VLC for each plane + VLC_MULTI multi[4]; // Buffer for joint VLC data int (*magy_decode_slice)(AVCodecContext *avctx, void *tdata, int j, int threadnr); LLVidDSPContext llviddsp; + HuffEntry he[1 << 14]; + uint8_t len[1 << 14]; } MagicYUVContext; -static int huff_build(const uint8_t len[], uint16_t codes_pos[33], - VLC *vlc, int nb_elems, void *logctx) +static int huff_build(AVCodecContext *avctx, + const uint8_t len[], uint16_t codes_pos[33], + VLC *vlc, VLC_MULTI *multi, int nb_elems, void *logctx) { - HuffEntry he[4096]; + MagicYUVContext *s = avctx->priv_data; + HuffEntry *he = s->he; for (int i = 31; i > 0; i--) codes_pos[i] += codes_pos[i + 1]; @@ -83,8 +90,9 @@ static int huff_build(const uint8_t len[], uint16_t codes_pos[33], for (unsigned i = nb_elems; i-- > 0;) he[--codes_pos[len[i]]] = (HuffEntry){ len[i], i }; - ff_free_vlc(vlc); - return ff_init_vlc_from_lengths(vlc, FFMIN(he[0].len, 12), nb_elems, + ff_vlc_free(vlc); + ff_vlc_free_multi(multi); + return ff_vlc_init_multi_from_lengths(vlc, multi, FFMIN(he[0].len, VLC_BITS), nb_elems, nb_elems, &he[0].len, sizeof(he[0]), &he[0].sym, sizeof(he[0]), sizeof(he[0].sym), 0, 0, logctx); @@ -111,6 +119,22 @@ static void magicyuv_median_pred16(uint16_t *dst, const uint16_t *src1, *left_top = lt; } +#define READ_PLANE(dst, plane, b, c) \ +{ \ + x = 0; \ + for (; CACHED_BITSTREAM_READER && x < width-c && get_bits_left(&gb) > 0;) {\ + ret = get_vlc_multi(&gb, (uint8_t *)dst + x * b, multi, \ + vlc, vlc_bits, 3); \ + if (ret > 0) \ + x += ret; \ + if (ret <= 0) \ + return AVERROR_INVALIDDATA; \ + } \ + for (; x < width && get_bits_left(&gb) > 0; x++) \ + dst[x] = get_vlc2(&gb, vlc, vlc_bits, 3); \ + dst += stride; \ +} + static int magy_decode_slice10(AVCodecContext *avctx, void *tdata, int j, int threadnr) { @@ -130,6 +154,9 @@ static int magy_decode_slice10(AVCodecContext *avctx, void *tdata, int sheight = AV_CEIL_RSHIFT(s->slice_height, s->vshift[i]); ptrdiff_t fake_stride = (p->linesize[i] / 2) * (1 + interlaced); ptrdiff_t stride = p->linesize[i] / 2; + const VLC_MULTI_ELEM *const multi = s->multi[i].table; + const VLCElem *const vlc = s->vlc[i].table; + const int vlc_bits = s->vlc[i].bits; int flags, pred; int ret = init_get_bits8(&gb, s->buf + s->slices[i][j].start, s->slices[i][j].size); @@ -151,20 +178,8 @@ static int magy_decode_slice10(AVCodecContext *avctx, void *tdata, dst += stride; } } else { - for (k = 0; k < height; k++) { - for (x = 0; x < width; x++) { - int pix; - if (get_bits_left(&gb) <= 0) - return AVERROR_INVALIDDATA; - - pix = get_vlc2(&gb, s->vlc[i].table, s->vlc[i].bits, 3); - if (pix < 0) - return AVERROR_INVALIDDATA; - - dst[x] = pix; - } - dst += stride; - } + for (k = 0; k < height; k++) + READ_PLANE(dst, i, 2, 3) } switch (pred) { @@ -261,6 +276,9 @@ static int magy_decode_slice(AVCodecContext *avctx, void *tdata, ptrdiff_t fake_stride = p->linesize[i] * (1 + interlaced); ptrdiff_t stride = p->linesize[i]; const uint8_t *slice = s->buf + s->slices[i][j].start; + const VLC_MULTI_ELEM *const multi = s->multi[i].table; + const VLCElem *const vlc = s->vlc[i].table; + const int vlc_bits = s->vlc[i].bits; int flags, pred; flags = bytestream_get_byte(&slice); @@ -280,20 +298,8 @@ static int magy_decode_slice(AVCodecContext *avctx, void *tdata, if (ret < 0) return ret; - for (k = 0; k < height; k++) { - for (x = 0; x < width; x++) { - int pix; - if (get_bits_left(&gb) <= 0) - return AVERROR_INVALIDDATA; - - pix = get_vlc2(&gb, s->vlc[i].table, s->vlc[i].bits, 3); - if (pix < 0) - return AVERROR_INVALIDDATA; - - dst[x] = pix; - } - dst += stride; - } + for (k = 0; k < height; k++) + READ_PLANE(dst, i, 1, 5) } switch (pred) { @@ -379,7 +385,7 @@ static int build_huffman(AVCodecContext *avctx, const uint8_t *table, { MagicYUVContext *s = avctx->priv_data; GetByteContext gb; - uint8_t len[4096]; + uint8_t *len = s->len; uint16_t length_count[33] = { 0 }; int i = 0, j = 0, k; @@ -407,7 +413,7 @@ static int build_huffman(AVCodecContext *avctx, const uint8_t *table, if (j == max) { j = 0; - if (huff_build(len, length_count, &s->vlc[i], max, avctx)) { + if (huff_build(avctx, len, length_count, &s->vlc[i], &s->multi[i], max, avctx)) { av_log(avctx, AV_LOG_ERROR, "Cannot build Huffman codes\n"); return AVERROR_INVALIDDATA; } @@ -524,6 +530,16 @@ static int magy_decode_frame(AVCodecContext *avctx, AVFrame *p, s->decorrelate = 1; s->bps = 12; break; + case 0x71: + avctx->pix_fmt = AV_PIX_FMT_GBRP14; + s->decorrelate = 1; + s->bps = 14; + break; + case 0x72: + avctx->pix_fmt = AV_PIX_FMT_GBRAP14; + s->decorrelate = 1; + s->bps = 14; + break; case 0x73: avctx->pix_fmt = AV_PIX_FMT_GRAY10; s->bps = 10; @@ -651,7 +667,9 @@ static int magy_decode_frame(AVCodecContext *avctx, AVFrame *p, avctx->pix_fmt == AV_PIX_FMT_GBRP10 || avctx->pix_fmt == AV_PIX_FMT_GBRAP10|| avctx->pix_fmt == AV_PIX_FMT_GBRAP12|| - avctx->pix_fmt == AV_PIX_FMT_GBRP12) { + avctx->pix_fmt == AV_PIX_FMT_GBRAP14|| + avctx->pix_fmt == AV_PIX_FMT_GBRP12|| + avctx->pix_fmt == AV_PIX_FMT_GBRP14) { FFSWAP(uint8_t*, p->data[0], p->data[1]); FFSWAP(int, p->linesize[0], p->linesize[1]); } else { @@ -686,7 +704,8 @@ static av_cold int magy_decode_end(AVCodecContext *avctx) for (i = 0; i < FF_ARRAY_ELEMS(s->slices); i++) { av_freep(&s->slices[i]); s->slices_size[i] = 0; - ff_free_vlc(&s->vlc[i]); + ff_vlc_free(&s->vlc[i]); + ff_vlc_free_multi(&s->multi[i]); } return 0; diff --git a/arm/android/third_party/ffmpeg/libavcodec/magicyuvenc.c b/arm/android/third_party/ffmpeg/libavcodec/magicyuvenc.c index 082e2846..ccd6a549 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/magicyuvenc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/magicyuvenc.c @@ -53,10 +53,17 @@ typedef struct PTable { int64_t prob; ///< number of occurences of this value in input } PTable; +typedef struct Slice { + unsigned pos; + unsigned size; + uint8_t *slice; + uint8_t *bitslice; + PTable counts[256]; +} Slice; + typedef struct MagicYUVContext { const AVClass *class; int frame_pred; - PutBitContext pb; int planes; uint8_t format; int slice_height; @@ -64,14 +71,9 @@ typedef struct MagicYUVContext { int correlate; int hshift[4]; int vshift[4]; - uint8_t **slices; - uint8_t **bitslices; unsigned bitslice_size; - unsigned *slice_pos; - unsigned *slice_size; - unsigned tables_size; - PTable *counts; uint8_t *decorrelate_buf[2]; + Slice *slices; HuffEntry he[4][256]; LLVidEncDSPContext llvidencdsp; void (*predict)(struct MagicYUVContext *s, const uint8_t *src, uint8_t *dst, @@ -194,12 +196,6 @@ static av_cold int magy_encode_init(AVCodecContext *avctx) s->format = 0x6b; break; } - if (s->correlate) { - s->decorrelate_buf[0] = av_calloc(2U * avctx->height, FFALIGN(avctx->width, 16)); - if (!s->decorrelate_buf[0]) - return AVERROR(ENOMEM); - s->decorrelate_buf[1] = s->decorrelate_buf[0] + avctx->height * FFALIGN(avctx->width, 16); - } ff_llvidencdsp_init(&s->llvidencdsp); @@ -209,21 +205,27 @@ static av_cold int magy_encode_init(AVCodecContext *avctx) s->nb_slices = FFMIN(s->nb_slices, avctx->height >> s->vshift[1]); s->nb_slices = FFMAX(1, s->nb_slices); s->slice_height = FFALIGN((avctx->height + s->nb_slices - 1) / s->nb_slices, 1 << s->vshift[1]); - s->slice_pos = av_calloc(s->nb_slices * s->planes, sizeof(*s->slice_pos)); - s->slice_size = av_calloc(s->nb_slices * s->planes, sizeof(*s->slice_size)); + s->nb_slices = (avctx->height + s->slice_height - 1) / s->slice_height; s->slices = av_calloc(s->nb_slices * s->planes, sizeof(*s->slices)); - s->bitslices = av_calloc(s->nb_slices * s->planes, sizeof(*s->bitslices)); - s->counts = av_calloc(s->nb_slices * s->planes * 256, sizeof(*s->counts)); - if (!s->slices || !s->slice_pos || !s->counts || !s->slice_size) + if (!s->slices) return AVERROR(ENOMEM); - s->bitslice_size = avctx->width * (s->slice_height + 2) + AV_INPUT_BUFFER_PADDING_SIZE; + if (s->correlate) { + s->decorrelate_buf[0] = av_calloc(2U * (s->nb_slices * s->slice_height), FFALIGN(avctx->width, av_cpu_max_align())); + if (!s->decorrelate_buf[0]) + return AVERROR(ENOMEM); + s->decorrelate_buf[1] = s->decorrelate_buf[0] + (s->nb_slices * s->slice_height) * FFALIGN(avctx->width, av_cpu_max_align()); + } + + s->bitslice_size = avctx->width * s->slice_height + 2; for (int n = 0; n < s->nb_slices; n++) { for (int i = 0; i < s->planes; i++) { - s->bitslices[n * s->planes + i] = av_malloc(s->bitslice_size); - s->slices[n * s->planes + i] = av_malloc(avctx->width * (s->slice_height + 2) + + Slice *sl = &s->slices[n * s->planes + i]; + + sl->bitslice = av_malloc(s->bitslice_size + AV_INPUT_BUFFER_PADDING_SIZE); + sl->slice = av_malloc(avctx->width * (s->slice_height + 2) + AV_INPUT_BUFFER_PADDING_SIZE); - if (!s->slices[n * s->planes + i] || !s->bitslices[n * s->planes + i]) { + if (!sl->slice || !sl->bitslice) { av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer.\n"); return AVERROR(ENOMEM); } @@ -370,10 +372,11 @@ static void magy_huffman_compute_bits(PTable *prob_table, HuffEntry *distincts, static int count_plane_slice(AVCodecContext *avctx, int n, int plane) { MagicYUVContext *s = avctx->priv_data; - const uint8_t *dst = s->slices[n * s->planes + plane]; - PTable *counts = s->counts + 256 * (n * s->planes + plane); + Slice *sl = &s->slices[n * s->planes + plane]; + const uint8_t *dst = sl->slice; + PTable *counts = sl->counts; - memset(counts, 0, sizeof(*counts) * 256); + memset(counts, 0, sizeof(sl->counts)); count_usage(dst, AV_CEIL_RSHIFT(avctx->width, s->hshift[plane]), AV_CEIL_RSHIFT(s->slice_height, s->vshift[plane]), counts); @@ -389,7 +392,8 @@ static int encode_table(AVCodecContext *avctx, uint16_t codes_counts[33] = { 0 }; for (int n = 0; n < s->nb_slices; n++) { - PTable *slice_counts = s->counts + 256 * (n * s->planes + plane); + Slice *sl = &s->slices[n * s->planes + plane]; + PTable *slice_counts = sl->counts; for (int i = 0; i < 256; i++) counts[i].prob = slice_counts[i].prob; @@ -412,11 +416,28 @@ static int encode_table(AVCodecContext *avctx, return 0; } -static int encode_plane_slice(uint8_t *src, uint8_t *dst, int dst_size, +static int encode_plane_slice_raw(const uint8_t *src, uint8_t *dst, unsigned dst_size, + int width, int height, int prediction) +{ + unsigned count = width * height; + + dst[0] = 1; + dst[1] = prediction; + + memcpy(dst + 2, src, count); + count += 2; + AV_WN32(dst + count, 0); + if (count & 3) + count += 4 - (count & 3); + + return count; +} + +static int encode_plane_slice(const uint8_t *src, uint8_t *dst, unsigned dst_size, int width, int height, HuffEntry *he, int prediction) { + const uint8_t *osrc = src; PutBitContext pb; - int i, j; int count; init_put_bits(&pb, dst, dst_size); @@ -424,10 +445,13 @@ static int encode_plane_slice(uint8_t *src, uint8_t *dst, int dst_size, put_bits(&pb, 8, 0); put_bits(&pb, 8, prediction); - for (j = 0; j < height; j++) { - for (i = 0; i < width; i++) { + for (int j = 0; j < height; j++) { + for (int i = 0; i < width; i++) { const int idx = src[i]; - put_bits(&pb, he[idx].len, he[idx].code); + const int len = he[idx].len; + if (put_bits_left(&pb) < len + 32) + return encode_plane_slice_raw(osrc, dst, dst_size, width, height, prediction); + put_bits(&pb, len, he[idx].code); } src += width; @@ -450,16 +474,14 @@ static int encode_slice(AVCodecContext *avctx, void *tdata, const int slice_height = s->slice_height; const int last_height = FFMIN(slice_height, avctx->height - n * slice_height); const int height = (n < (s->nb_slices - 1)) ? slice_height : last_height; - PutByteContext pb; for (int i = 0; i < s->planes; i++) { - bytestream2_init_writer(&pb, s->bitslices[n + s->planes + i], - s->bitslice_size); + Slice *sl = &s->slices[n * s->planes + i]; - s->slice_size[n * s->planes + i] = - encode_plane_slice(s->slices[n * s->planes + i], - s->bitslices[n * s->planes + i], - bytestream2_get_bytes_left_p(&pb), + sl->size = + encode_plane_slice(sl->slice, + sl->bitslice, + s->bitslice_size, AV_CEIL_RSHIFT(avctx->width, s->hshift[i]), AV_CEIL_RSHIFT(height, s->vshift[i]), s->he[i], s->frame_pred); @@ -471,7 +493,7 @@ static int encode_slice(AVCodecContext *avctx, void *tdata, static int predict_slice(AVCodecContext *avctx, void *tdata, int n, int threadnr) { - const int aligned_width = FFALIGN(avctx->width, 16); + const int aligned_width = FFALIGN(avctx->width, av_cpu_max_align()); MagicYUVContext *s = avctx->priv_data; const int slice_height = s->slice_height; const int last_height = FFMIN(slice_height, avctx->height - n * slice_height); @@ -484,7 +506,7 @@ static int predict_slice(AVCodecContext *avctx, void *tdata, s->decorrelate_buf[1] + n * slice_height * aligned_width }; const int decorrelate_linesize = aligned_width; const uint8_t *const data[4] = { decorrelated[0], frame->data[0] + n * slice_height * frame->linesize[0], - decorrelated[1], frame->data[3] + n * slice_height * frame->linesize[3] }; + decorrelated[1], s->planes == 4 ? frame->data[3] + n * slice_height * frame->linesize[3] : NULL }; const uint8_t *r, *g, *b; const int linesize[4] = { decorrelate_linesize, frame->linesize[0], decorrelate_linesize, frame->linesize[3] }; @@ -493,7 +515,7 @@ static int predict_slice(AVCodecContext *avctx, void *tdata, b = frame->data[1] + n * slice_height * frame->linesize[1]; r = frame->data[2] + n * slice_height * frame->linesize[2]; - for (int i = 0; i < slice_height; i++) { + for (int i = 0; i < height; i++) { s->llvidencdsp.diff_bytes(decorrelated[0], b, g, width); s->llvidencdsp.diff_bytes(decorrelated[1], r, g, width); g += frame->linesize[0]; @@ -504,13 +526,17 @@ static int predict_slice(AVCodecContext *avctx, void *tdata, } for (int i = 0; i < s->planes; i++) { - s->predict(s, data[i], s->slices[n * s->planes + i], linesize[i], + Slice *sl = &s->slices[n * s->planes + i]; + + s->predict(s, data[i], sl->slice, linesize[i], frame->width, height); } } else { for (int i = 0; i < s->planes; i++) { + Slice *sl = &s->slices[n * s->planes + i]; + s->predict(s, frame->data[i] + n * (slice_height >> s->vshift[i]) * frame->linesize[i], - s->slices[n * s->planes + i], + sl->slice, frame->linesize[i], AV_CEIL_RSHIFT(frame->width, s->hshift[i]), AV_CEIL_RSHIFT(height, s->vshift[i])); @@ -527,9 +553,11 @@ static int magy_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet) { MagicYUVContext *s = avctx->priv_data; - PutByteContext pb; const int width = avctx->width, height = avctx->height; const int slice_height = s->slice_height; + unsigned tables_size; + PutBitContext pbit; + PutByteContext pb; int pos, ret = 0; ret = ff_alloc_packet(avctx, pkt, (256 + 4 * s->nb_slices + width * height) * @@ -571,31 +599,35 @@ static int magy_encode_frame(AVCodecContext *avctx, AVPacket *pkt, avctx->execute2(avctx, predict_slice, (void *)frame, NULL, s->nb_slices); - init_put_bits(&s->pb, pkt->data + bytestream2_tell_p(&pb), bytestream2_get_bytes_left_p(&pb)); + init_put_bits(&pbit, pkt->data + bytestream2_tell_p(&pb), bytestream2_get_bytes_left_p(&pb)); for (int i = 0; i < s->planes; i++) - encode_table(avctx, &s->pb, s->he[i], i); + encode_table(avctx, &pbit, s->he[i], i); - s->tables_size = put_bytes_count(&s->pb, 1); - bytestream2_skip_p(&pb, s->tables_size); + tables_size = put_bytes_count(&pbit, 1); + bytestream2_skip_p(&pb, tables_size); avctx->execute2(avctx, encode_slice, NULL, NULL, s->nb_slices); for (int n = 0; n < s->nb_slices; n++) { for (int i = 0; i < s->planes; i++) { - s->slice_pos[n * s->planes + i] = bytestream2_tell_p(&pb); + Slice *sl = &s->slices[n * s->planes + i]; - bytestream2_put_buffer(&pb, s->bitslices[n * s->planes + i], - s->slice_size[n * s->planes + i]); + sl->pos = bytestream2_tell_p(&pb); + + bytestream2_put_buffer(&pb, sl->bitslice, sl->size); } } pos = bytestream2_tell_p(&pb); bytestream2_seek_p(&pb, 32, SEEK_SET); - bytestream2_put_le32(&pb, s->slice_pos[0] - 32); + bytestream2_put_le32(&pb, s->slices[0].pos - 32); for (int i = 0; i < s->planes; i++) { - for (int n = 0; n < s->nb_slices; n++) - bytestream2_put_le32(&pb, s->slice_pos[n * s->planes + i] - 32); + for (int n = 0; n < s->nb_slices; n++) { + Slice *sl = &s->slices[n * s->planes + i]; + + bytestream2_put_le32(&pb, sl->pos - 32); + } } bytestream2_seek_p(&pb, pos, SEEK_SET); @@ -610,15 +642,13 @@ static av_cold int magy_encode_close(AVCodecContext *avctx) { MagicYUVContext *s = avctx->priv_data; - av_freep(&s->slice_pos); - av_freep(&s->slice_size); - for (int i = 0; i < s->planes * s->nb_slices && s->slices; i++) - av_freep(&s->slices[i]); - for (int i = 0; i < s->planes * s->nb_slices && s->bitslices; i++) - av_freep(&s->bitslices[i]); - av_freep(&s->counts); + for (int i = 0; i < s->planes * s->nb_slices && s->slices; i++) { + Slice *sl = &s->slices[i]; + + av_freep(&sl->slice); + av_freep(&sl->bitslice); + } av_freep(&s->slices); - av_freep(&s->bitslices); av_freep(&s->decorrelate_buf); return 0; diff --git a/arm/android/third_party/ffmpeg/libavcodec/mediacodec_wrapper.c b/arm/android/third_party/ffmpeg/libavcodec/mediacodec_wrapper.c index eb69ad7e..0880ddd3 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/mediacodec_wrapper.c +++ b/arm/android/third_party/ffmpeg/libavcodec/mediacodec_wrapper.c @@ -365,82 +365,82 @@ int ff_AMediaCodecProfile_getProfileFromAVCodecContext(AVCodecContext *avctx) if (avctx->codec_id == AV_CODEC_ID_H264) { switch(avctx->profile) { - case FF_PROFILE_H264_BASELINE: + case AV_PROFILE_H264_BASELINE: return AVCProfileBaseline; - case FF_PROFILE_H264_CONSTRAINED_BASELINE: + case AV_PROFILE_H264_CONSTRAINED_BASELINE: return AVCProfileConstrainedBaseline; - case FF_PROFILE_H264_MAIN: + case AV_PROFILE_H264_MAIN: return AVCProfileMain; break; - case FF_PROFILE_H264_EXTENDED: + case AV_PROFILE_H264_EXTENDED: return AVCProfileExtended; - case FF_PROFILE_H264_HIGH: + case AV_PROFILE_H264_HIGH: return AVCProfileHigh; - case FF_PROFILE_H264_HIGH_10: - case FF_PROFILE_H264_HIGH_10_INTRA: + case AV_PROFILE_H264_HIGH_10: + case AV_PROFILE_H264_HIGH_10_INTRA: return AVCProfileHigh10; - case FF_PROFILE_H264_HIGH_422: - case FF_PROFILE_H264_HIGH_422_INTRA: + case AV_PROFILE_H264_HIGH_422: + case AV_PROFILE_H264_HIGH_422_INTRA: return AVCProfileHigh422; - case FF_PROFILE_H264_HIGH_444: - case FF_PROFILE_H264_HIGH_444_INTRA: - case FF_PROFILE_H264_HIGH_444_PREDICTIVE: + case AV_PROFILE_H264_HIGH_444: + case AV_PROFILE_H264_HIGH_444_INTRA: + case AV_PROFILE_H264_HIGH_444_PREDICTIVE: return AVCProfileHigh444; } } else if (avctx->codec_id == AV_CODEC_ID_HEVC) { switch (avctx->profile) { - case FF_PROFILE_HEVC_MAIN: + case AV_PROFILE_HEVC_MAIN: return HEVCProfileMain; - case FF_PROFILE_HEVC_MAIN_STILL_PICTURE: + case AV_PROFILE_HEVC_MAIN_STILL_PICTURE: return HEVCProfileMainStill; - case FF_PROFILE_HEVC_MAIN_10: + case AV_PROFILE_HEVC_MAIN_10: return HEVCProfileMain10; } } else if (avctx->codec_id == AV_CODEC_ID_VP9) { switch (avctx->profile) { - case FF_PROFILE_VP9_0: + case AV_PROFILE_VP9_0: return VP9Profile0; - case FF_PROFILE_VP9_1: + case AV_PROFILE_VP9_1: return VP9Profile1; - case FF_PROFILE_VP9_2: + case AV_PROFILE_VP9_2: return VP9Profile2; - case FF_PROFILE_VP9_3: + case AV_PROFILE_VP9_3: return VP9Profile3; } } else if(avctx->codec_id == AV_CODEC_ID_MPEG4) { switch (avctx->profile) { - case FF_PROFILE_MPEG4_SIMPLE: + case AV_PROFILE_MPEG4_SIMPLE: return MPEG4ProfileSimple; - case FF_PROFILE_MPEG4_SIMPLE_SCALABLE: + case AV_PROFILE_MPEG4_SIMPLE_SCALABLE: return MPEG4ProfileSimpleScalable; - case FF_PROFILE_MPEG4_CORE: + case AV_PROFILE_MPEG4_CORE: return MPEG4ProfileCore; - case FF_PROFILE_MPEG4_MAIN: + case AV_PROFILE_MPEG4_MAIN: return MPEG4ProfileMain; - case FF_PROFILE_MPEG4_N_BIT: + case AV_PROFILE_MPEG4_N_BIT: return MPEG4ProfileNbit; - case FF_PROFILE_MPEG4_SCALABLE_TEXTURE: + case AV_PROFILE_MPEG4_SCALABLE_TEXTURE: return MPEG4ProfileScalableTexture; - case FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION: + case AV_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION: return MPEG4ProfileSimpleFBA; - case FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE: + case AV_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE: return MPEG4ProfileBasicAnimated; - case FF_PROFILE_MPEG4_HYBRID: + case AV_PROFILE_MPEG4_HYBRID: return MPEG4ProfileHybrid; - case FF_PROFILE_MPEG4_ADVANCED_REAL_TIME: + case AV_PROFILE_MPEG4_ADVANCED_REAL_TIME: return MPEG4ProfileAdvancedRealTime; - case FF_PROFILE_MPEG4_CORE_SCALABLE: + case AV_PROFILE_MPEG4_CORE_SCALABLE: return MPEG4ProfileCoreScalable; - case FF_PROFILE_MPEG4_ADVANCED_CODING: + case AV_PROFILE_MPEG4_ADVANCED_CODING: return MPEG4ProfileAdvancedCoding; - case FF_PROFILE_MPEG4_ADVANCED_CORE: + case AV_PROFILE_MPEG4_ADVANCED_CORE: return MPEG4ProfileAdvancedCore; - case FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE: + case AV_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE: return MPEG4ProfileAdvancedScalable; - case FF_PROFILE_MPEG4_ADVANCED_SIMPLE: + case AV_PROFILE_MPEG4_ADVANCED_SIMPLE: return MPEG4ProfileAdvancedSimple; - case FF_PROFILE_MPEG4_SIMPLE_STUDIO: + case AV_PROFILE_MPEG4_SIMPLE_STUDIO: // Studio profiles are not supported by mediacodec. default: break; @@ -448,10 +448,10 @@ int ff_AMediaCodecProfile_getProfileFromAVCodecContext(AVCodecContext *avctx) } else if(avctx->codec_id == AV_CODEC_ID_AV1) { switch (avctx->profile) { - case FF_PROFILE_AV1_MAIN: + case AV_PROFILE_AV1_MAIN: return AV1ProfileMain8; - case FF_PROFILE_AV1_HIGH: - case FF_PROFILE_AV1_PROFESSIONAL: + case AV_PROFILE_AV1_HIGH: + case AV_PROFILE_AV1_PROFESSIONAL: default: break; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/mediacodecenc.c b/arm/android/third_party/ffmpeg/libavcodec/mediacodecenc.c index 1da705d1..a1ae5d5e 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/mediacodecenc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/mediacodecenc.c @@ -428,9 +428,6 @@ static void copy_frame_to_buffer(AVCodecContext *avctx, const AVFrame *frame, ui MediaCodecEncContext *s = avctx->priv_data; uint8_t *dst_data[4] = {}; int dst_linesize[4] = {}; - const uint8_t *src_data[4] = { - frame->data[0], frame->data[1], frame->data[2], frame->data[3] - }; if (avctx->pix_fmt == AV_PIX_FMT_YUV420P) { dst_data[0] = dst; @@ -449,8 +446,8 @@ static void copy_frame_to_buffer(AVCodecContext *avctx, const AVFrame *frame, ui av_assert0(0); } - av_image_copy(dst_data, dst_linesize, src_data, frame->linesize, - avctx->pix_fmt, avctx->width, avctx->height); + av_image_copy2(dst_data, dst_linesize, frame->data, frame->linesize, + avctx->pix_fmt, avctx->width, avctx->height); } static int mediacodec_send(AVCodecContext *avctx, @@ -660,14 +657,14 @@ enum MediaCodecAvcLevel { static const AVOption h264_options[] = { COMMON_OPTION - FF_AVCTX_PROFILE_OPTION("baseline", NULL, VIDEO, FF_PROFILE_H264_BASELINE) - FF_AVCTX_PROFILE_OPTION("constrained_baseline", NULL, VIDEO, FF_PROFILE_H264_CONSTRAINED_BASELINE) - FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, FF_PROFILE_H264_MAIN) - FF_AVCTX_PROFILE_OPTION("extended", NULL, VIDEO, FF_PROFILE_H264_EXTENDED) - FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, FF_PROFILE_H264_HIGH) - FF_AVCTX_PROFILE_OPTION("high10", NULL, VIDEO, FF_PROFILE_H264_HIGH_10) - FF_AVCTX_PROFILE_OPTION("high422", NULL, VIDEO, FF_PROFILE_H264_HIGH_422) - FF_AVCTX_PROFILE_OPTION("high444", NULL, VIDEO, FF_PROFILE_H264_HIGH_444) + FF_AVCTX_PROFILE_OPTION("baseline", NULL, VIDEO, AV_PROFILE_H264_BASELINE) + FF_AVCTX_PROFILE_OPTION("constrained_baseline", NULL, VIDEO, AV_PROFILE_H264_CONSTRAINED_BASELINE) + FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, AV_PROFILE_H264_MAIN) + FF_AVCTX_PROFILE_OPTION("extended", NULL, VIDEO, AV_PROFILE_H264_EXTENDED) + FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, AV_PROFILE_H264_HIGH) + FF_AVCTX_PROFILE_OPTION("high10", NULL, VIDEO, AV_PROFILE_H264_HIGH_10) + FF_AVCTX_PROFILE_OPTION("high422", NULL, VIDEO, AV_PROFILE_H264_HIGH_422) + FF_AVCTX_PROFILE_OPTION("high444", NULL, VIDEO, AV_PROFILE_H264_HIGH_444) { "level", "Specify level", OFFSET(level), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, VE, "level" }, @@ -732,8 +729,8 @@ enum MediaCodecHevcLevel { static const AVOption hevc_options[] = { COMMON_OPTION - FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, FF_PROFILE_HEVC_MAIN) - FF_AVCTX_PROFILE_OPTION("main10", NULL, VIDEO, FF_PROFILE_HEVC_MAIN_10) + FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, AV_PROFILE_HEVC_MAIN) + FF_AVCTX_PROFILE_OPTION("main10", NULL, VIDEO, AV_PROFILE_HEVC_MAIN_10) { "level", "Specify tier and level", OFFSET(level), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, VE, "level" }, @@ -846,10 +843,10 @@ enum MediaCodecVP9Level { static const AVOption vp9_options[] = { COMMON_OPTION - FF_AVCTX_PROFILE_OPTION("profile0", NULL, VIDEO, FF_PROFILE_VP9_0) - FF_AVCTX_PROFILE_OPTION("profile1", NULL, VIDEO, FF_PROFILE_VP9_1) - FF_AVCTX_PROFILE_OPTION("profile2", NULL, VIDEO, FF_PROFILE_VP9_2) - FF_AVCTX_PROFILE_OPTION("profile3", NULL, VIDEO, FF_PROFILE_VP9_3) + FF_AVCTX_PROFILE_OPTION("profile0", NULL, VIDEO, AV_PROFILE_VP9_0) + FF_AVCTX_PROFILE_OPTION("profile1", NULL, VIDEO, AV_PROFILE_VP9_1) + FF_AVCTX_PROFILE_OPTION("profile2", NULL, VIDEO, AV_PROFILE_VP9_2) + FF_AVCTX_PROFILE_OPTION("profile3", NULL, VIDEO, AV_PROFILE_VP9_3) { "level", "Specify tier and level", OFFSET(level), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, VE, "level" }, diff --git a/arm/android/third_party/ffmpeg/libavcodec/mfenc.c b/arm/android/third_party/ffmpeg/libavcodec/mfenc.c index 8d950a31..3c50a6c0 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/mfenc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/mfenc.c @@ -672,10 +672,10 @@ FF_ENABLE_DEPRECATION_WARNINGS if (avctx->codec_id == AV_CODEC_ID_H264) { UINT32 profile = ff_eAVEncH264VProfile_Base; switch (avctx->profile) { - case FF_PROFILE_H264_MAIN: + case AV_PROFILE_H264_MAIN: profile = ff_eAVEncH264VProfile_Main; break; - case FF_PROFILE_H264_HIGH: + case AV_PROFILE_H264_HIGH: profile = ff_eAVEncH264VProfile_High; break; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/mimic.c b/arm/android/third_party/ffmpeg/libavcodec/mimic.c index 891471b3..a846a07a 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/mimic.c +++ b/arm/android/third_party/ffmpeg/libavcodec/mimic.c @@ -120,7 +120,7 @@ static av_cold int mimic_decode_end(AVCodecContext *avctx) static av_cold void mimic_init_static(void) { - INIT_VLC_STATIC_FROM_LENGTHS(&block_vlc, MIMIC_VLC_BITS, FF_ARRAY_ELEMS(huffbits), + VLC_INIT_STATIC_FROM_LENGTHS(&block_vlc, MIMIC_VLC_BITS, FF_ARRAY_ELEMS(huffbits), huffbits, 1, huffsyms, 1, 1, 0, 0, 4368); } diff --git a/arm/android/third_party/ffmpeg/libavcodec/mips/Makefile b/arm/android/third_party/ffmpeg/libavcodec/mips/Makefile index 05ed63bf..45c56e8a 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/mips/Makefile +++ b/arm/android/third_party/ffmpeg/libavcodec/mips/Makefile @@ -13,7 +13,6 @@ MIPSFPU-OBJS-$(CONFIG_AMRWB_DECODER) += mips/acelp_filters_mips.o \ mips/acelp_vectors_mips.o MIPSFPU-OBJS-$(CONFIG_MPEGAUDIODSP) += mips/mpegaudiodsp_mips_float.o MIPSDSP-OBJS-$(CONFIG_MPEGAUDIODSP) += mips/mpegaudiodsp_mips_fixed.o -MIPSFPU-OBJS-$(CONFIG_FFT) += mips/fft_mips.o MIPSFPU-OBJS-$(CONFIG_FMTCONVERT) += mips/fmtconvert_mips.o OBJS-$(CONFIG_AC3DSP) += mips/ac3dsp_mips.o OBJS-$(CONFIG_AAC_DECODER) += mips/aacdec_mips.o \ diff --git a/arm/android/third_party/ffmpeg/libavcodec/mjpegdec.c b/arm/android/third_party/ffmpeg/libavcodec/mjpegdec.c index b42e75bc..8676155e 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/mjpegdec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/mjpegdec.c @@ -33,6 +33,7 @@ #include "config_components.h" #include "libavutil/display.h" +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/avassert.h" #include "libavutil/opt.h" @@ -41,6 +42,7 @@ #include "codec_internal.h" #include "copy_block.h" #include "decode.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "idctdsp.h" #include "internal.h" @@ -81,7 +83,7 @@ static int init_default_huffman_tables(MJpegDecodeContext *s) int i, ret; for (i = 0; i < FF_ARRAY_ELEMS(ht); i++) { - ff_free_vlc(&s->vlcs[ht[i].class][ht[i].index]); + ff_vlc_free(&s->vlcs[ht[i].class][ht[i].index]); ret = ff_mjpeg_build_vlc(&s->vlcs[ht[i].class][ht[i].index], ht[i].bits, ht[i].values, ht[i].class == 1, s->avctx); @@ -275,7 +277,7 @@ int ff_mjpeg_decode_dht(MJpegDecodeContext *s) len -= n; /* build VLC and flush previous vlc if present */ - ff_free_vlc(&s->vlcs[class][index]); + ff_vlc_free(&s->vlcs[class][index]); av_log(s->avctx, AV_LOG_DEBUG, "class=%d index=%d nb_codes=%d\n", class, index, n); if ((ret = ff_mjpeg_build_vlc(&s->vlcs[class][index], bits_table, @@ -283,7 +285,7 @@ int ff_mjpeg_decode_dht(MJpegDecodeContext *s) return ret; if (class > 0) { - ff_free_vlc(&s->vlcs[2][index]); + ff_vlc_free(&s->vlcs[2][index]); if ((ret = ff_mjpeg_build_vlc(&s->vlcs[2][index], bits_table, val_table, 0, s->avctx)) < 0) return ret; @@ -796,13 +798,14 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) } if (s->avctx->hwaccel) { + const FFHWAccel *hwaccel = ffhwaccel(s->avctx->hwaccel); s->hwaccel_picture_private = - av_mallocz(s->avctx->hwaccel->frame_priv_data_size); + av_mallocz(hwaccel->frame_priv_data_size); if (!s->hwaccel_picture_private) return AVERROR(ENOMEM); - ret = s->avctx->hwaccel->start_frame(s->avctx, s->raw_image_buffer, - s->raw_image_buffer_size); + ret = hwaccel->start_frame(s->avctx, s->raw_image_buffer, + s->raw_image_buffer_size); if (ret < 0) return ret; } @@ -1774,9 +1777,9 @@ next_field: av_assert0(bytes_to_start >= 0 && s->raw_scan_buffer_size >= bytes_to_start); - ret = s->avctx->hwaccel->decode_slice(s->avctx, - s->raw_scan_buffer + bytes_to_start, - s->raw_scan_buffer_size - bytes_to_start); + ret = FF_HW_CALL(s->avctx, decode_slice, + s->raw_scan_buffer + bytes_to_start, + s->raw_scan_buffer_size - bytes_to_start); if (ret < 0) return ret; @@ -2483,9 +2486,9 @@ redo_for_pal8: case SOF0: case SOF1: if (start_code == SOF0) - s->avctx->profile = FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT; + s->avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT; else - s->avctx->profile = FF_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT; + s->avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT; s->lossless = 0; s->ls = 0; s->progressive = 0; @@ -2493,7 +2496,7 @@ redo_for_pal8: goto fail; break; case SOF2: - s->avctx->profile = FF_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT; + s->avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT; s->lossless = 0; s->ls = 0; s->progressive = 1; @@ -2501,7 +2504,7 @@ redo_for_pal8: goto fail; break; case SOF3: - s->avctx->profile = FF_PROFILE_MJPEG_HUFFMAN_LOSSLESS; + s->avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_LOSSLESS; s->avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS; s->lossless = 1; s->ls = 0; @@ -2510,7 +2513,7 @@ redo_for_pal8: goto fail; break; case SOF48: - s->avctx->profile = FF_PROFILE_MJPEG_JPEG_LS; + s->avctx->profile = AV_PROFILE_MJPEG_JPEG_LS; s->avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS; s->lossless = 1; s->ls = 1; @@ -2547,7 +2550,7 @@ eoi_parser: goto the_end_no_picture; } if (s->avctx->hwaccel) { - ret = s->avctx->hwaccel->end_frame(s->avctx); + ret = FF_HW_SIMPLE_CALL(s->avctx, end_frame); if (ret < 0) return ret; @@ -2952,7 +2955,7 @@ av_cold int ff_mjpeg_decode_end(AVCodecContext *avctx) for (i = 0; i < 3; i++) { for (j = 0; j < 4; j++) - ff_free_vlc(&s->vlcs[i][j]); + ff_vlc_free(&s->vlcs[i][j]); } for (i = 0; i < MAX_COMPONENTS; i++) { av_freep(&s->blocks[i]); diff --git a/arm/android/third_party/ffmpeg/libavcodec/mjpegdec_common.c b/arm/android/third_party/ffmpeg/libavcodec/mjpegdec_common.c index 701ddfec..ef2a0ad5 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/mjpegdec_common.c +++ b/arm/android/third_party/ffmpeg/libavcodec/mjpegdec_common.c @@ -52,6 +52,6 @@ int ff_mjpeg_build_vlc(VLC *vlc, const uint8_t *bits_table, huff_sym[i] = 16 * 256; } - return ff_init_vlc_from_lengths(vlc, 9, nb_codes, huff_size, 1, + return ff_vlc_init_from_lengths(vlc, 9, nb_codes, huff_size, 1, huff_sym, 2, 2, 0, 0, logctx); } diff --git a/arm/android/third_party/ffmpeg/libavcodec/mlpdec.c b/arm/android/third_party/ffmpeg/libavcodec/mlpdec.c index 966ee0f0..a24ae0be 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/mlpdec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/mlpdec.c @@ -230,9 +230,9 @@ static av_cold void init_static(void) static VLCElem vlc_buf[3 * VLC_STATIC_SIZE]; huff_vlc[i].table = &vlc_buf[i * VLC_STATIC_SIZE]; huff_vlc[i].table_allocated = VLC_STATIC_SIZE; - init_vlc(&huff_vlc[i], VLC_BITS, 18, + vlc_init(&huff_vlc[i], VLC_BITS, 18, &ff_mlp_huffman_tables[i][0][1], 2, 1, - &ff_mlp_huffman_tables[i][0][0], 2, 1, INIT_VLC_USE_NEW_STATIC); + &ff_mlp_huffman_tables[i][0][0], 2, 1, VLC_INIT_USE_STATIC); } ff_mlp_init_crc(); @@ -398,7 +398,7 @@ static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb) */ if (m->avctx->codec_id == AV_CODEC_ID_TRUEHD && m->num_substreams == 4 && m->substream_info >> 7 == 1) { - m->avctx->profile = FF_PROFILE_TRUEHD_ATMOS; + m->avctx->profile = AV_PROFILE_TRUEHD_ATMOS; } /* limit to decoding 3 substreams, as the 4th is used by Dolby Atmos for non-audio data */ diff --git a/arm/android/third_party/ffmpeg/libavcodec/mlpenc.c b/arm/android/third_party/ffmpeg/libavcodec/mlpenc.c index 5995a6b5..89b55750 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/mlpenc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/mlpenc.c @@ -32,6 +32,7 @@ #include "libavutil/crc.h" #include "libavutil/avstring.h" #include "libavutil/intmath.h" +#include "libavutil/opt.h" #include "libavutil/samplefmt.h" #include "libavutil/thread.h" #include "mlp.h" @@ -41,7 +42,7 @@ #define MLP_MIN_LPC_ORDER 1 #define MLP_MAX_LPC_ORDER 8 -#define MLP_MIN_LPC_SHIFT 8 +#define MLP_MIN_LPC_SHIFT 0 #define MLP_MAX_LPC_SHIFT 15 typedef struct { @@ -108,8 +109,13 @@ typedef struct BestOffset { #define NUM_CODEBOOKS 4 typedef struct MLPEncodeContext { + AVClass *class; AVCodecContext *avctx; + int lpc_type; + int lpc_passes; + int prediction_order; + int num_substreams; ///< Number of substreams contained within this stream. int num_channels; /**< Number of channels in major_scratch_buffer. @@ -573,8 +579,6 @@ static av_cold int mlp_encode_init(AVCodecContext *avctx) ctx->min_restart_interval = MAJOR_HEADER_INTERVAL; ctx->restart_intervals = ctx->max_restart_interval / ctx->min_restart_interval; - /* TODO Let user pass parameters for LPC filter. */ - size = avctx->frame_size * ctx->max_restart_interval; ctx->lpc_sample_buffer = av_calloc(size, sizeof(*ctx->lpc_sample_buffer)); if (!ctx->lpc_sample_buffer) @@ -682,7 +686,7 @@ static av_cold int mlp_encode_init(AVCodecContext *avctx) rh->max_matrix_channel = rh->max_channel; if ((ret = ff_lpc_init(&ctx->lpc_ctx, ctx->number_of_samples, - MLP_MAX_LPC_ORDER, FF_LPC_TYPE_LEVINSON)) < 0) + MLP_MAX_LPC_ORDER, ctx->lpc_type)) < 0) return ret; for (int i = 0; i < NUM_FILTERS; i++) { @@ -1086,7 +1090,7 @@ static uint8_t *write_substr(MLPEncodeContext *ctx, uint8_t *buf, int buf_size, put_bits(&pb, 16, END_OF_STREAM & 0xFFFF); put_bits(&pb, 16, (ctx->shorten_by & 0x1FFF) | 0x2000); } else { - put_bits(&pb, 32, END_OF_STREAM); + put_bits32(&pb, END_OF_STREAM); } } @@ -1261,14 +1265,7 @@ static void input_to_sample_buffer(MLPEncodeContext *ctx) /** Counts the number of trailing zeroes in a value */ static int number_trailing_zeroes(int32_t sample) { - int bits = ff_ctz(sample); - - /* All samples are 0. TODO Return previous quant_step_size to avoid - * writing a new header. */ - if (bits >= 24) - return 0; - - return bits; + return FFMIN(15, ff_ctz(sample)); } /** Determines how many bits are zero at the end of all samples so they can be @@ -1341,13 +1338,12 @@ static void set_filter_params(MLPEncodeContext *ctx, } else if (filter == IIR) { fp->order = 0; } else if (filter == FIR) { - const int max_order = (ctx->substream_info & SUBSTREAM_INFO_HIGH_RATE) - ? 4 : MLP_MAX_LPC_ORDER; + const int max_order = MAX_FIR_ORDER; int32_t *sample_buffer = ctx->sample_buffer + channel; int32_t coefs[MAX_LPC_ORDER][MAX_LPC_ORDER]; int32_t *lpc_samples = ctx->lpc_sample_buffer; int32_t *fcoeff = ctx->cur_channel_params[channel].coeff[filter]; - int shift[MLP_MAX_LPC_ORDER]; + int shift[MAX_LPC_ORDER]; int order; for (unsigned int i = 0; i < ctx->number_of_samples; i++) { @@ -1357,8 +1353,8 @@ static void set_filter_params(MLPEncodeContext *ctx, order = ff_lpc_calc_coefs(&ctx->lpc_ctx, ctx->lpc_sample_buffer, ctx->number_of_samples, MLP_MIN_LPC_ORDER, - max_order, 11, coefs, shift, FF_LPC_TYPE_LEVINSON, 0, - ORDER_METHOD_EST, MLP_MIN_LPC_SHIFT, + max_order, 11, coefs, shift, ctx->lpc_type, ctx->lpc_passes, + ctx->prediction_order, MLP_MIN_LPC_SHIFT, MLP_MAX_LPC_SHIFT, MLP_MIN_LPC_SHIFT); fp->order = order; @@ -2238,6 +2234,26 @@ static av_cold int mlp_encode_close(AVCodecContext *avctx) return 0; } +#define FLAGS AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM +#define OFFSET(x) offsetof(MLPEncodeContext, x) +static const AVOption mlp_options[] = { +{ "lpc_type", "LPC algorithm", OFFSET(lpc_type), AV_OPT_TYPE_INT, {.i64 = FF_LPC_TYPE_LEVINSON }, FF_LPC_TYPE_LEVINSON, FF_LPC_TYPE_CHOLESKY, FLAGS, "lpc_type" }, +{ "levinson", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_LPC_TYPE_LEVINSON }, 0, 0, FLAGS, "lpc_type" }, +{ "cholesky", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_LPC_TYPE_CHOLESKY }, 0, 0, FLAGS, "lpc_type" }, +{ "lpc_passes", "Number of passes to use for Cholesky factorization during LPC analysis", OFFSET(lpc_passes), AV_OPT_TYPE_INT, {.i64 = 2 }, 1, INT_MAX, FLAGS }, +{ "prediction_order", "Search method for selecting prediction order", OFFSET(prediction_order), AV_OPT_TYPE_INT, {.i64 = ORDER_METHOD_EST }, ORDER_METHOD_EST, ORDER_METHOD_SEARCH, FLAGS, "predm" }, +{ "estimation", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = ORDER_METHOD_EST }, 0, 0, FLAGS, "predm" }, +{ "search", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = ORDER_METHOD_SEARCH }, 0, 0, FLAGS, "predm" }, +{ NULL }, +}; + +static const AVClass mlp_class = { + .class_name = "mlpenc", + .item_name = av_default_item_name, + .option = mlp_options, + .version = LIBAVUTIL_VERSION_INT, +}; + #if CONFIG_MLP_ENCODER const FFCodec ff_mlp_encoder = { .p.name ="mlp", @@ -2250,6 +2266,7 @@ const FFCodec ff_mlp_encoder = { .init = mlp_encode_init, FF_CODEC_ENCODE_CB(mlp_encode_frame), .close = mlp_encode_close, + .p.priv_class = &mlp_class, .p.sample_fmts = (const enum AVSampleFormat[]) {AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE}, .p.supported_samplerates = (const int[]) {44100, 48000, 88200, 96000, 176400, 192000, 0}, CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(ff_mlp_channel_layouts) @@ -2270,6 +2287,7 @@ const FFCodec ff_truehd_encoder = { .init = mlp_encode_init, FF_CODEC_ENCODE_CB(mlp_encode_frame), .close = mlp_encode_close, + .p.priv_class = &mlp_class, .p.sample_fmts = (const enum AVSampleFormat[]) {AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE}, .p.supported_samplerates = (const int[]) {44100, 48000, 88200, 96000, 176400, 192000, 0}, CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_5POINT0, AV_CH_LAYOUT_5POINT1) diff --git a/arm/android/third_party/ffmpeg/libavcodec/mmaldec.c b/arm/android/third_party/ffmpeg/libavcodec/mmaldec.c index 8d67d10c..4bb3eb22 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/mmaldec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/mmaldec.c @@ -648,8 +648,8 @@ static int ffmal_copy_frame(AVCodecContext *avctx, AVFrame *frame, av_image_fill_arrays(src, linesize, buffer->data + buffer->type->video.offset[0], avctx->pix_fmt, w, h, 1); - av_image_copy(frame->data, frame->linesize, (const uint8_t **)src, linesize, - avctx->pix_fmt, avctx->width, avctx->height); + av_image_copy2(frame->data, frame->linesize, src, linesize, + avctx->pix_fmt, avctx->width, avctx->height); } frame->sample_aspect_ratio = avctx->sample_aspect_ratio; diff --git a/arm/android/third_party/ffmpeg/libavcodec/mobiclip.c b/arm/android/third_party/ffmpeg/libavcodec/mobiclip.c index 381b492d..98c0f55a 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/mobiclip.c +++ b/arm/android/third_party/ffmpeg/libavcodec/mobiclip.c @@ -279,11 +279,11 @@ static VLC mv_vlc[2][16]; static av_cold void mobiclip_init_static(void) { - INIT_VLC_STATIC_FROM_LENGTHS(&rl_vlc[0], MOBI_RL_VLC_BITS, 104, + VLC_INIT_STATIC_FROM_LENGTHS(&rl_vlc[0], MOBI_RL_VLC_BITS, 104, bits0, sizeof(*bits0), syms0, sizeof(*syms0), sizeof(*syms0), 0, 0, 1 << MOBI_RL_VLC_BITS); - INIT_VLC_STATIC_FROM_LENGTHS(&rl_vlc[1], MOBI_RL_VLC_BITS, 104, + VLC_INIT_STATIC_FROM_LENGTHS(&rl_vlc[1], MOBI_RL_VLC_BITS, 104, bits0, sizeof(*bits0), syms1, sizeof(*syms1), sizeof(*syms1), 0, 0, 1 << MOBI_RL_VLC_BITS); @@ -292,10 +292,10 @@ static av_cold void mobiclip_init_static(void) for (int j = 0; j < 16; j++) { mv_vlc[i][j].table = &vlc_buf[(16 * i + j) << MOBI_MV_VLC_BITS]; mv_vlc[i][j].table_allocated = 1 << MOBI_MV_VLC_BITS; - ff_init_vlc_from_lengths(&mv_vlc[i][j], MOBI_MV_VLC_BITS, mv_len[j], + ff_vlc_init_from_lengths(&mv_vlc[i][j], MOBI_MV_VLC_BITS, mv_len[j], mv_bits[i][j], sizeof(*mv_bits[i][j]), mv_syms[i][j], sizeof(*mv_syms[i][j]), sizeof(*mv_syms[i][j]), - 0, INIT_VLC_USE_NEW_STATIC, NULL); + 0, VLC_INIT_USE_STATIC, NULL); } } } diff --git a/arm/android/third_party/ffmpeg/libavcodec/motionpixels.c b/arm/android/third_party/ffmpeg/libavcodec/motionpixels.c index a947ca05..9df0b206 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/motionpixels.c +++ b/arm/android/third_party/ffmpeg/libavcodec/motionpixels.c @@ -328,7 +328,7 @@ static int mp_decode_frame(AVCodecContext *avctx, AVFrame *rframe, if (mp->codes_count > 1) { /* The entries of the mp->codes array are sorted from right to left * in the Huffman tree, hence -(int)sizeof(HuffCode). */ - ret = ff_init_vlc_from_lengths(&mp->vlc, mp->max_codes_bits, mp->codes_count, + ret = ff_vlc_init_from_lengths(&mp->vlc, mp->max_codes_bits, mp->codes_count, &mp->codes[mp->codes_count - 1].size, -(int)sizeof(HuffCode), &mp->codes[mp->codes_count - 1].delta, -(int)sizeof(HuffCode), 1, 0, 0, avctx); @@ -336,7 +336,7 @@ static int mp_decode_frame(AVCodecContext *avctx, AVFrame *rframe, goto end; } mp_decode_frame_helper(mp, &gb); - ff_free_vlc(&mp->vlc); + ff_vlc_free(&mp->vlc); end: if ((ret = av_frame_ref(rframe, mp->frame)) < 0) diff --git a/arm/android/third_party/ffmpeg/libavcodec/mpc.c b/arm/android/third_party/ffmpeg/libavcodec/mpc.c index 6aa3e809..46cb967c 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/mpc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/mpc.c @@ -27,7 +27,7 @@ */ #include -#include "libavutil/intmath.h" +#include "libavutil/common.h" #include "mpegaudiodsp.h" #include "mpc.h" diff --git a/arm/android/third_party/ffmpeg/libavcodec/mpc7.c b/arm/android/third_party/ffmpeg/libavcodec/mpc7.c index d2745366..59782c67 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/mpc7.c +++ b/arm/android/third_party/ffmpeg/libavcodec/mpc7.c @@ -47,24 +47,24 @@ static av_cold void mpc7_init_static(void) static VLCElem quant_tables[7224]; const uint8_t *raw_quant_table = mpc7_quant_vlcs; - INIT_VLC_STATIC_FROM_LENGTHS(&scfi_vlc, MPC7_SCFI_BITS, MPC7_SCFI_SIZE, + VLC_INIT_STATIC_FROM_LENGTHS(&scfi_vlc, MPC7_SCFI_BITS, MPC7_SCFI_SIZE, &mpc7_scfi[1], 2, &mpc7_scfi[0], 2, 1, 0, 0, 1 << MPC7_SCFI_BITS); - INIT_VLC_STATIC_FROM_LENGTHS(&dscf_vlc, MPC7_DSCF_BITS, MPC7_DSCF_SIZE, + VLC_INIT_STATIC_FROM_LENGTHS(&dscf_vlc, MPC7_DSCF_BITS, MPC7_DSCF_SIZE, &mpc7_dscf[1], 2, &mpc7_dscf[0], 2, 1, -7, 0, 1 << MPC7_DSCF_BITS); - INIT_VLC_STATIC_FROM_LENGTHS(&hdr_vlc, MPC7_HDR_BITS, MPC7_HDR_SIZE, + VLC_INIT_STATIC_FROM_LENGTHS(&hdr_vlc, MPC7_HDR_BITS, MPC7_HDR_SIZE, &mpc7_hdr[1], 2, &mpc7_hdr[0], 2, 1, -5, 0, 1 << MPC7_HDR_BITS); for (unsigned i = 0, offset = 0; i < MPC7_QUANT_VLC_TABLES; i++){ for (int j = 0; j < 2; j++) { quant_vlc[i][j].table = &quant_tables[offset]; quant_vlc[i][j].table_allocated = FF_ARRAY_ELEMS(quant_tables) - offset; - ff_init_vlc_from_lengths(&quant_vlc[i][j], 9, mpc7_quant_vlc_sizes[i], + ff_vlc_init_from_lengths(&quant_vlc[i][j], 9, mpc7_quant_vlc_sizes[i], &raw_quant_table[1], 2, &raw_quant_table[0], 2, 1, mpc7_quant_vlc_off[i], - INIT_VLC_STATIC_OVERLONG, NULL); + VLC_INIT_STATIC_OVERLONG, NULL); raw_quant_table += 2 * mpc7_quant_vlc_sizes[i]; offset += quant_vlc[i][j].table_size; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/mpc8.c b/arm/android/third_party/ffmpeg/libavcodec/mpc8.c index c1b787c3..27852591 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/mpc8.c +++ b/arm/android/third_party/ffmpeg/libavcodec/mpc8.c @@ -103,8 +103,8 @@ static av_cold void build_vlc(VLC *vlc, unsigned *buf_offset, for (unsigned tmp = num + codes_counts[i - 1]; num < tmp; num++) len[num] = i; - ff_init_vlc_from_lengths(vlc, FFMIN(len[0], 9), num, len, 1, - *syms, 1, 1, offset, INIT_VLC_STATIC_OVERLONG, NULL); + ff_vlc_init_from_lengths(vlc, FFMIN(len[0], 9), num, len, 1, + *syms, 1, 1, offset, VLC_INIT_STATIC_OVERLONG, NULL); *buf_offset += vlc->table_size; *syms += num; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/mpeg12.c b/arm/android/third_party/ffmpeg/libavcodec/mpeg12.c index 305876dd..80b3a1ad 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/mpeg12.c +++ b/arm/android/third_party/ffmpeg/libavcodec/mpeg12.c @@ -72,7 +72,7 @@ av_cold void ff_init_2d_vlc_rl(const uint16_t table_vlc[][2], RL_VLC_ELEM rl_vlc VLCElem table[680] = { 0 }; VLC vlc = { .table = table, .table_allocated = static_size }; av_assert0(static_size <= FF_ARRAY_ELEMS(table)); - init_vlc(&vlc, TEX_VLC_BITS, n + 2, &table_vlc[0][1], 4, 2, &table_vlc[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC | flags); + vlc_init(&vlc, TEX_VLC_BITS, n + 2, &table_vlc[0][1], 4, 2, &table_vlc[0][0], 4, 2, VLC_INIT_USE_STATIC | flags); for (i = 0; i < vlc.table_size; i++) { int code = vlc.table[i].sym; @@ -130,26 +130,26 @@ RL_VLC_ELEM ff_mpeg2_rl_vlc[674]; static av_cold void mpeg12_init_vlcs(void) { - INIT_VLC_STATIC(&ff_dc_lum_vlc, DC_VLC_BITS, 12, + VLC_INIT_STATIC(&ff_dc_lum_vlc, DC_VLC_BITS, 12, ff_mpeg12_vlc_dc_lum_bits, 1, 1, ff_mpeg12_vlc_dc_lum_code, 2, 2, 512); - INIT_VLC_STATIC(&ff_dc_chroma_vlc, DC_VLC_BITS, 12, + VLC_INIT_STATIC(&ff_dc_chroma_vlc, DC_VLC_BITS, 12, ff_mpeg12_vlc_dc_chroma_bits, 1, 1, ff_mpeg12_vlc_dc_chroma_code, 2, 2, 514); - INIT_VLC_STATIC(&ff_mv_vlc, MV_VLC_BITS, 17, + VLC_INIT_STATIC(&ff_mv_vlc, MV_VLC_BITS, 17, &ff_mpeg12_mbMotionVectorTable[0][1], 2, 1, &ff_mpeg12_mbMotionVectorTable[0][0], 2, 1, 266); - INIT_VLC_STATIC(&ff_mbincr_vlc, MBINCR_VLC_BITS, 36, + VLC_INIT_STATIC(&ff_mbincr_vlc, MBINCR_VLC_BITS, 36, &ff_mpeg12_mbAddrIncrTable[0][1], 2, 1, &ff_mpeg12_mbAddrIncrTable[0][0], 2, 1, 538); - INIT_VLC_STATIC(&ff_mb_pat_vlc, MB_PAT_VLC_BITS, 64, + VLC_INIT_STATIC(&ff_mb_pat_vlc, MB_PAT_VLC_BITS, 64, &ff_mpeg12_mbPatTable[0][1], 2, 1, &ff_mpeg12_mbPatTable[0][0], 2, 1, 512); - INIT_VLC_STATIC(&ff_mb_ptype_vlc, MB_PTYPE_VLC_BITS, 7, + VLC_INIT_STATIC(&ff_mb_ptype_vlc, MB_PTYPE_VLC_BITS, 7, &table_mb_ptype[0][1], 2, 1, &table_mb_ptype[0][0], 2, 1, 64); - INIT_VLC_STATIC(&ff_mb_btype_vlc, MB_BTYPE_VLC_BITS, 11, + VLC_INIT_STATIC(&ff_mb_btype_vlc, MB_BTYPE_VLC_BITS, 11, &table_mb_btype[0][1], 2, 1, &table_mb_btype[0][0], 2, 1, 64); diff --git a/arm/android/third_party/ffmpeg/libavcodec/mpeg12dec.c b/arm/android/third_party/ffmpeg/libavcodec/mpeg12dec.c index 736a1754..5a1cae99 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/mpeg12dec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/mpeg12dec.c @@ -31,6 +31,7 @@ #include #include "libavutil/attributes.h" +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/internal.h" #include "libavutil/mem_internal.h" @@ -42,6 +43,7 @@ #include "codec_internal.h" #include "decode.h" #include "error_resilience.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "idctdsp.h" #include "internal.h" @@ -74,7 +76,6 @@ typedef struct Mpeg1Context { unsigned aspect_ratio_info; AVRational save_aspect; int save_width, save_height, save_progressive_seq; - int rc_buffer_size; AVRational frame_rate_ext; /* MPEG-2 specific framerate modificator */ unsigned frame_rate_index; int sync; /* Did we reach a sync point like a GOP/SEQ/KEYFrame? */ @@ -1167,7 +1168,7 @@ static enum AVPixelFormat mpeg_get_pixelformat(AVCodecContext *avctx) else pix_fmts = mpeg12_pixfmt_list_444; - return ff_thread_get_format(avctx, pix_fmts); + return ff_get_format(avctx, pix_fmts); } /* Call this function when we know all parameters. @@ -1247,7 +1248,8 @@ static int mpeg_decode_postinit(AVCodecContext *avctx) if (ret < 0) return ret; - if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO && s->bit_rate) { + if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO && s->bit_rate && + (s->bit_rate != 0x3FFFF*400)) { avctx->rc_max_rate = s->bit_rate; } else if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO && s->bit_rate && (s->bit_rate != 0x3FFFF*400 || s->vbv_delay != 0xFFFF)) { @@ -1370,7 +1372,6 @@ static void mpeg_decode_sequence_extension(Mpeg1Context *s1) MpegEncContext *s = &s1->mpeg_enc_ctx; int horiz_size_ext, vert_size_ext; int bit_rate_ext; - AVCPBProperties *cpb_props; skip_bits(&s->gb, 1); /* profile and level esc*/ s->avctx->profile = get_bits(&s->gb, 3); @@ -1390,7 +1391,7 @@ static void mpeg_decode_sequence_extension(Mpeg1Context *s1) bit_rate_ext = get_bits(&s->gb, 12); /* XXX: handle it */ s->bit_rate += (bit_rate_ext << 18) * 400LL; check_marker(s->avctx, &s->gb, "after bit rate extension"); - s1->rc_buffer_size += get_bits(&s->gb, 8) * 1024 * 16 << 10; + s->avctx->rc_buffer_size += get_bits(&s->gb, 8) * 1024 * 16 << 10; s->low_delay = get_bits1(&s->gb); if (s->avctx->flags & AV_CODEC_FLAG_LOW_DELAY) @@ -1402,17 +1403,11 @@ static void mpeg_decode_sequence_extension(Mpeg1Context *s1) ff_dlog(s->avctx, "sequence extension\n"); s->codec_id = s->avctx->codec_id = AV_CODEC_ID_MPEG2VIDEO; - if (cpb_props = ff_add_cpb_side_data(s->avctx)) { - cpb_props->buffer_size = s1->rc_buffer_size; - if (s->bit_rate != 0x3FFFF*400) - cpb_props->max_bitrate = s->bit_rate; - } - 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:%"PRId64"\n", s->avctx->profile, s->avctx->level, s->progressive_sequence, s->chroma_format, - s1->rc_buffer_size, s->bit_rate); + s->avctx->rc_buffer_size, s->bit_rate); } static void mpeg_decode_sequence_display_extension(Mpeg1Context *s1) @@ -1656,7 +1651,7 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) } if (s->avctx->hwaccel) { - if ((ret = s->avctx->hwaccel->end_frame(s->avctx)) < 0) { + if ((ret = FF_HW_SIMPLE_CALL(s->avctx, end_frame)) < 0) { av_log(avctx, AV_LOG_ERROR, "hardware accelerator failed to decode first field\n"); return ret; @@ -1672,7 +1667,7 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) } if (avctx->hwaccel) { - if ((ret = avctx->hwaccel->start_frame(avctx, buf, buf_size)) < 0) + if ((ret = FF_HW_CALL(avctx, start_frame, buf, buf_size)) < 0) return ret; } @@ -1750,14 +1745,14 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y, return AVERROR_INVALIDDATA; } - if (avctx->hwaccel && avctx->hwaccel->decode_slice) { + if (avctx->hwaccel) { const uint8_t *buf_end, *buf_start = *buf - 4; /* include start_code */ int start_code = -1; buf_end = avpriv_find_start_code(buf_start + 2, *buf + buf_size, &start_code); if (buf_end < *buf + buf_size) buf_end -= 4; s->mb_y = mb_y; - if (avctx->hwaccel->decode_slice(avctx, buf_start, buf_end - buf_start) < 0) + if (FF_HW_CALL(avctx, decode_slice, buf_start, buf_end - buf_start) < 0) return DECODE_SLICE_ERROR; *buf = buf_end; return DECODE_SLICE_OK; @@ -2026,7 +2021,7 @@ static int slice_end(AVCodecContext *avctx, AVFrame *pict) return 0; if (s->avctx->hwaccel) { - int ret = s->avctx->hwaccel->end_frame(s->avctx); + int ret = FF_HW_SIMPLE_CALL(s->avctx, end_frame); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "hardware accelerator failed to decode picture\n"); @@ -2038,7 +2033,7 @@ static int slice_end(AVCodecContext *avctx, AVFrame *pict) if (/* s->mb_y << field_pic == s->mb_height && */ !s->first_field && !s1->first_slice) { /* end of image */ - ff_er_frame_end(&s->er); + ff_er_frame_end(&s->er, NULL); ff_mpv_frame_end(s); @@ -2102,7 +2097,7 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx, return AVERROR_INVALIDDATA; } - s1->rc_buffer_size = get_bits(&s->gb, 10) * 1024 * 16; + s->avctx->rc_buffer_size = get_bits(&s->gb, 10) * 1024 * 16; skip_bits(&s->gb, 1); /* get matrix */ @@ -2150,7 +2145,7 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx, if (s->avctx->debug & FF_DEBUG_PICT_INFO) av_log(s->avctx, AV_LOG_DEBUG, "vbv buffer: %d, bitrate:%"PRId64", aspect_ratio_info: %d \n", - s1->rc_buffer_size, s->bit_rate, s1->aspect_ratio_info); + s->avctx->rc_buffer_size, s->bit_rate, s1->aspect_ratio_info); return 0; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/mpeg12enc.c b/arm/android/third_party/ffmpeg/libavcodec/mpeg12enc.c index 4aa45e9e..0135623c 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/mpeg12enc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/mpeg12enc.c @@ -203,23 +203,23 @@ static av_cold int encode_init(AVCodecContext *avctx) } } - if (avctx->profile == FF_PROFILE_UNKNOWN) { - if (avctx->level != FF_LEVEL_UNKNOWN) { + if (avctx->profile == AV_PROFILE_UNKNOWN) { + if (avctx->level != AV_LEVEL_UNKNOWN) { av_log(avctx, AV_LOG_ERROR, "Set profile and level\n"); return AVERROR(EINVAL); } /* Main or 4:2:2 */ - avctx->profile = avctx->pix_fmt == AV_PIX_FMT_YUV420P ? FF_PROFILE_MPEG2_MAIN - : FF_PROFILE_MPEG2_422; + avctx->profile = avctx->pix_fmt == AV_PIX_FMT_YUV420P ? AV_PROFILE_MPEG2_MAIN + : AV_PROFILE_MPEG2_422; } - if (avctx->level == FF_LEVEL_UNKNOWN) { - if (avctx->profile == FF_PROFILE_MPEG2_422) { /* 4:2:2 */ + if (avctx->level == AV_LEVEL_UNKNOWN) { + if (avctx->profile == AV_PROFILE_MPEG2_422) { /* 4:2:2 */ if (avctx->width <= 720 && avctx->height <= 608) avctx->level = 5; /* Main */ else avctx->level = 2; /* High */ } else { - if (avctx->profile != FF_PROFILE_MPEG2_HIGH && + if (avctx->profile != AV_PROFILE_MPEG2_HIGH && avctx->pix_fmt != AV_PIX_FMT_YUV420P) { av_log(avctx, AV_LOG_ERROR, "Only High(1) and 4:2:2(0) profiles support 4:2:2 color sampling\n"); @@ -366,7 +366,7 @@ static void mpeg1_encode_sequence_header(MpegEncContext *s) put_header(s, EXT_START_CODE); put_bits(&s->pb, 4, 1); // seq ext - put_bits(&s->pb, 1, s->avctx->profile == FF_PROFILE_MPEG2_422); // escx 1 for 4:2:2 profile + put_bits(&s->pb, 1, s->avctx->profile == AV_PROFILE_MPEG2_422); // escx 1 for 4:2:2 profile put_bits(&s->pb, 3, s->avctx->profile); // profile put_bits(&s->pb, 4, s->avctx->level); // level diff --git a/arm/android/third_party/ffmpeg/libavcodec/mpeg4videodec.c b/arm/android/third_party/ffmpeg/libavcodec/mpeg4videodec.c index 5ce244d0..c946b127 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/mpeg4videodec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/mpeg4videodec.c @@ -295,7 +295,7 @@ void ff_mpeg4_decode_studio(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb int hsub = i ? s->chroma_x_shift : 0; int lowres = s->avctx->lowres; int step = 1 << lowres; - dest_pcm[i] += (linesize[i] / 2) * ((16 >> vsub) - 1); + dest_pcm[i] += (linesize[i] / 2) * ((16 >> vsub + lowres) - 1); for (int h = (16 >> (vsub + lowres)) - 1; h >= 0; h--){ for (int w = (16 >> (hsub + lowres)) - 1, idx = 0; w >= 0; w--, idx += step) dest_pcm[i][w] = src[idx]; @@ -861,7 +861,7 @@ static inline int get_amv(Mpeg4DecContext *ctx, int n) for (y = 0; y < 16; y++) { int v; - v = mb_v + dy * y; + v = mb_v + (unsigned)dy * y; // FIXME optimize for (x = 0; x < 16; x++) { sum += v >> shift; @@ -2564,10 +2564,10 @@ static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb) */ if (ctx->vo_type == CORE_STUDIO_VO_TYPE || ctx->vo_type == SIMPLE_STUDIO_VO_TYPE) { - if (s->avctx->profile != FF_PROFILE_UNKNOWN && s->avctx->profile != FF_PROFILE_MPEG4_SIMPLE_STUDIO) + if (s->avctx->profile != AV_PROFILE_UNKNOWN && s->avctx->profile != AV_PROFILE_MPEG4_SIMPLE_STUDIO) return AVERROR_INVALIDDATA; s->studio_profile = 1; - s->avctx->profile = FF_PROFILE_MPEG4_SIMPLE_STUDIO; + s->avctx->profile = AV_PROFILE_MPEG4_SIMPLE_STUDIO; return decode_studio_vol_header(ctx, gb); } else if (s->studio_profile) { return AVERROR_PATCHWELCOME; @@ -3141,9 +3141,6 @@ static int decode_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb, av_log(s->avctx, AV_LOG_WARNING, "time_increment_bits set to %d bits, based on bitstream analysis\n", ctx->time_increment_bits); - if (s->avctx->framerate.num && 4*s->avctx->framerate.num < 1<time_increment_bits) { - s->avctx->framerate.num = 1<time_increment_bits; - } } if (IS_3IV1) @@ -3605,7 +3602,7 @@ int ff_mpeg4_decode_picture_header(Mpeg4DecContext *ctx, GetBitContext *gb, } else if (startcode == VOS_STARTCODE) { int profile, level; mpeg4_decode_profile_level(s, gb, &profile, &level); - if (profile == FF_PROFILE_MPEG4_SIMPLE_STUDIO && + if (profile == AV_PROFILE_MPEG4_SIMPLE_STUDIO && (level > 0 && level < 9)) { s->studio_profile = 1; next_start_code_studio(gb); @@ -3761,12 +3758,12 @@ static av_cold void mpeg4_init_static(void) { static uint8_t mpeg4_rvlc_rl_tables[2][2][2 * MAX_RUN + MAX_LEVEL + 3]; - INIT_VLC_STATIC_FROM_LENGTHS(&studio_luma_dc, STUDIO_INTRA_BITS, 19, + VLC_INIT_STATIC_FROM_LENGTHS(&studio_luma_dc, STUDIO_INTRA_BITS, 19, &ff_mpeg4_studio_dc_luma[0][1], 2, &ff_mpeg4_studio_dc_luma[0][0], 2, 1, 0, 0, 528); - INIT_VLC_STATIC_FROM_LENGTHS(&studio_chroma_dc, STUDIO_INTRA_BITS, 19, + VLC_INIT_STATIC_FROM_LENGTHS(&studio_chroma_dc, STUDIO_INTRA_BITS, 19, &ff_mpeg4_studio_dc_chroma[0][1], 2, &ff_mpeg4_studio_dc_chroma[0][0], 2, 1, 0, 0, 528); @@ -3776,11 +3773,11 @@ static av_cold void mpeg4_init_static(void) studio_intra_tab[i].table = &vlc_buf[offset]; studio_intra_tab[i].table_allocated = FF_ARRAY_ELEMS(vlc_buf) - offset; - ff_init_vlc_from_lengths(&studio_intra_tab[i], + ff_vlc_init_from_lengths(&studio_intra_tab[i], STUDIO_INTRA_BITS, 24, &ff_mpeg4_studio_intra[i][0][1], 2, &ff_mpeg4_studio_intra[i][0][0], 2, 1, - 0, INIT_VLC_STATIC_OVERLONG, NULL); + 0, VLC_INIT_STATIC_OVERLONG, NULL); offset += studio_intra_tab[i].table_size; } @@ -3788,18 +3785,18 @@ static av_cold void mpeg4_init_static(void) ff_rl_init(&ff_rvlc_rl_inter, mpeg4_rvlc_rl_tables[0]); ff_rl_init(&ff_rvlc_rl_intra, mpeg4_rvlc_rl_tables[1]); INIT_FIRST_VLC_RL(ff_mpeg4_rl_intra, 554); - INIT_VLC_RL(ff_rvlc_rl_inter, 1072); + VLC_INIT_RL(ff_rvlc_rl_inter, 1072); INIT_FIRST_VLC_RL(ff_rvlc_rl_intra, 1072); - INIT_VLC_STATIC(&dc_lum, DC_VLC_BITS, 10 /* 13 */, + VLC_INIT_STATIC(&dc_lum, DC_VLC_BITS, 10 /* 13 */, &ff_mpeg4_DCtab_lum[0][1], 2, 1, &ff_mpeg4_DCtab_lum[0][0], 2, 1, 512); - INIT_VLC_STATIC(&dc_chrom, DC_VLC_BITS, 10 /* 13 */, + VLC_INIT_STATIC(&dc_chrom, DC_VLC_BITS, 10 /* 13 */, &ff_mpeg4_DCtab_chrom[0][1], 2, 1, &ff_mpeg4_DCtab_chrom[0][0], 2, 1, 512); - INIT_VLC_STATIC_FROM_LENGTHS(&sprite_trajectory, SPRITE_TRAJ_VLC_BITS, 15, + VLC_INIT_STATIC_FROM_LENGTHS(&sprite_trajectory, SPRITE_TRAJ_VLC_BITS, 15, ff_sprite_trajectory_lens, 1, NULL, 0, 0, 0, 0, 128); - INIT_VLC_STATIC(&mb_type_b_vlc, MB_TYPE_B_VLC_BITS, 4, + VLC_INIT_STATIC(&mb_type_b_vlc, MB_TYPE_B_VLC_BITS, 4, &ff_mb_type_b_tab[0][1], 2, 1, &ff_mb_type_b_tab[0][0], 2, 1, 16); } diff --git a/arm/android/third_party/ffmpeg/libavcodec/mpeg4videoenc.c b/arm/android/third_party/ffmpeg/libavcodec/mpeg4videoenc.c index 777635c4..d1e50612 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/mpeg4videoenc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/mpeg4videoenc.c @@ -916,7 +916,7 @@ static void mpeg4_encode_visual_object_header(MpegEncContext *s) int profile_and_level_indication; int vo_ver_id; - if (s->avctx->profile != FF_PROFILE_UNKNOWN) { + if (s->avctx->profile != AV_PROFILE_UNKNOWN) { profile_and_level_indication = s->avctx->profile << 4; } else if (s->max_b_frames || s->quarter_sample) { profile_and_level_indication = 0xF0; // adv simple @@ -924,7 +924,7 @@ static void mpeg4_encode_visual_object_header(MpegEncContext *s) profile_and_level_indication = 0x00; // simple } - if (s->avctx->level != FF_LEVEL_UNKNOWN) + if (s->avctx->level != AV_LEVEL_UNKNOWN) profile_and_level_indication |= s->avctx->level; else profile_and_level_indication |= 1; // level 1 diff --git a/arm/android/third_party/ffmpeg/libavcodec/mpegaudiodec_common.c b/arm/android/third_party/ffmpeg/libavcodec/mpegaudiodec_common.c index 5fcb39b3..3a60b03e 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/mpegaudiodec_common.c +++ b/arm/android/third_party/ffmpeg/libavcodec/mpegaudiodec_common.c @@ -428,9 +428,9 @@ static av_cold void mpegaudiodec_common_init_static(void) ff_huff_vlc[++i].table = huff_vlc_tables + offset; ff_huff_vlc[i].table_allocated = FF_ARRAY_ELEMS(huff_vlc_tables) - offset; - ff_init_vlc_from_lengths(&ff_huff_vlc[i], 7, j, + ff_vlc_init_from_lengths(&ff_huff_vlc[i], 7, j, huff_lens, 1, tmp_symbols, 2, 2, - 0, INIT_VLC_STATIC_OVERLONG, NULL); + 0, VLC_INIT_STATIC_OVERLONG, NULL); offset += ff_huff_vlc[i].table_size; huff_lens += j; huff_sym += j; @@ -443,9 +443,9 @@ static av_cold void mpegaudiodec_common_init_static(void) ff_huff_quad_vlc[i].table = huff_quad_vlc_tables + offset; ff_huff_quad_vlc[i].table_allocated = 1 << bits; offset += 1 << bits; - init_vlc(&ff_huff_quad_vlc[i], bits, 16, + vlc_init(&ff_huff_quad_vlc[i], bits, 16, mpa_quad_bits[i], 1, 1, mpa_quad_codes[i], 1, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); } av_assert0(offset == FF_ARRAY_ELEMS(huff_quad_vlc_tables)); diff --git a/arm/android/third_party/ffmpeg/libavcodec/mpegaudiodsp.c b/arm/android/third_party/ffmpeg/libavcodec/mpegaudiodsp.c index 5a5a679d..0971c287 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/mpegaudiodsp.c +++ b/arm/android/third_party/ffmpeg/libavcodec/mpegaudiodsp.c @@ -23,7 +23,6 @@ #include "libavutil/thread.h" #include "mpegaudio.h" #include "mpegaudiodsp.h" -#include "dct.h" #include "dct32.h" static AVOnce mpadsp_table_init = AV_ONCE_INIT; @@ -81,15 +80,12 @@ static av_cold void mpadsp_init_tabs(void) av_cold void ff_mpadsp_init(MPADSPContext *s) { - DCTContext dct; - - ff_dct_init(&dct, 5, DCT_II); ff_thread_once(&mpadsp_table_init, &mpadsp_init_tabs); s->apply_window_float = ff_mpadsp_apply_window_float; s->apply_window_fixed = ff_mpadsp_apply_window_fixed; - s->dct32_float = dct.dct32; + s->dct32_float = ff_dct32_float; s->dct32_fixed = ff_dct32_fixed; s->imdct36_blocks_float = ff_imdct36_blocks_float; diff --git a/arm/android/third_party/ffmpeg/libavcodec/mpegpicture.c b/arm/android/third_party/ffmpeg/libavcodec/mpegpicture.c index 71c7a3fd..b7c804c8 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/mpegpicture.c +++ b/arm/android/third_party/ffmpeg/libavcodec/mpegpicture.c @@ -171,17 +171,10 @@ static int alloc_frame_buffer(AVCodecContext *avctx, Picture *pic, pic->f->height = avctx->height; } - if (avctx->hwaccel) { - assert(!pic->hwaccel_picture_private); - if (avctx->hwaccel->frame_priv_data_size) { - pic->hwaccel_priv_buf = ff_hwaccel_frame_priv_alloc(avctx, avctx->hwaccel); - if (!pic->hwaccel_priv_buf) { - av_log(avctx, AV_LOG_ERROR, "alloc_frame_buffer() failed (hwaccel private data allocation)\n"); - return -1; - } - pic->hwaccel_picture_private = pic->hwaccel_priv_buf->data; - } - } + ret = ff_hwaccel_frame_priv_alloc(avctx, &pic->hwaccel_picture_private, + &pic->hwaccel_priv_buf); + if (ret < 0) + return ret; if ((linesize && linesize != pic->f->linesize[0]) || (uvlinesize && uvlinesize != pic->f->linesize[1])) { diff --git a/arm/android/third_party/ffmpeg/libavcodec/mpegutils.c b/arm/android/third_party/ffmpeg/libavcodec/mpegutils.c index 2d812a25..5e76d7ac 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/mpegutils.c +++ b/arm/android/third_party/ffmpeg/libavcodec/mpegutils.c @@ -21,6 +21,7 @@ #include #include "libavutil/common.h" +#include "libavutil/emms.h" #include "libavutil/frame.h" #include "libavutil/pixdesc.h" #include "libavutil/motion_vector.h" diff --git a/arm/android/third_party/ffmpeg/libavcodec/mpegvideo_dec.c b/arm/android/third_party/ffmpeg/libavcodec/mpegvideo_dec.c index 670b0912..f9fccff5 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/mpegvideo_dec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/mpegvideo_dec.c @@ -25,6 +25,7 @@ #include "config_components.h" #include "libavutil/avassert.h" +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/internal.h" #include "libavutil/video_enc_params.h" @@ -36,6 +37,7 @@ #include "mpegvideo.h" #include "mpegvideodec.h" #include "mpeg4videodec.h" +#include "thread.h" #include "threadframe.h" #include "wmv2dec.h" @@ -154,21 +156,16 @@ do {\ s->divx_packed = s1->divx_packed; if (s1->bitstream_buffer) { - if (s1->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); - if (!s->bitstream_buffer) { - s->bitstream_buffer_size = 0; - return AVERROR(ENOMEM); - } + av_fast_padded_malloc(&s->bitstream_buffer, + &s->allocated_bitstream_buffer_size, + s1->bitstream_buffer_size); + if (!s->bitstream_buffer) { + s->bitstream_buffer_size = 0; + return AVERROR(ENOMEM); } s->bitstream_buffer_size = s1->bitstream_buffer_size; memcpy(s->bitstream_buffer, s1->bitstream_buffer, s1->bitstream_buffer_size); - memset(s->bitstream_buffer + s->bitstream_buffer_size, 0, - AV_INPUT_BUFFER_PADDING_SIZE); } // linesize-dependent scratch buffer allocation @@ -248,14 +245,16 @@ static int alloc_picture(MpegEncContext *s, Picture *pic) &s->linesize, &s->uvlinesize); } -static void gray_frame(AVFrame *frame) +static void color_frame(AVFrame *frame, int luma) { int h_chroma_shift, v_chroma_shift; - av_pix_fmt_get_chroma_sub_sample(frame->format, &h_chroma_shift, &v_chroma_shift); - for (int i = 0; i < frame->height; i++) - memset(frame->data[0] + frame->linesize[0] * i, 0x80, frame->width); + memset(frame->data[0] + frame->linesize[0] * i, luma, frame->width); + + if (!frame->data[1]) + return; + av_pix_fmt_get_chroma_sub_sample(frame->format, &h_chroma_shift, &v_chroma_shift); for (int i = 0; i < AV_CEIL_RSHIFT(frame->height, v_chroma_shift); i++) { memset(frame->data[1] + frame->linesize[1] * i, 0x80, AV_CEIL_RSHIFT(frame->width, h_chroma_shift)); @@ -366,9 +365,6 @@ FF_ENABLE_DEPRECATION_WARNINGS if ((!s->last_picture_ptr || !s->last_picture_ptr->f->buf[0]) && (s->pict_type != AV_PICTURE_TYPE_I)) { - int h_chroma_shift, v_chroma_shift; - av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, - &h_chroma_shift, &v_chroma_shift); if (s->pict_type == AV_PICTURE_TYPE_B && s->next_picture_ptr && s->next_picture_ptr->f->buf[0]) av_log(avctx, AV_LOG_DEBUG, "allocating dummy last picture for B frame\n"); @@ -394,23 +390,8 @@ FF_ENABLE_DEPRECATION_WARNINGS } if (!avctx->hwaccel) { - for (int 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); - if (s->last_picture_ptr->f->data[2]) { - for (int i = 0; i < AV_CEIL_RSHIFT(avctx->height, v_chroma_shift); i++) { - memset(s->last_picture_ptr->f->data[1] + s->last_picture_ptr->f->linesize[1]*i, - 0x80, AV_CEIL_RSHIFT(avctx->width, h_chroma_shift)); - memset(s->last_picture_ptr->f->data[2] + s->last_picture_ptr->f->linesize[2]*i, - 0x80, AV_CEIL_RSHIFT(avctx->width, h_chroma_shift)); - } - } - - if (s->codec_id == AV_CODEC_ID_FLV1 || s->codec_id == AV_CODEC_ID_H263) { - for (int i = 0; i < avctx->height; i++) - memset(s->last_picture_ptr->f->data[0] + s->last_picture_ptr->f->linesize[0] * i, - 16, avctx->width); - } + int luma_val = s->codec_id == AV_CODEC_ID_FLV1 || s->codec_id == AV_CODEC_ID_H263 ? 16 : 0x80; + color_frame(s->last_picture_ptr->f, luma_val); } ff_thread_report_progress(&s->last_picture_ptr->tf, INT_MAX, 0); @@ -438,10 +419,6 @@ FF_ENABLE_DEPRECATION_WARNINGS ff_thread_report_progress(&s->next_picture_ptr->tf, INT_MAX, 1); } -#if 0 // BUFREF-FIXME - memset(s->last_picture.f->data, 0, sizeof(s->last_picture.f->data)); - memset(s->next_picture.f->data, 0, sizeof(s->next_picture.f->data)); -#endif if (s->last_picture_ptr) { if (s->last_picture_ptr->f->buf[0] && (ret = ff_mpeg_ref_picture(s->avctx, &s->last_picture, @@ -485,7 +462,7 @@ FF_ENABLE_DEPRECATION_WARNINGS } if (s->avctx->debug & FF_DEBUG_NOMC) - gray_frame(s->current_picture_ptr->f); + color_frame(s->current_picture_ptr->f, 0x80); return 0; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/mpegvideo_enc.c b/arm/android/third_party/ffmpeg/libavcodec/mpegvideo_enc.c index 9bdf5dbe..5bf4b06a 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/mpegvideo_enc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/mpegvideo_enc.c @@ -35,6 +35,7 @@ #include +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "libavutil/intmath.h" #include "libavutil/mathematics.h" @@ -43,7 +44,6 @@ #include "libavutil/opt.h" #include "libavutil/thread.h" #include "avcodec.h" -#include "dct.h" #include "encode.h" #include "idctdsp.h" #include "mpeg12codecs.h" @@ -973,7 +973,7 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx) } } - cpb_props = ff_add_cpb_side_data(avctx); + cpb_props = ff_encode_add_cpb_side_data(avctx); if (!cpb_props) return AVERROR(ENOMEM); cpb_props->max_bitrate = avctx->rc_max_rate; diff --git a/arm/android/third_party/ffmpeg/libavcodec/mpegvideo_parser.c b/arm/android/third_party/ffmpeg/libavcodec/mpegvideo_parser.c index 1204789c..2cd03483 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/mpegvideo_parser.c +++ b/arm/android/third_party/ffmpeg/libavcodec/mpegvideo_parser.c @@ -105,22 +105,23 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s, { struct MpvParseContext *pc = s->priv_data; const uint8_t *buf_end = buf + buf_size; - uint32_t start_code; - int frame_rate_index, ext_type, bytes_left; - int frame_rate_ext_n, frame_rate_ext_d; - int top_field_first, repeat_first_field, progressive_frame; - int horiz_size_ext, vert_size_ext, bit_rate_ext; + int bytes_left; int did_set_size=0; 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; + // number of picture coding extensions (i.e. MPEG2 pictures) + // in this packet - should be 1 or 2 + int nb_pic_ext = 0; + // when there are two pictures in the packet this indicates + // which field is in the first of them + int first_field = AV_FIELD_UNKNOWN; + +//FIXME replace the crap with get_bits() while (buf < buf_end) { - start_code= -1; + uint32_t start_code = -1; buf= avpriv_find_start_code(buf, buf_end, &start_code); bytes_left = buf_end - buf; switch(start_code) { @@ -129,11 +130,12 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s, s->pict_type = (buf[1] >> 3) & 7; if (bytes_left >= 4) vbv_delay = ((buf[1] & 0x07) << 13) | (buf[2] << 5) | (buf[3] >> 3); - s->repeat_pict = 1; } break; case SEQ_START_CODE: if (bytes_left >= 7) { + int frame_rate_index; + pc->width = (buf[0] << 4) | (buf[1] >> 4); pc->height = ((buf[1] & 0x0f) << 8) | buf[2]; if(!avctx->width || !avctx->height || !avctx->coded_width || !avctx->coded_height){ @@ -154,20 +156,18 @@ FF_ENABLE_DEPRECATION_WARNINGS break; case EXT_START_CODE: if (bytes_left >= 1) { - ext_type = (buf[0] >> 4); - switch(ext_type) { + switch (buf[0] >> 4) { // ext_type case 0x1: /* sequence extension */ if (bytes_left >= 6) { - horiz_size_ext = ((buf[1] & 1) << 1) | (buf[2] >> 7); - vert_size_ext = (buf[2] >> 5) & 3; - bit_rate_ext = ((buf[2] & 0x1F)<<7) | (buf[3]>>1); - frame_rate_ext_n = (buf[5] >> 5) & 3; - frame_rate_ext_d = (buf[5] & 0x1f); + int horiz_size_ext = ((buf[1] & 1) << 1) | (buf[2] >> 7); + int vert_size_ext = (buf[2] >> 5) & 3; + int bit_rate_ext = ((buf[2] & 0x1F)<<7) | (buf[3]>>1); + int frame_rate_ext_n = (buf[5] >> 5) & 3; + int frame_rate_ext_d = (buf[5] & 0x1f); pc->progressive_sequence = buf[1] & (1 << 3); avctx->has_b_frames= !(buf[5] >> 7); - chroma_format = (buf[1] >> 1) & 3; - switch (chroma_format) { + switch ((buf[1] >> 1) & 3) { // 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; @@ -190,11 +190,12 @@ FF_ENABLE_DEPRECATION_WARNINGS break; case 0x8: /* picture coding extension */ if (bytes_left >= 5) { - top_field_first = buf[3] & (1 << 7); - repeat_first_field = buf[3] & (1 << 1); - progressive_frame = buf[4] & (1 << 7); + int top_field_first = buf[3] & (1 << 7); + int repeat_first_field = buf[3] & (1 << 1); + int progressive_frame = buf[4] & (1 << 7); /* check if we must repeat the frame */ + s->repeat_pict = 1; if (repeat_first_field) { if (pc->progressive_sequence) { if (top_field_first) @@ -213,6 +214,19 @@ FF_ENABLE_DEPRECATION_WARNINGS s->field_order = AV_FIELD_BB; } else s->field_order = AV_FIELD_PROGRESSIVE; + + s->picture_structure = buf[2] & 3; + + if (!nb_pic_ext) { + // remember parity of the first field for the case + // when there are 2 fields in packet + switch (s->picture_structure) { + case AV_PICTURE_STRUCTURE_BOTTOM_FIELD: first_field = AV_FIELD_BB; break; + case AV_PICTURE_STRUCTURE_TOP_FIELD: first_field = AV_FIELD_TT; break; + } + } + + nb_pic_ext++; } break; } @@ -233,7 +247,7 @@ FF_ENABLE_DEPRECATION_WARNINGS if (set_dim_ret < 0) av_log(avctx, AV_LOG_ERROR, "Failed to set dimensions\n"); - if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO && bit_rate) { + if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO && bit_rate && bit_rate != 0x3FFFF) { avctx->rc_max_rate = 400LL*bit_rate; } if (bit_rate && @@ -248,6 +262,12 @@ FF_ENABLE_DEPRECATION_WARNINGS s->coded_width = FFALIGN(pc->width, 16); s->coded_height = FFALIGN(pc->height, 16); } + + if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO || nb_pic_ext > 1) { + s->repeat_pict = 1; + s->picture_structure = AV_PICTURE_STRUCTURE_FRAME; + s->field_order = nb_pic_ext > 1 ? first_field : AV_FIELD_PROGRESSIVE; + } } static int mpegvideo_parse(AVCodecParserContext *s, diff --git a/arm/android/third_party/ffmpeg/libavcodec/msmpeg4_vc1_data.c b/arm/android/third_party/ffmpeg/libavcodec/msmpeg4_vc1_data.c index 059c6f32..e6436687 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/msmpeg4_vc1_data.c +++ b/arm/android/third_party/ffmpeg/libavcodec/msmpeg4_vc1_data.c @@ -38,20 +38,20 @@ VLC ff_msmp4_dc_chroma_vlc[2]; static av_cold void msmp4_vc1_vlcs_init(void) { - INIT_VLC_STATIC(&ff_msmp4_dc_luma_vlc[0], MSMP4_DC_VLC_BITS, 120, + VLC_INIT_STATIC(&ff_msmp4_dc_luma_vlc[0], MSMP4_DC_VLC_BITS, 120, &ff_table0_dc_lum[0][1], 8, 4, &ff_table0_dc_lum[0][0], 8, 4, 1158); - INIT_VLC_STATIC(&ff_msmp4_dc_chroma_vlc[0], MSMP4_DC_VLC_BITS, 120, + VLC_INIT_STATIC(&ff_msmp4_dc_chroma_vlc[0], MSMP4_DC_VLC_BITS, 120, &ff_table0_dc_chroma[0][1], 8, 4, &ff_table0_dc_chroma[0][0], 8, 4, 1118); - INIT_VLC_STATIC(&ff_msmp4_dc_luma_vlc[1], MSMP4_DC_VLC_BITS, 120, + VLC_INIT_STATIC(&ff_msmp4_dc_luma_vlc[1], MSMP4_DC_VLC_BITS, 120, &ff_table1_dc_lum[0][1], 8, 4, &ff_table1_dc_lum[0][0], 8, 4, 1476); - INIT_VLC_STATIC(&ff_msmp4_dc_chroma_vlc[1], MSMP4_DC_VLC_BITS, 120, + VLC_INIT_STATIC(&ff_msmp4_dc_chroma_vlc[1], MSMP4_DC_VLC_BITS, 120, &ff_table1_dc_chroma[0][1], 8, 4, &ff_table1_dc_chroma[0][0], 8, 4, 1216); - INIT_VLC_STATIC(&ff_msmp4_mb_i_vlc, MSMP4_MB_INTRA_VLC_BITS, 64, + VLC_INIT_STATIC(&ff_msmp4_mb_i_vlc, MSMP4_MB_INTRA_VLC_BITS, 64, &ff_msmp4_mb_i_table[0][1], 4, 2, &ff_msmp4_mb_i_table[0][0], 4, 2, 536); } diff --git a/arm/android/third_party/ffmpeg/libavcodec/msmpeg4dec.c b/arm/android/third_party/ffmpeg/libavcodec/msmpeg4dec.c index 26a196a3..a81241b1 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/msmpeg4dec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/msmpeg4dec.c @@ -301,33 +301,33 @@ static av_cold void msmpeg4_decode_init_static(void) INIT_FIRST_VLC_RL(ff_rl_table[0], 642); INIT_FIRST_VLC_RL(ff_rl_table[1], 1104); INIT_FIRST_VLC_RL(ff_rl_table[2], 554); - INIT_VLC_RL(ff_rl_table[3], 940); - INIT_VLC_RL(ff_rl_table[4], 962); + VLC_INIT_RL(ff_rl_table[3], 940); + VLC_INIT_RL(ff_rl_table[4], 962); /* ff_rl_table[5] coincides with ff_h263_rl_inter which has just been * initialized in ff_h263_decode_init() earlier. So just copy the VLCs. */ av_assert1(ff_h263_rl_inter.rl_vlc[0]); memcpy(ff_rl_table[5].rl_vlc, ff_h263_rl_inter.rl_vlc, sizeof(ff_rl_table[5].rl_vlc)); mv = &ff_mv_tables[0]; - INIT_VLC_STATIC(&mv->vlc, MV_VLC_BITS, MSMPEG4_MV_TABLES_NB_ELEMS + 1, + VLC_INIT_STATIC(&mv->vlc, MV_VLC_BITS, MSMPEG4_MV_TABLES_NB_ELEMS + 1, mv->table_mv_bits, 1, 1, mv->table_mv_code, 2, 2, 3714); mv = &ff_mv_tables[1]; - INIT_VLC_STATIC(&mv->vlc, MV_VLC_BITS, MSMPEG4_MV_TABLES_NB_ELEMS + 1, + VLC_INIT_STATIC(&mv->vlc, MV_VLC_BITS, MSMPEG4_MV_TABLES_NB_ELEMS + 1, mv->table_mv_bits, 1, 1, mv->table_mv_code, 2, 2, 2694); - INIT_VLC_STATIC(&v2_dc_lum_vlc, MSMP4_DC_VLC_BITS, 512, + VLC_INIT_STATIC(&v2_dc_lum_vlc, MSMP4_DC_VLC_BITS, 512, &ff_v2_dc_lum_table[0][1], 8, 4, &ff_v2_dc_lum_table[0][0], 8, 4, 1472); - INIT_VLC_STATIC(&v2_dc_chroma_vlc, MSMP4_DC_VLC_BITS, 512, + VLC_INIT_STATIC(&v2_dc_chroma_vlc, MSMP4_DC_VLC_BITS, 512, &ff_v2_dc_chroma_table[0][1], 8, 4, &ff_v2_dc_chroma_table[0][0], 8, 4, 1506); - INIT_VLC_STATIC(&v2_intra_cbpc_vlc, V2_INTRA_CBPC_VLC_BITS, 4, + VLC_INIT_STATIC(&v2_intra_cbpc_vlc, V2_INTRA_CBPC_VLC_BITS, 4, &ff_v2_intra_cbpc[0][1], 2, 1, &ff_v2_intra_cbpc[0][0], 2, 1, 8); - INIT_VLC_STATIC(&v2_mb_type_vlc, V2_MB_TYPE_VLC_BITS, 8, + VLC_INIT_STATIC(&v2_mb_type_vlc, V2_MB_TYPE_VLC_BITS, 8, &ff_v2_mb_type[0][1], 2, 1, &ff_v2_mb_type[0][0], 2, 1, 128); @@ -335,14 +335,14 @@ static av_cold void msmpeg4_decode_init_static(void) static VLCElem vlc_buf[1636 + 2648 + 1532 + 2488]; ff_mb_non_intra_vlc[i].table = &vlc_buf[offset]; ff_mb_non_intra_vlc[i].table_allocated = FF_ARRAY_ELEMS(vlc_buf) - offset; - init_vlc(&ff_mb_non_intra_vlc[i], MB_NON_INTRA_VLC_BITS, 128, + vlc_init(&ff_mb_non_intra_vlc[i], MB_NON_INTRA_VLC_BITS, 128, &ff_wmv2_inter_table[i][0][1], 8, 4, &ff_wmv2_inter_table[i][0][0], 8, 4, - INIT_VLC_STATIC_OVERLONG); + VLC_INIT_STATIC_OVERLONG); offset += ff_mb_non_intra_vlc[i].table_size; } - INIT_VLC_STATIC(&ff_inter_intra_vlc, INTER_INTRA_VLC_BITS, 4, + VLC_INIT_STATIC(&ff_inter_intra_vlc, INTER_INTRA_VLC_BITS, 4, &ff_table_inter_intra[0][1], 2, 1, &ff_table_inter_intra[0][0], 2, 1, 8); ff_msmp4_vc1_vlcs_init_once(); diff --git a/arm/android/third_party/ffmpeg/libavcodec/msmpeg4enc.c b/arm/android/third_party/ffmpeg/libavcodec/msmpeg4enc.c index 9828901b..a8ddb8d8 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/msmpeg4enc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/msmpeg4enc.c @@ -284,7 +284,7 @@ void ff_msmpeg4_encode_ext_header(MpegEncContext * s) if (s->avctx->framerate.num > 0 && s->avctx->framerate.den > 0) fps = s->avctx->framerate.num / s->avctx->framerate.den; - else + else { FF_DISABLE_DEPRECATION_WARNINGS fps = s->avctx->time_base.den / s->avctx->time_base.num #if FF_API_TICKS_PER_FRAME @@ -292,6 +292,7 @@ FF_DISABLE_DEPRECATION_WARNINGS #endif ; FF_ENABLE_DEPRECATION_WARNINGS + } put_bits(&s->pb, 5, FFMIN(fps, 31)); //yes 29.97 -> 29 diff --git a/arm/android/third_party/ffmpeg/libavcodec/mss2.c b/arm/android/third_party/ffmpeg/libavcodec/mss2.c index 98103f7f..2237cc8b 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/mss2.c +++ b/arm/android/third_party/ffmpeg/libavcodec/mss2.c @@ -324,7 +324,7 @@ static int decode_rle(GetBitContext *gb, uint8_t *pal_dst, ptrdiff_t pal_stride, if (next_code != 1 << current_length) return AVERROR_INVALIDDATA; - if ((i = init_vlc(&vlc, 9, alphabet_size, bits, 1, 1, codes, 4, 4, 0)) < 0) + if ((i = vlc_init(&vlc, 9, alphabet_size, bits, 1, 1, codes, 4, 4, 0)) < 0) return i; /* frame decode */ @@ -371,7 +371,7 @@ static int decode_rle(GetBitContext *gb, uint8_t *pal_dst, ptrdiff_t pal_stride, prev_avail = 1; } while (--h); - ff_free_vlc(&vlc); + ff_vlc_free(&vlc); return 0; } @@ -422,7 +422,7 @@ static int decode_wmv9(AVCodecContext *avctx, const uint8_t *buf, int buf_size, ff_vc1_decode_blocks(v); if (v->end_mb_x == s->mb_width && s->end_mb_y == s->mb_height) { - ff_er_frame_end(&s->er); + ff_er_frame_end(&s->er, NULL); } else { av_log(v->s.avctx, AV_LOG_WARNING, "disabling error correction due to block count mismatch %dx%d != %dx%d\n", @@ -797,8 +797,7 @@ static int mss2_decode_frame(AVCodecContext *avctx, AVFrame *frame, av_log(avctx, AV_LOG_WARNING, "buffer not fully consumed\n"); if (c->mvX < 0 || c->mvY < 0) { - av_frame_unref(ctx->last_pic); - ret = av_frame_ref(ctx->last_pic, frame); + ret = av_frame_replace(ctx->last_pic, frame); if (ret < 0) return ret; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/mss4.c b/arm/android/third_party/ffmpeg/libavcodec/mss4.c index 75f31bed..0e7cc3e1 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/mss4.c +++ b/arm/android/third_party/ffmpeg/libavcodec/mss4.c @@ -115,9 +115,9 @@ static av_cold void mss4_init_vlc(VLC *vlc, unsigned *offset, vlc->table = &vlc_buf[*offset]; vlc->table_allocated = FF_ARRAY_ELEMS(vlc_buf) - *offset; - ff_init_vlc_from_lengths(vlc, FFMIN(bits[idx - 1], 9), idx, + ff_vlc_init_from_lengths(vlc, FFMIN(bits[idx - 1], 9), idx, bits, 1, syms, 1, 1, - 0, INIT_VLC_STATIC_OVERLONG, NULL); + 0, VLC_INIT_STATIC_OVERLONG, NULL); *offset += vlc->table_size; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/mv30.c b/arm/android/third_party/ffmpeg/libavcodec/mv30.c index c2d05470..9c72c008 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/mv30.c +++ b/arm/android/third_party/ffmpeg/libavcodec/mv30.c @@ -643,8 +643,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, return ret; } - av_frame_unref(s->prev_frame); - if ((ret = av_frame_ref(s->prev_frame, frame)) < 0) + if ((ret = av_frame_replace(s->prev_frame, frame)) < 0) return ret; *got_frame = 1; @@ -658,7 +657,7 @@ static const uint8_t cbp_bits[] = { static av_cold void init_static_data(void) { - INIT_VLC_STATIC_FROM_LENGTHS(&cbp_tab, CBP_VLC_BITS, FF_ARRAY_ELEMS(cbp_bits), + VLC_INIT_STATIC_FROM_LENGTHS(&cbp_tab, CBP_VLC_BITS, FF_ARRAY_ELEMS(cbp_bits), cbp_bits, 1, NULL, 0, 0, 0, 0, 1 << CBP_VLC_BITS); } diff --git a/arm/android/third_party/ffmpeg/libavcodec/mvha.c b/arm/android/third_party/ffmpeg/libavcodec/mvha.c index 8fb4a69e..356cebc6 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/mvha.c +++ b/arm/android/third_party/ffmpeg/libavcodec/mvha.c @@ -83,7 +83,7 @@ static int build_vlc(AVCodecContext *avctx, VLC *vlc) uint8_t xlat[256]; int cur_node, i, j, pos = 0; - ff_free_vlc(vlc); + ff_vlc_free(vlc); for (i = 0; i < s->nb_symbols; i++) { nodes[i].count = s->prob[i]; @@ -140,7 +140,7 @@ static int build_vlc(AVCodecContext *avctx, VLC *vlc) get_tree_codes(bits, lens, xlat, nodes, cur_node - 1, 0, 0, &pos); - return ff_init_vlc_sparse(vlc, 12, pos, lens, 2, 2, bits, 4, 4, xlat, 1, 1, 0); + return ff_vlc_init_sparse(vlc, 12, pos, lens, 2, 2, bits, 4, 4, xlat, 1, 1, 0); } static int decode_frame(AVCodecContext *avctx, AVFrame *frame, @@ -294,7 +294,7 @@ static av_cold int decode_close(AVCodecContext *avctx) MVHAContext *s = avctx->priv_data; ff_inflate_end(&s->zstream); - ff_free_vlc(&s->vlc); + ff_vlc_free(&s->vlc); return 0; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/mwsc.c b/arm/android/third_party/ffmpeg/libavcodec/mwsc.c index c7045ac7..f8c53c33 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/mwsc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/mwsc.c @@ -127,8 +127,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, frame->pict_type = (frame->flags & AV_FRAME_FLAG_KEY) ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P; - av_frame_unref(s->prev_frame); - if ((ret = av_frame_ref(s->prev_frame, frame)) < 0) + if ((ret = av_frame_replace(s->prev_frame, frame)) < 0) return ret; *got_frame = 1; diff --git a/arm/android/third_party/ffmpeg/libavcodec/notchlc.c b/arm/android/third_party/ffmpeg/libavcodec/notchlc.c index d973c83a..0feb0918 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/notchlc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/notchlc.c @@ -76,12 +76,13 @@ static int lz4_decompress(AVCodecContext *avctx, GetByteContext *gb, PutByteContext *pb) { - unsigned reference_pos, match_length, delta, pos = 0; + unsigned reference_pos, delta, pos = 0; uint8_t history[64 * 1024]; + int match_length; while (bytestream2_get_bytes_left(gb) > 0) { uint8_t token = bytestream2_get_byte(gb); - unsigned num_literals = token >> 4; + int num_literals = token >> 4; if (num_literals == 15) { unsigned char current; diff --git a/arm/android/third_party/ffmpeg/libavcodec/nuv.c b/arm/android/third_party/ffmpeg/libavcodec/nuv.c index 82048e93..1dda770c 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/nuv.c +++ b/arm/android/third_party/ffmpeg/libavcodec/nuv.c @@ -56,8 +56,8 @@ static void copy_frame(AVFrame *f, const uint8_t *src, int width, int height) int src_linesize[4]; av_image_fill_arrays(src_data, src_linesize, src, f->format, width, height, 1); - av_image_copy(f->data, f->linesize, (const uint8_t **)src_data, src_linesize, - f->format, width, height); + av_image_copy2(f->data, f->linesize, src_data, src_linesize, + f->format, width, height); } /** diff --git a/arm/android/third_party/ffmpeg/libavcodec/nvdec_av1.c b/arm/android/third_party/ffmpeg/libavcodec/nvdec_av1.c index 3bbcd761..74b04421 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/nvdec_av1.c +++ b/arm/android/third_party/ffmpeg/libavcodec/nvdec_av1.c @@ -23,6 +23,7 @@ #include "avcodec.h" #include "nvdec.h" #include "decode.h" +#include "hwaccel_internal.h" #include "internal.h" #include "av1dec.h" @@ -337,11 +338,11 @@ static int nvdec_av1_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ return ff_nvdec_frame_params(avctx, hw_frames_ctx, 8 * 2, 0); } -const AVHWAccel ff_av1_nvdec_hwaccel = { - .name = "av1_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AV1, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_av1_nvdec_hwaccel = { + .p.name = "av1_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_av1_start_frame, .end_frame = ff_nvdec_simple_end_frame, .decode_slice = nvdec_av1_decode_slice, diff --git a/arm/android/third_party/ffmpeg/libavcodec/nvdec_h264.c b/arm/android/third_party/ffmpeg/libavcodec/nvdec_h264.c index 116bd4fb..f022619b 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/nvdec_h264.c +++ b/arm/android/third_party/ffmpeg/libavcodec/nvdec_h264.c @@ -28,6 +28,7 @@ #include "decode.h" #include "internal.h" #include "h264dec.h" +#include "hwaccel_internal.h" static void dpb_add(const H264Context *h, CUVIDH264DPBENTRY *dst, const H264Picture *src, int frame_idx) @@ -169,11 +170,11 @@ static int nvdec_h264_frame_params(AVCodecContext *avctx, return ff_nvdec_frame_params(avctx, hw_frames_ctx, sps->ref_frame_count + sps->num_reorder_frames, 0); } -const AVHWAccel ff_h264_nvdec_hwaccel = { - .name = "h264_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_h264_nvdec_hwaccel = { + .p.name = "h264_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_h264_start_frame, .end_frame = ff_nvdec_end_frame, .decode_slice = nvdec_h264_decode_slice, diff --git a/arm/android/third_party/ffmpeg/libavcodec/nvdec_hevc.c b/arm/android/third_party/ffmpeg/libavcodec/nvdec_hevc.c index cd549d2e..91fb9f53 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/nvdec_hevc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/nvdec_hevc.c @@ -29,6 +29,7 @@ #include "internal.h" #include "hevcdec.h" #include "hevc_data.h" +#include "hwaccel_internal.h" static void dpb_add(CUVIDHEVCPICPARAMS *pp, int idx, const HEVCFrame *src) { @@ -308,11 +309,11 @@ static int nvdec_hevc_decode_init(AVCodecContext *avctx) { return ff_nvdec_decode_init(avctx); } -const AVHWAccel ff_hevc_nvdec_hwaccel = { - .name = "hevc_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_hevc_nvdec_hwaccel = { + .p.name = "hevc_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_hevc_start_frame, .end_frame = ff_nvdec_end_frame, .decode_slice = nvdec_hevc_decode_slice, diff --git a/arm/android/third_party/ffmpeg/libavcodec/nvdec_mjpeg.c b/arm/android/third_party/ffmpeg/libavcodec/nvdec_mjpeg.c index fce464c1..850634bf 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/nvdec_mjpeg.c +++ b/arm/android/third_party/ffmpeg/libavcodec/nvdec_mjpeg.c @@ -25,6 +25,7 @@ #include "mjpegdec.h" #include "nvdec.h" #include "decode.h" +#include "hwaccel_internal.h" static int nvdec_mjpeg_start_frame(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size) { @@ -69,11 +70,11 @@ static int nvdec_mjpeg_frame_params(AVCodecContext *avctx, return ff_nvdec_frame_params(avctx, hw_frames_ctx, 1, 0); } -AVHWAccel ff_mjpeg_nvdec_hwaccel = { - .name = "mjpeg_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MJPEG, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_mjpeg_nvdec_hwaccel = { + .p.name = "mjpeg_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MJPEG, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_mjpeg_start_frame, .end_frame = ff_nvdec_simple_end_frame, .decode_slice = nvdec_mjpeg_decode_slice, diff --git a/arm/android/third_party/ffmpeg/libavcodec/nvdec_mpeg12.c b/arm/android/third_party/ffmpeg/libavcodec/nvdec_mpeg12.c index 3b9ff607..a4603c7e 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/nvdec_mpeg12.c +++ b/arm/android/third_party/ffmpeg/libavcodec/nvdec_mpeg12.c @@ -23,6 +23,7 @@ #include "config_components.h" #include "avcodec.h" +#include "hwaccel_internal.h" #include "internal.h" #include "mpegvideo.h" #include "nvdec.h" @@ -99,11 +100,11 @@ static int nvdec_mpeg12_frame_params(AVCodecContext *avctx, } #if CONFIG_MPEG2_NVDEC_HWACCEL -const AVHWAccel ff_mpeg2_nvdec_hwaccel = { - .name = "mpeg2_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG2VIDEO, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_mpeg2_nvdec_hwaccel = { + .p.name = "mpeg2_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG2VIDEO, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_mpeg12_start_frame, .end_frame = ff_nvdec_simple_end_frame, .decode_slice = ff_nvdec_simple_decode_slice, @@ -115,11 +116,11 @@ const AVHWAccel ff_mpeg2_nvdec_hwaccel = { #endif #if CONFIG_MPEG1_NVDEC_HWACCEL -const AVHWAccel ff_mpeg1_nvdec_hwaccel = { - .name = "mpeg1_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG1VIDEO, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_mpeg1_nvdec_hwaccel = { + .p.name = "mpeg1_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG1VIDEO, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_mpeg12_start_frame, .end_frame = ff_nvdec_simple_end_frame, .decode_slice = ff_nvdec_simple_decode_slice, diff --git a/arm/android/third_party/ffmpeg/libavcodec/nvdec_mpeg4.c b/arm/android/third_party/ffmpeg/libavcodec/nvdec_mpeg4.c index c193f6b6..20a04994 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/nvdec_mpeg4.c +++ b/arm/android/third_party/ffmpeg/libavcodec/nvdec_mpeg4.c @@ -26,6 +26,7 @@ #include "mpeg4videodefs.h" #include "nvdec.h" #include "decode.h" +#include "hwaccel_internal.h" static int nvdec_mpeg4_start_frame(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size) { @@ -109,11 +110,11 @@ static int nvdec_mpeg4_frame_params(AVCodecContext *avctx, return ff_nvdec_frame_params(avctx, hw_frames_ctx, 2, 0); } -const AVHWAccel ff_mpeg4_nvdec_hwaccel = { - .name = "mpeg4_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG4, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_mpeg4_nvdec_hwaccel = { + .p.name = "mpeg4_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG4, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_mpeg4_start_frame, .end_frame = ff_nvdec_simple_end_frame, .decode_slice = nvdec_mpeg4_decode_slice, diff --git a/arm/android/third_party/ffmpeg/libavcodec/nvdec_vc1.c b/arm/android/third_party/ffmpeg/libavcodec/nvdec_vc1.c index fae1cb0a..5096d784 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/nvdec_vc1.c +++ b/arm/android/third_party/ffmpeg/libavcodec/nvdec_vc1.c @@ -23,6 +23,7 @@ #include "config_components.h" #include "avcodec.h" +#include "hwaccel_internal.h" #include "internal.h" #include "nvdec.h" #include "decode.h" @@ -113,11 +114,11 @@ static int nvdec_vc1_frame_params(AVCodecContext *avctx, return ff_nvdec_frame_params(avctx, hw_frames_ctx, 2, 0); } -const AVHWAccel ff_vc1_nvdec_hwaccel = { - .name = "vc1_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VC1, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_vc1_nvdec_hwaccel = { + .p.name = "vc1_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VC1, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_vc1_start_frame, .end_frame = ff_nvdec_simple_end_frame, .decode_slice = ff_nvdec_simple_decode_slice, @@ -128,11 +129,11 @@ const AVHWAccel ff_vc1_nvdec_hwaccel = { }; #if CONFIG_WMV3_NVDEC_HWACCEL -const AVHWAccel ff_wmv3_nvdec_hwaccel = { - .name = "wmv3_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WMV3, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_wmv3_nvdec_hwaccel = { + .p.name = "wmv3_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WMV3, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_vc1_start_frame, .end_frame = ff_nvdec_simple_end_frame, .decode_slice = ff_nvdec_simple_decode_slice, diff --git a/arm/android/third_party/ffmpeg/libavcodec/nvdec_vp8.c b/arm/android/third_party/ffmpeg/libavcodec/nvdec_vp8.c index f174ca43..ff3b3f25 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/nvdec_vp8.c +++ b/arm/android/third_party/ffmpeg/libavcodec/nvdec_vp8.c @@ -23,6 +23,7 @@ #include "avcodec.h" #include "nvdec.h" #include "decode.h" +#include "hwaccel_internal.h" #include "internal.h" #include "vp8.h" @@ -90,11 +91,11 @@ static int nvdec_vp8_frame_params(AVCodecContext *avctx, return ff_nvdec_frame_params(avctx, hw_frames_ctx, 3, 0); } -AVHWAccel ff_vp8_nvdec_hwaccel = { - .name = "vp8_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP8, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_vp8_nvdec_hwaccel = { + .p.name = "vp8_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP8, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_vp8_start_frame, .end_frame = ff_nvdec_simple_end_frame, .decode_slice = ff_nvdec_simple_decode_slice, diff --git a/arm/android/third_party/ffmpeg/libavcodec/nvdec_vp9.c b/arm/android/third_party/ffmpeg/libavcodec/nvdec_vp9.c index a76bcf99..e196391c 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/nvdec_vp9.c +++ b/arm/android/third_party/ffmpeg/libavcodec/nvdec_vp9.c @@ -25,6 +25,7 @@ #include "avcodec.h" #include "nvdec.h" #include "decode.h" +#include "hwaccel_internal.h" #include "internal.h" #include "vp9shared.h" @@ -169,11 +170,11 @@ static int nvdec_vp9_frame_params(AVCodecContext *avctx, return ff_nvdec_frame_params(avctx, hw_frames_ctx, 8, 0); } -const AVHWAccel ff_vp9_nvdec_hwaccel = { - .name = "vp9_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP9, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_vp9_nvdec_hwaccel = { + .p.name = "vp9_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP9, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_vp9_start_frame, .end_frame = ff_nvdec_simple_end_frame, .decode_slice = ff_nvdec_simple_decode_slice, diff --git a/arm/android/third_party/ffmpeg/libavcodec/nvenc.c b/arm/android/third_party/ffmpeg/libavcodec/nvenc.c index 0b641767..02486c20 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/nvenc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/nvenc.c @@ -36,6 +36,7 @@ #include "libavutil/pixdesc.h" #include "libavutil/mathematics.h" #include "atsc_a53.h" +#include "codec_desc.h" #include "encode.h" #include "internal.h" #include "packet_internal.h" @@ -1166,8 +1167,13 @@ static av_cold int nvenc_setup_h264_config(AVCodecContext *avctx) || vui->videoFormat != 5 || vui->videoFullRangeFlag != 0); - h264->sliceMode = 3; - h264->sliceModeData = avctx->slices > 0 ? avctx->slices : 1; + if (ctx->max_slice_size > 0) { + h264->sliceMode = 1; + h264->sliceModeData = ctx->max_slice_size; + } else { + h264->sliceMode = 3; + h264->sliceModeData = avctx->slices > 0 ? avctx->slices : 1; + } if (ctx->intra_refresh) { h264->enableIntraRefresh = 1; @@ -1214,19 +1220,19 @@ static av_cold int nvenc_setup_h264_config(AVCodecContext *avctx) switch(ctx->profile) { case NV_ENC_H264_PROFILE_BASELINE: cc->profileGUID = NV_ENC_H264_PROFILE_BASELINE_GUID; - avctx->profile = FF_PROFILE_H264_BASELINE; + avctx->profile = AV_PROFILE_H264_BASELINE; break; case NV_ENC_H264_PROFILE_MAIN: cc->profileGUID = NV_ENC_H264_PROFILE_MAIN_GUID; - avctx->profile = FF_PROFILE_H264_MAIN; + avctx->profile = AV_PROFILE_H264_MAIN; break; case NV_ENC_H264_PROFILE_HIGH: cc->profileGUID = NV_ENC_H264_PROFILE_HIGH_GUID; - avctx->profile = FF_PROFILE_H264_HIGH; + avctx->profile = AV_PROFILE_H264_HIGH; break; case NV_ENC_H264_PROFILE_HIGH_444P: cc->profileGUID = NV_ENC_H264_PROFILE_HIGH_444_GUID; - avctx->profile = FF_PROFILE_H264_HIGH_444_PREDICTIVE; + avctx->profile = AV_PROFILE_H264_HIGH_444_PREDICTIVE; break; } } @@ -1234,10 +1240,10 @@ static av_cold int nvenc_setup_h264_config(AVCodecContext *avctx) // force setting profile as high444p if input is AV_PIX_FMT_YUV444P if (IS_YUV444(ctx->data_pix_fmt)) { cc->profileGUID = NV_ENC_H264_PROFILE_HIGH_444_GUID; - avctx->profile = FF_PROFILE_H264_HIGH_444_PREDICTIVE; + avctx->profile = AV_PROFILE_H264_HIGH_444_PREDICTIVE; } - h264->chromaFormatIDC = avctx->profile == FF_PROFILE_H264_HIGH_444_PREDICTIVE ? 3 : 1; + h264->chromaFormatIDC = avctx->profile == AV_PROFILE_H264_HIGH_444_PREDICTIVE ? 3 : 1; h264->level = ctx->level; @@ -1287,8 +1293,13 @@ static av_cold int nvenc_setup_hevc_config(AVCodecContext *avctx) || vui->videoFormat != 5 || vui->videoFullRangeFlag != 0); - hevc->sliceMode = 3; - hevc->sliceModeData = avctx->slices > 0 ? avctx->slices : 1; + if (ctx->max_slice_size > 0) { + hevc->sliceMode = 1; + hevc->sliceModeData = ctx->max_slice_size; + } else { + hevc->sliceMode = 3; + hevc->sliceModeData = avctx->slices > 0 ? avctx->slices : 1; + } if (ctx->intra_refresh) { hevc->enableIntraRefresh = 1; @@ -1325,28 +1336,28 @@ static av_cold int nvenc_setup_hevc_config(AVCodecContext *avctx) switch (ctx->profile) { case NV_ENC_HEVC_PROFILE_MAIN: cc->profileGUID = NV_ENC_HEVC_PROFILE_MAIN_GUID; - avctx->profile = FF_PROFILE_HEVC_MAIN; + avctx->profile = AV_PROFILE_HEVC_MAIN; break; case NV_ENC_HEVC_PROFILE_MAIN_10: cc->profileGUID = NV_ENC_HEVC_PROFILE_MAIN10_GUID; - avctx->profile = FF_PROFILE_HEVC_MAIN_10; + avctx->profile = AV_PROFILE_HEVC_MAIN_10; break; case NV_ENC_HEVC_PROFILE_REXT: cc->profileGUID = NV_ENC_HEVC_PROFILE_FREXT_GUID; - avctx->profile = FF_PROFILE_HEVC_REXT; + avctx->profile = AV_PROFILE_HEVC_REXT; break; } // force setting profile as main10 if input is 10 bit if (IS_10BIT(ctx->data_pix_fmt)) { cc->profileGUID = NV_ENC_HEVC_PROFILE_MAIN10_GUID; - avctx->profile = FF_PROFILE_HEVC_MAIN_10; + avctx->profile = AV_PROFILE_HEVC_MAIN_10; } // force setting profile as rext if input is yuv444 if (IS_YUV444(ctx->data_pix_fmt)) { cc->profileGUID = NV_ENC_HEVC_PROFILE_FREXT_GUID; - avctx->profile = FF_PROFILE_HEVC_REXT; + avctx->profile = AV_PROFILE_HEVC_REXT; } hevc->chromaFormatIDC = IS_YUV444(ctx->data_pix_fmt) ? 3 : 1; @@ -1397,7 +1408,7 @@ static av_cold int nvenc_setup_av1_config(AVCodecContext *avctx) return AVERROR(ENOTSUP); } else { cc->profileGUID = NV_ENC_AV1_PROFILE_MAIN_GUID; - avctx->profile = FF_PROFILE_AV1_MAIN; + avctx->profile = AV_PROFILE_AV1_MAIN; } if (ctx->dpb_size >= 0) { @@ -1656,7 +1667,7 @@ FF_ENABLE_DEPRECATION_WARNINGS if (ctx->encode_config.rcParams.averageBitRate > 0) avctx->bit_rate = ctx->encode_config.rcParams.averageBitRate; - cpb_props = ff_add_cpb_side_data(avctx); + cpb_props = ff_encode_add_cpb_side_data(avctx); if (!cpb_props) return AVERROR(ENOMEM); cpb_props->max_bitrate = ctx->encode_config.rcParams.maxBitRate; @@ -1998,9 +2009,9 @@ static int nvenc_copy_frame(AVCodecContext *avctx, NvencSurface *nv_surface, if (frame->format == AV_PIX_FMT_YUV420P) FFSWAP(uint8_t*, dst_data[1], dst_data[2]); - av_image_copy(dst_data, dst_linesize, - (const uint8_t**)frame->data, frame->linesize, frame->format, - avctx->width, avctx->height); + av_image_copy2(dst_data, dst_linesize, + frame->data, frame->linesize, frame->format, + avctx->width, avctx->height); return 0; } @@ -2249,7 +2260,7 @@ static int nvenc_store_frame_data(AVCodecContext *avctx, NV_ENC_PIC_PARAMS *pic_ // in case the encoder got reconfigured, there might be leftovers av_buffer_unref(&frame_data->frame_opaque_ref); - if (frame && frame->opaque_ref && avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { + if (frame->opaque_ref && avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { frame_data->frame_opaque_ref = av_buffer_ref(frame->opaque_ref); if (!frame_data->frame_opaque_ref) return AVERROR(ENOMEM); diff --git a/arm/android/third_party/ffmpeg/libavcodec/nvenc.h b/arm/android/third_party/ffmpeg/libavcodec/nvenc.h index 3a4b456a..cf0e8e59 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/nvenc.h +++ b/arm/android/third_party/ffmpeg/libavcodec/nvenc.h @@ -262,6 +262,7 @@ typedef struct NvencContext int udu_sei; int timing_info; int highbitdepth; + int max_slice_size; } NvencContext; int ff_nvenc_encode_init(AVCodecContext *avctx); diff --git a/arm/android/third_party/ffmpeg/libavcodec/nvenc_h264.c b/arm/android/third_party/ffmpeg/libavcodec/nvenc_h264.c index a9986099..4440e49b 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/nvenc_h264.c +++ b/arm/android/third_party/ffmpeg/libavcodec/nvenc_h264.c @@ -206,6 +206,8 @@ static const AVOption options[] = { OFFSET(intra_refresh),AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, { "single-slice-intra-refresh", "Use single slice intra refresh", OFFSET(single_slice_intra_refresh), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, + { "max_slice_size", "Maximum encoded slice size in bytes", + OFFSET(max_slice_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE }, { "constrained-encoding", "Enable constrainedFrame encoding where each slice in the constrained picture is independent of other slices", OFFSET(constrained_encoding), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, { NULL } diff --git a/arm/android/third_party/ffmpeg/libavcodec/nvenc_hevc.c b/arm/android/third_party/ffmpeg/libavcodec/nvenc_hevc.c index a02f2778..e88f7e97 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/nvenc_hevc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/nvenc_hevc.c @@ -57,7 +57,7 @@ static const AVOption options[] = { { "ull", "Ultra low latency", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_TUNING_INFO_ULTRA_LOW_LATENCY }, 0, 0, VE, "tune" }, { "lossless", "Lossless", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_TUNING_INFO_LOSSLESS }, 0, 0, VE, "tune" }, #endif - { "profile", "Set the encoding profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = NV_ENC_HEVC_PROFILE_MAIN }, NV_ENC_HEVC_PROFILE_MAIN, FF_PROFILE_HEVC_REXT, VE, "profile" }, + { "profile", "Set the encoding profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = NV_ENC_HEVC_PROFILE_MAIN }, NV_ENC_HEVC_PROFILE_MAIN, AV_PROFILE_HEVC_REXT, VE, "profile" }, { "main", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_HEVC_PROFILE_MAIN }, 0, 0, VE, "profile" }, { "main10", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_HEVC_PROFILE_MAIN_10 }, 0, 0, VE, "profile" }, { "rext", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_HEVC_PROFILE_REXT }, 0, 0, VE, "profile" }, @@ -187,6 +187,8 @@ static const AVOption options[] = { OFFSET(intra_refresh),AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, { "single-slice-intra-refresh", "Use single slice intra refresh", OFFSET(single_slice_intra_refresh), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, + { "max_slice_size", "Maximum encoded slice size in bytes", + OFFSET(max_slice_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE }, { "constrained-encoding", "Enable constrainedFrame encoding where each slice in the constrained picture is independent of other slices", OFFSET(constrained_encoding), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, { NULL } diff --git a/arm/android/third_party/ffmpeg/libavcodec/omx.c b/arm/android/third_party/ffmpeg/libavcodec/omx.c index 6e667971..82fd4920 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/omx.c +++ b/arm/android/third_party/ffmpeg/libavcodec/omx.c @@ -531,14 +531,14 @@ static av_cold int omx_component_init(AVCodecContext *avctx, const char *role) CHECK(err); avc.nBFrames = 0; avc.nPFrames = avctx->gop_size - 1; - switch (s->profile == FF_PROFILE_UNKNOWN ? avctx->profile : s->profile) { - case FF_PROFILE_H264_BASELINE: + switch (s->profile == AV_PROFILE_UNKNOWN ? avctx->profile : s->profile) { + case AV_PROFILE_H264_BASELINE: avc.eProfile = OMX_VIDEO_AVCProfileBaseline; break; - case FF_PROFILE_H264_MAIN: + case AV_PROFILE_H264_MAIN: avc.eProfile = OMX_VIDEO_AVCProfileMain; break; - case FF_PROFILE_H264_HIGH: + case AV_PROFILE_H264_HIGH: avc.eProfile = OMX_VIDEO_AVCProfileHigh; break; default: @@ -793,7 +793,8 @@ static int omx_encode_frame(AVCodecContext *avctx, AVPacket *pkt, need_copy = 1; } if (need_copy) - av_image_copy(dst, linesize, (const uint8_t**) frame->data, frame->linesize, avctx->pix_fmt, avctx->width, avctx->height); + av_image_copy2(dst, linesize, frame->data, frame->linesize, + avctx->pix_fmt, avctx->width, avctx->height); buffer->nFlags = OMX_BUFFERFLAG_ENDOFFRAME; buffer->nOffset = 0; // Convert the timestamps to microseconds; some encoders can ignore @@ -919,10 +920,10 @@ static const AVOption options[] = { { "omx_libname", "OpenMAX library name", OFFSET(libname), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VDE }, { "omx_libprefix", "OpenMAX library prefix", OFFSET(libprefix), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VDE }, { "zerocopy", "Try to avoid copying input frames if possible", OFFSET(input_zerocopy), AV_OPT_TYPE_INT, { .i64 = CONFIG_OMX_RPI }, 0, 1, VE }, - { "profile", "Set the encoding profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, FF_PROFILE_H264_HIGH, VE, "profile" }, - { "baseline", "", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_BASELINE }, 0, 0, VE, "profile" }, - { "main", "", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_MAIN }, 0, 0, VE, "profile" }, - { "high", "", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_HIGH }, 0, 0, VE, "profile" }, + { "profile", "Set the encoding profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, AV_PROFILE_H264_HIGH, VE, "profile" }, + { "baseline", "", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_BASELINE }, 0, 0, VE, "profile" }, + { "main", "", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_MAIN }, 0, 0, VE, "profile" }, + { "high", "", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_HIGH }, 0, 0, VE, "profile" }, { NULL } }; diff --git a/arm/android/third_party/ffmpeg/libavcodec/on2avc.c b/arm/android/third_party/ffmpeg/libavcodec/on2avc.c index 74be1dcb..8d0c8812 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/on2avc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/on2avc.c @@ -51,9 +51,9 @@ typedef struct On2AVCContext { AVCodecContext *avctx; AVFloatDSPContext *fdsp; AVTXContext *mdct, *mdct_half, *mdct_small; - AVTXContext *fft128, *fft256, *fft512, *fft1024; + AVTXContext *fft64, *fft128, *fft256, *fft512; av_tx_fn mdct_fn, mdct_half_fn, mdct_small_fn; - av_tx_fn fft128_fn, fft256_fn, fft512_fn, fft1024_fn; + av_tx_fn fft64_fn, fft128_fn, fft256_fn, fft512_fn; void (*wtf)(struct On2AVCContext *ctx, float *out, float *in, int size); int is_av500; @@ -475,16 +475,16 @@ static void wtf_end_512(On2AVCContext *c, float *out, float *src, zero_head_and_tail(tmp1 + 256, 128, 13, 7); zero_head_and_tail(tmp1 + 384, 128, 15, 5); - c->fft128_fn(c->fft128, src + 0, tmp1 + 0, sizeof(float)); - c->fft128_fn(c->fft128, src + 128, tmp1 + 128, sizeof(float)); - c->fft128_fn(c->fft128, src + 256, tmp1 + 256, sizeof(float)); - c->fft128_fn(c->fft128, src + 384, tmp1 + 384, sizeof(float)); + c->fft64_fn(c->fft64, src + 0, tmp1 + 0, sizeof(float)); + c->fft64_fn(c->fft64, src + 128, tmp1 + 128, sizeof(float)); + c->fft64_fn(c->fft64, src + 256, tmp1 + 256, sizeof(float)); + c->fft64_fn(c->fft64, src + 384, tmp1 + 384, sizeof(float)); combine_fft(src, src + 128, src + 256, src + 384, tmp1, ff_on2avc_ctab_1, ff_on2avc_ctab_2, ff_on2avc_ctab_3, ff_on2avc_ctab_4, 512, 2); - c->fft512_fn(c->fft512, src, tmp1, sizeof(float)); + c->fft256_fn(c->fft256, src, tmp1, sizeof(float)); pretwiddle(&tmp0[ 0], src, 512, 84, 4, 16, 4, ff_on2avc_tabs_20_84_1); pretwiddle(&tmp0[128], src, 512, 84, 4, 16, 4, ff_on2avc_tabs_20_84_2); @@ -503,16 +503,16 @@ static void wtf_end_1024(On2AVCContext *c, float *out, float *src, zero_head_and_tail(tmp1 + 512, 256, 13, 7); zero_head_and_tail(tmp1 + 768, 256, 15, 5); - c->fft256_fn(c->fft256, src + 0, tmp1 + 0, sizeof(float)); - c->fft256_fn(c->fft256, src + 256, tmp1 + 256, sizeof(float)); - c->fft256_fn(c->fft256, src + 512, tmp1 + 512, sizeof(float)); - c->fft256_fn(c->fft256, src + 768, tmp1 + 768, sizeof(float)); + c->fft128_fn(c->fft128, src + 0, tmp1 + 0, sizeof(float)); + c->fft128_fn(c->fft128, src + 256, tmp1 + 256, sizeof(float)); + c->fft128_fn(c->fft128, src + 512, tmp1 + 512, sizeof(float)); + c->fft128_fn(c->fft128, src + 768, tmp1 + 768, sizeof(float)); combine_fft(src, src + 256, src + 512, src + 768, tmp1, ff_on2avc_ctab_1, ff_on2avc_ctab_2, ff_on2avc_ctab_3, ff_on2avc_ctab_4, 1024, 1); - c->fft1024_fn(c->fft1024, src, tmp1, sizeof(float)); + c->fft512_fn(c->fft512, src, tmp1, sizeof(float)); pretwiddle(&tmp0[ 0], src, 1024, 84, 4, 16, 4, ff_on2avc_tabs_20_84_1); pretwiddle(&tmp0[256], src, 1024, 84, 4, 16, 4, ff_on2avc_tabs_20_84_2); @@ -700,7 +700,7 @@ static int on2avc_reconstruct_channel_ext(On2AVCContext *c, AVFrame *dst, int of break; case WINDOW_TYPE_EXT5: c->wtf(c, buf, in, 512); - c->mdct_half_fn(c->mdct, buf + 512, in + 512, sizeof(float)); + c->mdct_half_fn(c->mdct_half, buf + 512, in + 512, sizeof(float)); for (i = 0; i < 256; i++) { FFSWAP(float, buf[i + 512], buf[1023 - i]); } @@ -892,9 +892,9 @@ static av_cold void on2avc_free_vlcs(On2AVCContext *c) { int i; - ff_free_vlc(&c->scale_diff); + ff_vlc_free(&c->scale_diff); for (i = 1; i < 16; i++) - ff_free_vlc(&c->cb_vlc[i]); + ff_vlc_free(&c->cb_vlc[i]); } static av_cold int on2avc_decode_init(AVCodecContext *avctx) @@ -956,27 +956,27 @@ static av_cold int on2avc_decode_init(AVCodecContext *avctx) if ((ret = av_tx_init(&c->mdct_small, &c->mdct_small_fn, AV_TX_FLOAT_MDCT, 1, 128, &scale, 0)) < 0) return ret; - if ((ret = av_tx_init(&c->fft1024, &c->fft1024_fn, AV_TX_FLOAT_FFT, 1, 1024, NULL, 0)) < 0) - return ret; if ((ret = av_tx_init(&c->fft512, &c->fft512_fn, AV_TX_FLOAT_FFT, 1, 512, NULL, 0)) < 0) return ret; - if ((ret = av_tx_init(&c->fft256, &c->fft256_fn, AV_TX_FLOAT_FFT, 0, 256, NULL, 0)) < 0) + if ((ret = av_tx_init(&c->fft256, &c->fft256_fn, AV_TX_FLOAT_FFT, 1, 256, NULL, 0)) < 0) return ret; if ((ret = av_tx_init(&c->fft128, &c->fft128_fn, AV_TX_FLOAT_FFT, 0, 128, NULL, 0)) < 0) return ret; + if ((ret = av_tx_init(&c->fft64, &c->fft64_fn, AV_TX_FLOAT_FFT, 0, 64, NULL, 0)) < 0) + return ret; c->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT); if (!c->fdsp) return AVERROR(ENOMEM); - ret = ff_init_vlc_from_lengths(&c->scale_diff, 9, ON2AVC_SCALE_DIFFS, + ret = ff_vlc_init_from_lengths(&c->scale_diff, 9, ON2AVC_SCALE_DIFFS, ff_on2avc_scale_diff_bits, 1, ff_on2avc_scale_diff_syms, 1, 1, -60, 0, avctx); if (ret < 0) goto vlc_fail; for (i = 1; i < 16; i++) { int idx = i - 1; - ret = ff_init_vlc_from_lengths(&c->cb_vlc[i], 9, ff_on2avc_cb_elems[idx], + ret = ff_vlc_init_from_lengths(&c->cb_vlc[i], 9, ff_on2avc_cb_elems[idx], lens, 1, syms, 2, 2, 0, 0, avctx); if (ret < 0) @@ -998,10 +998,10 @@ static av_cold int on2avc_decode_close(AVCodecContext *avctx) av_tx_uninit(&c->mdct); av_tx_uninit(&c->mdct_half); av_tx_uninit(&c->mdct_small); + av_tx_uninit(&c->fft64); av_tx_uninit(&c->fft128); av_tx_uninit(&c->fft256); av_tx_uninit(&c->fft512); - av_tx_uninit(&c->fft1024); av_freep(&c->fdsp); diff --git a/arm/android/third_party/ffmpeg/libavcodec/options_table.h b/arm/android/third_party/ffmpeg/libavcodec/options_table.h index bb4b894b..f2155232 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/options_table.h +++ b/arm/android/third_party/ffmpeg/libavcodec/options_table.h @@ -223,9 +223,9 @@ static const AVOption avcodec_options[] = { {"nssew", "nsse weight", OFFSET(nsse_weight), AV_OPT_TYPE_INT, {.i64 = 8 }, INT_MIN, INT_MAX, V|E}, {"skip_top", "number of macroblock rows at the top which are skipped", OFFSET(skip_top), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|D}, {"skip_bottom", "number of macroblock rows at the bottom which are skipped", OFFSET(skip_bottom), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|D}, -{"profile", NULL, OFFSET(profile), AV_OPT_TYPE_INT, {.i64 = FF_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, V|A|E|CC, "avctx.profile"}, -{"unknown", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, "avctx.profile"}, -{"main10", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_HEVC_MAIN_10 }, INT_MIN, INT_MAX, V|E, "avctx.profile"}, +{"profile", NULL, OFFSET(profile), AV_OPT_TYPE_INT, {.i64 = AV_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, V|A|E|CC, "avctx.profile"}, +{"unknown", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AV_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, "avctx.profile"}, +{"main10", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AV_PROFILE_HEVC_MAIN_10 }, INT_MIN, INT_MAX, V|E, "avctx.profile"}, {"level", NULL, OFFSET(level), AV_OPT_TYPE_INT, {.i64 = FF_LEVEL_UNKNOWN }, INT_MIN, INT_MAX, V|A|E|CC, "avctx.level"}, {"unknown", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_LEVEL_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, "avctx.level"}, {"lowres", "decode at 1= 1/2, 2=1/4, 3=1/8 resolutions", OFFSET(lowres), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, V|A|D}, @@ -350,6 +350,8 @@ static const AVOption avcodec_options[] = { {"unspecified", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, "color_range_type"}, {"mpeg", "MPEG (219*2^(n-8))", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_MPEG }, INT_MIN, INT_MAX, V|E|D, "color_range_type"}, {"jpeg", "JPEG (2^n-1)", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_JPEG }, INT_MIN, INT_MAX, V|E|D, "color_range_type"}, +{"limited", "MPEG (219*2^(n-8))", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_MPEG }, INT_MIN, INT_MAX, V|E|D, "color_range_type"}, +{"full", "JPEG (2^n-1)", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_JPEG }, INT_MIN, INT_MAX, V|E|D, "color_range_type"}, {"chroma_sample_location", "chroma sample location", OFFSET(chroma_sample_location), AV_OPT_TYPE_INT, {.i64 = AVCHROMA_LOC_UNSPECIFIED }, 0, INT_MAX, V|E|D, "chroma_sample_location_type"}, {"unknown", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = AVCHROMA_LOC_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, "chroma_sample_location_type"}, {"left", "Left", 0, AV_OPT_TYPE_CONST, {.i64 = AVCHROMA_LOC_LEFT }, INT_MIN, INT_MAX, V|E|D, "chroma_sample_location_type"}, diff --git a/arm/android/third_party/ffmpeg/libavcodec/opus_silk.c b/arm/android/third_party/ffmpeg/libavcodec/opus_silk.c index cf8b16ac..27671516 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/opus_silk.c +++ b/arm/android/third_party/ffmpeg/libavcodec/opus_silk.c @@ -48,7 +48,7 @@ typedef struct SilkFrame { } SilkFrame; struct SilkContext { - AVCodecContext *avctx; + void *logctx; int output_channels; int midonly; @@ -799,7 +799,7 @@ int ff_silk_decode_superframe(SilkContext *s, OpusRangeCoder *rc, if (bandwidth > OPUS_BANDWIDTH_WIDEBAND || coded_channels > 2 || duration_ms > 60) { - av_log(s->avctx, AV_LOG_ERROR, "Invalid parameters passed " + av_log(s->logctx, AV_LOG_ERROR, "Invalid parameters passed " "to the SILK decoder.\n"); return AVERROR(EINVAL); } @@ -879,12 +879,12 @@ void ff_silk_flush(SilkContext *s) memset(s->prev_stereo_weights, 0, sizeof(s->prev_stereo_weights)); } -int ff_silk_init(AVCodecContext *avctx, SilkContext **ps, int output_channels) +int ff_silk_init(void *logctx, SilkContext **ps, int output_channels) { SilkContext *s; if (output_channels != 1 && output_channels != 2) { - av_log(avctx, AV_LOG_ERROR, "Invalid number of output channels: %d\n", + av_log(logctx, AV_LOG_ERROR, "Invalid number of output channels: %d\n", output_channels); return AVERROR(EINVAL); } @@ -893,7 +893,7 @@ int ff_silk_init(AVCodecContext *avctx, SilkContext **ps, int output_channels) if (!s) return AVERROR(ENOMEM); - s->avctx = avctx; + s->logctx = logctx; s->output_channels = output_channels; ff_silk_flush(s); diff --git a/arm/android/third_party/ffmpeg/libavcodec/opus_silk.h b/arm/android/third_party/ffmpeg/libavcodec/opus_silk.h index 6552c166..4b595da2 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/opus_silk.h +++ b/arm/android/third_party/ffmpeg/libavcodec/opus_silk.h @@ -23,7 +23,6 @@ #ifndef AVCODEC_OPUS_SILK_H #define AVCODEC_OPUS_SILK_H -#include "avcodec.h" #include "opus.h" #include "opus_rc.h" @@ -32,7 +31,7 @@ typedef struct SilkContext SilkContext; -int ff_silk_init(AVCodecContext *avctx, SilkContext **ps, int output_channels); +int ff_silk_init(void *logctx, SilkContext **ps, int output_channels); void ff_silk_free(SilkContext **ps); void ff_silk_flush(SilkContext *s); diff --git a/arm/android/third_party/ffmpeg/libavcodec/osq.c b/arm/android/third_party/ffmpeg/libavcodec/osq.c new file mode 100644 index 00000000..435f3ea7 --- /dev/null +++ b/arm/android/third_party/ffmpeg/libavcodec/osq.c @@ -0,0 +1,481 @@ +/* + * OSQ audio decoder + * Copyright (c) 2023 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/internal.h" +#include "libavutil/intreadwrite.h" +#include "avcodec.h" +#include "codec_internal.h" +#include "decode.h" +#include "internal.h" +#define BITSTREAM_READER_LE +#include "get_bits.h" +#include "unary.h" + +#define OFFSET 5 + +typedef struct OSQChannel { + unsigned prediction; + unsigned coding_mode; + unsigned residue_parameter; + unsigned residue_bits; + unsigned history[3]; + unsigned pos, count; + double sum; + int32_t prev; +} OSQChannel; + +typedef struct OSQContext { + GetBitContext gb; + OSQChannel ch[2]; + + uint8_t *bitstream; + size_t max_framesize; + size_t bitstream_size; + + int factor; + int decorrelate; + int frame_samples; + uint64_t nb_samples; + + int32_t *decode_buffer[2]; + + AVPacket *pkt; + int pkt_offset; +} OSQContext; + +static av_cold int osq_close(AVCodecContext *avctx) +{ + OSQContext *s = avctx->priv_data; + + av_freep(&s->bitstream); + s->bitstream_size = 0; + + for (int ch = 0; ch < FF_ARRAY_ELEMS(s->decode_buffer); ch++) + av_freep(&s->decode_buffer[ch]); + + return 0; +} + +static av_cold int osq_init(AVCodecContext *avctx) +{ + OSQContext *s = avctx->priv_data; + + if (avctx->extradata_size < 48) + return AVERROR(EINVAL); + + if (avctx->extradata[0] != 1) { + av_log(avctx, AV_LOG_ERROR, "Unsupported version.\n"); + return AVERROR_INVALIDDATA; + } + + avctx->sample_rate = AV_RL32(avctx->extradata + 4); + if (avctx->sample_rate < 1) + return AVERROR_INVALIDDATA; + + av_channel_layout_uninit(&avctx->ch_layout); + avctx->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; + avctx->ch_layout.nb_channels = avctx->extradata[3]; + if (avctx->ch_layout.nb_channels < 1) + return AVERROR_INVALIDDATA; + if (avctx->ch_layout.nb_channels > FF_ARRAY_ELEMS(s->decode_buffer)) + return AVERROR_INVALIDDATA; + + s->factor = 1; + switch (avctx->extradata[2]) { + case 8: avctx->sample_fmt = AV_SAMPLE_FMT_U8P; break; + case 16: avctx->sample_fmt = AV_SAMPLE_FMT_S16P; break; + case 20: + case 24: s->factor = 256; + avctx->sample_fmt = AV_SAMPLE_FMT_S32P; break; + default: return AVERROR_INVALIDDATA; + } + + avctx->bits_per_raw_sample = avctx->extradata[2]; + s->nb_samples = AV_RL64(avctx->extradata + 16); + s->frame_samples = AV_RL16(avctx->extradata + 8); + s->max_framesize = (s->frame_samples * 16 + 1024) * avctx->ch_layout.nb_channels; + + s->bitstream = av_calloc(s->max_framesize + AV_INPUT_BUFFER_PADDING_SIZE, sizeof(*s->bitstream)); + if (!s->bitstream) + return AVERROR(ENOMEM); + + for (int ch = 0; ch < avctx->ch_layout.nb_channels; ch++) { + s->decode_buffer[ch] = av_calloc(s->frame_samples + OFFSET, + sizeof(*s->decode_buffer[ch])); + if (!s->decode_buffer[ch]) + return AVERROR(ENOMEM); + } + + s->pkt = avctx->internal->in_pkt; + + return 0; +} + +static void reset_stats(OSQChannel *cb) +{ + memset(cb->history, 0, sizeof(cb->history)); + cb->pos = cb->count = cb->sum = 0; +} + +static void update_stats(OSQChannel *cb, int val) +{ + cb->sum += FFABS(val) - cb->history[cb->pos]; + cb->history[cb->pos] = FFABS(val); + cb->pos++; + cb->count++; + if (cb->pos >= FF_ARRAY_ELEMS(cb->history)) + cb->pos = 0; +} + +static int update_residue_parameter(OSQChannel *cb) +{ + double sum, x; + int rice_k; + + sum = cb->sum; + x = sum / cb->count; + rice_k = av_ceil_log2(x); + if (rice_k >= 30) { + rice_k = floor(sum / 1.4426952 + 0.5); + if (rice_k < 1) + rice_k = 1; + } + + return rice_k; +} + +static uint32_t get_urice(GetBitContext *gb, int k) +{ + uint32_t z, x, b; + + x = get_unary(gb, 1, 512); + b = get_bits_long(gb, k); + z = b | x << k; + + return z; +} + +static int32_t get_srice(GetBitContext *gb, int x) +{ + int32_t y = get_urice(gb, x); + return get_bits1(gb) ? -y : y; +} + +static int osq_channel_parameters(AVCodecContext *avctx, int ch) +{ + OSQContext *s = avctx->priv_data; + OSQChannel *cb = &s->ch[ch]; + GetBitContext *gb = &s->gb; + + cb->prev = 0; + cb->prediction = get_urice(gb, 5); + cb->coding_mode = get_urice(gb, 3); + if (cb->prediction >= 15) + return AVERROR_INVALIDDATA; + if (cb->coding_mode > 0 && cb->coding_mode < 3) { + cb->residue_parameter = get_urice(gb, 4); + if (!cb->residue_parameter || cb->residue_parameter >= 31) + return AVERROR_INVALIDDATA; + } else if (cb->coding_mode == 3) { + cb->residue_bits = get_urice(gb, 4); + if (!cb->residue_bits || cb->residue_bits >= 31) + return AVERROR_INVALIDDATA; + } else if (cb->coding_mode) { + return AVERROR_INVALIDDATA; + } + + if (cb->coding_mode == 2) + reset_stats(cb); + + return 0; +} + +#define A (-1) +#define B (-2) +#define C (-3) +#define D (-4) +#define E (-5) +#define P2 ((dst[A] + dst[A]) - dst[B]) +#define P3 ((dst[A] - dst[B]) * 3 + dst[C]) + +static int do_decode(AVCodecContext *avctx, AVFrame *frame, int decorrelate, int downsample) +{ + OSQContext *s = avctx->priv_data; + const int nb_channels = avctx->ch_layout.nb_channels; + const int nb_samples = frame->nb_samples; + GetBitContext *gb = &s->gb; + + for (int n = 0; n < nb_samples; n++) { + for (int ch = 0; ch < nb_channels; ch++) { + OSQChannel *cb = &s->ch[ch]; + int32_t *dst = s->decode_buffer[ch] + OFFSET; + int32_t p, prev = cb->prev; + + if (nb_channels == 2 && ch == 1 && decorrelate != s->decorrelate) { + if (!decorrelate) { + s->decode_buffer[1][OFFSET+A] += s->decode_buffer[0][OFFSET+B]; + s->decode_buffer[1][OFFSET+B] += s->decode_buffer[0][OFFSET+C]; + s->decode_buffer[1][OFFSET+C] += s->decode_buffer[0][OFFSET+D]; + s->decode_buffer[1][OFFSET+D] += s->decode_buffer[0][OFFSET+E]; + } else { + s->decode_buffer[1][OFFSET+A] -= s->decode_buffer[0][OFFSET+B]; + s->decode_buffer[1][OFFSET+B] -= s->decode_buffer[0][OFFSET+C]; + s->decode_buffer[1][OFFSET+C] -= s->decode_buffer[0][OFFSET+D]; + s->decode_buffer[1][OFFSET+D] -= s->decode_buffer[0][OFFSET+E]; + } + s->decorrelate = decorrelate; + } + + if (!cb->coding_mode) { + dst[n] = 0; + } else if (cb->coding_mode == 3) { + dst[n] = get_sbits_long(gb, cb->residue_bits); + } else { + dst[n] = get_srice(gb, cb->residue_parameter); + } + + if (get_bits_left(gb) < 0) { + av_log(avctx, AV_LOG_ERROR, "overread!\n"); + return AVERROR_INVALIDDATA; + } + + p = prev / 2; + prev = dst[n]; + + switch (cb->prediction) { + case 0: + break; + case 1: + dst[n] += dst[A]; + break; + case 2: + dst[n] += dst[A] + p; + break; + case 3: + dst[n] += P2; + break; + case 4: + dst[n] += P2 + p; + break; + case 5: + dst[n] += P3; + break; + case 6: + dst[n] += P3 + p; + break; + case 7: + dst[n] += (P2 + P3) / 2 + p; + break; + case 8: + dst[n] += (P2 + P3) / 2; + break; + case 9: + dst[n] += (P2 * 2 + P3) / 3 + p; + break; + case 10: + dst[n] += (P2 + P3 * 2) / 3 + p; + break; + case 11: + dst[n] += (dst[A] + dst[B]) / 2; + break; + case 12: + dst[n] += dst[B]; + break; + case 13: + dst[n] += (dst[D] + dst[B]) / 2; + break; + case 14: + dst[n] += (P2 + dst[A]) / 2 + p; + break; + default: + return AVERROR_INVALIDDATA; + } + + cb->prev = prev; + + if (downsample) + dst[n] *= 256; + + dst[E] = dst[D]; + dst[D] = dst[C]; + dst[C] = dst[B]; + dst[B] = dst[A]; + dst[A] = dst[n]; + + if (cb->coding_mode == 2) { + update_stats(cb, dst[n]); + cb->residue_parameter = update_residue_parameter(cb); + } + + if (nb_channels == 2 && ch == 1) { + if (decorrelate) + dst[n] += s->decode_buffer[0][OFFSET+n]; + } + + if (downsample) + dst[A] /= 256; + } + } + + return 0; +} + +static int osq_decode_block(AVCodecContext *avctx, AVFrame *frame) +{ + const int nb_channels = avctx->ch_layout.nb_channels; + const int nb_samples = frame->nb_samples; + OSQContext *s = avctx->priv_data; + const int factor = s->factor; + int ret, decorrelate, downsample; + GetBitContext *gb = &s->gb; + + skip_bits1(gb); + decorrelate = get_bits1(gb); + downsample = get_bits1(gb); + + for (int ch = 0; ch < nb_channels; ch++) { + if ((ret = osq_channel_parameters(avctx, ch)) < 0) { + av_log(avctx, AV_LOG_ERROR, "invalid channel parameters\n"); + return ret; + } + } + + if ((ret = do_decode(avctx, frame, decorrelate, downsample)) < 0) + return ret; + + align_get_bits(gb); + + switch (avctx->sample_fmt) { + case AV_SAMPLE_FMT_U8P: + for (int ch = 0; ch < nb_channels; ch++) { + uint8_t *dst = (uint8_t *)frame->extended_data[ch]; + int32_t *src = s->decode_buffer[ch] + OFFSET; + + for (int n = 0; n < nb_samples; n++) + dst[n] = av_clip_uint8(src[n] + 0x80); + } + break; + case AV_SAMPLE_FMT_S16P: + for (int ch = 0; ch < nb_channels; ch++) { + int16_t *dst = (int16_t *)frame->extended_data[ch]; + int32_t *src = s->decode_buffer[ch] + OFFSET; + + for (int n = 0; n < nb_samples; n++) + dst[n] = (int16_t)src[n]; + } + break; + case AV_SAMPLE_FMT_S32P: + for (int ch = 0; ch < nb_channels; ch++) { + int32_t *dst = (int32_t *)frame->extended_data[ch]; + int32_t *src = s->decode_buffer[ch] + OFFSET; + + for (int n = 0; n < nb_samples; n++) + dst[n] = src[n] * factor; + } + break; + default: + return AVERROR_BUG; + } + + return 0; +} + +static int osq_receive_frame(AVCodecContext *avctx, AVFrame *frame) +{ + OSQContext *s = avctx->priv_data; + GetBitContext *gb = &s->gb; + int ret, n; + + while (s->bitstream_size < s->max_framesize) { + int size; + + if (!s->pkt->data) { + ret = ff_decode_get_packet(avctx, s->pkt); + if (ret == AVERROR_EOF && s->bitstream_size > 0) + break; + if (ret == AVERROR_EOF || ret == AVERROR(EAGAIN)) + return ret; + if (ret < 0) + goto fail; + } + + size = FFMIN(s->pkt->size - s->pkt_offset, s->max_framesize - s->bitstream_size); + memcpy(s->bitstream + s->bitstream_size, s->pkt->data + s->pkt_offset, size); + s->bitstream_size += size; + s->pkt_offset += size; + + if (s->pkt_offset == s->pkt->size) { + av_packet_unref(s->pkt); + s->pkt_offset = 0; + } + } + + frame->nb_samples = FFMIN(s->frame_samples, s->nb_samples); + if (frame->nb_samples <= 0) + return AVERROR_EOF; + + if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) + goto fail; + + if ((ret = init_get_bits8(gb, s->bitstream, s->bitstream_size)) < 0) + goto fail; + + if ((ret = osq_decode_block(avctx, frame)) < 0) + goto fail; + + s->nb_samples -= frame->nb_samples; + + n = get_bits_count(gb) / 8; + if (n > s->bitstream_size) { + ret = AVERROR_INVALIDDATA; + goto fail; + } + + memmove(s->bitstream, &s->bitstream[n], s->bitstream_size - n); + s->bitstream_size -= n; + + return 0; + +fail: + s->bitstream_size = 0; + s->pkt_offset = 0; + av_packet_unref(s->pkt); + + return ret; +} + +const FFCodec ff_osq_decoder = { + .p.name = "osq", + CODEC_LONG_NAME("OSQ (Original Sound Quality)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_OSQ, + .priv_data_size = sizeof(OSQContext), + .init = osq_init, + FF_CODEC_RECEIVE_FRAME_CB(osq_receive_frame), + .close = osq_close, + .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | + AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P, + AV_SAMPLE_FMT_S16P, + AV_SAMPLE_FMT_S32P, + AV_SAMPLE_FMT_NONE }, +}; diff --git a/arm/android/third_party/ffmpeg/libavcodec/parsers.c b/arm/android/third_party/ffmpeg/libavcodec/parsers.c index 285f81a9..5128009c 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/parsers.c +++ b/arm/android/third_party/ffmpeg/libavcodec/parsers.c @@ -55,6 +55,7 @@ extern const AVCodecParser ff_hevc_parser; extern const AVCodecParser ff_hdr_parser; extern const AVCodecParser ff_ipu_parser; extern const AVCodecParser ff_jpeg2000_parser; +extern const AVCodecParser ff_jpegxl_parser; extern const AVCodecParser ff_misc4_parser; extern const AVCodecParser ff_mjpeg_parser; extern const AVCodecParser ff_mlp_parser; @@ -65,8 +66,7 @@ extern const AVCodecParser ff_opus_parser; extern const AVCodecParser ff_png_parser; extern const AVCodecParser ff_pnm_parser; extern const AVCodecParser ff_qoi_parser; -extern const AVCodecParser ff_rv30_parser; -extern const AVCodecParser ff_rv40_parser; +extern const AVCodecParser ff_rv34_parser; extern const AVCodecParser ff_sbc_parser; extern const AVCodecParser ff_sipr_parser; extern const AVCodecParser ff_tak_parser; diff --git a/arm/android/third_party/ffmpeg/libavcodec/pcm.c b/arm/android/third_party/ffmpeg/libavcodec/pcm.c index 23955ba2..4abca7cc 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/pcm.c +++ b/arm/android/third_party/ffmpeg/libavcodec/pcm.c @@ -538,7 +538,6 @@ static int pcm_decode_frame(AVCodecContext *avctx, AVFrame *frame, s->vector_fmul_scalar((float *)frame->extended_data[0], (const float *)frame->extended_data[0], s->scale, FFALIGN(frame->nb_samples * avctx->ch_layout.nb_channels, 4)); - emms_c(); } *got_frame_ptr = 1; @@ -578,7 +577,7 @@ const FFCodec ff_ ## name_ ## _decoder = { \ .priv_data_size = sizeof(PCMDecode), \ .init = pcm_decode_init, \ FF_CODEC_DECODE_CB(pcm_decode_frame), \ - .p.capabilities = AV_CODEC_CAP_DR1, \ + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_PARAM_CHANGE, \ .p.sample_fmts = (const enum AVSampleFormat[]){ sample_fmt_, \ AV_SAMPLE_FMT_NONE }, \ } diff --git a/arm/android/third_party/ffmpeg/libavcodec/pcx.c b/arm/android/third_party/ffmpeg/libavcodec/pcx.c index 4cca4972..8e2aae7b 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/pcx.c +++ b/arm/android/third_party/ffmpeg/libavcodec/pcx.c @@ -75,9 +75,10 @@ static int pcx_decode_frame(AVCodecContext *avctx, AVFrame *p, GetByteContext gb; int compressed, xmin, ymin, xmax, ymax; int ret; - unsigned int w, h, bits_per_pixel, bytes_per_line, nplanes, stride, y, x, + unsigned int w, h, bits_per_pixel, bytes_per_line, nplanes, y, x, bytes_per_scanline; uint8_t *ptr, *scanline; + ptrdiff_t stride; if (avpkt->size < PCX_HEADER_SIZE) { av_log(avctx, AV_LOG_ERROR, "Packet too small\n"); diff --git a/arm/android/third_party/ffmpeg/libavcodec/pdvdec.c b/arm/android/third_party/ffmpeg/libavcodec/pdvdec.c index d50c4e72..e2c03e7e 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/pdvdec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/pdvdec.c @@ -102,8 +102,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, dst += frame->linesize[0]; } - av_frame_unref(s->previous_frame); - if ((ret = av_frame_ref(s->previous_frame, frame)) < 0) + if ((ret = av_frame_replace(s->previous_frame, frame)) < 0) return ret; if (avpkt->flags & AV_PKT_FLAG_KEY) { diff --git a/arm/android/third_party/ffmpeg/libavcodec/photocd.c b/arm/android/third_party/ffmpeg/libavcodec/photocd.c index 3a09b819..07e8d460 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/photocd.c +++ b/arm/android/third_party/ffmpeg/libavcodec/photocd.c @@ -210,8 +210,8 @@ static av_noinline int read_hufftable(AVCodecContext *avctx, VLC *vlc) s->syms[j] = sym; } - ff_free_vlc(vlc); - ret = ff_init_vlc_sparse(vlc, 12, count, + ff_vlc_free(vlc); + ret = ff_vlc_init_sparse(vlc, 12, count, s->bits, sizeof(*s->bits), sizeof(*s->bits), s->codes, sizeof(*s->codes), sizeof(*s->codes), s->syms, sizeof(*s->syms), sizeof(*s->syms), 0); @@ -438,7 +438,7 @@ static av_cold int photocd_decode_close(AVCodecContext *avctx) PhotoCDContext *s = avctx->priv_data; for (int i = 0; i < 3; i++) - ff_free_vlc(&s->vlc[i]); + ff_vlc_free(&s->vlc[i]); return 0; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/pngenc.c b/arm/android/third_party/ffmpeg/libavcodec/pngenc.c index 21b033ea..f0650962 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/pngenc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/pngenc.c @@ -1059,8 +1059,7 @@ static int encode_apng(AVCodecContext *avctx, AVPacket *pkt, } } - av_frame_unref(s->last_frame); - ret = av_frame_ref(s->last_frame, pict); + ret = av_frame_replace(s->last_frame, pict); if (ret < 0) return ret; diff --git a/arm/android/third_party/ffmpeg/libavcodec/pnmdec.c b/arm/android/third_party/ffmpeg/libavcodec/pnmdec.c index 72bc83b2..acd77ea8 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/pnmdec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/pnmdec.c @@ -137,7 +137,7 @@ static int pnm_decode_frame(AVCodecContext *avctx, AVFrame *p, if(s->type < 4 || (is_mono && s->type==7)){ for (i=0; iheight; i++) { PutBitContext pb; - init_put_bits(&pb, ptr, linesize); + init_put_bits(&pb, ptr, FFABS(linesize)); for(j=0; jwidth * components; j++){ unsigned int c=0; unsigned v=0; diff --git a/arm/android/third_party/ffmpeg/libavcodec/ppc/Makefile b/arm/android/third_party/ffmpeg/libavcodec/ppc/Makefile index bc13d8a0..10b9ca60 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/ppc/Makefile +++ b/arm/android/third_party/ffmpeg/libavcodec/ppc/Makefile @@ -1,9 +1,6 @@ # subsystems OBJS-$(CONFIG_AUDIODSP) += ppc/audiodsp.o OBJS-$(CONFIG_BLOCKDSP) += ppc/blockdsp.o -OBJS-$(CONFIG_FFT) += ppc/fft_init.o \ - ppc/fft_altivec.o \ - ppc/fft_vsx.o OBJS-$(CONFIG_FDCTDSP) += ppc/fdctdsp.o OBJS-$(CONFIG_FMTCONVERT) += ppc/fmtconvert_altivec.o OBJS-$(CONFIG_H264CHROMA) += ppc/h264chroma_init.o diff --git a/arm/android/third_party/ffmpeg/libavcodec/ppc/fdctdsp.c b/arm/android/third_party/ffmpeg/libavcodec/ppc/fdctdsp.c index 4ab516c6..ae3c1b18 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/ppc/fdctdsp.c +++ b/arm/android/third_party/ffmpeg/libavcodec/ppc/fdctdsp.c @@ -25,6 +25,7 @@ #include "libavutil/ppc/cpu.h" #include "libavutil/ppc/util_altivec.h" +#include "libavcodec/avcodec.h" #include "libavcodec/fdctdsp.h" #include "fdct.h" diff --git a/arm/android/third_party/ffmpeg/libavcodec/ppc/idctdsp.c b/arm/android/third_party/ffmpeg/libavcodec/ppc/idctdsp.c index 29f625a0..a7acbc5e 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/ppc/idctdsp.c +++ b/arm/android/third_party/ffmpeg/libavcodec/ppc/idctdsp.c @@ -40,6 +40,7 @@ #include "libavutil/ppc/cpu.h" #include "libavutil/ppc/util_altivec.h" +#include "libavcodec/avcodec.h" #include "libavcodec/idctdsp.h" #if HAVE_ALTIVEC diff --git a/arm/android/third_party/ffmpeg/libavcodec/ppc/mpegaudiodsp_altivec.c b/arm/android/third_party/ffmpeg/libavcodec/ppc/mpegaudiodsp_altivec.c index 6794ed09..b065203c 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/ppc/mpegaudiodsp_altivec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/ppc/mpegaudiodsp_altivec.c @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + #include "config.h" #include "libavutil/attributes.h" #include "libavutil/cpu.h" diff --git a/arm/android/third_party/ffmpeg/libavcodec/profiles.c b/arm/android/third_party/ffmpeg/libavcodec/profiles.c index c646a3f5..5bb8f150 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/profiles.c +++ b/arm/android/third_party/ffmpeg/libavcodec/profiles.c @@ -24,180 +24,180 @@ #if !CONFIG_SMALL const AVProfile ff_aac_profiles[] = { - { FF_PROFILE_AAC_LOW, "LC" }, - { 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_AAC_MAIN, "Main" }, - { FF_PROFILE_AAC_SSR, "SSR" }, - { FF_PROFILE_AAC_LTP, "LTP" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_AAC_LOW, "LC" }, + { AV_PROFILE_AAC_HE, "HE-AAC" }, + { AV_PROFILE_AAC_HE_V2, "HE-AACv2" }, + { AV_PROFILE_AAC_LD, "LD" }, + { AV_PROFILE_AAC_ELD, "ELD" }, + { AV_PROFILE_AAC_MAIN, "Main" }, + { AV_PROFILE_AAC_SSR, "SSR" }, + { AV_PROFILE_AAC_LTP, "LTP" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_dca_profiles[] = { - { FF_PROFILE_DTS, "DTS" }, - { FF_PROFILE_DTS_ES, "DTS-ES" }, - { FF_PROFILE_DTS_96_24, "DTS 96/24" }, - { FF_PROFILE_DTS_HD_HRA, "DTS-HD HRA" }, - { FF_PROFILE_DTS_HD_MA, "DTS-HD MA" }, - { FF_PROFILE_DTS_HD_MA_X, "DTS-HD MA + DTS:X" }, - { FF_PROFILE_DTS_HD_MA_X_IMAX, "DTS-HD MA + DTS:X IMAX" }, - { FF_PROFILE_DTS_EXPRESS, "DTS Express" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_DTS, "DTS" }, + { AV_PROFILE_DTS_ES, "DTS-ES" }, + { AV_PROFILE_DTS_96_24, "DTS 96/24" }, + { AV_PROFILE_DTS_HD_HRA, "DTS-HD HRA" }, + { AV_PROFILE_DTS_HD_MA, "DTS-HD MA" }, + { AV_PROFILE_DTS_HD_MA_X, "DTS-HD MA + DTS:X" }, + { AV_PROFILE_DTS_HD_MA_X_IMAX, "DTS-HD MA + DTS:X IMAX" }, + { AV_PROFILE_DTS_EXPRESS, "DTS Express" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_eac3_profiles[] = { - { FF_PROFILE_EAC3_DDP_ATMOS, "Dolby Digital Plus + Dolby Atmos"}, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_EAC3_DDP_ATMOS, "Dolby Digital Plus + Dolby Atmos"}, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_truehd_profiles[] = { - { FF_PROFILE_TRUEHD_ATMOS, "Dolby TrueHD + Dolby Atmos"}, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_TRUEHD_ATMOS, "Dolby TrueHD + Dolby Atmos"}, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_dnxhd_profiles[] = { - { FF_PROFILE_DNXHD, "DNXHD"}, - { FF_PROFILE_DNXHR_LB, "DNXHR LB"}, - { FF_PROFILE_DNXHR_SQ, "DNXHR SQ"}, - { FF_PROFILE_DNXHR_HQ, "DNXHR HQ" }, - { FF_PROFILE_DNXHR_HQX, "DNXHR HQX"}, - { FF_PROFILE_DNXHR_444, "DNXHR 444"}, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_DNXHD, "DNXHD"}, + { AV_PROFILE_DNXHR_LB, "DNXHR LB"}, + { AV_PROFILE_DNXHR_SQ, "DNXHR SQ"}, + { AV_PROFILE_DNXHR_HQ, "DNXHR HQ" }, + { AV_PROFILE_DNXHR_HQX, "DNXHR HQX"}, + { AV_PROFILE_DNXHR_444, "DNXHR 444"}, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_h264_profiles[] = { - { FF_PROFILE_H264_BASELINE, "Baseline" }, - { FF_PROFILE_H264_CONSTRAINED_BASELINE, "Constrained Baseline" }, - { FF_PROFILE_H264_MAIN, "Main" }, - { FF_PROFILE_H264_EXTENDED, "Extended" }, - { FF_PROFILE_H264_HIGH, "High" }, - { FF_PROFILE_H264_HIGH_10, "High 10" }, - { FF_PROFILE_H264_HIGH_10_INTRA, "High 10 Intra" }, - { FF_PROFILE_H264_HIGH_422, "High 4:2:2" }, - { FF_PROFILE_H264_HIGH_422_INTRA, "High 4:2:2 Intra" }, - { FF_PROFILE_H264_HIGH_444, "High 4:4:4" }, - { FF_PROFILE_H264_HIGH_444_PREDICTIVE, "High 4:4:4 Predictive" }, - { FF_PROFILE_H264_HIGH_444_INTRA, "High 4:4:4 Intra" }, - { FF_PROFILE_H264_CAVLC_444, "CAVLC 4:4:4" }, - { FF_PROFILE_H264_MULTIVIEW_HIGH, "Multiview High" }, - { FF_PROFILE_H264_STEREO_HIGH, "Stereo High" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_H264_BASELINE, "Baseline" }, + { AV_PROFILE_H264_CONSTRAINED_BASELINE, "Constrained Baseline" }, + { AV_PROFILE_H264_MAIN, "Main" }, + { AV_PROFILE_H264_EXTENDED, "Extended" }, + { AV_PROFILE_H264_HIGH, "High" }, + { AV_PROFILE_H264_HIGH_10, "High 10" }, + { AV_PROFILE_H264_HIGH_10_INTRA, "High 10 Intra" }, + { AV_PROFILE_H264_HIGH_422, "High 4:2:2" }, + { AV_PROFILE_H264_HIGH_422_INTRA, "High 4:2:2 Intra" }, + { AV_PROFILE_H264_HIGH_444, "High 4:4:4" }, + { AV_PROFILE_H264_HIGH_444_PREDICTIVE, "High 4:4:4 Predictive" }, + { AV_PROFILE_H264_HIGH_444_INTRA, "High 4:4:4 Intra" }, + { AV_PROFILE_H264_CAVLC_444, "CAVLC 4:4:4" }, + { AV_PROFILE_H264_MULTIVIEW_HIGH, "Multiview High" }, + { AV_PROFILE_H264_STEREO_HIGH, "Stereo High" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_vvc_profiles[] = { - { FF_PROFILE_VVC_MAIN_10, "Main 10" }, - { FF_PROFILE_VVC_MAIN_10_444, "Main 10 4:4:4" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_VVC_MAIN_10, "Main 10" }, + { AV_PROFILE_VVC_MAIN_10_444, "Main 10 4:4:4" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_hevc_profiles[] = { - { FF_PROFILE_HEVC_MAIN, "Main" }, - { FF_PROFILE_HEVC_MAIN_10, "Main 10" }, - { FF_PROFILE_HEVC_MAIN_STILL_PICTURE, "Main Still Picture" }, - { FF_PROFILE_HEVC_REXT, "Rext" }, - { FF_PROFILE_HEVC_SCC, "Scc" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_HEVC_MAIN, "Main" }, + { AV_PROFILE_HEVC_MAIN_10, "Main 10" }, + { AV_PROFILE_HEVC_MAIN_STILL_PICTURE, "Main Still Picture" }, + { AV_PROFILE_HEVC_REXT, "Rext" }, + { AV_PROFILE_HEVC_SCC, "Scc" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_jpeg2000_profiles[] = { - { FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0, "JPEG 2000 codestream restriction 0" }, - { FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1, "JPEG 2000 codestream restriction 1" }, - { FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION, "JPEG 2000 no codestream restrictions" }, - { FF_PROFILE_JPEG2000_DCINEMA_2K, "JPEG 2000 digital cinema 2K" }, - { FF_PROFILE_JPEG2000_DCINEMA_4K, "JPEG 2000 digital cinema 4K" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0, "JPEG 2000 codestream restriction 0" }, + { AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1, "JPEG 2000 codestream restriction 1" }, + { AV_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION, "JPEG 2000 no codestream restrictions" }, + { AV_PROFILE_JPEG2000_DCINEMA_2K, "JPEG 2000 digital cinema 2K" }, + { AV_PROFILE_JPEG2000_DCINEMA_4K, "JPEG 2000 digital cinema 4K" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_mpeg2_video_profiles[] = { - { FF_PROFILE_MPEG2_422, "4:2:2" }, - { FF_PROFILE_MPEG2_HIGH, "High" }, - { FF_PROFILE_MPEG2_SS, "Spatially Scalable" }, - { FF_PROFILE_MPEG2_SNR_SCALABLE, "SNR Scalable" }, - { FF_PROFILE_MPEG2_MAIN, "Main" }, - { FF_PROFILE_MPEG2_SIMPLE, "Simple" }, - { FF_PROFILE_RESERVED, "Reserved" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_MPEG2_422, "4:2:2" }, + { AV_PROFILE_MPEG2_HIGH, "High" }, + { AV_PROFILE_MPEG2_SS, "Spatially Scalable" }, + { AV_PROFILE_MPEG2_SNR_SCALABLE, "SNR Scalable" }, + { AV_PROFILE_MPEG2_MAIN, "Main" }, + { AV_PROFILE_MPEG2_SIMPLE, "Simple" }, + { AV_PROFILE_RESERVED, "Reserved" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_mpeg4_video_profiles[] = { - { FF_PROFILE_MPEG4_SIMPLE, "Simple Profile" }, - { FF_PROFILE_MPEG4_SIMPLE_SCALABLE, "Simple Scalable Profile" }, - { FF_PROFILE_MPEG4_CORE, "Core Profile" }, - { FF_PROFILE_MPEG4_MAIN, "Main Profile" }, - { FF_PROFILE_MPEG4_N_BIT, "N-bit Profile" }, - { FF_PROFILE_MPEG4_SCALABLE_TEXTURE, "Scalable Texture Profile" }, - { FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION, "Simple Face Animation Profile" }, - { FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE, "Basic Animated Texture Profile" }, - { FF_PROFILE_MPEG4_HYBRID, "Hybrid Profile" }, - { FF_PROFILE_MPEG4_ADVANCED_REAL_TIME, "Advanced Real Time Simple Profile" }, - { FF_PROFILE_MPEG4_CORE_SCALABLE, "Code Scalable Profile" }, - { FF_PROFILE_MPEG4_ADVANCED_CODING, "Advanced Coding Profile" }, - { FF_PROFILE_MPEG4_ADVANCED_CORE, "Advanced Core Profile" }, - { FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE, "Advanced Scalable Texture Profile" }, - { FF_PROFILE_MPEG4_SIMPLE_STUDIO, "Simple Studio Profile" }, - { FF_PROFILE_MPEG4_ADVANCED_SIMPLE, "Advanced Simple Profile" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_MPEG4_SIMPLE, "Simple Profile" }, + { AV_PROFILE_MPEG4_SIMPLE_SCALABLE, "Simple Scalable Profile" }, + { AV_PROFILE_MPEG4_CORE, "Core Profile" }, + { AV_PROFILE_MPEG4_MAIN, "Main Profile" }, + { AV_PROFILE_MPEG4_N_BIT, "N-bit Profile" }, + { AV_PROFILE_MPEG4_SCALABLE_TEXTURE, "Scalable Texture Profile" }, + { AV_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION, "Simple Face Animation Profile" }, + { AV_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE, "Basic Animated Texture Profile" }, + { AV_PROFILE_MPEG4_HYBRID, "Hybrid Profile" }, + { AV_PROFILE_MPEG4_ADVANCED_REAL_TIME, "Advanced Real Time Simple Profile" }, + { AV_PROFILE_MPEG4_CORE_SCALABLE, "Code Scalable Profile" }, + { AV_PROFILE_MPEG4_ADVANCED_CODING, "Advanced Coding Profile" }, + { AV_PROFILE_MPEG4_ADVANCED_CORE, "Advanced Core Profile" }, + { AV_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE, "Advanced Scalable Texture Profile" }, + { AV_PROFILE_MPEG4_SIMPLE_STUDIO, "Simple Studio Profile" }, + { AV_PROFILE_MPEG4_ADVANCED_SIMPLE, "Advanced Simple Profile" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_vc1_profiles[] = { - { FF_PROFILE_VC1_SIMPLE, "Simple" }, - { FF_PROFILE_VC1_MAIN, "Main" }, - { FF_PROFILE_VC1_COMPLEX, "Complex" }, - { FF_PROFILE_VC1_ADVANCED, "Advanced" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_VC1_SIMPLE, "Simple" }, + { AV_PROFILE_VC1_MAIN, "Main" }, + { AV_PROFILE_VC1_COMPLEX, "Complex" }, + { AV_PROFILE_VC1_ADVANCED, "Advanced" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_vp9_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 }, + { AV_PROFILE_VP9_0, "Profile 0" }, + { AV_PROFILE_VP9_1, "Profile 1" }, + { AV_PROFILE_VP9_2, "Profile 2" }, + { AV_PROFILE_VP9_3, "Profile 3" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_av1_profiles[] = { - { FF_PROFILE_AV1_MAIN, "Main" }, - { FF_PROFILE_AV1_HIGH, "High" }, - { FF_PROFILE_AV1_PROFESSIONAL, "Professional" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_AV1_MAIN, "Main" }, + { AV_PROFILE_AV1_HIGH, "High" }, + { AV_PROFILE_AV1_PROFESSIONAL, "Professional" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_sbc_profiles[] = { - { FF_PROFILE_SBC_MSBC, "mSBC" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_SBC_MSBC, "mSBC" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_prores_profiles[] = { - { FF_PROFILE_PRORES_PROXY, "Proxy" }, - { FF_PROFILE_PRORES_LT, "LT" }, - { FF_PROFILE_PRORES_STANDARD, "Standard" }, - { FF_PROFILE_PRORES_HQ, "HQ" }, - { FF_PROFILE_PRORES_4444, "4444" }, - { FF_PROFILE_PRORES_XQ, "XQ" }, - { FF_PROFILE_UNKNOWN } + { AV_PROFILE_PRORES_PROXY, "Proxy" }, + { AV_PROFILE_PRORES_LT, "LT" }, + { AV_PROFILE_PRORES_STANDARD, "Standard" }, + { AV_PROFILE_PRORES_HQ, "HQ" }, + { AV_PROFILE_PRORES_4444, "4444" }, + { AV_PROFILE_PRORES_XQ, "XQ" }, + { AV_PROFILE_UNKNOWN } }; const AVProfile ff_mjpeg_profiles[] = { - { FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, "Baseline" }, - { FF_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT, "Sequential" }, - { FF_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT, "Progressive" }, - { FF_PROFILE_MJPEG_HUFFMAN_LOSSLESS, "Lossless" }, - { FF_PROFILE_MJPEG_JPEG_LS, "JPEG LS" }, - { FF_PROFILE_UNKNOWN } + { AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, "Baseline" }, + { AV_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT, "Sequential" }, + { AV_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT, "Progressive" }, + { AV_PROFILE_MJPEG_HUFFMAN_LOSSLESS, "Lossless" }, + { AV_PROFILE_MJPEG_JPEG_LS, "JPEG LS" }, + { AV_PROFILE_UNKNOWN } }; const AVProfile ff_arib_caption_profiles[] = { - { FF_PROFILE_ARIB_PROFILE_A, "Profile A" }, - { FF_PROFILE_ARIB_PROFILE_C, "Profile C" }, - { FF_PROFILE_UNKNOWN } + { AV_PROFILE_ARIB_PROFILE_A, "Profile A" }, + { AV_PROFILE_ARIB_PROFILE_C, "Profile C" }, + { AV_PROFILE_UNKNOWN } }; const AVProfile ff_evc_profiles[] = { - { FF_PROFILE_EVC_BASELINE, "Baseline" }, - { FF_PROFILE_EVC_MAIN, "Main" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_EVC_BASELINE, "Baseline" }, + { AV_PROFILE_EVC_MAIN, "Main" }, + { AV_PROFILE_UNKNOWN }, }; #endif /* !CONFIG_SMALL */ diff --git a/arm/android/third_party/ffmpeg/libavcodec/profiles.h b/arm/android/third_party/ffmpeg/libavcodec/profiles.h index c0eacae5..270430a4 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/profiles.h +++ b/arm/android/third_party/ffmpeg/libavcodec/profiles.h @@ -26,35 +26,35 @@ {name, description, 0, AV_OPT_TYPE_CONST, {.i64 = value }, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_## type ##_PARAM, "avctx.profile"}, #define FF_AAC_PROFILE_OPTS \ - FF_AVCTX_PROFILE_OPTION("aac_main", NULL, AUDIO, FF_PROFILE_AAC_MAIN)\ - FF_AVCTX_PROFILE_OPTION("aac_low", NULL, AUDIO, FF_PROFILE_AAC_LOW)\ - FF_AVCTX_PROFILE_OPTION("aac_ssr", NULL, AUDIO, FF_PROFILE_AAC_SSR)\ - FF_AVCTX_PROFILE_OPTION("aac_ltp", NULL, AUDIO, FF_PROFILE_AAC_LTP)\ - FF_AVCTX_PROFILE_OPTION("aac_he", NULL, AUDIO, FF_PROFILE_AAC_HE)\ - FF_AVCTX_PROFILE_OPTION("aac_he_v2", NULL, AUDIO, FF_PROFILE_AAC_HE_V2)\ - FF_AVCTX_PROFILE_OPTION("aac_ld", NULL, AUDIO, FF_PROFILE_AAC_LD)\ - FF_AVCTX_PROFILE_OPTION("aac_eld", NULL, AUDIO, FF_PROFILE_AAC_ELD)\ - FF_AVCTX_PROFILE_OPTION("mpeg2_aac_low", NULL, AUDIO, FF_PROFILE_MPEG2_AAC_LOW)\ - FF_AVCTX_PROFILE_OPTION("mpeg2_aac_he", NULL, AUDIO, FF_PROFILE_MPEG2_AAC_HE)\ + FF_AVCTX_PROFILE_OPTION("aac_main", NULL, AUDIO, AV_PROFILE_AAC_MAIN)\ + FF_AVCTX_PROFILE_OPTION("aac_low", NULL, AUDIO, AV_PROFILE_AAC_LOW)\ + FF_AVCTX_PROFILE_OPTION("aac_ssr", NULL, AUDIO, AV_PROFILE_AAC_SSR)\ + FF_AVCTX_PROFILE_OPTION("aac_ltp", NULL, AUDIO, AV_PROFILE_AAC_LTP)\ + FF_AVCTX_PROFILE_OPTION("aac_he", NULL, AUDIO, AV_PROFILE_AAC_HE)\ + FF_AVCTX_PROFILE_OPTION("aac_he_v2", NULL, AUDIO, AV_PROFILE_AAC_HE_V2)\ + FF_AVCTX_PROFILE_OPTION("aac_ld", NULL, AUDIO, AV_PROFILE_AAC_LD)\ + FF_AVCTX_PROFILE_OPTION("aac_eld", NULL, AUDIO, AV_PROFILE_AAC_ELD)\ + FF_AVCTX_PROFILE_OPTION("mpeg2_aac_low", NULL, AUDIO, AV_PROFILE_MPEG2_AAC_LOW)\ + FF_AVCTX_PROFILE_OPTION("mpeg2_aac_he", NULL, AUDIO, AV_PROFILE_MPEG2_AAC_HE)\ #define FF_MPEG4_PROFILE_OPTS \ - FF_AVCTX_PROFILE_OPTION("mpeg4_sp", NULL, VIDEO, FF_PROFILE_MPEG4_SIMPLE)\ - FF_AVCTX_PROFILE_OPTION("mpeg4_core", NULL, VIDEO, FF_PROFILE_MPEG4_CORE)\ - FF_AVCTX_PROFILE_OPTION("mpeg4_main", NULL, VIDEO, FF_PROFILE_MPEG4_MAIN)\ - FF_AVCTX_PROFILE_OPTION("mpeg4_asp", NULL, VIDEO, FF_PROFILE_MPEG4_ADVANCED_SIMPLE)\ + FF_AVCTX_PROFILE_OPTION("mpeg4_sp", NULL, VIDEO, AV_PROFILE_MPEG4_SIMPLE)\ + FF_AVCTX_PROFILE_OPTION("mpeg4_core", NULL, VIDEO, AV_PROFILE_MPEG4_CORE)\ + FF_AVCTX_PROFILE_OPTION("mpeg4_main", NULL, VIDEO, AV_PROFILE_MPEG4_MAIN)\ + FF_AVCTX_PROFILE_OPTION("mpeg4_asp", NULL, VIDEO, AV_PROFILE_MPEG4_ADVANCED_SIMPLE)\ #define FF_MPEG2_PROFILE_OPTS \ - FF_AVCTX_PROFILE_OPTION("422", NULL, VIDEO, FF_PROFILE_MPEG2_422)\ - FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, FF_PROFILE_MPEG2_HIGH)\ - FF_AVCTX_PROFILE_OPTION("ss", NULL, VIDEO, FF_PROFILE_MPEG2_SS)\ - FF_AVCTX_PROFILE_OPTION("snr", NULL, VIDEO, FF_PROFILE_MPEG2_SNR_SCALABLE)\ - FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, FF_PROFILE_MPEG2_MAIN)\ - FF_AVCTX_PROFILE_OPTION("simple", NULL, VIDEO, FF_PROFILE_MPEG2_SIMPLE)\ + FF_AVCTX_PROFILE_OPTION("422", NULL, VIDEO, AV_PROFILE_MPEG2_422)\ + FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, AV_PROFILE_MPEG2_HIGH)\ + FF_AVCTX_PROFILE_OPTION("ss", NULL, VIDEO, AV_PROFILE_MPEG2_SS)\ + FF_AVCTX_PROFILE_OPTION("snr", NULL, VIDEO, AV_PROFILE_MPEG2_SNR_SCALABLE)\ + FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, AV_PROFILE_MPEG2_MAIN)\ + FF_AVCTX_PROFILE_OPTION("simple", NULL, VIDEO, AV_PROFILE_MPEG2_SIMPLE)\ #define FF_AV1_PROFILE_OPTS \ - FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, FF_PROFILE_AV1_MAIN)\ - FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, FF_PROFILE_AV1_HIGH)\ - FF_AVCTX_PROFILE_OPTION("professional", NULL, VIDEO, FF_PROFILE_AV1_PROFESSIONAL)\ + FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, AV_PROFILE_AV1_MAIN)\ + FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, AV_PROFILE_AV1_HIGH)\ + FF_AVCTX_PROFILE_OPTION("professional", NULL, VIDEO, AV_PROFILE_AV1_PROFESSIONAL)\ extern const AVProfile ff_aac_profiles[]; extern const AVProfile ff_dca_profiles[]; diff --git a/arm/android/third_party/ffmpeg/libavcodec/proresdec.h b/arm/android/third_party/ffmpeg/libavcodec/proresdec.h index 1e48752e..230fca41 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/proresdec.h +++ b/arm/android/third_party/ffmpeg/libavcodec/proresdec.h @@ -22,10 +22,15 @@ #ifndef AVCODEC_PRORESDEC_H #define AVCODEC_PRORESDEC_H +#include + #include "get_bits.h" #include "blockdsp.h" #include "proresdsp.h" +#include "libavutil/frame.h" +#include "libavutil/pixfmt.h" + typedef struct { const uint8_t *data; unsigned mb_x; diff --git a/arm/android/third_party/ffmpeg/libavcodec/proresdec2.c b/arm/android/third_party/ffmpeg/libavcodec/proresdec2.c index b86614ad..3a5b7534 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/proresdec2.c +++ b/arm/android/third_party/ffmpeg/libavcodec/proresdec2.c @@ -37,6 +37,7 @@ #include "codec_internal.h" #include "decode.h" #include "get_bits.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "idctdsp.h" #include "profiles.h" @@ -140,27 +141,27 @@ static av_cold int decode_init(AVCodecContext *avctx) switch (avctx->codec_tag) { case MKTAG('a','p','c','o'): - avctx->profile = FF_PROFILE_PRORES_PROXY; + avctx->profile = AV_PROFILE_PRORES_PROXY; break; case MKTAG('a','p','c','s'): - avctx->profile = FF_PROFILE_PRORES_LT; + avctx->profile = AV_PROFILE_PRORES_LT; break; case MKTAG('a','p','c','n'): - avctx->profile = FF_PROFILE_PRORES_STANDARD; + avctx->profile = AV_PROFILE_PRORES_STANDARD; break; case MKTAG('a','p','c','h'): - avctx->profile = FF_PROFILE_PRORES_HQ; + avctx->profile = AV_PROFILE_PRORES_HQ; break; case MKTAG('a','p','4','h'): - avctx->profile = FF_PROFILE_PRORES_4444; + avctx->profile = AV_PROFILE_PRORES_4444; avctx->bits_per_raw_sample = 12; break; case MKTAG('a','p','4','x'): - avctx->profile = FF_PROFILE_PRORES_XQ; + avctx->profile = AV_PROFILE_PRORES_XQ; avctx->bits_per_raw_sample = 12; break; default: - avctx->profile = FF_PROFILE_UNKNOWN; + avctx->profile = AV_PROFILE_UNKNOWN; av_log(avctx, AV_LOG_WARNING, "Unknown prores profile %d\n", avctx->codec_tag); } @@ -171,7 +172,7 @@ static av_cold int decode_init(AVCodecContext *avctx) } ff_blockdsp_init(&ctx->bdsp); - ret = ff_proresdsp_init(&ctx->prodsp, avctx); + ret = ff_proresdsp_init(&ctx->prodsp, avctx->bits_per_raw_sample); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "Fail to init proresdsp for bits per raw sample %d\n", avctx->bits_per_raw_sample); return ret; @@ -277,7 +278,7 @@ static int decode_frame_header(ProresContext *ctx, const uint8_t *buf, *fmtp++ = ctx->pix_fmt; *fmtp = AV_PIX_FMT_NONE; - if ((ret = ff_thread_get_format(avctx, pix_fmts)) < 0) + if ((ret = ff_get_format(avctx, pix_fmts)) < 0) return ret; avctx->pix_fmt = ret; @@ -804,13 +805,14 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, ff_thread_finish_setup(avctx); if (avctx->hwaccel) { - ret = avctx->hwaccel->start_frame(avctx, NULL, 0); + const FFHWAccel *hwaccel = ffhwaccel(avctx->hwaccel); + ret = hwaccel->start_frame(avctx, NULL, 0); if (ret < 0) return ret; - ret = avctx->hwaccel->decode_slice(avctx, avpkt->data, avpkt->size); + ret = hwaccel->decode_slice(avctx, avpkt->data, avpkt->size); if (ret < 0) return ret; - ret = avctx->hwaccel->end_frame(avctx); + ret = hwaccel->end_frame(avctx); if (ret < 0) return ret; goto finish; diff --git a/arm/android/third_party/ffmpeg/libavcodec/proresdsp.c b/arm/android/third_party/ffmpeg/libavcodec/proresdsp.c index 6ed01179..bc253e55 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/proresdsp.c +++ b/arm/android/third_party/ffmpeg/libavcodec/proresdsp.c @@ -76,12 +76,12 @@ static void prores_idct_put_12_c(uint16_t *out, ptrdiff_t linesize, int16_t *blo put_pixels_12(out, linesize >> 1, block); } -av_cold int ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx) +av_cold int ff_proresdsp_init(ProresDSPContext *dsp, int bits_per_raw_sample) { - if (avctx->bits_per_raw_sample == 10) { + if (bits_per_raw_sample == 10) { dsp->idct_put = prores_idct_put_10_c; dsp->idct_permutation_type = FF_IDCT_PERM_NONE; - } else if (avctx->bits_per_raw_sample == 12) { + } else if (bits_per_raw_sample == 12) { dsp->idct_put = prores_idct_put_12_c; dsp->idct_permutation_type = FF_IDCT_PERM_NONE; } else { @@ -89,7 +89,7 @@ av_cold int ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx) } #if ARCH_X86 - ff_proresdsp_init_x86(dsp, avctx); + ff_proresdsp_init_x86(dsp, bits_per_raw_sample); #endif ff_init_scantable_permutation(dsp->idct_permutation, diff --git a/arm/android/third_party/ffmpeg/libavcodec/proresdsp.h b/arm/android/third_party/ffmpeg/libavcodec/proresdsp.h index 37ba76b8..966ba3d7 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/proresdsp.h +++ b/arm/android/third_party/ffmpeg/libavcodec/proresdsp.h @@ -25,7 +25,6 @@ #include #include -#include "avcodec.h" typedef struct ProresDSPContext { int idct_permutation_type; @@ -33,8 +32,8 @@ typedef struct ProresDSPContext { void (*idct_put)(uint16_t *out, ptrdiff_t linesize, int16_t *block, const int16_t *qmat); } ProresDSPContext; -int ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx); +int ff_proresdsp_init(ProresDSPContext *dsp, int bits_per_raw_sample); -void ff_proresdsp_init_x86(ProresDSPContext *dsp, AVCodecContext *avctx); +void ff_proresdsp_init_x86(ProresDSPContext *dsp, int bits_per_raw_sample); #endif /* AVCODEC_PRORESDSP_H */ diff --git a/arm/android/third_party/ffmpeg/libavcodec/proresenc_anatoliy.c b/arm/android/third_party/ffmpeg/libavcodec/proresenc_anatoliy.c index fc48c97d..e7114f16 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/proresenc_anatoliy.c +++ b/arm/android/third_party/ffmpeg/libavcodec/proresenc_anatoliy.c @@ -32,7 +32,6 @@ #include "avcodec.h" #include "codec_internal.h" #include "encode.h" -#include "internal.h" #include "profiles.h" #include "proresdata.h" #include "put_bits.h" @@ -42,13 +41,13 @@ #define DEFAULT_SLICE_MB_WIDTH 8 static const AVProfile profiles[] = { - { FF_PROFILE_PRORES_PROXY, "apco"}, - { FF_PROFILE_PRORES_LT, "apcs"}, - { FF_PROFILE_PRORES_STANDARD, "apcn"}, - { FF_PROFILE_PRORES_HQ, "apch"}, - { FF_PROFILE_PRORES_4444, "ap4h"}, - { FF_PROFILE_PRORES_XQ, "ap4x"}, - { FF_PROFILE_UNKNOWN } + { AV_PROFILE_PRORES_PROXY, "apco"}, + { AV_PROFILE_PRORES_LT, "apcs"}, + { AV_PROFILE_PRORES_STANDARD, "apcn"}, + { AV_PROFILE_PRORES_HQ, "apch"}, + { AV_PROFILE_PRORES_4444, "ap4h"}, + { AV_PROFILE_PRORES_XQ, "ap4x"}, + { AV_PROFILE_UNKNOWN } }; static const int qp_start_table[] = { 8, 3, 2, 1, 1, 1}; @@ -198,6 +197,35 @@ typedef struct { char *vendor; } ProresContext; +/** + * Check if a value is in the list. If not, return the default value + * + * @param ctx Context for the log msg + * @param val_name Name of the checked value, for log msg + * @param array_valid_values Array of valid int, ended with INT_MAX + * @param default_value Value return if checked value is not in the array + * @return Value or default_value. + */ +static int int_from_list_or_default(void *ctx, const char *val_name, int val, + const int *array_valid_values, int default_value) +{ + int i = 0; + + while (1) { + int ref_val = array_valid_values[i]; + if (ref_val == INT_MAX) + break; + if (val == ref_val) + return val; + i++; + } + /* val is not a valid value */ + av_log(ctx, AV_LOG_DEBUG, + "%s %d are not supported. Set to default value : %d\n", + val_name, val, default_value); + return default_value; +} + static void encode_codeword(PutBitContext *pb, int val, int codebook) { unsigned int rice_order, exp_order, switch_bits, first_exp, exp, zeros; @@ -743,7 +771,7 @@ static int prores_encode_frame(AVCodecContext *avctx, AVPacket *pkt, bytestream_put_be16(&buf, avctx->width); bytestream_put_be16(&buf, avctx->height); frame_flags = 0x82; /* 422 not interlaced */ - if (avctx->profile >= FF_PROFILE_PRORES_4444) /* 4444 or 4444 Xq */ + if (avctx->profile >= AV_PROFILE_PRORES_4444) /* 4444 or 4444 Xq */ frame_flags |= 0x40; /* 444 chroma */ if (ctx->is_interlaced) { if ((pict->flags & AV_FRAME_FLAG_TOP_FIELD_FIRST) || !(pict->flags & AV_FRAME_FLAG_INTERLACED)) { @@ -761,10 +789,13 @@ static int prores_encode_frame(AVCodecContext *avctx, AVPacket *pkt, *buf++ = frame_flags; *buf++ = 0; /* reserved */ /* only write color properties, if valid value. set to unspecified otherwise */ - *buf++ = ff_int_from_list_or_default(avctx, "frame color primaries", pict->color_primaries, valid_primaries, 0); - *buf++ = ff_int_from_list_or_default(avctx, "frame color trc", pict->color_trc, valid_trc, 0); - *buf++ = ff_int_from_list_or_default(avctx, "frame colorspace", pict->colorspace, valid_colorspace, 0); - if (avctx->profile >= FF_PROFILE_PRORES_4444) { + *buf++ = int_from_list_or_default(avctx, "frame color primaries", + pict->color_primaries, valid_primaries, 0); + *buf++ = int_from_list_or_default(avctx, "frame color trc", + pict->color_trc, valid_trc, 0); + *buf++ = int_from_list_or_default(avctx, "frame colorspace", + pict->colorspace, valid_colorspace, 0); + if (avctx->profile >= AV_PROFILE_PRORES_4444) { if (avctx->pix_fmt == AV_PIX_FMT_YUV444P10) { *buf++ = 0xA0;/* src b64a and no alpha */ } else { @@ -840,40 +871,40 @@ static av_cold int prores_encode_init(AVCodecContext *avctx) return AVERROR(EINVAL); } - if (avctx->profile == FF_PROFILE_UNKNOWN) { + if (avctx->profile == AV_PROFILE_UNKNOWN) { if (avctx->pix_fmt == AV_PIX_FMT_YUV422P10) { - avctx->profile = FF_PROFILE_PRORES_STANDARD; + avctx->profile = AV_PROFILE_PRORES_STANDARD; av_log(avctx, AV_LOG_INFO, "encoding with ProRes standard (apcn) profile\n"); } else if (avctx->pix_fmt == AV_PIX_FMT_YUV444P10) { - avctx->profile = FF_PROFILE_PRORES_4444; + avctx->profile = AV_PROFILE_PRORES_4444; av_log(avctx, AV_LOG_INFO, "encoding with ProRes 4444 (ap4h) profile\n"); } else if (avctx->pix_fmt == AV_PIX_FMT_YUVA444P10) { - avctx->profile = FF_PROFILE_PRORES_4444; + avctx->profile = AV_PROFILE_PRORES_4444; av_log(avctx, AV_LOG_INFO, "encoding with ProRes 4444+ (ap4h) profile\n"); } - } else if (avctx->profile < FF_PROFILE_PRORES_PROXY - || avctx->profile > FF_PROFILE_PRORES_XQ) { + } else if (avctx->profile < AV_PROFILE_PRORES_PROXY + || avctx->profile > AV_PROFILE_PRORES_XQ) { av_log( avctx, AV_LOG_ERROR, "unknown profile %d, use [0 - apco, 1 - apcs, 2 - apcn (default), 3 - apch, 4 - ap4h, 5 - ap4x]\n", avctx->profile); return AVERROR(EINVAL); - } else if ((avctx->pix_fmt == AV_PIX_FMT_YUV422P10) && (avctx->profile > FF_PROFILE_PRORES_HQ)){ + } else if ((avctx->pix_fmt == AV_PIX_FMT_YUV422P10) && (avctx->profile > AV_PROFILE_PRORES_HQ)){ av_log(avctx, AV_LOG_ERROR, "encoding with ProRes 444/Xq (ap4h/ap4x) profile, need YUV444P10 input\n"); return AVERROR(EINVAL); } else if ((avctx->pix_fmt == AV_PIX_FMT_YUV444P10 || avctx->pix_fmt == AV_PIX_FMT_YUVA444P10) - && (avctx->profile < FF_PROFILE_PRORES_4444)){ + && (avctx->profile < AV_PROFILE_PRORES_4444)){ av_log(avctx, AV_LOG_ERROR, "encoding with ProRes Proxy/LT/422/422 HQ (apco, apcs, apcn, ap4h) profile, need YUV422P10 input\n"); return AVERROR(EINVAL); } - if (avctx->profile < FF_PROFILE_PRORES_4444) { /* 422 versions */ + if (avctx->profile < AV_PROFILE_PRORES_4444) { /* 422 versions */ ctx->is_422 = 1; if ((avctx->height & 0xf) || (avctx->width & 0xf)) { ctx->fill_y = av_malloc(4 * (DEFAULT_SLICE_MB_WIDTH << 8)); diff --git a/arm/android/third_party/ffmpeg/libavcodec/pthread_frame.c b/arm/android/third_party/ffmpeg/libavcodec/pthread_frame.c index bc305f56..13857677 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/pthread_frame.c +++ b/arm/android/third_party/ffmpeg/libavcodec/pthread_frame.c @@ -31,6 +31,7 @@ #include "avcodec_internal.h" #include "codec_internal.h" #include "decode.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "internal.h" #include "pthread_internal.h" @@ -50,21 +51,11 @@ #include "libavutil/thread.h" enum { - ///< Set when the thread is awaiting a packet. + /// Set when the thread is awaiting a packet. STATE_INPUT_READY, - ///< Set before the codec has called ff_thread_finish_setup(). + /// Set before the codec has called ff_thread_finish_setup(). STATE_SETTING_UP, - /** - * Set when the codec calls get_buffer(). - * State is returned to STATE_SETTING_UP afterwards. - */ - STATE_GET_BUFFER, - /** - * Set when the codec calls get_format(). - * State is returned to STATE_SETTING_UP afterwards. - */ - STATE_GET_FORMAT, - ///< Set after the codec has called ff_thread_finish_setup(). + /// Set after the codec has called ff_thread_finish_setup(). STATE_SETUP_FINISHED, }; @@ -150,7 +141,7 @@ typedef struct FrameThreadContext { static int hwaccel_serial(const AVCodecContext *avctx) { - return avctx->hwaccel && !(avctx->hwaccel->caps_internal & HWACCEL_CAP_THREAD_SAFE); + return avctx->hwaccel && !(ffhwaccel(avctx->hwaccel)->caps_internal & HWACCEL_CAP_THREAD_SAFE); } static void async_lock(FrameThreadContext *fctx) @@ -245,7 +236,7 @@ static attribute_align_arg void *frame_worker_thread(void *arg) pthread_mutex_unlock(&p->parent->hwaccel_mutex); } av_assert0(!avctx->hwaccel || - (avctx->hwaccel->caps_internal & HWACCEL_CAP_THREAD_SAFE)); + (ffhwaccel(avctx->hwaccel)->caps_internal & HWACCEL_CAP_THREAD_SAFE)); if (p->async_serializing) { p->async_serializing = 0; @@ -274,7 +265,7 @@ static attribute_align_arg void *frame_worker_thread(void *arg) * @param for_user 0 if the destination is a codec thread, 1 if the destination is the user's thread * @return 0 on success, negative error code on failure */ -static int update_context_from_thread(AVCodecContext *dst, AVCodecContext *src, int for_user) +static int update_context_from_thread(AVCodecContext *dst, const AVCodecContext *src, int for_user) { const FFCodec *const codec = ffcodec(dst->codec); int err = 0; @@ -367,12 +358,13 @@ FF_ENABLE_DEPRECATION_WARNINGS // propagate hwaccel state for threadsafe hwaccels if (p_src->hwaccel_threadsafe) { + const FFHWAccel *hwaccel = ffhwaccel(src->hwaccel); if (!dst->hwaccel) { - if (src->hwaccel->priv_data_size) { - av_assert0(src->hwaccel->update_thread_context); + if (hwaccel->priv_data_size) { + av_assert0(hwaccel->update_thread_context); dst->internal->hwaccel_priv_data = - av_mallocz(src->hwaccel->priv_data_size); + av_mallocz(hwaccel->priv_data_size); if (!dst->internal->hwaccel_priv_data) return AVERROR(ENOMEM); } @@ -380,8 +372,8 @@ FF_ENABLE_DEPRECATION_WARNINGS } av_assert0(dst->hwaccel == src->hwaccel); - if (src->hwaccel->update_thread_context) { - err = src->hwaccel->update_thread_context(dst, src); + if (hwaccel->update_thread_context) { + err = hwaccel->update_thread_context(dst, src); if (err < 0) { av_log(dst, AV_LOG_ERROR, "Error propagating hwaccel state\n"); ff_hwaccel_uninit(dst); @@ -402,7 +394,7 @@ FF_ENABLE_DEPRECATION_WARNINGS * @param src The source context. * @return 0 on success, negative error code on failure */ -static int update_context_from_user(AVCodecContext *dst, AVCodecContext *src) +static int update_context_from_user(AVCodecContext *dst, const AVCodecContext *src) { int err; @@ -432,22 +424,6 @@ FF_ENABLE_DEPRECATION_WARNINGS FF_DISABLE_DEPRECATION_WARNINGS dst->reordered_opaque = src->reordered_opaque; FF_ENABLE_DEPRECATION_WARNINGS -#endif - -#if FF_API_SLICE_OFFSET -FF_DISABLE_DEPRECATION_WARNINGS - if (src->slice_count && src->slice_offset) { - if (dst->slice_count < src->slice_count) { - int err = av_reallocp_array(&dst->slice_offset, src->slice_count, - sizeof(*dst->slice_offset)); - if (err < 0) - return err; - } - memcpy(dst->slice_offset, src->slice_offset, - src->slice_count * sizeof(*dst->slice_offset)); - } - dst->slice_count = src->slice_count; -FF_ENABLE_DEPRECATION_WARNINGS #endif av_packet_unref(dst->internal->last_pkt_props); @@ -652,12 +628,14 @@ void ff_thread_await_progress(const ThreadFrame *f, int n, int field) } void ff_thread_finish_setup(AVCodecContext *avctx) { - PerThreadContext *p = avctx->internal->thread_ctx; + PerThreadContext *p; if (!(avctx->active_thread_type&FF_THREAD_FRAME)) return; + p = avctx->internal->thread_ctx; + p->hwaccel_threadsafe = avctx->hwaccel && - (avctx->hwaccel->caps_internal & HWACCEL_CAP_THREAD_SAFE); + (ffhwaccel(avctx->hwaccel)->caps_internal & HWACCEL_CAP_THREAD_SAFE); if (hwaccel_serial(avctx) && !p->hwaccel_serializing) { pthread_mutex_lock(&p->parent->hwaccel_mutex); @@ -666,7 +644,7 @@ void ff_thread_finish_setup(AVCodecContext *avctx) { /* this assumes that no hwaccel calls happen before ff_thread_finish_setup() */ if (avctx->hwaccel && - !(avctx->hwaccel->caps_internal & HWACCEL_CAP_ASYNC_SAFE)) { + !(ffhwaccel(avctx->hwaccel)->caps_internal & HWACCEL_CAP_ASYNC_SAFE)) { p->async_serializing = 1; async_lock(p->parent); @@ -762,12 +740,6 @@ void ff_frame_thread_free(AVCodecContext *avctx, int thread_count) av_freep(&ctx->priv_data); } -#if FF_API_SLICE_OFFSET -FF_DISABLE_DEPRECATION_WARNINGS - av_freep(&ctx->slice_offset); -FF_ENABLE_DEPRECATION_WARNINGS -#endif - av_buffer_unref(&ctx->internal->pool); av_packet_free(&ctx->internal->last_pkt_props); av_freep(&ctx->internal); @@ -964,11 +936,12 @@ void ff_thread_flush(AVCodecContext *avctx) int ff_thread_can_start_frame(AVCodecContext *avctx) { - PerThreadContext *p = avctx->internal->thread_ctx; - - if ((avctx->active_thread_type&FF_THREAD_FRAME) && atomic_load(&p->state) != STATE_SETTING_UP && + if ((avctx->active_thread_type & FF_THREAD_FRAME) && ffcodec(avctx->codec)->update_thread_context) { - return 0; + PerThreadContext *p = avctx->internal->thread_ctx; + + if (atomic_load(&p->state) != STATE_SETTING_UP) + return 0; } return 1; diff --git a/arm/android/third_party/ffmpeg/libavcodec/qdm2_tablegen.h b/arm/android/third_party/ffmpeg/libavcodec/qdm2_tablegen.h index a68ea859..6e174a78 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/qdm2_tablegen.h +++ b/arm/android/third_party/ffmpeg/libavcodec/qdm2_tablegen.h @@ -116,9 +116,9 @@ static av_cold void build_vlc(VLC *vlc, int nb_bits, int nb_codes, { vlc->table = &qdm2_table[*offset]; vlc->table_allocated = FF_ARRAY_ELEMS(qdm2_table) - *offset; - ff_init_vlc_from_lengths(vlc, nb_bits, nb_codes, + ff_vlc_init_from_lengths(vlc, nb_bits, nb_codes, &tab[0][1], 2, &tab[0][0], 2, 1, - -1, INIT_VLC_STATIC_OVERLONG | INIT_VLC_LE, NULL); + -1, VLC_INIT_STATIC_OVERLONG | VLC_INIT_LE, NULL); *offset += vlc->table_size; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/qdmc.c b/arm/android/third_party/ffmpeg/libavcodec/qdmc.c index 081c4dd4..474e5ef8 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/qdmc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/qdmc.c @@ -172,9 +172,9 @@ static av_cold void qdmc_init_static_data(void) static VLCElem vlc_buffer[13698]; vtable[i].table = &vlc_buffer[offset]; vtable[i].table_allocated = FF_ARRAY_ELEMS(vlc_buffer) - offset; - ff_init_vlc_from_lengths(&vtable[i], huff_bits[i], huff_sizes[i], + ff_vlc_init_from_lengths(&vtable[i], huff_bits[i], huff_sizes[i], &hufftab[0][1], 2, &hufftab[0][0], 2, 1, -1, - INIT_VLC_LE | INIT_VLC_STATIC_OVERLONG, NULL); + VLC_INIT_LE | VLC_INIT_STATIC_OVERLONG, NULL); hufftab += huff_sizes[i]; offset += vtable[i].table_size; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/qpeg.c b/arm/android/third_party/ffmpeg/libavcodec/qpeg.c index 1f76ebc5..9b4ad8e2 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/qpeg.c +++ b/arm/android/third_party/ffmpeg/libavcodec/qpeg.c @@ -307,8 +307,7 @@ FF_ENABLE_DEPRECATION_WARNINGS #endif memcpy(p->data[1], a->pal, AVPALETTE_SIZE); - av_frame_unref(ref); - if ((ret = av_frame_ref(ref, p)) < 0) + if ((ret = av_frame_replace(ref, p)) < 0) return ret; if (intra) diff --git a/arm/android/third_party/ffmpeg/libavcodec/qsvenc.c b/arm/android/third_party/ffmpeg/libavcodec/qsvenc.c index df63c182..a0144b07 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/qsvenc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/qsvenc.c @@ -21,12 +21,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "config_components.h" - #include #include #include +#include "libavutil/avassert.h" #include "libavutil/common.h" #include "libavutil/hwcontext.h" #include "libavutil/hwcontext_qsv.h" @@ -34,9 +33,9 @@ #include "libavutil/log.h" #include "libavutil/time.h" #include "libavutil/imgutils.h" -#include "libavcodec/bytestream.h" #include "avcodec.h" +#include "encode.h" #include "internal.h" #include "packet_internal.h" #include "qsv.h" @@ -1506,7 +1505,7 @@ static int qsv_retrieve_enc_params(AVCodecContext *avctx, QSVEncContext *q) } memset(avctx->extradata + avctx->extradata_size, 0, AV_INPUT_BUFFER_PADDING_SIZE); - cpb_props = ff_add_cpb_side_data(avctx); + cpb_props = ff_encode_add_cpb_side_data(avctx); if (!cpb_props) return AVERROR(ENOMEM); cpb_props->max_bitrate = avctx->rc_max_rate; @@ -1997,8 +1996,7 @@ static int submit_frame(QSVEncContext *q, const AVFrame *frame, return ret; } } else { - av_frame_unref(qf->frame); - ret = av_frame_ref(qf->frame, frame); + ret = av_frame_replace(qf->frame, frame); if (ret < 0) return ret; } @@ -2586,7 +2584,7 @@ int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext *q, pict_type = AV_PICTURE_TYPE_P; else if (qpkt.bs->FrameType & MFX_FRAMETYPE_B || qpkt.bs->FrameType & MFX_FRAMETYPE_xB) pict_type = AV_PICTURE_TYPE_B; - else if (qpkt.bs->FrameType == MFX_FRAMETYPE_UNKNOWN) { + else if (qpkt.bs->FrameType == MFX_FRAMETYPE_UNKNOWN && qpkt.bs->DataLength) { pict_type = AV_PICTURE_TYPE_NONE; av_log(avctx, AV_LOG_WARNING, "Unknown FrameType, set pict_type to AV_PICTURE_TYPE_NONE.\n"); } else { diff --git a/arm/android/third_party/ffmpeg/libavcodec/qsvenc_hevc.c b/arm/android/third_party/ffmpeg/libavcodec/qsvenc_hevc.c index 5e23ca96..c5b7ac7c 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/qsvenc_hevc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/qsvenc_hevc.c @@ -376,7 +376,7 @@ static const AVClass class = { static const FFCodecDefault qsv_enc_defaults[] = { { "b", "1M" }, { "refs", "0" }, - { "g", "-1" }, + { "g", "248" }, { "bf", "-1" }, { "qmin", "-1" }, { "qmax", "-1" }, diff --git a/arm/android/third_party/ffmpeg/libavcodec/qtrleenc.c b/arm/android/third_party/ffmpeg/libavcodec/qtrleenc.c index 38467627..92e6e843 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/qtrleenc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/qtrleenc.c @@ -385,8 +385,7 @@ static int qtrle_encode_frame(AVCodecContext *avctx, AVPacket *pkt, pkt->size = encode_frame(s, pict, pkt->data); /* save the current frame */ - av_frame_unref(s->previous_frame); - ret = av_frame_ref(s->previous_frame, pict); + ret = av_frame_replace(s->previous_frame, pict); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "cannot add reference\n"); return ret; diff --git a/arm/android/third_party/ffmpeg/libavcodec/ralf.c b/arm/android/third_party/ffmpeg/libavcodec/ralf.c index 591598d8..8f7fac79 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/ralf.c +++ b/arm/android/third_party/ffmpeg/libavcodec/ralf.c @@ -99,7 +99,7 @@ static av_cold int init_ralf_vlc(VLC *vlc, const uint8_t *data, int elems) for (i = 0; i < elems; i++) codes[i] = prefixes[lens[i]]++; - return ff_init_vlc_sparse(vlc, FFMIN(max_bits, 9), elems, + return ff_vlc_init_sparse(vlc, FFMIN(max_bits, 9), elems, lens, 1, 1, codes, 2, 2, NULL, 0, 0, 0); } @@ -109,16 +109,16 @@ static av_cold int decode_close(AVCodecContext *avctx) int i, j, k; for (i = 0; i < 3; i++) { - ff_free_vlc(&ctx->sets[i].filter_params); - ff_free_vlc(&ctx->sets[i].bias); - ff_free_vlc(&ctx->sets[i].coding_mode); + ff_vlc_free(&ctx->sets[i].filter_params); + ff_vlc_free(&ctx->sets[i].bias); + ff_vlc_free(&ctx->sets[i].coding_mode); for (j = 0; j < 10; j++) for (k = 0; k < 11; k++) - ff_free_vlc(&ctx->sets[i].filter_coeffs[j][k]); + ff_vlc_free(&ctx->sets[i].filter_coeffs[j][k]); for (j = 0; j < 15; j++) - ff_free_vlc(&ctx->sets[i].short_codes[j]); + ff_vlc_free(&ctx->sets[i].short_codes[j]); for (j = 0; j < 125; j++) - ff_free_vlc(&ctx->sets[i].long_codes[j]); + ff_vlc_free(&ctx->sets[i].long_codes[j]); } return 0; diff --git a/arm/android/third_party/ffmpeg/libavcodec/rasc.c b/arm/android/third_party/ffmpeg/libavcodec/rasc.c index 4d057e80..21c1829f 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/rasc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/rasc.c @@ -379,8 +379,8 @@ static int decode_dlta(AVCodecContext *avctx, if (!s->frame2->data[0] || !s->frame1->data[0]) return AVERROR_INVALIDDATA; - b1 = s->frame1->data[0] + s->frame1->linesize[0] * (y + h - 1) + x * s->bpp; - b2 = s->frame2->data[0] + s->frame2->linesize[0] * (y + h - 1) + x * s->bpp; + b1 = s->frame1->data[0] + s->frame1->linesize[0] * (int)(y + h - 1) + ((int)x) * s->bpp; + b2 = s->frame2->data[0] + s->frame2->linesize[0] * (int)(y + h - 1) + ((int)x) * s->bpp; cx = 0, cy = h; while (bytestream2_get_bytes_left(&dc) > 0) { int type = bytestream2_get_byte(&dc); @@ -620,7 +620,7 @@ static void draw_cursor(AVCodecContext *avctx) if (cr == s->cursor[0] && cg == s->cursor[1] && cb == s->cursor[2]) continue; - dst = s->frame->data[0] + s->frame->linesize[0] * (s->cursor_y + i) + (s->cursor_x + j); + dst = s->frame->data[0] + s->frame->linesize[0] * (int)(s->cursor_y + i) + (int)(s->cursor_x + j); for (int k = 0; k < 256; k++) { int pr = pal[k * 4 + 0]; int pg = pal[k * 4 + 1]; @@ -646,7 +646,7 @@ static void draw_cursor(AVCodecContext *avctx) continue; cr >>= 3; cg >>=3; cb >>= 3; - dst = s->frame->data[0] + s->frame->linesize[0] * (s->cursor_y + i) + 2 * (s->cursor_x + j); + dst = s->frame->data[0] + s->frame->linesize[0] * (int)(s->cursor_y + i) + 2 * (s->cursor_x + j); AV_WL16(dst, cr | cg << 5 | cb << 10); } } @@ -660,7 +660,7 @@ static void draw_cursor(AVCodecContext *avctx) if (cr == s->cursor[0] && cg == s->cursor[1] && cb == s->cursor[2]) continue; - dst = s->frame->data[0] + s->frame->linesize[0] * (s->cursor_y + i) + 4 * (s->cursor_x + j); + dst = s->frame->data[0] + s->frame->linesize[0] * (int)(s->cursor_y + i) + 4 * (s->cursor_x + j); dst[0] = cb; dst[1] = cg; dst[2] = cr; diff --git a/arm/android/third_party/ffmpeg/libavcodec/ratecontrol.c b/arm/android/third_party/ffmpeg/libavcodec/ratecontrol.c index 649f570c..55ce0547 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/ratecontrol.c +++ b/arm/android/third_party/ffmpeg/libavcodec/ratecontrol.c @@ -26,6 +26,7 @@ */ #include "libavutil/attributes.h" +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "avcodec.h" diff --git a/arm/android/third_party/ffmpeg/libavcodec/raw.c b/arm/android/third_party/ffmpeg/libavcodec/raw.c index 1e5b48d1..b73b80e5 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/raw.c +++ b/arm/android/third_party/ffmpeg/libavcodec/raw.c @@ -206,6 +206,8 @@ static const PixelFormatTag raw_pix_fmt_tags[] = { { AV_PIX_FMT_GBRAP10BE, MKTAG(10 , 00 , '4', 'G') }, { AV_PIX_FMT_GBRAP12LE, MKTAG('G', '4', 00 , 12 ) }, { AV_PIX_FMT_GBRAP12BE, MKTAG(12 , 00 , '4', 'G') }, + { AV_PIX_FMT_GBRAP14LE, MKTAG('G', '4', 00 , 14 ) }, + { AV_PIX_FMT_GBRAP14BE, MKTAG(14 , 00 , '4', 'G') }, { AV_PIX_FMT_GBRAP16LE, MKTAG('G', '4', 00 , 16 ) }, { AV_PIX_FMT_GBRAP16BE, MKTAG(16 , 00 , '4', 'G') }, diff --git a/arm/android/third_party/ffmpeg/libavcodec/riscv/Makefile b/arm/android/third_party/ffmpeg/libavcodec/riscv/Makefile index ee17a521..77bba7f7 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/riscv/Makefile +++ b/arm/android/third_party/ffmpeg/libavcodec/riscv/Makefile @@ -10,6 +10,8 @@ OBJS-$(CONFIG_BSWAPDSP) += riscv/bswapdsp_init.o \ RVV-OBJS-$(CONFIG_BSWAPDSP) += riscv/bswapdsp_rvv.o OBJS-$(CONFIG_FMTCONVERT) += riscv/fmtconvert_init.o RVV-OBJS-$(CONFIG_FMTCONVERT) += riscv/fmtconvert_rvv.o +OBJS-$(CONFIG_G722DSP) += riscv/g722dsp_init.o +RVV-OBJS-$(CONFIG_G722DSP) += riscv/g722dsp_rvv.o OBJS-$(CONFIG_H264CHROMA) += riscv/h264_chroma_init_riscv.o RVV-OBJS-$(CONFIG_H264CHROMA) += riscv/h264_mc_chroma.o OBJS-$(CONFIG_IDCTDSP) += riscv/idctdsp_init.o diff --git a/arm/android/third_party/ffmpeg/libavcodec/riscv/aacpsdsp_rvv.S b/arm/android/third_party/ffmpeg/libavcodec/riscv/aacpsdsp_rvv.S index b581383f..fe250cd8 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/riscv/aacpsdsp_rvv.S +++ b/arm/android/third_party/ffmpeg/libavcodec/riscv/aacpsdsp_rvv.S @@ -38,14 +38,14 @@ endfunc func ff_ps_mul_pair_single_rvv, zve32f 1: - vsetvli t0, a3, e32, m1, ta, ma + vsetvli t0, a3, e32, m4, ta, ma vlseg2e32.v v24, (a1) sub a3, a3, t0 vle32.v v16, (a2) sh3add a1, t0, a1 vfmul.vv v24, v24, v16 sh2add a2, t0, a2 - vfmul.vv v25, v25, v16 + vfmul.vv v28, v28, v16 vsseg2e32.v v24, (a0) sh3add a0, t0, a0 bnez a3, 1b @@ -168,10 +168,10 @@ func ff_ps_hybrid_analysis_ileave_rvv, zve32x /* no needs for zve32f here */ mv t4, a4 addi a2, a2, 1 2: - vsetvli t5, t3, e32, m1, ta, ma + vsetvli t5, t3, e32, m4, ta, ma vlse32.v v16, (t1), t6 sub t3, t3, t5 - vlse32.v v17, (t4), t6 + vlse32.v v20, (t4), t6 mul t2, t5, t6 vsseg2e32.v v16, (t0) sh3add t0, t5, t0 @@ -203,12 +203,12 @@ func ff_ps_hybrid_synthesis_deint_rvv, zve32x mv t4, a4 addi a2, a2, 1 2: - vsetvli t5, t3, e32, m1, ta, ma + vsetvli t5, t3, e32, m4, ta, ma vlseg2e32.v v16, (t1) sub t3, t3, t5 vsse32.v v16, (t0), t6 mul t2, t5, t6 - vsse32.v v17, (t4), t6 + vsse32.v v20, (t4), t6 sh3add t1, t5, t1 add t0, t0, t2 add t4, t4, t2 @@ -223,7 +223,7 @@ func ff_ps_hybrid_synthesis_deint_rvv, zve32x endfunc func ff_ps_stereo_interpolate_rvv, zve32f - vsetvli t0, zero, e32, m1, ta, ma + vsetvli t0, zero, e32, m2, ta, ma vid.v v24 flw ft0, (a2) vadd.vi v24, v24, 1 // v24[i] = i + 1 @@ -232,47 +232,43 @@ func ff_ps_stereo_interpolate_rvv, zve32f flw ft2, 8(a2) vfmv.v.f v16, ft0 flw ft3, 12(a2) - vfmv.v.f v17, ft1 + vfmv.v.f v18, ft1 flw ft0, (a3) - vfmv.v.f v18, ft2 + vfmv.v.f v20, ft2 flw ft1, 4(a3) - vfmv.v.f v19, ft3 + vfmv.v.f v22, ft3 flw ft2, 8(a3) - vfmv.v.f v20, ft0 flw ft3, 12(a3) - vfmv.v.f v21, ft1 fcvt.s.wu ft4, t0 // (float)(vlenb / sizeof (float)) - vfmv.v.f v22, ft2 + vfmacc.vf v16, ft0, v24 // h0 += (i + 1) * h0_step fmul.s ft0, ft0, ft4 - vfmv.v.f v23, ft3 + vfmacc.vf v18, ft1, v24 fmul.s ft1, ft1, ft4 - vfmacc.vv v16, v24, v20 // h0 += (i + 1) * h0_step + vfmacc.vf v20, ft2, v24 fmul.s ft2, ft2, ft4 - vfmacc.vv v17, v24, v21 + vfmacc.vf v22, ft3, v24 fmul.s ft3, ft3, ft4 - vfmacc.vv v18, v24, v22 - vfmacc.vv v19, v24, v23 1: - vsetvli t0, a4, e32, m1, ta, ma - vlseg2e32.v v8, (a0) // v8:l_re, v9:l_im + vsetvli t0, a4, e32, m2, ta, ma + vlseg2e32.v v0, (a0) // v0:l_re, v2:l_im sub a4, a4, t0 - vlseg2e32.v v10, (a1) // v10:r_re, v11:r_im - vfmul.vv v12, v8, v16 - vfmul.vv v13, v9, v16 - vfmul.vv v14, v8, v17 - vfmul.vv v15, v9, v17 - vfmacc.vv v12, v10, v18 - vfmacc.vv v13, v11, v18 - vfmacc.vv v14, v10, v19 - vfmacc.vv v15, v11, v19 - vsseg2e32.v v12, (a0) + vlseg2e32.v v4, (a1) // v4:r_re, v6:r_im + vfmul.vv v8, v0, v16 + vfmul.vv v10, v2, v16 + vfmul.vv v12, v0, v18 + vfmul.vv v14, v2, v18 + vfmacc.vv v8, v4, v20 + vfmacc.vv v10, v6, v20 + vfmacc.vv v12, v4, v22 + vfmacc.vv v14, v6, v22 + vsseg2e32.v v8, (a0) sh3add a0, t0, a0 - vsseg2e32.v v14, (a1) + vsseg2e32.v v12, (a1) sh3add a1, t0, a1 vfadd.vf v16, v16, ft0 // h0 += (vlenb / sizeof (float)) * h0_step - vfadd.vf v17, v17, ft1 - vfadd.vf v18, v18, ft2 - vfadd.vf v19, v19, ft3 + vfadd.vf v18, v18, ft1 + vfadd.vf v20, v20, ft2 + vfadd.vf v22, v22, ft3 bnez a4, 1b ret diff --git a/arm/android/third_party/ffmpeg/libavcodec/riscv/audiodsp_rvv.S b/arm/android/third_party/ffmpeg/libavcodec/riscv/audiodsp_rvv.S index f7eba211..f0b23bab 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/riscv/audiodsp_rvv.S +++ b/arm/android/third_party/ffmpeg/libavcodec/riscv/audiodsp_rvv.S @@ -42,7 +42,7 @@ endfunc func ff_vector_clip_int32_rvv, zve32x 1: - vsetvli t0, a4, e32, m1, ta, ma + vsetvli t0, a4, e32, m8, ta, ma vle32.v v8, (a1) sub a4, a4, t0 vmax.vx v8, v8, a2 @@ -59,7 +59,7 @@ func ff_vector_clipf_rvv, zve32f NOHWF fmv.w.x fa0, a3 NOHWF fmv.w.x fa1, a4 1: - vsetvli t0, a2, e32, m1, ta, ma + vsetvli t0, a2, e32, m8, ta, ma vle32.v v8, (a1) sub a2, a2, t0 vfmax.vf v8, v8, fa0 diff --git a/arm/android/third_party/ffmpeg/libavcodec/riscv/bswapdsp_rvb.S b/arm/android/third_party/ffmpeg/libavcodec/riscv/bswapdsp_rvb.S index 91b47bf8..0786bd3f 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/riscv/bswapdsp_rvb.S +++ b/arm/android/third_party/ffmpeg/libavcodec/riscv/bswapdsp_rvb.S @@ -20,49 +20,10 @@ #include "config.h" #include "libavutil/riscv/asm.S" +#include "libavutil/riscv/bswap_rvb.S" #if (__riscv_xlen >= 64) func ff_bswap32_buf_rvb, zbb - andi t0, a1, 4 - beqz t0, 1f - /* Align a1 (input) to 64-bit */ - lwu t0, (a1) - addi a0, a0, 4 - rev8 t0, t0 - addi a2, a2, -1 - srli t0, t0, __riscv_xlen - 32 - addi a1, a1, 4 - sw t0, -4(a0) -1: - andi a3, a2, -2 - sh2add a2, a2, a0 - beqz a3, 3f - sh2add a3, a3, a0 -2: /* 2 elements (64 bits) at a time on a 64-bit boundary */ - ld t0, (a1) - addi a0, a0, 8 - rev8 t0, t0 -#if (__riscv_xlen == 64) - srli t2, t0, 32 - sw t0, -4(a0) -#else - srli t1, t0, __riscv_xlen - 64 - srli t2, t0, __riscv_xlen - 32 - sw t1, -4(a0) -#endif - addi a1, a1, 8 - sw t2, -8(a0) - bne a0, a3, 2b -3: - beq a0, a2, 5f -4: /* Process last element */ - lwu t0, (a1) - addi a0, a0, 4 - rev8 t0, t0 - addi a1, a1, 4 - srli t0, t0, __riscv_xlen - 32 - sw t0, -4(a0) -5: - ret + bswap32_rvb a0, a1, a2 endfunc #endif diff --git a/arm/android/third_party/ffmpeg/libavcodec/riscv/fmtconvert_rvv.S b/arm/android/third_party/ffmpeg/libavcodec/riscv/fmtconvert_rvv.S index 51365753..d0e2f106 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/riscv/fmtconvert_rvv.S +++ b/arm/android/third_party/ffmpeg/libavcodec/riscv/fmtconvert_rvv.S @@ -24,7 +24,7 @@ func ff_int32_to_float_fmul_scalar_rvv, zve32f NOHWF fmv.w.x fa0, a2 NOHWF mv a2, a3 1: - vsetvli t0, a2, e32, m1, ta, ma + vsetvli t0, a2, e32, m8, ta, ma vle32.v v24, (a1) sub a2, a2, t0 vfcvt.f.x.v v24, v24 diff --git a/arm/android/third_party/ffmpeg/libavcodec/riscv/g722dsp_init.c b/arm/android/third_party/ffmpeg/libavcodec/riscv/g722dsp_init.c new file mode 100644 index 00000000..77e29bfb --- /dev/null +++ b/arm/android/third_party/ffmpeg/libavcodec/riscv/g722dsp_init.c @@ -0,0 +1,40 @@ +/* + * Copyright © 2023 Rémi Denis-Courmont. + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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 + +#include "libavutil/attributes.h" +#include "libavutil/cpu.h" +#include "libavutil/riscv/cpu.h" +#include "libavcodec/g722dsp.h" + +extern void ff_g722_apply_qmf_rvv(const int16_t *prev_samples, int xout[2]); + +av_cold void ff_g722dsp_init_riscv(G722DSPContext *dsp) +{ +#if HAVE_RVV + int flags = av_get_cpu_flags(); + + if ((flags & AV_CPU_FLAG_RVV_I32) && ff_get_rv_vlenb() >= 16) + dsp->apply_qmf = ff_g722_apply_qmf_rvv; +#endif +} diff --git a/arm/android/third_party/ffmpeg/libavcodec/riscv/g722dsp_rvv.S b/arm/android/third_party/ffmpeg/libavcodec/riscv/g722dsp_rvv.S new file mode 100644 index 00000000..350be8dc --- /dev/null +++ b/arm/android/third_party/ffmpeg/libavcodec/riscv/g722dsp_rvv.S @@ -0,0 +1,66 @@ +/* + * Copyright © 2023 Rémi Denis-Courmont. + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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/riscv/asm.S" + +func ff_g722_apply_qmf_rvv, zve32x + lla t0, qmf_coeffs + vsetivli zero, 12, e16, m2, ta, ma + vlseg2e16.v v28, (a0) + vlseg2e16.v v24, (t0) + vwmul.vv v16, v28, v24 + vwmul.vv v20, v30, v26 + vsetivli zero, 12, e32, m4, ta, ma + vmv.s.x v10, zero + vredsum.vs v8, v16, v10 + vredsum.vs v9, v20, v10 + vmv.x.s t0, v8 + vmv.x.s t1, v9 + sw t0, 4(a1) + sw t1, 0(a1) + ret +endfunc + +const qmf_coeffs, align=2 + .short 3 + .short -11 + .short -11 + .short 53 + .short 12 + .short -156 + .short 32 + .short 362 + .short -210 + .short -805 + .short 951 + .short 3876 + .short 3876 + .short 951 + .short -805 + .short -210 + .short 362 + .short 32 + .short -156 + .short 12 + .short 53 + .short -11 + .short -11 + .short 3 +endconst diff --git a/arm/android/third_party/ffmpeg/libavcodec/riscv/h264_chroma_init_riscv.c b/arm/android/third_party/ffmpeg/libavcodec/riscv/h264_chroma_init_riscv.c index f3e91282..e6fe5f6e 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/riscv/h264_chroma_init_riscv.c +++ b/arm/android/third_party/ffmpeg/libavcodec/riscv/h264_chroma_init_riscv.c @@ -27,6 +27,10 @@ void h264_put_chroma_mc8_rvv(uint8_t *p_dst, const uint8_t *p_src, ptrdiff_t stride, int h, int x, int y); void h264_avg_chroma_mc8_rvv(uint8_t *p_dst, const uint8_t *p_src, ptrdiff_t stride, int h, int x, int y); +void h264_put_chroma_mc4_rvv(uint8_t *p_dst, const uint8_t *p_src, ptrdiff_t stride, int h, int x, int y); +void h264_avg_chroma_mc4_rvv(uint8_t *p_dst, const uint8_t *p_src, ptrdiff_t stride, int h, int x, int y); +void h264_put_chroma_mc2_rvv(uint8_t *p_dst, const uint8_t *p_src, ptrdiff_t stride, int h, int x, int y); +void h264_avg_chroma_mc2_rvv(uint8_t *p_dst, const uint8_t *p_src, ptrdiff_t stride, int h, int x, int y); av_cold void ff_h264chroma_init_riscv(H264ChromaContext *c, int bit_depth) { @@ -37,6 +41,10 @@ av_cold void ff_h264chroma_init_riscv(H264ChromaContext *c, int bit_depth) (flags & AV_CPU_FLAG_RVB_ADDR) && ff_get_rv_vlenb() >= 16) { c->put_h264_chroma_pixels_tab[0] = h264_put_chroma_mc8_rvv; c->avg_h264_chroma_pixels_tab[0] = h264_avg_chroma_mc8_rvv; + c->put_h264_chroma_pixels_tab[1] = h264_put_chroma_mc4_rvv; + c->avg_h264_chroma_pixels_tab[1] = h264_avg_chroma_mc4_rvv; + c->put_h264_chroma_pixels_tab[2] = h264_put_chroma_mc2_rvv; + c->avg_h264_chroma_pixels_tab[2] = h264_avg_chroma_mc2_rvv; } #endif } diff --git a/arm/android/third_party/ffmpeg/libavcodec/riscv/h264_mc_chroma.S b/arm/android/third_party/ffmpeg/libavcodec/riscv/h264_mc_chroma.S index 364bc315..ce99bda4 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/riscv/h264_mc_chroma.S +++ b/arm/android/third_party/ffmpeg/libavcodec/riscv/h264_mc_chroma.S @@ -19,8 +19,7 @@ */ #include "libavutil/riscv/asm.S" -.macro h264_chroma_mc8 type -func h264_\type\()_chroma_mc8_rvv, zve32x +.macro do_chroma_mc type unroll csrw vxrm, zero slli t2, a5, 3 mul t1, a5, a4 @@ -30,94 +29,100 @@ func h264_\type\()_chroma_mc8_rvv, zve32x sub a7, a4, t1 addi a6, a5, 64 sub t0, t2, t1 - vsetivli t3, 8, e8, m1, ta, mu + vsetvli t3, t6, e8, m1, ta, mu beqz t1, 2f blez a3, 8f li t4, 0 li t2, 0 li t5, 1 addi a5, t3, 1 - slli t3, a2, 2 + slli t3, a2, (1 + \unroll) 1: # if (xy != 0) add a4, a1, t4 vsetvli zero, a5, e8, m1, ta, ma + .ifc \unroll,1 addi t2, t2, 4 + .else + addi t2, t2, 2 + .endif vle8.v v10, (a4) add a4, a4, a2 vslide1down.vx v11, v10, t5 - vsetivli zero, 8, e8, m1, ta, ma + vsetvli zero, t6, e8, m1, ta, ma vwmulu.vx v8, v10, a6 vwmaccu.vx v8, a7, v11 vsetvli zero, a5, e8, m1, ta, ma vle8.v v12, (a4) - vsetivli zero, 8, e8, m1, ta, ma + vsetvli zero, t6, e8, m1, ta, ma add a4, a4, a2 vwmaccu.vx v8, t0, v12 vsetvli zero, a5, e8, m1, ta, ma vslide1down.vx v13, v12, t5 - vsetivli zero, 8, e8, m1, ta, ma + vsetvli zero, t6, e8, m1, ta, ma vwmulu.vx v10, v12, a6 vwmaccu.vx v8, t1, v13 vwmaccu.vx v10, a7, v13 vsetvli zero, a5, e8, m1, ta, ma vle8.v v14, (a4) - vsetivli zero, 8, e8, m1, ta, ma + vsetvli zero, t6, e8, m1, ta, ma add a4, a4, a2 vwmaccu.vx v10, t0, v14 vsetvli zero, a5, e8, m1, ta, ma vslide1down.vx v15, v14, t5 - vsetivli zero, 8, e8, m1, ta, ma + vsetvli zero, t6, e8, m1, ta, ma vwmulu.vx v12, v14, a6 vwmaccu.vx v10, t1, v15 vwmaccu.vx v12, a7, v15 + vnclipu.wi v15, v8, 6 + .ifc \type,avg + vle8.v v9, (a0) + vaaddu.vv v15, v15, v9 + .endif + vse8.v v15, (a0) + add a0, a0, a2 + vnclipu.wi v8, v10, 6 + .ifc \type,avg + vle8.v v9, (a0) + vaaddu.vv v8, v8, v9 + .endif + add t4, t4, t3 + vse8.v v8, (a0) + add a0, a0, a2 + .ifc \unroll,1 vsetvli zero, a5, e8, m1, ta, ma vle8.v v14, (a4) - vsetivli zero, 8, e8, m1, ta, ma + vsetvli zero, t6, e8, m1, ta, ma add a4, a4, a2 vwmaccu.vx v12, t0, v14 vsetvli zero, a5, e8, m1, ta, ma vslide1down.vx v15, v14, t5 - vsetivli zero, 8, e8, m1, ta, ma + vsetvli zero, t6, e8, m1, ta, ma vwmulu.vx v16, v14, a6 vwmaccu.vx v12, t1, v15 vwmaccu.vx v16, a7, v15 vsetvli zero, a5, e8, m1, ta, ma vle8.v v14, (a4) - vsetivli zero, 8, e8, m1, ta, ma - add a4, a0, t4 - add t4, t4, t3 + vsetvli zero, t6, e8, m1, ta, ma vwmaccu.vx v16, t0, v14 vsetvli zero, a5, e8, m1, ta, ma vslide1down.vx v14, v14, t5 - vsetivli zero, 8, e8, m1, ta, ma - vnclipu.wi v15, v8, 6 + vsetvli zero, t6, e8, m1, ta, ma vwmaccu.vx v16, t1, v14 - .ifc \type,avg - vle8.v v9, (a4) - vaaddu.vv v15, v15, v9 - .endif - vse8.v v15, (a4) - add a4, a4, a2 - vnclipu.wi v8, v10, 6 - .ifc \type,avg - vle8.v v9, (a4) - vaaddu.vv v8, v8, v9 - .endif - vse8.v v8, (a4) - add a4, a4, a2 vnclipu.wi v8, v12, 6 .ifc \type,avg - vle8.v v9, (a4) + vle8.v v9, (a0) vaaddu.vv v8, v8, v9 .endif - vse8.v v8, (a4) - add a4, a4, a2 + vse8.v v8, (a0) + add a0, a0, a2 vnclipu.wi v8, v16, 6 .ifc \type,avg - vle8.v v9, (a4) + vle8.v v9, (a0) vaaddu.vv v8, v8, v9 .endif - vse8.v v8, (a4) + vse8.v v8, (a0) + add a0, a0, a2 + .endif blt t2, a3, 1b j 8f 2: @@ -126,11 +131,15 @@ func h264_\type\()_chroma_mc8_rvv, zve32x blez a3, 8f li a4, 0 li t1, 0 - slli a7, a2, 2 + slli a7, a2, (1 + \unroll) 3: # if ((x8 - xy) == 0 && (y8 -xy) != 0) add a5, a1, a4 vsetvli zero, zero, e8, m1, ta, ma + .ifc \unroll,1 addi t1, t1, 4 + .else + addi t1, t1, 2 + .endif vle8.v v8, (a5) add a5, a5, a2 add t2, a5, a2 @@ -141,42 +150,44 @@ func h264_\type\()_chroma_mc8_rvv, zve32x add t2, t2, a2 add a5, t2, a2 vwmaccu.vx v10, t0, v8 - vle8.v v8, (t2) - vle8.v v14, (a5) - add a5, a0, a4 add a4, a4, a7 vwmaccu.vx v12, t0, v9 vnclipu.wi v15, v10, 6 vwmulu.vx v10, v9, a6 + vnclipu.wi v9, v12, 6 .ifc \type,avg - vle8.v v16, (a5) + vle8.v v16, (a0) vaaddu.vv v15, v15, v16 .endif - vse8.v v15, (a5) - add a5, a5, a2 - vnclipu.wi v9, v12, 6 - vwmaccu.vx v10, t0, v8 - vwmulu.vx v12, v8, a6 + vse8.v v15, (a0) + add a0, a0, a2 .ifc \type,avg - vle8.v v16, (a5) + vle8.v v16, (a0) vaaddu.vv v9, v9, v16 .endif - vse8.v v9, (a5) - add a5, a5, a2 + vse8.v v9, (a0) + add a0, a0, a2 + .ifc \unroll,1 + vle8.v v8, (t2) + vle8.v v14, (a5) + vwmaccu.vx v10, t0, v8 + vwmulu.vx v12, v8, a6 vnclipu.wi v8, v10, 6 vwmaccu.vx v12, t0, v14 .ifc \type,avg - vle8.v v16, (a5) + vle8.v v16, (a0) vaaddu.vv v8, v8, v16 .endif - vse8.v v8, (a5) - add a5, a5, a2 + vse8.v v8, (a0) + add a0, a0, a2 vnclipu.wi v8, v12, 6 .ifc \type,avg - vle8.v v16, (a5) + vle8.v v16, (a0) vaaddu.vv v8, v8, v16 .endif - vse8.v v8, (a5) + vse8.v v8, (a0) + add a0, a0, a2 + .endif blt t1, a3, 3b j 8f 4: @@ -186,87 +197,95 @@ func h264_\type\()_chroma_mc8_rvv, zve32x li a4, 0 li t2, 0 addi t0, t3, 1 - slli t1, a2, 2 + slli t1, a2, (1 + \unroll) 5: # if ((x8 - xy) != 0 && (y8 -xy) == 0) add a5, a1, a4 vsetvli zero, t0, e8, m1, ta, ma + .ifc \unroll,1 addi t2, t2, 4 + .else + addi t2, t2, 2 + .endif vle8.v v8, (a5) add a5, a5, a2 vslide1down.vx v9, v8, t5 - vsetivli zero, 8, e8, m1, ta, ma + vsetvli zero, t6, e8, m1, ta, ma vwmulu.vx v10, v8, a6 vwmaccu.vx v10, a7, v9 vsetvli zero, t0, e8, m1, ta, ma vle8.v v8, (a5) add a5, a5, a2 vslide1down.vx v9, v8, t5 - vsetivli zero, 8, e8, m1, ta, ma + vsetvli zero, t6, e8, m1, ta, ma vwmulu.vx v12, v8, a6 vwmaccu.vx v12, a7, v9 + vnclipu.wi v16, v10, 6 + .ifc \type,avg + vle8.v v18, (a0) + vaaddu.vv v16, v16, v18 + .endif + vse8.v v16, (a0) + add a0, a0, a2 + vnclipu.wi v10, v12, 6 + .ifc \type,avg + vle8.v v18, (a0) + vaaddu.vv v10, v10, v18 + .endif + add a4, a4, t1 + vse8.v v10, (a0) + add a0, a0, a2 + .ifc \unroll,1 vsetvli zero, t0, e8, m1, ta, ma vle8.v v8, (a5) add a5, a5, a2 vslide1down.vx v9, v8, t5 - vsetivli zero, 8, e8, m1, ta, ma + vsetvli zero, t6, e8, m1, ta, ma vwmulu.vx v14, v8, a6 vwmaccu.vx v14, a7, v9 vsetvli zero, t0, e8, m1, ta, ma vle8.v v8, (a5) - add a5, a0, a4 - add a4, a4, t1 vslide1down.vx v9, v8, t5 - vsetivli zero, 8, e8, m1, ta, ma - vnclipu.wi v16, v10, 6 - .ifc \type,avg - vle8.v v18, (a5) - vaaddu.vv v16, v16, v18 - .endif - vse8.v v16, (a5) - add a5, a5, a2 - vnclipu.wi v10, v12, 6 + vsetvli zero, t6, e8, m1, ta, ma vwmulu.vx v12, v8, a6 - .ifc \type,avg - vle8.v v18, (a5) - vaaddu.vv v10, v10, v18 - .endif - vse8.v v10, (a5) - add a5, a5, a2 vnclipu.wi v8, v14, 6 vwmaccu.vx v12, a7, v9 .ifc \type,avg - vle8.v v18, (a5) + vle8.v v18, (a0) vaaddu.vv v8, v8, v18 .endif - vse8.v v8, (a5) - add a5, a5, a2 + vse8.v v8, (a0) + add a0, a0, a2 vnclipu.wi v8, v12, 6 .ifc \type,avg - vle8.v v18, (a5) + vle8.v v18, (a0) vaaddu.vv v8, v8, v18 .endif - vse8.v v8, (a5) + vse8.v v8, (a0) + add a0, a0, a2 + .endif blt t2, a3, 5b j 8f 6: blez a3, 8f li a4, 0 li t2, 0 - slli a7, a2, 2 + slli a7, a2, (1 + \unroll) 7: # the final else, none of the above conditions are met add t0, a1, a4 vsetvli zero, zero, e8, m1, ta, ma add a5, a0, a4 add a4, a4, a7 + .ifc \unroll,1 addi t2, t2, 4 + .else + addi t2, t2, 2 + .endif vle8.v v8, (t0) add t0, t0, a2 add t1, t0, a2 vwmulu.vx v10, v8, a6 vle8.v v8, (t0) add t0, t1, a2 - vle8.v v9, (t1) - vle8.v v12, (t0) vnclipu.wi v13, v10, 6 vwmulu.vx v10, v8, a6 .ifc \type,avg @@ -276,13 +295,16 @@ func h264_\type\()_chroma_mc8_rvv, zve32x vse8.v v13, (a5) add a5, a5, a2 vnclipu.wi v8, v10, 6 - vwmulu.vx v10, v9, a6 .ifc \type,avg vle8.v v18, (a5) vaaddu.vv v8, v8, v18 .endif vse8.v v8, (a5) add a5, a5, a2 + .ifc \unroll,1 + vle8.v v9, (t1) + vle8.v v12, (t0) + vwmulu.vx v10, v9, a6 vnclipu.wi v8, v10, 6 vwmulu.vx v10, v12, a6 .ifc \type,avg @@ -297,11 +319,56 @@ func h264_\type\()_chroma_mc8_rvv, zve32x vaaddu.vv v8, v8, v18 .endif vse8.v v8, (a5) + .endif blt t2, a3, 7b 8: ret -endfunc .endm -h264_chroma_mc8 put -h264_chroma_mc8 avg +func h264_put_chroma_mc_rvv, zve32x +11: + li a7, 3 + blt a3, a7, 12f + do_chroma_mc put 1 +12: + do_chroma_mc put 0 +endfunc + +func h264_avg_chroma_mc_rvv, zve32x +21: + li a7, 3 + blt a3, a7, 22f + do_chroma_mc avg 1 +22: + do_chroma_mc avg 0 +endfunc + +func h264_put_chroma_mc8_rvv, zve32x + li t6, 8 + j 11b +endfunc + +func h264_put_chroma_mc4_rvv, zve32x + li t6, 4 + j 11b +endfunc + +func h264_put_chroma_mc2_rvv, zve32x + li t6, 2 + j 11b +endfunc + +func h264_avg_chroma_mc8_rvv, zve32x + li t6, 8 + j 21b +endfunc + +func h264_avg_chroma_mc4_rvv, zve32x + li t6, 4 + j 21b +endfunc + +func h264_avg_chroma_mc2_rvv, zve32x + li t6, 2 + j 21b +endfunc diff --git a/arm/android/third_party/ffmpeg/libavcodec/rka.c b/arm/android/third_party/ffmpeg/libavcodec/rka.c index d56f4fae..724107f3 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/rka.c +++ b/arm/android/third_party/ffmpeg/libavcodec/rka.c @@ -59,8 +59,8 @@ typedef struct AdaptiveModel { } AdaptiveModel; typedef struct ChContext { - int cmode; - int cmode2; + int qfactor; + int vrq; int last_nb_decoded; unsigned srate_pad; unsigned pos_idx; @@ -131,7 +131,7 @@ static void adaptive_model_free(AdaptiveModel *am) static av_cold int rka_decode_init(AVCodecContext *avctx) { RKAContext *s = avctx->priv_data; - int cmode; + int qfactor; if (avctx->extradata_size < 16) return AVERROR_INVALIDDATA; @@ -160,14 +160,18 @@ static av_cold int rka_decode_init(AVCodecContext *avctx) s->last_nb_samples = s->total_nb_samples % s->frame_samples; s->correlated = avctx->extradata[15] & 1; - cmode = avctx->extradata[14] & 0xf; + qfactor = avctx->extradata[14] & 0xf; if ((avctx->extradata[15] & 4) != 0) - cmode = -cmode; + qfactor = -qfactor; - s->ch[0].cmode = s->ch[1].cmode = cmode < 0 ? 2 : cmode; - s->ch[0].cmode2 = cmode < 0 ? FFABS(cmode) : 0; - s->ch[1].cmode2 = cmode < 0 ? FFABS(cmode) : 0; - av_log(avctx, AV_LOG_DEBUG, "cmode: %d\n", cmode); + s->ch[0].qfactor = s->ch[1].qfactor = qfactor < 0 ? 2 : qfactor; + s->ch[0].vrq = qfactor < 0 ? -qfactor : 0; + s->ch[1].vrq = qfactor < 0 ? -qfactor : 0; + if (qfactor < 0) { + s->ch[0].vrq = av_clip(s->ch[0].vrq, 1, 8); + s->ch[1].vrq = av_clip(s->ch[1].vrq, 1, 8); + } + av_log(avctx, AV_LOG_DEBUG, "qfactor: %d\n", qfactor); return 0; } @@ -665,18 +669,16 @@ static int mdl64_decode(ACoder *ac, Model64 *ctx, int *dst) return 0; } -static const uint8_t tab[16] = { - 0, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 -}; +static const uint8_t vrq_qfactors[8] = { 3, 3, 2, 2, 1, 1, 1, 1 }; static int decode_filter(RKAContext *s, ChContext *ctx, ACoder *ac, int off, unsigned size) { FiltCoeffs filt; Model64 *mdl64; - int m = 0, split, val, last_val = 0, ret; - unsigned idx = 3, bits = 0; + int split, val, last_val = 0, ret; + unsigned rsize, idx = 3, bits = 0, m = 0; - if (ctx->cmode == 0) { + if (ctx->qfactor == 0) { if (amdl_decode_int(&ctx->fshift, ac, &bits, 15) < 0) return -1; bits &= 31U; @@ -698,10 +700,12 @@ static int decode_filter(RKAContext *s, ChContext *ctx, ACoder *ac, int off, uns if (amdl_decode_int(&ctx->position, ac, &idx, 10) < 0) return -1; + m = 0; idx = (ctx->pos_idx + idx) % 11; ctx->pos_idx = idx; - for (int y = 0; y < FFMIN(split, size - x); y++, off++) { + rsize = FFMIN(split, size - x); + for (int y = 0; y < rsize; y++, off++) { int midx, shift = idx, *src, sum = 16; if (off >= FF_ARRAY_ELEMS(ctx->buf0)) @@ -728,7 +732,7 @@ static int decode_filter(RKAContext *s, ChContext *ctx, ACoder *ac, int off, uns for (int i = 15; i < filt.size; i++) sum += filt.coeffs[i] * (unsigned)src[-i]; sum = sum >> 6; - if (ctx->cmode == 0) { + if (ctx->qfactor == 0) { if (bits == 0) { ctx->buf1[off] = sum + val; } else { @@ -737,7 +741,7 @@ static int decode_filter(RKAContext *s, ChContext *ctx, ACoder *ac, int off, uns } ctx->buf0[off] = ctx->buf1[off] + (unsigned)ctx->buf0[off + -1]; } else { - val *= 1U << ctx->cmode; + val *= 1U << ctx->qfactor; sum += ctx->buf0[off + -1] + (unsigned)val; switch (s->bps) { case 16: sum = av_clip_int16(sum); break; @@ -745,15 +749,15 @@ static int decode_filter(RKAContext *s, ChContext *ctx, ACoder *ac, int off, uns } ctx->buf1[off] = sum - ctx->buf0[off + -1]; ctx->buf0[off] = sum; - m += FFABS(ctx->buf1[off]); + m += (unsigned)FFABS(ctx->buf1[off]); } } - if (ctx->cmode2 != 0) { + if (ctx->vrq != 0) { int sum = 0; - for (int i = (signed)((unsigned)m << 6) / split; i > 0; i = i >> 1) + for (unsigned i = (m << 6) / rsize; i > 0; i = i >> 1) sum++; - sum = sum - (ctx->cmode2 + 7); - ctx->cmode = FFMAX(sum, tab[ctx->cmode2]); + sum -= (ctx->vrq + 7); + ctx->qfactor = FFMAX(sum, vrq_qfactors[ctx->vrq - 1]); } x += split; @@ -949,6 +953,10 @@ static int rka_decode_frame(AVCodecContext *avctx, AVFrame *frame, } } + if (frame->nb_samples < s->frame_samples && + frame->nb_samples > s->last_nb_samples) + frame->nb_samples = s->last_nb_samples; + *got_frame_ptr = 1; return avpkt->size; diff --git a/arm/android/third_party/ffmpeg/libavcodec/rl.c b/arm/android/third_party/ffmpeg/libavcodec/rl.c index 3f8271d3..a78242d4 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/rl.c +++ b/arm/android/third_party/ffmpeg/libavcodec/rl.c @@ -82,7 +82,9 @@ av_cold void ff_rl_init_vlc(RLTable *rl, unsigned static_size) VLCElem table[1500] = { 0 }; VLC vlc = { .table = table, .table_allocated = static_size }; av_assert0(static_size <= FF_ARRAY_ELEMS(table)); - init_vlc(&vlc, 9, rl->n + 1, &rl->table_vlc[0][1], 4, 2, &rl->table_vlc[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC); + vlc_init(&vlc, 9, rl->n + 1, + &rl->table_vlc[0][1], 4, 2, + &rl->table_vlc[0][0], 4, 2, VLC_INIT_USE_STATIC); for (q = 0; q < 32; q++) { int qmul = q * 2; diff --git a/arm/android/third_party/ffmpeg/libavcodec/rl.h b/arm/android/third_party/ffmpeg/libavcodec/rl.h index 4380fda2..c45d8659 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/rl.h +++ b/arm/android/third_party/ffmpeg/libavcodec/rl.h @@ -80,7 +80,7 @@ void ff_rl_init(RLTable *rl, uint8_t static_store[2][2*MAX_RUN + MAX_LEVEL + 3]) */ void ff_rl_init_vlc(RLTable *rl, unsigned static_size); -#define INIT_VLC_RL(rl, static_size)\ +#define VLC_INIT_RL(rl, static_size)\ {\ static RL_VLC_ELEM rl_vlc_table[32][static_size];\ \ diff --git a/arm/android/third_party/ffmpeg/libavcodec/roqvideo.c b/arm/android/third_party/ffmpeg/libavcodec/roqvideo.c index f9a3c8e0..ca8c8de9 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/roqvideo.c +++ b/arm/android/third_party/ffmpeg/libavcodec/roqvideo.c @@ -111,13 +111,13 @@ static inline void apply_motion_generic(RoqContext *ri, int x, int y, int deltax /* check MV against frame boundaries */ if ((mx < 0) || (mx > ri->width - sz) || (my < 0) || (my > ri->height - sz)) { - av_log(ri->avctx, AV_LOG_ERROR, "motion vector out of bounds: MV = (%d, %d), boundaries = (0, 0, %d, %d)\n", + av_log(ri->logctx, AV_LOG_ERROR, "motion vector out of bounds: MV = (%d, %d), boundaries = (0, 0, %d, %d)\n", mx, my, ri->width, ri->height); return; } if (!ri->last_frame->data[0]) { - av_log(ri->avctx, AV_LOG_ERROR, "Invalid decode type. Invalid header?\n"); + av_log(ri->logctx, AV_LOG_ERROR, "Invalid decode type. Invalid header?\n"); return; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/roqvideo.h b/arm/android/third_party/ffmpeg/libavcodec/roqvideo.h index 8318b6e5..2c2e4288 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/roqvideo.h +++ b/arm/android/third_party/ffmpeg/libavcodec/roqvideo.h @@ -22,7 +22,7 @@ #ifndef AVCODEC_ROQVIDEO_H #define AVCODEC_ROQVIDEO_H -#include "avcodec.h" +#include "libavutil/frame.h" typedef struct roq_cell { unsigned char y[4]; @@ -39,7 +39,7 @@ typedef struct motion_vect { typedef struct RoqContext { const AVClass *class; - AVCodecContext *avctx; + void *logctx; AVFrame *last_frame; AVFrame *current_frame; int width, height; diff --git a/arm/android/third_party/ffmpeg/libavcodec/roqvideodec.c b/arm/android/third_party/ffmpeg/libavcodec/roqvideodec.c index 6f2e48d2..bfc69a65 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/roqvideodec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/roqvideodec.c @@ -72,7 +72,7 @@ static void roqvideo_decode_frame(RoqContext *ri, GetByteContext *gb) xpos = ypos = 0; if (chunk_size > bytestream2_get_bytes_left(gb)) { - av_log(ri->avctx, AV_LOG_ERROR, "Chunk does not fit in input buffer\n"); + av_log(ri->logctx, AV_LOG_ERROR, "Chunk does not fit in input buffer\n"); chunk_size = bytestream2_get_bytes_left(gb); } @@ -80,7 +80,7 @@ static void roqvideo_decode_frame(RoqContext *ri, GetByteContext *gb) for (yp = ypos; yp < ypos + 16; yp += 8) for (xp = xpos; xp < xpos + 16; xp += 8) { if (bytestream2_tell(gb) >= chunk_start + chunk_size) { - av_log(ri->avctx, AV_LOG_VERBOSE, "Chunk is too short\n"); + av_log(ri->logctx, AV_LOG_VERBOSE, "Chunk is too short\n"); return; } if (vqflg_pos < 0) { @@ -114,7 +114,7 @@ static void roqvideo_decode_frame(RoqContext *ri, GetByteContext *gb) if(k & 0x02) y += 4; if (bytestream2_tell(gb) >= chunk_start + chunk_size) { - av_log(ri->avctx, AV_LOG_VERBOSE, "Chunk is too short\n"); + av_log(ri->logctx, AV_LOG_VERBOSE, "Chunk is too short\n"); return; } if (vqflg_pos < 0) { @@ -169,7 +169,7 @@ static av_cold int roq_decode_init(AVCodecContext *avctx) { RoqContext *s = avctx->priv_data; - s->avctx = avctx; + s->logctx = avctx; if (avctx->width % 16 || avctx->height % 16) { avpriv_request_sample(avctx, "Dimensions not being a multiple of 16"); diff --git a/arm/android/third_party/ffmpeg/libavcodec/roqvideoenc.c b/arm/android/third_party/ffmpeg/libavcodec/roqvideoenc.c index c25aa39b..0933abf4 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/roqvideoenc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/roqvideoenc.c @@ -911,10 +911,10 @@ static int roq_encode_video(RoqEncContext *enc) /* Quake 3 can't handle chunks bigger than 65535 bytes */ if (tempData->mainChunkSize/8 > 65535 && enc->quake3_compat) { if (enc->lambda > 100000) { - av_log(roq->avctx, AV_LOG_ERROR, "Cannot encode video in Quake compatible form\n"); + av_log(roq->logctx, AV_LOG_ERROR, "Cannot encode video in Quake compatible form\n"); return AVERROR(EINVAL); } - av_log(roq->avctx, AV_LOG_ERROR, + av_log(roq->logctx, AV_LOG_ERROR, "Warning, generated a frame too big for Quake (%d > 65535), " "now switching to a bigger qscale value.\n", tempData->mainChunkSize/8); @@ -972,7 +972,7 @@ static av_cold int roq_encode_init(AVCodecContext *avctx) av_lfg_init(&enc->randctx, 1); - roq->avctx = avctx; + roq->logctx = avctx; enc->framesSinceKeyframe = 0; if ((avctx->width & 0xf) || (avctx->height & 0xf)) { @@ -1057,8 +1057,6 @@ static int roq_encode_frame(AVCodecContext *avctx, AVPacket *pkt, RoqContext *const roq = &enc->common; int size, ret; - roq->avctx = avctx; - enc->frame_to_enc = frame; if (frame->quality) diff --git a/arm/android/third_party/ffmpeg/libavcodec/rpzaenc.c b/arm/android/third_party/ffmpeg/libavcodec/rpzaenc.c index da9500e4..d84555d6 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/rpzaenc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/rpzaenc.c @@ -30,6 +30,7 @@ #include "avcodec.h" #include "codec_internal.h" #include "encode.h" +#include "mathops.h" #include "put_bits.h" typedef struct RpzaContext { @@ -65,7 +66,7 @@ typedef struct rgb { #define SQR(x) ((x) * (x)) /* 15 bit components */ -#define GET_CHAN(color, chan) (((color) >> ((chan) * 5) & 0x1F) * 8) +#define GET_CHAN(color, chan) (((color) >> ((chan) * 5) & 0x1F)) #define R(color) GET_CHAN(color, RED) #define G(color) GET_CHAN(color, GREEN) #define B(color) GET_CHAN(color, BLUE) @@ -141,9 +142,9 @@ static uint16_t rgb24_to_rgb555(const uint8_t *rgb24) uint16_t rgb555 = 0; uint32_t r, g, b; - r = rgb24[0] >> 3; - g = rgb24[1] >> 3; - b = rgb24[2] >> 3; + r = rgb24[0]; + g = rgb24[1]; + b = rgb24[2]; rgb555 |= (r << 10); rgb555 |= (g << 5); @@ -185,7 +186,7 @@ static int max_component_diff(const uint16_t *colorA, const uint16_t *colorB) if (diff > max) { max = diff; } - return max * 8; + return max; } /* @@ -266,9 +267,9 @@ static int compare_blocks(const uint16_t *block1, const uint16_t *block2, */ static int leastsquares(const uint16_t *block_ptr, const BlockInfo *bi, channel_offset xchannel, channel_offset ychannel, - double *slope, double *y_intercept, double *correlation_coef) + int *slope, int *y_intercept, int *correlation_coef) { - double sumx = 0, sumy = 0, sumx2 = 0, sumy2 = 0, sumxy = 0, + int sumx = 0, sumy = 0, sumx2 = 0, sumy2 = 0, sumxy = 0, sumx_sq = 0, sumy_sq = 0, tmp, tmp2; int i, j, count; uint8_t x, y; @@ -305,10 +306,10 @@ static int leastsquares(const uint16_t *block_ptr, const BlockInfo *bi, tmp2 = count * sumy2 - sumy_sq; if (tmp2 == 0) { - *correlation_coef = 0.0; + *correlation_coef = 0; } else { *correlation_coef = (count * sumxy - sumx * sumy) / - sqrt(tmp * tmp2); + ff_sqrt((unsigned)tmp * tmp2); } return 0; // success @@ -332,18 +333,18 @@ static int calc_lsq_max_fit_error(const uint16_t *block_ptr, const BlockInfo *bi y = GET_CHAN(block_ptr[j], ychannel); /* calculate x_inc as the 4-color index (0..3) */ - x_inc = floor( (x - min) * 3.0 / (max - min) + 0.5); + x_inc = (x - min) * 3 / (max - min) + 1; x_inc = FFMAX(FFMIN(3, x_inc), 0); /* calculate lin_y corresponding to x_inc */ - lin_y = (int)(tmp_min + (tmp_max - tmp_min) * x_inc / 3.0 + 0.5); + lin_y = tmp_min + (tmp_max - tmp_min) * x_inc / 3 + 1; err = FFABS(lin_y - y); if (err > max_err) max_err = err; /* calculate lin_x corresponding to x_inc */ - lin_x = (int)(min + (max - min) * x_inc / 3.0 + 0.5); + lin_x = min + (max - min) * x_inc / 3 + 1; err = FFABS(lin_x - x); if (err > max_err) @@ -577,7 +578,7 @@ static void rpza_encode_stream(RpzaContext *s, const AVFrame *pict) uint8_t avg_color[3]; int pixel_count; uint8_t min_color[3], max_color[3]; - double slope, y_intercept, correlation_coef; + int slope, y_intercept, correlation_coef; const uint16_t *src_pixels = (const uint16_t *)pict->data[0]; uint16_t *prev_pixels = (uint16_t *)s->prev_frame->data[0]; @@ -730,8 +731,8 @@ post_skip : min_color[i] = GET_CHAN(src_pixels[block_offset], i); max_color[i] = GET_CHAN(src_pixels[block_offset], i); } else { - tmp_min = (int)(0.5 + min * slope + y_intercept); - tmp_max = (int)(0.5 + max * slope + y_intercept); + tmp_min = 1 + min * slope + y_intercept; + tmp_max = 1 + max * slope + y_intercept; av_assert0(tmp_min <= tmp_max); // clamp min and max color values @@ -802,7 +803,7 @@ static int rpza_encode_frame(AVCodecContext *avctx, AVPacket *pkt, { RpzaContext *s = avctx->priv_data; uint8_t *buf; - int ret = ff_alloc_packet(avctx, pkt, 4LL + 6LL * avctx->height * avctx->width); + int ret = ff_alloc_packet(avctx, pkt, 4LL + 6LL * FFMAX(avctx->height, 4) * FFMAX(avctx->width, 4)); if (ret < 0) return ret; diff --git a/arm/android/third_party/ffmpeg/libavcodec/rtjpeg.c b/arm/android/third_party/ffmpeg/libavcodec/rtjpeg.c index 8e02bce2..734e3875 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/rtjpeg.c +++ b/arm/android/third_party/ffmpeg/libavcodec/rtjpeg.c @@ -167,7 +167,7 @@ void ff_rtjpeg_decode_init(RTJpegContext *c, int width, int height, c->h = height; } -void ff_rtjpeg_init(RTJpegContext *c, AVCodecContext *avctx) +void ff_rtjpeg_init(RTJpegContext *c, struct AVCodecContext *avctx) { int i; diff --git a/arm/android/third_party/ffmpeg/libavcodec/rtjpeg.h b/arm/android/third_party/ffmpeg/libavcodec/rtjpeg.h index d4dc0744..14befb54 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/rtjpeg.h +++ b/arm/android/third_party/ffmpeg/libavcodec/rtjpeg.h @@ -24,6 +24,7 @@ #include +#include "libavutil/frame.h" #include "libavutil/mem_internal.h" #include "idctdsp.h" @@ -39,7 +40,8 @@ typedef struct RTJpegContext { DECLARE_ALIGNED(16, int16_t, block)[64]; } RTJpegContext; -void ff_rtjpeg_init(RTJpegContext *c, AVCodecContext *avctx); +struct AVCodecContext; +void ff_rtjpeg_init(RTJpegContext *c, struct AVCodecContext *avctx); void ff_rtjpeg_decode_init(RTJpegContext *c, int width, int height, const uint32_t *lquant, const uint32_t *cquant); diff --git a/arm/android/third_party/ffmpeg/libavcodec/rtv1.c b/arm/android/third_party/ffmpeg/libavcodec/rtv1.c index 4b202e6a..06afe9e8 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/rtv1.c +++ b/arm/android/third_party/ffmpeg/libavcodec/rtv1.c @@ -54,7 +54,7 @@ static int decode_rtv1(GetByteContext *gb, uint8_t *dst, ptrdiff_t linesize, int a, b; if (bytestream2_get_bytes_left(gb) < 4) - break; + return AVERROR_INVALIDDATA; a = bytestream2_get_le16u(gb); b = bytestream2_get_le16u(gb); @@ -77,7 +77,7 @@ static int decode_rtv1(GetByteContext *gb, uint8_t *dst, ptrdiff_t linesize, dxt1_block(dst + x, linesize, block); } else { if (bytestream2_get_bytes_left(gb) < 12 * 4) - break; + return AVERROR_INVALIDDATA; for (int by = 0; by < 4; by++) { for (int bx = 0; bx < 4; bx++) @@ -126,7 +126,9 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *p, dst = p->data[0] + p->linesize[0] * (avctx->coded_height - 1); linesize = -p->linesize[0]; - decode_rtv1(&gb, dst, linesize, width, height, flags, dsp->dxt1_block); + ret = decode_rtv1(&gb, dst, linesize, width, height, flags, dsp->dxt1_block); + if (ret < 0) + return ret; p->pict_type = AV_PICTURE_TYPE_I; p->flags |= AV_FRAME_FLAG_KEY; diff --git a/arm/android/third_party/ffmpeg/libavcodec/rv10.c b/arm/android/third_party/ffmpeg/libavcodec/rv10.c index bb1ead50..6abceade 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/rv10.c +++ b/arm/android/third_party/ffmpeg/libavcodec/rv10.c @@ -334,8 +334,8 @@ static av_cold void rv10_build_vlc(VLC *vlc, const uint16_t len_count[15], for (unsigned tmp = nb_lens + len_count[i]; nb_lens < tmp; nb_lens++) lens[nb_lens] = i + 2; av_assert1(nb_lens == nb_syms); - ff_init_vlc_from_lengths(vlc, DC_VLC_BITS, nb_lens, lens, 1, - syms, 2, 2, 0, INIT_VLC_STATIC_OVERLONG, NULL); + ff_vlc_init_from_lengths(vlc, DC_VLC_BITS, nb_lens, lens, 1, + syms, 2, 2, 0, VLC_INIT_STATIC_OVERLONG, NULL); } static av_cold void rv10_init_static(void) @@ -477,7 +477,7 @@ static int rv10_decode_packet(AVCodecContext *avctx, const uint8_t *buf, if ((s->mb_x == 0 && s->mb_y == 0) || !s->current_picture_ptr) { // FIXME write parser so we always have complete frames? if (s->current_picture_ptr) { - ff_er_frame_end(&s->er); + ff_er_frame_end(&s->er, NULL); ff_mpv_frame_end(s); s->mb_x = s->mb_y = s->resync_mb_x = s->resync_mb_y = 0; } @@ -649,7 +649,7 @@ static int rv10_decode_frame(AVCodecContext *avctx, AVFrame *pict, } if (s->current_picture_ptr && s->mb_y >= s->mb_height) { - ff_er_frame_end(&s->er); + ff_er_frame_end(&s->er, NULL); ff_mpv_frame_end(s); if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) { diff --git a/arm/android/third_party/ffmpeg/libavcodec/rv34.c b/arm/android/third_party/ffmpeg/libavcodec/rv34.c index 51f18147..e9660bb4 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/rv34.c +++ b/arm/android/third_party/ffmpeg/libavcodec/rv34.c @@ -113,10 +113,10 @@ static void rv34_gen_vlc(const uint8_t *bits, int size, VLC *vlc, const uint8_t vlc->table = &table_data[*offset]; vlc->table_allocated = FF_ARRAY_ELEMS(table_data) - *offset; - ff_init_vlc_sparse(vlc, FFMIN(maxbits, 9), size, + ff_vlc_init_sparse(vlc, FFMIN(maxbits, 9), size, bits, 1, 1, cw, 2, 2, - syms, !!syms, !!syms, INIT_VLC_STATIC_OVERLONG); + syms, !!syms, !!syms, VLC_INIT_STATIC_OVERLONG); *offset += vlc->table_size; } @@ -1560,7 +1560,7 @@ static int finish_frame(AVCodecContext *avctx, AVFrame *pict) MpegEncContext *s = &r->s; int got_picture = 0, ret; - ff_er_frame_end(&s->er); + ff_er_frame_end(&s->er, NULL); ff_mpv_frame_end(s); s->mb_num_left = 0; @@ -1655,7 +1655,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx, AVFrame *pict, av_log(avctx, AV_LOG_ERROR, "New frame but still %d MB left.\n", s->mb_num_left); if (!s->context_reinit) - ff_er_frame_end(&s->er); + ff_er_frame_end(&s->er, NULL); ff_mpv_frame_end(s); } @@ -1790,7 +1790,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx, AVFrame *pict, av_log(avctx, AV_LOG_INFO, "marking unfished frame as finished\n"); /* always mark the current frame as finished, frame-mt supports * only complete frames */ - ff_er_frame_end(&s->er); + ff_er_frame_end(&s->er, NULL); ff_mpv_frame_end(s); s->mb_num_left = 0; ff_thread_report_progress(&s->current_picture_ptr->tf, INT_MAX, 0); diff --git a/arm/android/third_party/ffmpeg/libavcodec/rv34_parser.c b/arm/android/third_party/ffmpeg/libavcodec/rv34_parser.c index e17bc856..2997a4db 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/rv34_parser.c +++ b/arm/android/third_party/ffmpeg/libavcodec/rv34_parser.c @@ -24,13 +24,10 @@ * RV30/40 parser */ -#include "config_components.h" - -#include "parser.h" +#include "avcodec.h" #include "libavutil/intreadwrite.h" typedef struct RV34ParseContext { - ParseContext pc; int64_t key_dts; int key_pts; } RV34ParseContext; @@ -78,18 +75,8 @@ static int rv34_parse(AVCodecParserContext *s, return buf_size; } -#if CONFIG_RV30_PARSER -const AVCodecParser ff_rv30_parser = { - .codec_ids = { AV_CODEC_ID_RV30 }, +const AVCodecParser ff_rv34_parser = { + .codec_ids = { AV_CODEC_ID_RV30, AV_CODEC_ID_RV40 }, .priv_data_size = sizeof(RV34ParseContext), .parser_parse = rv34_parse, }; -#endif - -#if CONFIG_RV40_PARSER -const AVCodecParser ff_rv40_parser = { - .codec_ids = { AV_CODEC_ID_RV40 }, - .priv_data_size = sizeof(RV34ParseContext), - .parser_parse = rv34_parse, -}; -#endif diff --git a/arm/android/third_party/ffmpeg/libavcodec/rv40.c b/arm/android/third_party/ffmpeg/libavcodec/rv40.c index 75849b17..d2f8ef9f 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/rv40.c +++ b/arm/android/third_party/ffmpeg/libavcodec/rv40.c @@ -53,9 +53,9 @@ static av_cold void rv40_init_table(VLC *vlc, unsigned *offset, int nb_bits, vlc->table_allocated = 1 << nb_bits; *offset += 1 << nb_bits; - ff_init_vlc_from_lengths(vlc, nb_bits, nb_codes, + ff_vlc_init_from_lengths(vlc, nb_bits, nb_codes, &tab[0][1], 2, &tab[0][0], 2, 1, - 0, INIT_VLC_USE_NEW_STATIC, NULL); + 0, VLC_INIT_USE_STATIC, NULL); } /** @@ -87,9 +87,9 @@ static av_cold void rv40_init_tables(void) } aic_mode2_vlc[i].table = &aic_mode2_table[offset]; aic_mode2_vlc[i].table_allocated = FF_ARRAY_ELEMS(aic_mode2_table) - offset; - ff_init_vlc_from_lengths(&aic_mode2_vlc[i], AIC_MODE2_BITS, AIC_MODE2_SIZE, + ff_vlc_init_from_lengths(&aic_mode2_vlc[i], AIC_MODE2_BITS, AIC_MODE2_SIZE, aic_mode2_vlc_bits[i], 1, - syms, 2, 2, 0, INIT_VLC_STATIC_OVERLONG, NULL); + syms, 2, 2, 0, VLC_INIT_STATIC_OVERLONG, NULL); offset += aic_mode2_vlc[i].table_size; } for(i = 0; i < NUM_PTYPE_VLCS; i++){ diff --git a/arm/android/third_party/ffmpeg/libavcodec/sbcenc.c b/arm/android/third_party/ffmpeg/libavcodec/sbcenc.c index fccb0e3e..6e1dd88c 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/sbcenc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/sbcenc.c @@ -31,6 +31,7 @@ */ #include "libavutil/channel_layout.h" +#include "libavutil/emms.h" #include "libavutil/opt.h" #include "avcodec.h" #include "codec_internal.h" @@ -198,7 +199,7 @@ static int sbc_encode_init(AVCodecContext *avctx) SBCEncContext *sbc = avctx->priv_data; struct sbc_frame *frame = &sbc->frame; - if (avctx->profile == FF_PROFILE_SBC_MSBC) + if (avctx->profile == AV_PROFILE_SBC_MSBC) sbc->msbc = 1; if (sbc->msbc) { @@ -332,7 +333,7 @@ static const AVOption options[] = { OFFSET(max_delay), AV_OPT_TYPE_DURATION, {.i64 = 13000}, 1000,13000, AE }, { "msbc", "use mSBC mode (wideband speech mono SBC)", OFFSET(msbc), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AE }, - FF_AVCTX_PROFILE_OPTION("msbc", NULL, AUDIO, FF_PROFILE_SBC_MSBC) + FF_AVCTX_PROFILE_OPTION("msbc", NULL, AUDIO, AV_PROFILE_SBC_MSBC) { NULL }, }; diff --git a/arm/android/third_party/ffmpeg/libavcodec/sbrdsp_template.c b/arm/android/third_party/ffmpeg/libavcodec/sbrdsp_template.c index b3737c0f..89e389d9 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/sbrdsp_template.c +++ b/arm/android/third_party/ffmpeg/libavcodec/sbrdsp_template.c @@ -20,6 +20,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/attributes_internal.h" + static void sbr_sum64x5_c(INTFLOAT *z) { int k; @@ -103,3 +105,268 @@ av_cold void AAC_RENAME(ff_sbrdsp_init)(SBRDSPContext *s) #endif #endif /* !USE_FIXED */ } + +/* First eight entries repeated at end to simplify SIMD implementations. */ +const attribute_visibility_hidden 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 +{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)}, +}; diff --git a/arm/android/third_party/ffmpeg/libavcodec/sga.c b/arm/android/third_party/ffmpeg/libavcodec/sga.c index eae691ad..4ced6e98 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/sga.c +++ b/arm/android/third_party/ffmpeg/libavcodec/sga.c @@ -127,19 +127,18 @@ static int decode_index_palmap(SGAVideoContext *s, AVFrame *frame) static int decode_index_tilemap(SGAVideoContext *s, AVFrame *frame) { - GetByteContext *gb = &s->gb; - GetBitContext pm; + GetByteContext *gb = &s->gb, gb2; bytestream2_seek(gb, s->tilemapdata_offset, SEEK_SET); if (bytestream2_get_bytes_left(gb) < s->tilemapdata_size) return AVERROR_INVALIDDATA; - init_get_bits8(&pm, gb->buffer, s->tilemapdata_size); + gb2 = *gb; for (int y = 0; y < s->tiles_h; y++) { for (int x = 0; x < s->tiles_w; x++) { uint8_t tile[64]; - int tilemap = get_bits(&pm, 16); + int tilemap = bytestream2_get_be16u(&gb2); int flip_x = (tilemap >> 11) & 1; int flip_y = (tilemap >> 12) & 1; int tindex = av_clip((tilemap & 511) - 1, 0, s->nb_tiles - 1); diff --git a/arm/android/third_party/ffmpeg/libavcodec/sheervideo.c b/arm/android/third_party/ffmpeg/libavcodec/sheervideo.c index d9c94ea9..660e2661 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/sheervideo.c +++ b/arm/android/third_party/ffmpeg/libavcodec/sheervideo.c @@ -1796,8 +1796,8 @@ static av_cold int build_vlc(VLC *vlc, const SheerTable *table) lens[count] = len; } - ff_free_vlc(vlc); - return ff_init_vlc_from_lengths(vlc, SHEER_VLC_BITS, count, + ff_vlc_free(vlc); + return ff_vlc_init_from_lengths(vlc, SHEER_VLC_BITS, count, lens, sizeof(*lens), NULL, 0, 0, 0, 0, NULL); } @@ -1992,8 +1992,8 @@ static av_cold int decode_end(AVCodecContext *avctx) { SheerVideoContext *s = avctx->priv_data; - ff_free_vlc(&s->vlc[0]); - ff_free_vlc(&s->vlc[1]); + ff_vlc_free(&s->vlc[0]); + ff_vlc_free(&s->vlc[1]); return 0; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/shorten.c b/arm/android/third_party/ffmpeg/libavcodec/shorten.c index eca0c4e8..0ad95bf9 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/shorten.c +++ b/arm/android/third_party/ffmpeg/libavcodec/shorten.c @@ -280,7 +280,7 @@ static int decode_wave_header(AVCodecContext *avctx, const uint8_t *header, int header_size) { int len, bps; - short wave_format; + uint16_t wave_format; GetByteContext gb; bytestream2_init(&gb, header, header_size); diff --git a/arm/android/third_party/ffmpeg/libavcodec/sipr.c b/arm/android/third_party/ffmpeg/libavcodec/sipr.c index 692b59b3..3ddc579f 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/sipr.c +++ b/arm/android/third_party/ffmpeg/libavcodec/sipr.c @@ -532,7 +532,6 @@ static int sipr_decode_frame(AVCodecContext *avctx, AVFrame *frame, int subframe_size = ctx->mode == MODE_16k ? L_SUBFR_16k : SUBFR_SIZE; int i, ret; - ctx->avctx = avctx; if (avpkt->size < (mode_par->bits_per_frame >> 3)) { av_log(avctx, AV_LOG_ERROR, "Error processing packet: packet size (%d) too small\n", diff --git a/arm/android/third_party/ffmpeg/libavcodec/sipr.h b/arm/android/third_party/ffmpeg/libavcodec/sipr.h index e1ef35d6..e7073987 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/sipr.h +++ b/arm/android/third_party/ffmpeg/libavcodec/sipr.h @@ -24,7 +24,6 @@ #ifndef AVCODEC_SIPR_H #define AVCODEC_SIPR_H -#include "avcodec.h" #include "acelp_pitch_delay.h" #include "libavutil/mem_internal.h" @@ -63,8 +62,6 @@ typedef struct SiprParameters { } SiprParameters; typedef struct SiprContext { - AVCodecContext *avctx; - SiprMode mode; float past_pitch_gain; diff --git a/arm/android/third_party/ffmpeg/libavcodec/smacker.c b/arm/android/third_party/ffmpeg/libavcodec/smacker.c index 7ee9fe85..3f2f83ad 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/smacker.c +++ b/arm/android/third_party/ffmpeg/libavcodec/smacker.c @@ -220,10 +220,10 @@ static int smacker_decode_header_tree(SmackVContext *smk, GetBitContext *gb, int goto error; skip_bits1(gb); if (h.current > 1) { - err = ff_init_vlc_from_lengths(&vlc[i], SMKTREE_BITS, h.current, + err = ff_vlc_init_from_lengths(&vlc[i], SMKTREE_BITS, h.current, &h.entries[0].length, sizeof(*h.entries), &h.entries[0].value, sizeof(*h.entries), 1, - 0, INIT_VLC_OUTPUT_LE, smk->avctx); + 0, VLC_INIT_OUTPUT_LE, smk->avctx); if (err < 0) { av_log(smk->avctx, AV_LOG_ERROR, "Cannot build VLC table\n"); goto error; @@ -264,7 +264,7 @@ static int smacker_decode_header_tree(SmackVContext *smk, GetBitContext *gb, int err = 0; error: for (int i = 0; i < 2; i++) { - ff_free_vlc(&vlc[i]); + ff_vlc_free(&vlc[i]); } return err; @@ -659,10 +659,10 @@ static int smka_decode_frame(AVCodecContext *avctx, AVFrame *frame, goto error; skip_bits1(&gb); if (h.current > 1) { - ret = ff_init_vlc_from_lengths(&vlc[i], SMKTREE_BITS, h.current, + ret = ff_vlc_init_from_lengths(&vlc[i], SMKTREE_BITS, h.current, &h.entries[0].length, sizeof(*h.entries), &h.entries[0].value, sizeof(*h.entries), 1, - 0, INIT_VLC_OUTPUT_LE, avctx); + 0, VLC_INIT_OUTPUT_LE, avctx); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "Cannot build VLC table\n"); goto error; @@ -740,7 +740,7 @@ static int smka_decode_frame(AVCodecContext *avctx, AVFrame *frame, error: for(i = 0; i < 4; i++) { - ff_free_vlc(&vlc[i]); + ff_vlc_free(&vlc[i]); } return ret; diff --git a/arm/android/third_party/ffmpeg/libavcodec/smcenc.c b/arm/android/third_party/ffmpeg/libavcodec/smcenc.c index 40b53c40..789aef4f 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/smcenc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/smcenc.c @@ -566,8 +566,7 @@ static int smc_encode_frame(AVCodecContext *avctx, AVPacket *pkt, // write chunk length AV_WB24(pkt->data + 1, pkt->size); - av_frame_unref(s->prev_frame); - ret = av_frame_ref(s->prev_frame, frame); + ret = av_frame_replace(s->prev_frame, frame); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "cannot add reference\n"); return ret; @@ -583,7 +582,7 @@ static int smc_encode_frame(AVCodecContext *avctx, AVPacket *pkt, static int smc_encode_end(AVCodecContext *avctx) { - SMCContext *s = (SMCContext *)avctx->priv_data; + SMCContext *s = avctx->priv_data; av_frame_free(&s->prev_frame); diff --git a/arm/android/third_party/ffmpeg/libavcodec/snow.c b/arm/android/third_party/ffmpeg/libavcodec/snow.c index 5eb3ee1e..59815d00 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/snow.c +++ b/arm/android/third_party/ffmpeg/libavcodec/snow.c @@ -21,8 +21,6 @@ #include "libavutil/log.h" #include "libavutil/thread.h" #include "avcodec.h" -#include "decode.h" -#include "encode.h" #include "snow_dwt.h" #include "snow.h" #include "snowdata.h" @@ -61,36 +59,6 @@ void ff_snow_inner_add_yblock(const uint8_t *obmc, const int obmc_stride, uint8_ } } -int ff_snow_get_buffer(SnowContext *s, AVFrame *frame) -{ - int ret, i; - int edges_needed = av_codec_is_encoder(s->avctx->codec); - - frame->width = s->avctx->width ; - frame->height = s->avctx->height; - if (edges_needed) { - frame->width += 2 * EDGE_WIDTH; - frame->height += 2 * EDGE_WIDTH; - - ret = ff_encode_alloc_frame(s->avctx, frame); - } else - ret = ff_get_buffer(s->avctx, frame, AV_GET_BUFFER_FLAG_REF); - if (ret < 0) - return ret; - if (edges_needed) { - for (i = 0; frame->data[i]; i++) { - int offset = (EDGE_WIDTH >> (i ? s->chroma_v_shift : 0)) * - frame->linesize[i] + - (EDGE_WIDTH >> (i ? s->chroma_h_shift : 0)); - frame->data[i] += offset; - } - frame->width = s->avctx->width; - frame->height = s->avctx->height; - } - - return 0; -} - void ff_snow_reset_contexts(SnowContext *s){ //FIXME better initial contexts int plane_index, level, orientation; @@ -433,36 +401,10 @@ av_cold int ff_snow_common_init(AVCodecContext *avctx){ s->max_ref_frames=1; //just make sure it's not an invalid value in case of no initial keyframe s->spatial_decomposition_count = 1; - ff_hpeldsp_init(&s->hdsp, avctx->flags); ff_videodsp_init(&s->vdsp, 8); ff_dwt_init(&s->dwt); ff_h264qpel_init(&s->h264qpel, 8); -#define mcf(dx,dy)\ - s->qdsp.put_qpel_pixels_tab [0][dy+dx/4]=\ - s->qdsp.put_no_rnd_qpel_pixels_tab[0][dy+dx/4]=\ - s->h264qpel.put_h264_qpel_pixels_tab[0][dy+dx/4];\ - s->qdsp.put_qpel_pixels_tab [1][dy+dx/4]=\ - s->qdsp.put_no_rnd_qpel_pixels_tab[1][dy+dx/4]=\ - s->h264qpel.put_h264_qpel_pixels_tab[1][dy+dx/4]; - - mcf( 0, 0) - mcf( 4, 0) - mcf( 8, 0) - mcf(12, 0) - mcf( 0, 4) - mcf( 4, 4) - mcf( 8, 4) - mcf(12, 4) - mcf( 0, 8) - mcf( 4, 8) - mcf( 8, 8) - mcf(12, 8) - mcf( 0,12) - mcf( 4,12) - mcf( 8,12) - mcf(12,12) - #define mcfh(dx,dy)\ s->hdsp.put_pixels_tab [0][dy/4+dx/8]=\ s->hdsp.put_no_rnd_pixels_tab[0][dy/4+dx/8]=\ @@ -507,27 +449,15 @@ av_cold int ff_snow_common_init(AVCodecContext *avctx){ int ff_snow_common_init_after_header(AVCodecContext *avctx) { SnowContext *s = avctx->priv_data; int plane_index, level, orientation; - int ret, emu_buf_size; if(!s->scratchbuf) { - if (av_codec_is_decoder(avctx->codec)) { - if ((ret = ff_get_buffer(s->avctx, s->mconly_picture, - AV_GET_BUFFER_FLAG_REF)) < 0) - return ret; - } - + int emu_buf_size; emu_buf_size = FFMAX(s->mconly_picture->linesize[0], 2*avctx->width+256) * (2 * MB_SIZE + HTAPS_MAX - 1); if (!FF_ALLOCZ_TYPED_ARRAY(s->scratchbuf, FFMAX(s->mconly_picture->linesize[0], 2*avctx->width+256) * 7 * MB_SIZE) || !FF_ALLOCZ_TYPED_ARRAY(s->emu_edge_buffer, emu_buf_size)) return AVERROR(ENOMEM); } - if (av_codec_is_decoder(avctx->codec) && - s->mconly_picture->format != avctx->pix_fmt) { - av_log(avctx, AV_LOG_ERROR, "pixel format changed\n"); - return AVERROR_INVALIDDATA; - } - for(plane_index=0; plane_index < s->nb_planes; plane_index++){ int w= s->avctx->width; int h= s->avctx->height; @@ -589,20 +519,21 @@ void ff_snow_release_buffer(AVCodecContext *avctx) } } -int ff_snow_frame_start(SnowContext *s){ +int ff_snow_frames_prepare(SnowContext *s) +{ AVFrame *tmp; - int i, ret; ff_snow_release_buffer(s->avctx); tmp= s->last_picture[s->max_ref_frames-1]; - for(i=s->max_ref_frames-1; i>0; i--) + for (int i = s->max_ref_frames - 1; i > 0; i--) s->last_picture[i] = s->last_picture[i-1]; s->last_picture[0] = s->current_picture; s->current_picture = tmp; if(s->keyframe){ s->ref_frames= 0; + s->current_picture->flags |= AV_FRAME_FLAG_KEY; }else{ int i; for(i=0; imax_ref_frames && s->last_picture[i]->data[0]; i++) @@ -613,14 +544,8 @@ int ff_snow_frame_start(SnowContext *s){ av_log(s->avctx,AV_LOG_ERROR, "No reference frames\n"); return AVERROR_INVALIDDATA; } - } - if ((ret = ff_snow_get_buffer(s, s->current_picture)) < 0) - return ret; - - if (s->keyframe) - s->current_picture->flags |= AV_FRAME_FLAG_KEY; - else s->current_picture->flags &= ~AV_FRAME_FLAG_KEY; + } return 0; } @@ -635,18 +560,11 @@ av_cold void ff_snow_common_end(SnowContext *s) av_freep(&s->temp_idwt_buffer); av_freep(&s->run_buffer); - s->m.me.temp= NULL; - av_freep(&s->m.me.scratchpad); - av_freep(&s->m.me.map); - av_freep(&s->m.sc.obmc_scratchpad); - av_freep(&s->block); av_freep(&s->scratchbuf); av_freep(&s->emu_edge_buffer); for(i=0; iref_mvs[i]); - av_freep(&s->ref_scores[i]); if(s->last_picture[i] && s->last_picture[i]->data[0]) { av_assert0(s->last_picture[i]->data[0] != s->current_picture->data[0]); } diff --git a/arm/android/third_party/ffmpeg/libavcodec/snow.h b/arm/android/third_party/ffmpeg/libavcodec/snow.h index ed0f9abb..a5e2c138 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/snow.h +++ b/arm/android/third_party/ffmpeg/libavcodec/snow.h @@ -24,21 +24,18 @@ #include "libavutil/motion_vector.h" +#include "avcodec.h" #include "hpeldsp.h" -#include "me_cmp.h" -#include "qpeldsp.h" #include "snow_dwt.h" #include "rangecoder.h" #include "mathops.h" -#include "mpegvideo.h" #include "h264qpel.h" +#include "videodsp.h" #define SNOW_MAX_PLANES 4 -#define FF_ME_ITER 3 - #define MID_STATE 128 #define MAX_PLANES 4 @@ -117,12 +114,9 @@ typedef struct SnowContext{ AVClass *class; AVCodecContext *avctx; RangeCoder c; - MECmpContext mecc; HpelDSPContext hdsp; - QpelDSPContext qdsp; VideoDSPContext vdsp; H264QpelContext h264qpel; - MpegvideoEncDSPContext mpvencdsp; SnowDWTContext dwt; AVFrame *input_picture; ///< new_picture with the internal linesizes AVFrame *current_picture; @@ -155,9 +149,6 @@ typedef struct SnowContext{ int spatial_scalability; int qlog; int last_qlog; - int lambda; - int lambda2; - int pass1_rc; int mv_scale; int last_mv_scale; int qbias; @@ -170,18 +161,7 @@ typedef struct SnowContext{ int nb_planes; Plane plane[MAX_PLANES]; BlockNode *block; -#define ME_CACHE_SIZE 1024 - unsigned me_cache[ME_CACHE_SIZE]; - unsigned me_cache_generation; slice_buffer sb; - int memc_only; - int no_bitstream; - int intra_penalty; - int motion_est; - int iterative_dia_size; - int scenechange_threshold; - - 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) uint8_t *scratchbuf; uint8_t *emu_edge_buffer; @@ -189,9 +169,6 @@ typedef struct SnowContext{ AVMotionVector *avmv; unsigned avmv_size; int avmv_index; - uint64_t encoding_error[SNOW_MAX_PLANES]; - - int pred; }SnowContext; /* Tables */ @@ -199,44 +176,6 @@ extern const uint8_t * const ff_obmc_tab[4]; extern const uint8_t ff_qexp[QROOT]; extern int ff_scale_mv_ref[MAX_REF_FRAMES][MAX_REF_FRAMES]; -/* C bits used by mmx/sse2/altivec */ - -static av_always_inline void snow_interleave_line_header(int * i, int width, IDWTELEM * low, IDWTELEM * high){ - (*i) = (width) - 2; - - if (width & 1){ - low[(*i)+1] = low[((*i)+1)>>1]; - (*i)--; - } -} - -static av_always_inline void snow_interleave_line_footer(int * i, IDWTELEM * low, IDWTELEM * high){ - for (; (*i)>=0; (*i)-=2){ - low[(*i)+1] = high[(*i)>>1]; - low[*i] = low[(*i)>>1]; - } -} - -static av_always_inline void snow_horizontal_compose_lift_lead_out(int i, IDWTELEM * dst, IDWTELEM * src, IDWTELEM * ref, int width, int w, int lift_high, int mul, int add, int shift){ - for(; i> shift); - } - - if((width^lift_high)&1){ - dst[w] = src[w] - ((mul * 2 * ref[w] + add) >> shift); - } -} - -static av_always_inline void snow_horizontal_compose_liftS_lead_out(int i, IDWTELEM * dst, IDWTELEM * src, IDWTELEM * ref, int width, int w){ - for(; i> W_BS); - } - - if(width&1){ - dst[w] = src[w] + ((2 * ref[w] + W_BO + 4 * src[w]) >> W_BS); - } -} - /* common code */ int ff_snow_common_init(AVCodecContext *avctx); @@ -245,11 +184,10 @@ void ff_snow_common_end(SnowContext *s); void ff_snow_release_buffer(AVCodecContext *avctx); void ff_snow_reset_contexts(SnowContext *s); int ff_snow_alloc_blocks(SnowContext *s); -int ff_snow_frame_start(SnowContext *s); +int ff_snow_frames_prepare(SnowContext *s); void ff_snow_pred_block(SnowContext *s, uint8_t *dst, uint8_t *tmp, ptrdiff_t stride, int sx, int sy, int b_w, int b_h, const BlockNode *block, int plane_index, int w, int h); -int ff_snow_get_buffer(SnowContext *s, AVFrame *frame); /* common inline functions */ //XXX doublecheck all of them should stay inlined @@ -486,227 +424,8 @@ static inline void set_blocks(SnowContext *s, int level, int x, int y, int l, in } } -static inline void init_ref(MotionEstContext *c, const uint8_t *const src[3], uint8_t *const ref[3], uint8_t *const ref2[3], int x, int y, int ref_index){ - SnowContext *s = c->avctx->priv_data; - const int offset[3]= { - y*c-> stride + x, - ((y*c->uvstride + x)>>s->chroma_h_shift), - ((y*c->uvstride + x)>>s->chroma_h_shift), - }; - int i; - for(i=0; i<3; i++){ - c->src[0][i]= src [i]; - c->ref[0][i]= ref [i] + offset[i]; - } - av_assert2(!ref_index); -} - - -/* bitstream functions */ - extern const int8_t ff_quant3bA[256]; #define QEXPSHIFT (7-FRAC_BITS+8) //FIXME try to change this to 0 -static inline void put_symbol(RangeCoder *c, uint8_t *state, int v, int is_signed){ - int i; - - if(v){ - const int a= FFABS(v); - const int e= av_log2(a); - const int el= FFMIN(e, 10); - put_rac(c, state+0, 0); - - for(i=0; i=el; i--){ - put_rac(c, state+22+9, (a>>i)&1); //22..31 - } - for(; i>=0; i--){ - put_rac(c, state+22+i, (a>>i)&1); //22..31 - } - - if(is_signed) - put_rac(c, state+11 + el, v < 0); //11..21 - }else{ - put_rac(c, state+0, 1); - } -} - -static inline int get_symbol(RangeCoder *c, uint8_t *state, int is_signed){ - if(get_rac(c, state+0)) - return 0; - else{ - int i, e; - unsigned a; - e= 0; - while(get_rac(c, state+1 + FFMIN(e,9))){ //1..10 - e++; - if (e > 31) - return AVERROR_INVALIDDATA; - } - - a= 1; - for(i=e-1; i>=0; i--){ - a += a + get_rac(c, state+22 + FFMIN(i,9)); //22..31 - } - - e= -(is_signed && get_rac(c, state+11 + FFMIN(e,10))); //11..21 - return (a^e)-e; - } -} - -static inline void put_symbol2(RangeCoder *c, uint8_t *state, int v, int log2){ - int i; - int r= log2>=0 ? 1<=0); - av_assert2(log2>=-4); - - while(v >= r){ - put_rac(c, state+4+log2, 1); - v -= r; - log2++; - if(log2>0) r+=r; - } - put_rac(c, state+4+log2, 0); - - for(i=log2-1; i>=0; i--){ - put_rac(c, state+31-i, (v>>i)&1); - } -} - -static inline int get_symbol2(RangeCoder *c, uint8_t *state, int log2){ - int i; - int r= log2>=0 ? 1<=-4); - - while(log2<28 && get_rac(c, state+4+log2)){ - v+= r; - log2++; - if(log2>0) r+=r; - } - - for(i=log2-1; i>=0; i--){ - v+= get_rac(c, state+31-i)<width; - const int h= b->height; - int x,y; - - int run, runs; - x_and_coeff *xc= b->x_coeff; - x_and_coeff *prev_xc= NULL; - x_and_coeff *prev2_xc= xc; - x_and_coeff *parent_xc= parent ? parent->x_coeff : NULL; - x_and_coeff *prev_parent_xc= parent_xc; - - runs= get_symbol2(&s->c, b->state[30], 0); - if(runs-- > 0) run= get_symbol2(&s->c, b->state[1], 3); - else run= INT_MAX; - - for(y=0; yx == 0){ - rt= prev_xc->coeff; - } - for(x=0; xx <= x) - prev_xc++; - if(prev_xc->x == x + 1) - rt= prev_xc->coeff; - else - rt=0; - } - if(parent_xc){ - if(x>>1 > parent_xc->x){ - parent_xc++; - } - if(x>>1 == parent_xc->x){ - p= parent_xc->coeff; - } - } - if(/*ll|*/l|lt|t|rt|p){ - int context= av_log2(/*FFABS(ll) + */3*(l>>1) + (lt>>1) + (t&~1) + (rt>>1) + (p>>1)); - - v=get_rac(&s->c, &b->state[0][context]); - if(v){ - v= 2*(get_symbol2(&s->c, b->state[context + 2], context-4) + 1); - v+=get_rac(&s->c, &b->state[0][16 + 1 + 3 + ff_quant3bA[l&0xFF] + 3*ff_quant3bA[t&0xFF]]); - if ((uint16_t)v != v) { - av_log(s->avctx, AV_LOG_ERROR, "Coefficient damaged\n"); - v = 1; - } - xc->x=x; - (xc++)->coeff= v; - } - }else{ - if(!run){ - if(runs-- > 0) run= get_symbol2(&s->c, b->state[1], 3); - else run= INT_MAX; - v= 2*(get_symbol2(&s->c, b->state[0 + 2], 0-4) + 1); - v+=get_rac(&s->c, &b->state[0][16 + 1 + 3]); - if ((uint16_t)v != v) { - av_log(s->avctx, AV_LOG_ERROR, "Coefficient damaged\n"); - v = 1; - } - - xc->x=x; - (xc++)->coeff= v; - }else{ - int max_run; - run--; - v=0; - av_assert2(run >= 0); - if(y) max_run= FFMIN(run, prev_xc->x - x - 2); - else max_run= FFMIN(run, w-x-1); - if(parent_xc) - max_run= FFMIN(max_run, 2*parent_xc->x - x - 1); - av_assert2(max_run >= 0 && max_run <= run); - - x+= max_run; - run-= max_run; - } - } - } - (xc++)->x= w+1; //end marker - prev_xc= prev2_xc; - prev2_xc= xc; - - if(parent_xc){ - if(y&1){ - while(parent_xc->x != parent->width+1) - parent_xc++; - parent_xc++; - prev_parent_xc= parent_xc; - }else{ - parent_xc= prev_parent_xc; - } - } - } - - (xc++)->x= w+1; //end marker -} - #endif /* AVCODEC_SNOW_H */ diff --git a/arm/android/third_party/ffmpeg/libavcodec/snow_dwt.h b/arm/android/third_party/ffmpeg/libavcodec/snow_dwt.h index 15b8a300..6e7d22c7 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/snow_dwt.h +++ b/arm/android/third_party/ffmpeg/libavcodec/snow_dwt.h @@ -24,6 +24,8 @@ #include #include +#include "libavutil/attributes.h" + struct MpegEncContext; typedef int DWTELEM; @@ -91,6 +93,44 @@ typedef struct SnowDWTContext { : ff_slice_buffer_load_line((slice_buf), \ (line_num))) +/* C bits used by mmx/sse2/altivec */ + +static av_always_inline void snow_interleave_line_header(int *i, int width, IDWTELEM *low, IDWTELEM *high) +{ + *i = width - 2; + + if (width & 1) { + low[*i + 1] = low[(*i + 1)>>1]; + (*i)--; + } +} + +static av_always_inline void snow_interleave_line_footer(int *i, IDWTELEM *low, const IDWTELEM *high) +{ + for (; *i >= 0; *i -= 2) { + low[*i + 1] = high[*i >> 1]; + low[*i] = low[*i >> 1]; + } +} + +static av_always_inline void snow_horizontal_compose_lift_lead_out(int i, IDWTELEM *dst, const IDWTELEM *src, const IDWTELEM *ref, int width, int w, int lift_high, int mul, int add, int shift) +{ + for (; i < w; i++) + dst[i] = src[i] - ((mul * (ref[i] + ref[i + 1]) + add) >> shift); + + if ((width ^ lift_high) & 1) + dst[w] = src[w] - ((mul * 2 * ref[w] + add) >> shift); +} + +static av_always_inline void snow_horizontal_compose_liftS_lead_out(int i, IDWTELEM *dst, const IDWTELEM *src, const IDWTELEM *ref, int width, int w) +{ + for (; i < w; i++) + dst[i] = src[i] + ((ref[i] + ref[(i+1)]+W_BO + 4 * src[i]) >> W_BS); + + if (width & 1) + dst[w] = src[w] + ((2 * ref[w] + W_BO + 4 * src[w]) >> W_BS); +} + int ff_slice_buffer_init(slice_buffer *buf, int line_count, int max_allocated_lines, int line_width, IDWTELEM *base_buffer); diff --git a/arm/android/third_party/ffmpeg/libavcodec/snowdec.c b/arm/android/third_party/ffmpeg/libavcodec/snowdec.c index bed29d33..70fbab9a 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/snowdec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/snowdec.c @@ -18,17 +18,166 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/emms.h" #include "libavutil/intmath.h" #include "libavutil/log.h" #include "libavutil/opt.h" #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "snow_dwt.h" #include "snow.h" #include "rangecoder.h" #include "mathops.h" +static inline int get_symbol(RangeCoder *c, uint8_t *state, int is_signed) +{ + if (get_rac(c, state + 0)) + return 0; + else { + int e; + unsigned a; + e = 0; + while (get_rac(c, state + 1 + FFMIN(e, 9))) { //1..10 + e++; + if (e > 31) + return AVERROR_INVALIDDATA; + } + + a = 1; + for (int i = e - 1; i >= 0; i--) + a += a + get_rac(c, state + 22 + FFMIN(i, 9)); //22..31 + + e = -(is_signed && get_rac(c, state + 11 + FFMIN(e, 10))); //11..21 + return (a ^ e) - e; + } +} + +static inline int get_symbol2(RangeCoder *c, uint8_t *state, int log2) +{ + int r = log2 >= 0 ? 1 << log2 : 1; + int v = 0; + + av_assert2(log2 >= -4); + + while (log2 < 28 && get_rac(c, state + 4 + log2)) { + v += r; + log2++; + if (log2 > 0) r += r; + } + + for (int i = log2 - 1; i >= 0; i--) + v += get_rac(c, state + 31 - i) << i; + + return v; +} + +static void unpack_coeffs(SnowContext *s, SubBand *b, SubBand * parent, int orientation) +{ + const int w = b->width; + const int h = b->height; + + int run, runs; + x_and_coeff *xc = b->x_coeff; + x_and_coeff *prev_xc = NULL; + x_and_coeff *prev2_xc = xc; + x_and_coeff *parent_xc = parent ? parent->x_coeff : NULL; + x_and_coeff *prev_parent_xc = parent_xc; + + runs = get_symbol2(&s->c, b->state[30], 0); + if (runs-- > 0) run = get_symbol2(&s->c, b->state[1], 3); + else run = INT_MAX; + + for (int y = 0; y < h; y++) { + int v = 0; + int lt = 0, t = 0, rt = 0; + + if (y && prev_xc->x == 0) + rt = prev_xc->coeff; + + for (int x = 0; x < w; x++) { + int p = 0; + const int l = v; + + lt= t; t= rt; + + if (y) { + if (prev_xc->x <= x) + prev_xc++; + if (prev_xc->x == x + 1) + rt = prev_xc->coeff; + else + rt = 0; + } + if (parent_xc) { + if (x>>1 > parent_xc->x) + parent_xc++; + if (x>>1 == parent_xc->x) + p = parent_xc->coeff; + } + if (/*ll|*/l|lt|t|rt|p) { + int context = av_log2(/*FFABS(ll) + */3*(l>>1) + (lt>>1) + (t&~1) + (rt>>1) + (p>>1)); + + v = get_rac(&s->c, &b->state[0][context]); + if (v) { + v = 2*(get_symbol2(&s->c, b->state[context + 2], context-4) + 1); + v += get_rac(&s->c, &b->state[0][16 + 1 + 3 + ff_quant3bA[l&0xFF] + 3 * ff_quant3bA[t&0xFF]]); + if ((uint16_t)v != v) { + av_log(s->avctx, AV_LOG_ERROR, "Coefficient damaged\n"); + v = 1; + } + xc->x = x; + (xc++)->coeff = v; + } + } else { + if (!run) { + if (runs-- > 0) run = get_symbol2(&s->c, b->state[1], 3); + else run = INT_MAX; + v = 2 * (get_symbol2(&s->c, b->state[0 + 2], 0-4) + 1); + v += get_rac(&s->c, &b->state[0][16 + 1 + 3]); + if ((uint16_t)v != v) { + av_log(s->avctx, AV_LOG_ERROR, "Coefficient damaged\n"); + v = 1; + } + + xc->x = x; + (xc++)->coeff = v; + } else { + int max_run; + run--; + v = 0; + av_assert2(run >= 0); + if (y) max_run = FFMIN(run, prev_xc->x - x - 2); + else max_run = FFMIN(run, w-x-1); + if (parent_xc) + max_run = FFMIN(max_run, 2*parent_xc->x - x - 1); + av_assert2(max_run >= 0 && max_run <= run); + + x += max_run; + run -= max_run; + } + } + } + (xc++)->x = w+1; //end marker + prev_xc = prev2_xc; + prev2_xc = xc; + + if (parent_xc) { + if (y & 1) { + while (parent_xc->x != parent->width+1) + parent_xc++; + parent_xc++; + prev_parent_xc= parent_xc; + } else { + parent_xc= prev_parent_xc; + } + } + } + + (xc++)->x = w + 1; //end marker +} + static av_always_inline void predict_slice_buffered(SnowContext *s, slice_buffer * sb, IDWTELEM * old_buffer, int plane_index, int add, int mb_y){ Plane *p= &s->plane[plane_index]; const int mb_w= s->b_width << s->block_max_depth; @@ -453,6 +602,17 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture, s->current_picture->pict_type= AV_PICTURE_TYPE_I; //FIXME I vs. P if ((res = decode_header(s)) < 0) return res; + + if (!s->mconly_picture->data[0]) { + res = ff_get_buffer(avctx, s->mconly_picture, AV_GET_BUFFER_FLAG_REF); + if (res < 0) + return res; + } + if (s->mconly_picture->format != avctx->pix_fmt) { + av_log(avctx, AV_LOG_ERROR, "pixel format changed\n"); + return AVERROR_INVALIDDATA; + } + if ((res=ff_snow_common_init_after_header(avctx)) < 0) return res; @@ -474,7 +634,13 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture, ff_snow_alloc_blocks(s); - if((res = ff_snow_frame_start(s)) < 0) + if ((res = ff_snow_frames_prepare(s)) < 0) + return res; + + s->current_picture->width = s->avctx->width; + s->current_picture->height = s->avctx->height; + res = ff_get_buffer(s->avctx, s->current_picture, AV_GET_BUFFER_FLAG_REF); + if (res < 0) return res; s->current_picture->pict_type = s->keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P; diff --git a/arm/android/third_party/ffmpeg/libavcodec/snowenc.c b/arm/android/third_party/ffmpeg/libavcodec/snowenc.c index 1360343a..c2152153 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/snowenc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/snowenc.c @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/emms.h" #include "libavutil/intmath.h" #include "libavutil/libm.h" #include "libavutil/log.h" @@ -29,6 +30,7 @@ #include "internal.h" //For AVCodecInternal.recon_frame #include "me_cmp.h" #include "packet_internal.h" +#include "qpeldsp.h" #include "snow_dwt.h" #include "snow.h" @@ -38,20 +40,136 @@ #include "mpegvideo.h" #include "h263enc.h" +#define FF_ME_ITER 3 + +typedef struct SnowEncContext { + SnowContext com; + QpelDSPContext qdsp; + MpegvideoEncDSPContext mpvencdsp; + + int lambda; + int lambda2; + int pass1_rc; + + int pred; + int memc_only; + int no_bitstream; + int intra_penalty; + int motion_est; + int iterative_dia_size; + int scenechange_threshold; + + MECmpContext mecc; + 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) +#define ME_CACHE_SIZE 1024 + unsigned me_cache[ME_CACHE_SIZE]; + unsigned me_cache_generation; + + uint64_t encoding_error[SNOW_MAX_PLANES]; +} SnowEncContext; + +static void init_ref(MotionEstContext *c, const uint8_t *const src[3], + uint8_t *const ref[3], uint8_t *const ref2[3], + int x, int y, int ref_index) +{ + SnowContext *s = c->avctx->priv_data; + const int offset[3] = { + y*c-> stride + x, + ((y*c->uvstride + x) >> s->chroma_h_shift), + ((y*c->uvstride + x) >> s->chroma_h_shift), + }; + for (int i = 0; i < 3; i++) { + c->src[0][i] = src [i]; + c->ref[0][i] = ref [i] + offset[i]; + } + av_assert2(!ref_index); +} + +static inline void put_symbol(RangeCoder *c, uint8_t *state, int v, int is_signed) +{ + if (v) { + const int a = FFABS(v); + const int e = av_log2(a); + const int el = FFMIN(e, 10); + int i; + + put_rac(c, state + 0, 0); + + for (i = 0; i < el; i++) + put_rac(c, state + 1 + i, 1); //1..10 + for(; i < e; i++) + put_rac(c, state + 1 + 9, 1); //1..10 + put_rac(c, state + 1 + FFMIN(i, 9), 0); + + for (i = e - 1; i >= el; i--) + put_rac(c, state + 22 + 9, (a >> i) & 1); //22..31 + for(; i >= 0; i--) + put_rac(c, state + 22 + i, (a >> i) & 1); //22..31 + + if (is_signed) + put_rac(c, state + 11 + el, v < 0); //11..21 + } else { + put_rac(c, state + 0, 1); + } +} + +static inline void put_symbol2(RangeCoder *c, uint8_t *state, int v, int log2) +{ + int r = log2 >= 0 ? 1<= 0); + av_assert2(log2 >= -4); + + while (v >= r) { + put_rac(c, state + 4 + log2, 1); + v -= r; + log2++; + if (log2 > 0) r += r; + } + put_rac(c, state + 4 + log2, 0); + + for (int i = log2 - 1; i >= 0; i--) + put_rac(c, state + 31 - i, (v >> i) & 1); +} + +static int get_encode_buffer(SnowContext *s, AVFrame *frame) +{ + int ret; + + frame->width = s->avctx->width + 2 * EDGE_WIDTH; + frame->height = s->avctx->height + 2 * EDGE_WIDTH; + + ret = ff_encode_alloc_frame(s->avctx, frame); + if (ret < 0) + return ret; + for (int i = 0; frame->data[i]; i++) { + int offset = (EDGE_WIDTH >> (i ? s->chroma_v_shift : 0)) * + frame->linesize[i] + + (EDGE_WIDTH >> (i ? s->chroma_h_shift : 0)); + frame->data[i] += offset; + } + frame->width = s->avctx->width; + frame->height = s->avctx->height; + + return 0; +} + static av_cold int encode_init(AVCodecContext *avctx) { - SnowContext *s = avctx->priv_data; + SnowEncContext *const enc = avctx->priv_data; + SnowContext *const s = &enc->com; + MpegEncContext *const mpv = &enc->m; int plane_index, ret; int i; - if(s->pred == DWT_97 + if (enc->pred == DWT_97 && (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 AVERROR(EINVAL); } - s->spatial_decomposition_type= s->pred; //FIXME add decorrelator type r transform_type + s->spatial_decomposition_type = enc->pred; //FIXME add decorrelator type r transform_type s->mv_scale = (avctx->flags & AV_CODEC_FLAG_QPEL) ? 2 : 4; s->block_max_depth= (avctx->flags & AV_CODEC_FLAG_4MV ) ? 1 : 0; @@ -65,31 +183,59 @@ static av_cold int encode_init(AVCodecContext *avctx) s->plane[plane_index].fast_mc= 1; } + // Must be before ff_snow_common_init() + ff_hpeldsp_init(&s->hdsp, avctx->flags); if ((ret = ff_snow_common_init(avctx)) < 0) { return ret; } - ff_me_cmp_init(&s->mecc, avctx); - ff_mpegvideoencdsp_init(&s->mpvencdsp, avctx); + +#define mcf(dx,dy)\ + enc->qdsp.put_qpel_pixels_tab [0][dy+dx/4]=\ + enc->qdsp.put_no_rnd_qpel_pixels_tab[0][dy+dx/4]=\ + s->h264qpel.put_h264_qpel_pixels_tab[0][dy+dx/4];\ + enc->qdsp.put_qpel_pixels_tab [1][dy+dx/4]=\ + enc->qdsp.put_no_rnd_qpel_pixels_tab[1][dy+dx/4]=\ + s->h264qpel.put_h264_qpel_pixels_tab[1][dy+dx/4]; + + mcf( 0, 0) + mcf( 4, 0) + mcf( 8, 0) + mcf(12, 0) + mcf( 0, 4) + mcf( 4, 4) + mcf( 8, 4) + mcf(12, 4) + mcf( 0, 8) + mcf( 4, 8) + mcf( 8, 8) + mcf(12, 8) + mcf( 0,12) + mcf( 4,12) + mcf( 8,12) + mcf(12,12) + + ff_me_cmp_init(&enc->mecc, avctx); + ff_mpegvideoencdsp_init(&enc->mpvencdsp, avctx); ff_snow_alloc_blocks(s); s->version=0; - s->m.avctx = avctx; - s->m.bit_rate= avctx->bit_rate; - s->m.lmin = avctx->mb_lmin; - s->m.lmax = avctx->mb_lmax; - s->m.mb_num = (avctx->width * avctx->height + 255) / 256; // For ratecontrol + mpv->avctx = avctx; + mpv->bit_rate= avctx->bit_rate; + mpv->lmin = avctx->mb_lmin; + mpv->lmax = avctx->mb_lmax; + mpv->mb_num = (avctx->width * avctx->height + 255) / 256; // For ratecontrol - s->m.me.temp = - s->m.me.scratchpad = av_calloc(avctx->width + 64, 2*16*2*sizeof(uint8_t)); - s->m.sc.obmc_scratchpad= av_mallocz(MB_SIZE*MB_SIZE*12*sizeof(uint32_t)); - s->m.me.map = av_mallocz(2 * ME_MAP_SIZE * sizeof(*s->m.me.map)); - if (!s->m.me.scratchpad || !s->m.me.map || !s->m.sc.obmc_scratchpad) + mpv->me.temp = + mpv->me.scratchpad = av_calloc(avctx->width + 64, 2*16*2*sizeof(uint8_t)); + mpv->sc.obmc_scratchpad= av_mallocz(MB_SIZE*MB_SIZE*12*sizeof(uint32_t)); + mpv->me.map = av_mallocz(2 * ME_MAP_SIZE * sizeof(*mpv->me.map)); + if (!mpv->me.scratchpad || !mpv->me.map || !mpv->sc.obmc_scratchpad) return AVERROR(ENOMEM); - s->m.me.score_map = s->m.me.map + ME_MAP_SIZE; + mpv->me.score_map = mpv->me.map + ME_MAP_SIZE; - ff_h263_encode_init(&s->m); //mv_penalty + ff_h263_encode_init(mpv); //mv_penalty s->max_ref_frames = av_clip(avctx->refs, 1, MAX_REF_FRAMES); @@ -101,11 +247,11 @@ static av_cold int encode_init(AVCodecContext *avctx) return AVERROR(ENOMEM); } if((avctx->flags&AV_CODEC_FLAG_PASS2) || !(avctx->flags&AV_CODEC_FLAG_QSCALE)){ - ret = ff_rate_control_init(&s->m); + ret = ff_rate_control_init(mpv); if(ret < 0) return ret; } - s->pass1_rc= !(avctx->flags & (AV_CODEC_FLAG_QSCALE|AV_CODEC_FLAG_PASS2)); + enc->pass1_rc = !(avctx->flags & (AV_CODEC_FLAG_QSCALE|AV_CODEC_FLAG_PASS2)); switch(avctx->pix_fmt){ case AV_PIX_FMT_YUV444P: @@ -130,8 +276,8 @@ static av_cold int encode_init(AVCodecContext *avctx) if (ret) return ret; - ret = ff_set_cmp(&s->mecc, s->mecc.me_cmp, s->avctx->me_cmp); - ret |= ff_set_cmp(&s->mecc, s->mecc.me_sub_cmp, s->avctx->me_sub_cmp); + ret = ff_set_cmp(&enc->mecc, enc->mecc.me_cmp, s->avctx->me_cmp); + ret |= ff_set_cmp(&enc->mecc, enc->mecc.me_sub_cmp, s->avctx->me_sub_cmp); if (ret < 0) return AVERROR(EINVAL); @@ -139,10 +285,10 @@ static av_cold int encode_init(AVCodecContext *avctx) if (!s->input_picture) return AVERROR(ENOMEM); - if ((ret = ff_snow_get_buffer(s, s->input_picture)) < 0) + if ((ret = get_encode_buffer(s, s->input_picture)) < 0) return ret; - if(s->motion_est == FF_ME_ITER){ + if (enc->motion_est == FF_ME_ITER) { int size= s->b_width * s->b_height << 2*s->block_max_depth; for(i=0; imax_ref_frames; i++){ s->ref_mvs[i] = av_calloc(size, sizeof(*s->ref_mvs[i])); @@ -220,7 +366,10 @@ static inline int get_penalty_factor(int lambda, int lambda2, int type){ #define P_MV1 P[9] #define FLAG_QPEL 1 //must be 1 -static int encode_q_branch(SnowContext *s, int level, int x, int y){ +static int encode_q_branch(SnowEncContext *enc, int level, int x, int y) +{ + SnowContext *const s = &enc->com; + MotionEstContext *const c = &enc->m.me; uint8_t p_buffer[1024]; uint8_t i_buffer[1024]; uint8_t p_state[sizeof(s->block_state)]; @@ -257,7 +406,6 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){ int16_t last_mv[3][2]; 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); int mx_context= av_log2(2*FFABS(left->mx - top->mx)); int my_context= av_log2(2*FFABS(left->my - top->my)); @@ -286,18 +434,18 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){ last_mv[2][0]= bottom->mx; last_mv[2][1]= bottom->my; - s->m.mb_stride=2; - s->m.mb_x= - s->m.mb_y= 0; + enc->m.mb_stride = 2; + enc->m.mb_x = + enc->m.mb_y = 0; c->skip= 0; av_assert1(c-> stride == stride); av_assert1(c->uvstride == uvstride); - c->penalty_factor = get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_cmp); - c->sub_penalty_factor= get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_sub_cmp); - c->mb_penalty_factor = get_penalty_factor(s->lambda, s->lambda2, c->avctx->mb_cmp); - c->current_mv_penalty= c->mv_penalty[s->m.f_code=1] + MAX_DMV; + c->penalty_factor = get_penalty_factor(enc->lambda, enc->lambda2, c->avctx->me_cmp); + c->sub_penalty_factor= get_penalty_factor(enc->lambda, enc->lambda2, c->avctx->me_sub_cmp); + c->mb_penalty_factor = get_penalty_factor(enc->lambda, enc->lambda2, c->avctx->mb_cmp); + c->current_mv_penalty = c->mv_penalty[enc->m.f_code=1] + MAX_DMV; c->xmin = - x*block_w - 16+3; c->ymin = - y*block_w - 16+3; @@ -328,7 +476,7 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){ for(ref=0; refref_frames; ref++){ init_ref(c, current_data, s->last_picture[ref]->data, NULL, block_w*x, block_w*y, 0); - ref_score= ff_epzs_motion_search(&s->m, &ref_mx, &ref_my, P, 0, /*ref_index*/ 0, last_mv, + ref_score= ff_epzs_motion_search(&enc->m, &ref_mx, &ref_my, P, 0, /*ref_index*/ 0, last_mv, (1<<16)>>shift, level-LOG2_MB_SIZE+4, block_w); av_assert2(ref_mx >= c->xmin); @@ -336,8 +484,8 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){ av_assert2(ref_my >= c->ymin); av_assert2(ref_my <= c->ymax); - ref_score= c->sub_motion_search(&s->m, &ref_mx, &ref_my, ref_score, 0, 0, level-LOG2_MB_SIZE+4, block_w); - ref_score= ff_get_mb_score(&s->m, ref_mx, ref_my, 0, 0, level-LOG2_MB_SIZE+4, block_w, 0); + ref_score= c->sub_motion_search(&enc->m, &ref_mx, &ref_my, ref_score, 0, 0, level-LOG2_MB_SIZE+4, block_w); + ref_score= ff_get_mb_score(&enc->m, ref_mx, ref_my, 0, 0, level-LOG2_MB_SIZE+4, block_w, 0); ref_score+= 2*av_log2(2*ref)*c->penalty_factor; if(s->ref_mvs[ref]){ s->ref_mvs[ref][index][0]= ref_mx; @@ -369,7 +517,7 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){ put_symbol(&pc, &p_state[128 + 32*(mx_context + 16*!!best_ref)], mx - pmx, 1); put_symbol(&pc, &p_state[128 + 32*(my_context + 16*!!best_ref)], my - pmy, 1); p_len= pc.bytestream - pc.bytestream_start; - score += (s->lambda2*(get_rac_count(&pc)-base_bits))>>FF_LAMBDA_SHIFT; + score += (enc->lambda2*(get_rac_count(&pc)-base_bits))>>FF_LAMBDA_SHIFT; block_s= block_w*block_w; sum = pix_sum(current_data[0], stride, block_w, block_w); @@ -400,9 +548,9 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){ put_symbol(&ic, &i_state[96], cr-pcr, 1); } i_len= ic.bytestream - ic.bytestream_start; - iscore += (s->lambda2*(get_rac_count(&ic)-base_bits))>>FF_LAMBDA_SHIFT; + iscore += (enc->lambda2*(get_rac_count(&ic)-base_bits))>>FF_LAMBDA_SHIFT; - av_assert1(iscore < 255*255*256 + s->lambda2*10); + av_assert1(iscore < 255*255*256 + enc->lambda2*10); av_assert1(iscore >= 0); av_assert1(l>=0 && l<=255); av_assert1(pl>=0 && pl<=255); @@ -413,16 +561,16 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){ if (vard <= 64 || vard < varc) c->scene_change_score+= ff_sqrt(vard) - ff_sqrt(varc); else - c->scene_change_score+= s->m.qscale; + c->scene_change_score += enc->m.qscale; } if(level!=s->block_max_depth){ put_rac(&s->c, &s->block_state[4 + s_context], 0); - score2 = encode_q_branch(s, level+1, 2*x+0, 2*y+0); - score2+= encode_q_branch(s, level+1, 2*x+1, 2*y+0); - score2+= encode_q_branch(s, level+1, 2*x+0, 2*y+1); - score2+= encode_q_branch(s, level+1, 2*x+1, 2*y+1); - score2+= s->lambda2>>FF_LAMBDA_SHIFT; //FIXME exact split overhead + score2 = encode_q_branch(enc, level+1, 2*x+0, 2*y+0); + score2+= encode_q_branch(enc, level+1, 2*x+1, 2*y+0); + score2+= encode_q_branch(enc, level+1, 2*x+0, 2*y+1); + score2+= encode_q_branch(enc, level+1, 2*x+1, 2*y+1); + score2+= enc->lambda2>>FF_LAMBDA_SHIFT; //FIXME exact split overhead if(score2 < score && score2 < iscore) return score2; @@ -504,7 +652,9 @@ static void encode_q_branch2(SnowContext *s, int level, int x, int y){ } } -static int get_dc(SnowContext *s, int mb_x, int mb_y, int plane_index){ +static int get_dc(SnowEncContext *enc, int mb_x, int mb_y, int plane_index) +{ + SnowContext *const s = &enc->com; int i, x2, y2; Plane *p= &s->plane[plane_index]; const int block_size = MB_SIZE >> s->block_max_depth; @@ -514,7 +664,7 @@ static int get_dc(SnowContext *s, int mb_x, int mb_y, int plane_index){ const int obmc_stride= plane_index ? (2*block_size)>>s->chroma_h_shift : 2*block_size; const int ref_stride= s->current_picture->linesize[plane_index]; const uint8_t *src = s->input_picture->data[plane_index]; - IDWTELEM *dst= (IDWTELEM*)s->m.sc.obmc_scratchpad + plane_index*block_size*block_size*4; //FIXME change to unsigned + IDWTELEM *dst= (IDWTELEM*)enc->m.sc.obmc_scratchpad + plane_index*block_size*block_size*4; //FIXME change to unsigned const int b_stride = s->b_width << s->block_max_depth; const int w= p->width; const int h= p->height; @@ -600,7 +750,10 @@ static inline int get_block_bits(SnowContext *s, int x, int y, int w){ } } -static int get_block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index, uint8_t (*obmc_edged)[MB_SIZE * 2]){ +static int get_block_rd(SnowEncContext *enc, int mb_x, int mb_y, + int plane_index, uint8_t (*obmc_edged)[MB_SIZE * 2]) +{ + SnowContext *const s = &enc->com; Plane *p= &s->plane[plane_index]; const int block_size = MB_SIZE >> s->block_max_depth; const int block_w = plane_index ? block_size>>s->chroma_h_shift : block_size; @@ -609,7 +762,7 @@ static int get_block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index, uin const int ref_stride= s->current_picture->linesize[plane_index]; uint8_t *dst= s->current_picture->data[plane_index]; const uint8_t *src = s->input_picture->data[plane_index]; - IDWTELEM *pred= (IDWTELEM*)s->m.sc.obmc_scratchpad + plane_index*block_size*block_size*4; + IDWTELEM *pred= (IDWTELEM*)enc->m.sc.obmc_scratchpad + plane_index*block_size*block_size*4; uint8_t *cur = s->scratchbuf; uint8_t *tmp = s->emu_edge_buffer; const int b_stride = s->b_width << s->block_max_depth; @@ -618,7 +771,7 @@ static int get_block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index, uin const int h= p->height; int distortion; int rate= 0; - const int penalty_factor= get_penalty_factor(s->lambda, s->lambda2, s->avctx->me_cmp); + const int penalty_factor = get_penalty_factor(enc->lambda, enc->lambda2, s->avctx->me_cmp); int sx= block_w*mb_x - block_w/2; int sy= block_h*mb_y - block_h/2; int x0= FFMAX(0,-sx); @@ -672,19 +825,19 @@ static int get_block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index, uin * to improve the score of the whole frame, thus iterative motion * estimation does not always converge. */ if(s->avctx->me_cmp == FF_CMP_W97) - distortion = ff_w97_32_c(&s->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, 32); + distortion = ff_w97_32_c(&enc->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, 32); else if(s->avctx->me_cmp == FF_CMP_W53) - distortion = ff_w53_32_c(&s->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, 32); + distortion = ff_w53_32_c(&enc->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, 32); else{ distortion = 0; for(i=0; i<4; i++){ int off = sx+16*(i&1) + (sy+16*(i>>1))*ref_stride; - distortion += s->mecc.me_cmp[0](&s->m, src + off, dst + off, ref_stride, 16); + distortion += enc->mecc.me_cmp[0](&enc->m, src + off, dst + off, ref_stride, 16); } } }else{ av_assert2(block_w==8); - distortion = s->mecc.me_cmp[0](&s->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, block_w*2); + distortion = enc->mecc.me_cmp[0](&enc->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, block_w*2); } if(plane_index==0){ @@ -701,7 +854,9 @@ static int get_block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index, uin return distortion + rate*penalty_factor; } -static int get_4block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index){ +static int get_4block_rd(SnowEncContext *enc, int mb_x, int mb_y, int plane_index) +{ + SnowContext *const s = &enc->com; int i, y2; Plane *p= &s->plane[plane_index]; const int block_size = MB_SIZE >> s->block_max_depth; @@ -720,7 +875,7 @@ static int get_4block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index){ const int h= p->height; int distortion= 0; int rate= 0; - const int penalty_factor= get_penalty_factor(s->lambda, s->lambda2, s->avctx->me_cmp); + const int penalty_factor= get_penalty_factor(enc->lambda, enc->lambda2, s->avctx->me_cmp); av_assert2(s->chroma_h_shift == s->chroma_v_shift); //obmc and square assumtions below @@ -748,7 +903,7 @@ static int get_4block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index){ } av_assert1(block_w== 8 || block_w==16); - distortion += s->mecc.me_cmp[block_w==8](&s->m, src + x + y*ref_stride, dst + x + y*ref_stride, ref_stride, block_h); + distortion += enc->mecc.me_cmp[block_w==8](&enc->m, src + x + y*ref_stride, dst + x + y*ref_stride, ref_stride, block_h); } if(plane_index==0){ @@ -897,9 +1052,10 @@ static int encode_subband(SnowContext *s, SubBand *b, const IDWTELEM *src, const // encode_subband_dzr(s, b, src, parent, stride, orientation); } -static av_always_inline int check_block_intra(SnowContext *s, int mb_x, int mb_y, int p[3], +static av_always_inline int check_block_intra(SnowEncContext *enc, int mb_x, int mb_y, int p[3], uint8_t (*obmc_edged)[MB_SIZE * 2], int *best_rd) { + SnowContext *const s = &enc->com; const int b_stride= s->b_width << s->block_max_depth; BlockNode *block= &s->block[mb_x + mb_y * b_stride]; BlockNode backup= *block; @@ -913,7 +1069,7 @@ static av_always_inline int check_block_intra(SnowContext *s, int mb_x, int mb_y block->color[2] = p[2]; block->type |= BLOCK_INTRA; - rd = get_block_rd(s, mb_x, mb_y, 0, obmc_edged) + s->intra_penalty; + rd = get_block_rd(enc, mb_x, mb_y, 0, obmc_edged) + enc->intra_penalty; //FIXME chroma if(rd < *best_rd){ @@ -927,7 +1083,11 @@ static av_always_inline int check_block_intra(SnowContext *s, int mb_x, int mb_y /* special case for int[2] args we discard afterwards, * fixes compilation problem with gcc 2.95 */ -static av_always_inline int check_block_inter(SnowContext *s, int mb_x, int mb_y, int p0, int p1, uint8_t (*obmc_edged)[MB_SIZE * 2], int *best_rd){ +static av_always_inline int check_block_inter(SnowEncContext *enc, + int mb_x, int mb_y, int p0, int p1, + uint8_t (*obmc_edged)[MB_SIZE * 2], int *best_rd) +{ + SnowContext *const s = &enc->com; const int b_stride = s->b_width << s->block_max_depth; BlockNode *block = &s->block[mb_x + mb_y * b_stride]; BlockNode backup = *block; @@ -938,16 +1098,16 @@ static av_always_inline int check_block_inter(SnowContext *s, int mb_x, int mb_y av_assert2(mb_x < b_stride); index = (p0 + 31 * p1) & (ME_CACHE_SIZE-1); - value = s->me_cache_generation + (p0 >> 10) + p1 * (1 << 6) + (block->ref << 12); - if (s->me_cache[index] == value) + value = enc->me_cache_generation + (p0 >> 10) + p1 * (1 << 6) + (block->ref << 12); + if (enc->me_cache[index] == value) return 0; - s->me_cache[index] = value; + enc->me_cache[index] = value; block->mx = p0; block->my = p1; block->type &= ~BLOCK_INTRA; - rd = get_block_rd(s, mb_x, mb_y, 0, obmc_edged); + rd = get_block_rd(enc, mb_x, mb_y, 0, obmc_edged); //FIXME chroma if (rd < *best_rd) { @@ -959,7 +1119,10 @@ static av_always_inline int check_block_inter(SnowContext *s, int mb_x, int mb_y } } -static av_always_inline int check_4block_inter(SnowContext *s, int mb_x, int mb_y, int p0, int p1, int ref, int *best_rd){ +static av_always_inline int check_4block_inter(SnowEncContext *enc, int mb_x, int mb_y, + int p0, int p1, int ref, int *best_rd) +{ + SnowContext *const s = &enc->com; const int b_stride= s->b_width << s->block_max_depth; BlockNode *block= &s->block[mb_x + mb_y * b_stride]; BlockNode backup[4]; @@ -979,10 +1142,10 @@ static av_always_inline int check_4block_inter(SnowContext *s, int mb_x, int mb_ av_assert2(((mb_x|mb_y)&1) == 0); index= (p0 + 31*p1) & (ME_CACHE_SIZE-1); - value= s->me_cache_generation + (p0>>10) + (p1<<6) + (block->ref<<12); - if(s->me_cache[index] == value) + value = enc->me_cache_generation + (p0>>10) + (p1<<6) + (block->ref<<12); + if (enc->me_cache[index] == value) return 0; - s->me_cache[index]= value; + enc->me_cache[index] = value; block->mx= p0; block->my= p1; @@ -990,7 +1153,7 @@ static av_always_inline int check_4block_inter(SnowContext *s, int mb_x, int mb_ block->type &= ~BLOCK_INTRA; block[1]= block[b_stride]= block[b_stride+1]= *block; - rd= get_4block_rd(s, mb_x, mb_y, 0); + rd = get_4block_rd(enc, mb_x, mb_y, 0); //FIXME chroma if(rd < *best_rd){ @@ -1005,7 +1168,9 @@ static av_always_inline int check_4block_inter(SnowContext *s, int mb_x, int mb_ } } -static void iterative_me(SnowContext *s){ +static void iterative_me(SnowEncContext *enc) +{ + SnowContext *const s = &enc->com; int pass, mb_x, mb_y; const int b_width = s->b_width << s->block_max_depth; const int b_height= s->b_height << s->block_max_depth; @@ -1018,7 +1183,7 @@ static void iterative_me(SnowContext *s){ memcpy(state, s->block_state, sizeof(s->block_state)); for(mb_y= 0; mb_yb_height; mb_y++) for(mb_x= 0; mb_xb_width; mb_x++) - encode_q_branch(s, 0, mb_x, mb_y); + encode_q_branch(enc, 0, mb_x, mb_y); s->c = r; memcpy(s->block_state, state, sizeof(s->block_state)); } @@ -1050,9 +1215,9 @@ static void iterative_me(SnowContext *s){ backup= *block; - if(!s->me_cache_generation) - memset(s->me_cache, 0, sizeof(s->me_cache)); - s->me_cache_generation += 1<<22; + if (!enc->me_cache_generation) + memset(enc->me_cache, 0, sizeof(enc->me_cache)); + enc->me_cache_generation += 1<<22; //FIXME precalculate { @@ -1108,14 +1273,14 @@ static void iterative_me(SnowContext *s){ // intra(black) = neighbors' contribution to the current block for(i=0; i < s->nb_planes; i++) - color[i]= get_dc(s, mb_x, mb_y, i); + color[i]= get_dc(enc, mb_x, mb_y, i); // get previous score (cannot be cached due to OBMC) if(pass > 0 && (block->type&BLOCK_INTRA)){ int color0[3]= {block->color[0], block->color[1], block->color[2]}; - check_block_intra(s, mb_x, mb_y, color0, obmc_edged, &best_rd); + check_block_intra(enc, mb_x, mb_y, color0, obmc_edged, &best_rd); }else - check_block_inter(s, mb_x, mb_y, block->mx, block->my, obmc_edged, &best_rd); + check_block_inter(enc, mb_x, mb_y, block->mx, block->my, obmc_edged, &best_rd); ref_b= *block; ref_rd= best_rd; @@ -1126,30 +1291,30 @@ static void iterative_me(SnowContext *s){ block->ref= ref; best_rd= INT_MAX; - check_block_inter(s, mb_x, mb_y, mvr[0][0], mvr[0][1], obmc_edged, &best_rd); - check_block_inter(s, mb_x, mb_y, 0, 0, obmc_edged, &best_rd); + check_block_inter(enc, mb_x, mb_y, mvr[0][0], mvr[0][1], obmc_edged, &best_rd); + check_block_inter(enc, mb_x, mb_y, 0, 0, obmc_edged, &best_rd); if(tb) - check_block_inter(s, mb_x, mb_y, mvr[-b_stride][0], mvr[-b_stride][1], obmc_edged, &best_rd); + check_block_inter(enc, mb_x, mb_y, mvr[-b_stride][0], mvr[-b_stride][1], obmc_edged, &best_rd); if(lb) - check_block_inter(s, mb_x, mb_y, mvr[-1][0], mvr[-1][1], obmc_edged, &best_rd); + check_block_inter(enc, mb_x, mb_y, mvr[-1][0], mvr[-1][1], obmc_edged, &best_rd); if(rb) - check_block_inter(s, mb_x, mb_y, mvr[1][0], mvr[1][1], obmc_edged, &best_rd); + check_block_inter(enc, mb_x, mb_y, mvr[1][0], mvr[1][1], obmc_edged, &best_rd); if(bb) - check_block_inter(s, mb_x, mb_y, mvr[b_stride][0], mvr[b_stride][1], obmc_edged, &best_rd); + check_block_inter(enc, mb_x, mb_y, mvr[b_stride][0], mvr[b_stride][1], obmc_edged, &best_rd); /* fullpel ME */ //FIXME avoid subpel interpolation / round to nearest integer 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); + int dia_size = enc->iterative_dia_size ? enc->iterative_dia_size : FFMAX(s->avctx->dia_size, 1); dia_change=0; for(i=0; i < dia_size; i++){ for(j=0; jmx+square[i][0], block->my+square[i][1], obmc_edged, &best_rd); + dia_change |= check_block_inter(enc, mb_x, mb_y, block->mx+square[i][0], block->my+square[i][1], obmc_edged, &best_rd); }while(dia_change); //FIXME or try the standard 2 pass qpel or similar @@ -1171,7 +1336,7 @@ static void iterative_me(SnowContext *s){ } best_rd= ref_rd; *block= ref_b; - check_block_intra(s, mb_x, mb_y, color, obmc_edged, &best_rd); + check_block_intra(enc, mb_x, mb_y, color, obmc_edged, &best_rd); //FIXME RD style color selection if(!same_block(block, &backup)){ if(tb ) tb ->type &= ~BLOCK_OPT; @@ -1209,20 +1374,20 @@ static void iterative_me(SnowContext *s){ same_block(b[0], b[3])) continue; - if(!s->me_cache_generation) - memset(s->me_cache, 0, sizeof(s->me_cache)); - s->me_cache_generation += 1<<22; + if (!enc->me_cache_generation) + memset(enc->me_cache, 0, sizeof(enc->me_cache)); + enc->me_cache_generation += 1<<22; - init_rd= best_rd= get_4block_rd(s, mb_x, mb_y, 0); + init_rd = best_rd = get_4block_rd(enc, mb_x, mb_y, 0); //FIXME more multiref search? - check_4block_inter(s, mb_x, mb_y, + check_4block_inter(enc, mb_x, mb_y, (b[0]->mx + b[1]->mx + b[2]->mx + b[3]->mx + 2) >> 2, (b[0]->my + b[1]->my + b[2]->my + b[3]->my + 2) >> 2, 0, &best_rd); for(i=0; i<4; i++) if(!(b[i]->type&BLOCK_INTRA)) - check_4block_inter(s, mb_x, mb_y, b[i]->mx, b[i]->my, b[i]->ref, &best_rd); + check_4block_inter(enc, mb_x, mb_y, b[i]->mx, b[i]->my, b[i]->ref, &best_rd); if(init_rd != best_rd) change++; @@ -1232,13 +1397,15 @@ static void iterative_me(SnowContext *s){ } } -static void encode_blocks(SnowContext *s, int search){ +static void encode_blocks(SnowEncContext *enc, int search) +{ + SnowContext *const s = &enc->com; int x, y; int w= s->b_width; int h= s->b_height; - if(s->motion_est == FF_ME_ITER && !s->keyframe && search) - iterative_me(s); + if (enc->motion_est == FF_ME_ITER && !s->keyframe && search) + iterative_me(enc); for(y=0; yc.bytestream_end - s->c.bytestream < w*MB_SIZE*MB_SIZE*3){ //FIXME nicer limit @@ -1246,10 +1413,10 @@ static void encode_blocks(SnowContext *s, int search){ return; } for(x=0; xmotion_est == FF_ME_ITER || !search) + if (enc->motion_est == FF_ME_ITER || !search) encode_q_branch2(s, 0, x, y); else - encode_q_branch (s, 0, x, y); + encode_q_branch (enc, 0, x, y); } } } @@ -1496,8 +1663,9 @@ static int qscale2qlog(int qscale){ + 61*QROOT/8; ///< 64 > 60 } -static int ratecontrol_1pass(SnowContext *s, AVFrame *pict) +static int ratecontrol_1pass(SnowEncContext *enc, AVFrame *pict) { + SnowContext *const s = &enc->com; /* Estimate the frame's complexity as a sum of weighted dwt coefficients. * FIXME we know exact mv bits at this point, * but ratecontrol isn't set up to include them. */ @@ -1532,17 +1700,17 @@ static int ratecontrol_1pass(SnowContext *s, AVFrame *pict) coef_sum = (uint64_t)coef_sum * coef_sum >> 16; if(pict->pict_type == AV_PICTURE_TYPE_I){ - s->m.mb_var_sum = coef_sum; - s->m.mc_mb_var_sum = 0; + enc->m.mb_var_sum = coef_sum; + enc->m.mc_mb_var_sum = 0; }else{ - s->m.mc_mb_var_sum = coef_sum; - s->m.mb_var_sum = 0; + enc->m.mc_mb_var_sum = coef_sum; + enc->m.mb_var_sum = 0; } - pict->quality= ff_rate_estimate_qscale(&s->m, 1); + pict->quality= ff_rate_estimate_qscale(&enc->m, 1); if (pict->quality < 0) return INT_MIN; - s->lambda= pict->quality * 3/2; + enc->lambda= pict->quality * 3/2; delta_qlog= qscale2qlog(pict->quality) - s->qlog; s->qlog+= delta_qlog; return delta_qlog; @@ -1581,7 +1749,9 @@ static void calculate_visual_weight(SnowContext *s, Plane *p){ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet) { - SnowContext *s = avctx->priv_data; + SnowEncContext *const enc = avctx->priv_data; + SnowContext *const s = &enc->com; + MpegEncContext *const mpv = &enc->m; RangeCoder * const c= &s->c; AVCodecInternal *avci = avctx->internal; AVFrame *pic; @@ -1604,7 +1774,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, memcpy(&s->input_picture->data[i][y * s->input_picture->linesize[i]], &pict->data[i][y * pict->linesize[i]], AV_CEIL_RSHIFT(width, hshift)); - s->mpvencdsp.draw_edges(s->input_picture->data[i], s->input_picture->linesize[i], + enc->mpvencdsp.draw_edges(s->input_picture->data[i], s->input_picture->linesize[i], AV_CEIL_RSHIFT(width, hshift), AV_CEIL_RSHIFT(height, vshift), EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift, EDGE_TOP | EDGE_BOTTOM); @@ -1615,54 +1785,57 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, pic->pict_type = pict->pict_type; pic->quality = pict->quality; - s->m.picture_number= avctx->frame_num; + mpv->picture_number = avctx->frame_num; if(avctx->flags&AV_CODEC_FLAG_PASS2){ - s->m.pict_type = pic->pict_type = s->m.rc_context.entry[avctx->frame_num].new_pict_type; + mpv->pict_type = pic->pict_type = mpv->rc_context.entry[avctx->frame_num].new_pict_type; s->keyframe = pic->pict_type == AV_PICTURE_TYPE_I; if(!(avctx->flags&AV_CODEC_FLAG_QSCALE)) { - pic->quality = ff_rate_estimate_qscale(&s->m, 0); + pic->quality = ff_rate_estimate_qscale(mpv, 0); if (pic->quality < 0) return -1; } }else{ s->keyframe= avctx->gop_size==0 || avctx->frame_num % avctx->gop_size == 0; - s->m.pict_type = pic->pict_type = s->keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P; + mpv->pict_type = pic->pict_type = s->keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P; } - if(s->pass1_rc && avctx->frame_num == 0) + if (enc->pass1_rc && avctx->frame_num == 0) pic->quality = 2*FF_QP2LAMBDA; if (pic->quality) { s->qlog = qscale2qlog(pic->quality); - s->lambda = pic->quality * 3/2; + enc->lambda = pic->quality * 3/2; } if (s->qlog < 0 || (!pic->quality && (avctx->flags & AV_CODEC_FLAG_QSCALE))) { s->qlog= LOSSLESS_QLOG; - s->lambda = 0; + enc->lambda = 0; }//else keep previous frame's qlog until after motion estimation if (s->current_picture->data[0]) { int w = s->avctx->width; int h = s->avctx->height; - s->mpvencdsp.draw_edges(s->current_picture->data[0], - s->current_picture->linesize[0], w , h , - EDGE_WIDTH , EDGE_WIDTH , EDGE_TOP | EDGE_BOTTOM); + enc->mpvencdsp.draw_edges(s->current_picture->data[0], + s->current_picture->linesize[0], w , h , + EDGE_WIDTH , EDGE_WIDTH , EDGE_TOP | EDGE_BOTTOM); if (s->current_picture->data[2]) { - s->mpvencdsp.draw_edges(s->current_picture->data[1], - s->current_picture->linesize[1], w>>s->chroma_h_shift, h>>s->chroma_v_shift, - EDGE_WIDTH>>s->chroma_h_shift, EDGE_WIDTH>>s->chroma_v_shift, EDGE_TOP | EDGE_BOTTOM); - s->mpvencdsp.draw_edges(s->current_picture->data[2], - s->current_picture->linesize[2], w>>s->chroma_h_shift, h>>s->chroma_v_shift, - EDGE_WIDTH>>s->chroma_h_shift, EDGE_WIDTH>>s->chroma_v_shift, EDGE_TOP | EDGE_BOTTOM); + enc->mpvencdsp.draw_edges(s->current_picture->data[1], + s->current_picture->linesize[1], w>>s->chroma_h_shift, h>>s->chroma_v_shift, + EDGE_WIDTH>>s->chroma_h_shift, EDGE_WIDTH>>s->chroma_v_shift, EDGE_TOP | EDGE_BOTTOM); + enc->mpvencdsp.draw_edges(s->current_picture->data[2], + s->current_picture->linesize[2], w>>s->chroma_h_shift, h>>s->chroma_v_shift, + EDGE_WIDTH>>s->chroma_h_shift, EDGE_WIDTH>>s->chroma_v_shift, EDGE_TOP | EDGE_BOTTOM); } emms_c(); } - ff_snow_frame_start(s); + ff_snow_frames_prepare(s); + ret = get_encode_buffer(s, s->current_picture); + if (ret < 0) + return ret; - s->m.current_picture_ptr= &s->m.current_picture; - s->m.current_picture.f = s->current_picture; - s->m.current_picture.f->pts = pict->pts; + mpv->current_picture_ptr = &mpv->current_picture; + mpv->current_picture.f = s->current_picture; + mpv->current_picture.f->pts = pict->pts; if(pic->pict_type == AV_PICTURE_TYPE_P){ int block_width = (width +15)>>4; int block_height= (height+15)>>4; @@ -1671,40 +1844,40 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, av_assert0(s->current_picture->data[0]); av_assert0(s->last_picture[0]->data[0]); - s->m.avctx= s->avctx; - s->m. last_picture.f = s->last_picture[0]; - s->m. new_picture = s->input_picture; - s->m. last_picture_ptr= &s->m. last_picture; - s->m.linesize = stride; - s->m.uvlinesize= s->current_picture->linesize[1]; - s->m.width = width; - s->m.height= height; - s->m.mb_width = block_width; - s->m.mb_height= block_height; - 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 = pic->pict_type; - 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 & AV_CODEC_FLAG_QPEL)!=0; - s->m.out_format= FMT_H263; - s->m.unrestricted_mv= 1; + mpv->avctx = s->avctx; + mpv->last_picture.f = s->last_picture[0]; + mpv-> new_picture = s->input_picture; + mpv->last_picture_ptr = &mpv->last_picture; + mpv->linesize = stride; + mpv->uvlinesize = s->current_picture->linesize[1]; + mpv->width = width; + mpv->height = height; + mpv->mb_width = block_width; + mpv->mb_height = block_height; + mpv->mb_stride = mpv->mb_width + 1; + mpv->b8_stride = 2 * mpv->mb_width + 1; + mpv->f_code = 1; + mpv->pict_type = pic->pict_type; + mpv->motion_est = enc->motion_est; + mpv->me.scene_change_score = 0; + mpv->me.dia_size = avctx->dia_size; + mpv->quarter_sample = (s->avctx->flags & AV_CODEC_FLAG_QPEL)!=0; + mpv->out_format = FMT_H263; + mpv->unrestricted_mv = 1; - s->m.lambda = s->lambda; - s->m.qscale= (s->m.lambda*139 + FF_LAMBDA_SCALE*64) >> (FF_LAMBDA_SHIFT + 7); - s->lambda2= s->m.lambda2= (s->m.lambda*s->m.lambda + FF_LAMBDA_SCALE/2) >> FF_LAMBDA_SHIFT; + mpv->lambda = enc->lambda; + mpv->qscale = (mpv->lambda*139 + FF_LAMBDA_SCALE*64) >> (FF_LAMBDA_SHIFT + 7); + enc->lambda2 = mpv->lambda2 = (mpv->lambda*mpv->lambda + FF_LAMBDA_SCALE/2) >> FF_LAMBDA_SHIFT; - s->m.mecc= s->mecc; //move - s->m.qdsp= s->qdsp; //move - s->m.hdsp = s->hdsp; - ff_init_me(&s->m); - s->hdsp = s->m.hdsp; - s->mecc= s->m.mecc; + mpv->mecc = enc->mecc; //move + mpv->qdsp = enc->qdsp; //move + mpv->hdsp = s->hdsp; + ff_init_me(&enc->m); + s->hdsp = mpv->hdsp; + enc->mecc = mpv->mecc; } - if(s->pass1_rc){ + if (enc->pass1_rc) { memcpy(rc_header_bak, s->header_state, sizeof(s->header_state)); memcpy(rc_block_bak, s->block_state, sizeof(s->block_state)); } @@ -1722,7 +1895,7 @@ redo_frame: return AVERROR(EINVAL); } - s->m.pict_type = pic->pict_type; + mpv->pict_type = pic->pict_type; s->qbias = pic->pict_type == AV_PICTURE_TYPE_P ? 2 : 0; ff_snow_common_init_after_header(avctx); @@ -1734,9 +1907,9 @@ redo_frame: } encode_header(s); - s->m.misc_bits = 8*(s->c.bytestream - s->c.bytestream_start); - encode_blocks(s, 1); - s->m.mv_bits = 8*(s->c.bytestream - s->c.bytestream_start) - s->m.misc_bits; + mpv->misc_bits = 8 * (s->c.bytestream - s->c.bytestream_start); + encode_blocks(enc, 1); + mpv->mv_bits = 8 * (s->c.bytestream - s->c.bytestream_start) - mpv->misc_bits; for(plane_index=0; plane_index < s->nb_planes; plane_index++){ Plane *p= &s->plane[plane_index]; @@ -1745,7 +1918,7 @@ redo_frame: int x, y; // int bits= put_bits_count(&s->c.pb); - if (!s->memc_only) { + if (!enc->memc_only) { //FIXME optimize if(pict->data[plane_index]) //FIXME gray hack for(y=0; ypict_type == AV_PICTURE_TYPE_P && !(avctx->flags&AV_CODEC_FLAG_PASS2) - && s->m.me.scene_change_score > s->scenechange_threshold){ + && mpv->me.scene_change_score > enc->scenechange_threshold) { ff_init_range_encoder(c, pkt->data, pkt->size); ff_build_rac_states(c, (1LL<<32)/20, 256-8); pic->pict_type= AV_PICTURE_TYPE_I; @@ -1783,8 +1956,8 @@ redo_frame: ff_spatial_dwt(s->spatial_dwt_buffer, s->temp_dwt_buffer, w, h, w, s->spatial_decomposition_type, s->spatial_decomposition_count); - if(s->pass1_rc && plane_index==0){ - int delta_qlog = ratecontrol_1pass(s, pic); + if (enc->pass1_rc && plane_index==0) { + int delta_qlog = ratecontrol_1pass(enc, pic); if (delta_qlog <= INT_MIN) return -1; if(delta_qlog){ @@ -1793,7 +1966,7 @@ redo_frame: memcpy(s->header_state, rc_header_bak, sizeof(s->header_state)); memcpy(s->block_state, rc_block_bak, sizeof(s->block_state)); encode_header(s); - encode_blocks(s, 0); + encode_blocks(enc, 0); } } @@ -1804,7 +1977,7 @@ redo_frame: quantize(s, b, b->ibuf, b->buf, b->stride, s->qbias); if(orientation==0) decorrelate(s, b, b->ibuf, b->stride, pic->pict_type == AV_PICTURE_TYPE_P, 0); - if (!s->no_bitstream) + if (!enc->no_bitstream) encode_subband(s, b, b->ibuf, b->parent ? b->parent->ibuf : NULL, b->stride, orientation); av_assert0(b->parent==NULL || b->parent->stride == b->stride*2); if(orientation==0) @@ -1854,7 +2027,7 @@ redo_frame: } } s->avctx->error[plane_index] += error; - s->encoding_error[plane_index] = error; + enc->encoding_error[plane_index] = error; } } @@ -1866,28 +2039,27 @@ redo_frame: s->current_picture->pict_type = pic->pict_type; s->current_picture->quality = pic->quality; - s->m.frame_bits = 8*(s->c.bytestream - s->c.bytestream_start); - s->m.p_tex_bits = s->m.frame_bits - s->m.misc_bits - s->m.mv_bits; - s->m.current_picture.display_picture_number = - s->m.current_picture.coded_picture_number = avctx->frame_num; - s->m.current_picture.f->quality = pic->quality; - s->m.total_bits += 8*(s->c.bytestream - s->c.bytestream_start); - if(s->pass1_rc) - if (ff_rate_estimate_qscale(&s->m, 0) < 0) + mpv->frame_bits = 8 * (s->c.bytestream - s->c.bytestream_start); + mpv->p_tex_bits = mpv->frame_bits - mpv->misc_bits - mpv->mv_bits; + mpv->total_bits += 8*(s->c.bytestream - s->c.bytestream_start); + mpv->current_picture.display_picture_number = + mpv->current_picture.coded_picture_number = avctx->frame_num; + mpv->current_picture.f->quality = pic->quality; + if (enc->pass1_rc) + if (ff_rate_estimate_qscale(mpv, 0) < 0) return -1; if(avctx->flags&AV_CODEC_FLAG_PASS1) - ff_write_pass1_stats(&s->m); - s->m.last_pict_type = s->m.pict_type; + ff_write_pass1_stats(mpv); + mpv->last_pict_type = mpv->pict_type; emms_c(); ff_side_data_set_encoder_stats(pkt, s->current_picture->quality, - s->encoding_error, + enc->encoding_error, (s->avctx->flags&AV_CODEC_FLAG_PSNR) ? SNOW_MAX_PLANES : 0, s->current_picture->pict_type); if (s->avctx->flags & AV_CODEC_FLAG_RECON_FRAME) { - av_frame_unref(avci->recon_frame); - av_frame_ref(avci->recon_frame, s->current_picture); + av_frame_replace(avci->recon_frame, s->current_picture); } pkt->size = ff_rac_terminate(c, 0); @@ -1900,17 +2072,29 @@ redo_frame: static av_cold int encode_end(AVCodecContext *avctx) { - SnowContext *s = avctx->priv_data; + SnowEncContext *const enc = avctx->priv_data; + SnowContext *const s = &enc->com; ff_snow_common_end(s); - ff_rate_control_uninit(&s->m); + ff_rate_control_uninit(&enc->m); av_frame_free(&s->input_picture); + + for (int i = 0; i < MAX_REF_FRAMES; i++) { + av_freep(&s->ref_mvs[i]); + av_freep(&s->ref_scores[i]); + } + + enc->m.me.temp = NULL; + av_freep(&enc->m.me.scratchpad); + av_freep(&enc->m.me.map); + av_freep(&enc->m.sc.obmc_scratchpad); + av_freep(&avctx->stats_out); return 0; } -#define OFFSET(x) offsetof(SnowContext, x) +#define OFFSET(x) offsetof(SnowEncContext, 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_ITER, VE, "motion_est" }, @@ -1949,7 +2133,7 @@ const FFCodec ff_snow_encoder = { .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE | AV_CODEC_CAP_ENCODER_RECON_FRAME, - .priv_data_size = sizeof(SnowContext), + .priv_data_size = sizeof(SnowEncContext), .init = encode_init, FF_CODEC_ENCODE_CB(encode_frame), .close = encode_end, diff --git a/arm/android/third_party/ffmpeg/libavcodec/speedhqdec.c b/arm/android/third_party/ffmpeg/libavcodec/speedhqdec.c index ff106009..f3e84ab3 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/speedhqdec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/speedhqdec.c @@ -506,7 +506,7 @@ static av_cold void compute_alpha_vlcs(void) av_assert0(entry == FF_ARRAY_ELEMS(run_code)); - INIT_LE_VLC_SPARSE_STATIC(&dc_alpha_run_vlc_le, ALPHA_VLC_BITS, + VLC_INIT_LE_SPARSE_STATIC(&dc_alpha_run_vlc_le, ALPHA_VLC_BITS, FF_ARRAY_ELEMS(run_code), run_bits, 1, 1, run_code, 2, 2, @@ -546,7 +546,7 @@ static av_cold void compute_alpha_vlcs(void) av_assert0(entry == FF_ARRAY_ELEMS(level_code)); - INIT_LE_VLC_SPARSE_STATIC(&dc_alpha_level_vlc_le, ALPHA_VLC_BITS, + VLC_INIT_LE_SPARSE_STATIC(&dc_alpha_level_vlc_le, ALPHA_VLC_BITS, FF_ARRAY_ELEMS(level_code), level_bits, 1, 1, level_code, 2, 2, @@ -556,18 +556,18 @@ static av_cold void compute_alpha_vlcs(void) static av_cold void speedhq_static_init(void) { /* Exactly the same as MPEG-2, except for a little-endian reader. */ - INIT_CUSTOM_VLC_STATIC(&dc_lum_vlc_le, DC_VLC_BITS, 12, + VLC_INIT_CUSTOM_STATIC(&dc_lum_vlc_le, DC_VLC_BITS, 12, ff_mpeg12_vlc_dc_lum_bits, 1, 1, ff_mpeg12_vlc_dc_lum_code, 2, 2, - INIT_VLC_OUTPUT_LE, 512); - INIT_CUSTOM_VLC_STATIC(&dc_chroma_vlc_le, DC_VLC_BITS, 12, + VLC_INIT_OUTPUT_LE, 512); + VLC_INIT_CUSTOM_STATIC(&dc_chroma_vlc_le, DC_VLC_BITS, 12, ff_mpeg12_vlc_dc_chroma_bits, 1, 1, ff_mpeg12_vlc_dc_chroma_code, 2, 2, - INIT_VLC_OUTPUT_LE, 514); + VLC_INIT_OUTPUT_LE, 514); ff_init_2d_vlc_rl(ff_speedhq_vlc_table, speedhq_rl_vlc, ff_speedhq_run, ff_speedhq_level, SPEEDHQ_RL_NB_ELEMS, - FF_ARRAY_ELEMS(speedhq_rl_vlc), INIT_VLC_LE); + FF_ARRAY_ELEMS(speedhq_rl_vlc), VLC_INIT_LE); compute_alpha_vlcs(); } diff --git a/arm/android/third_party/ffmpeg/libavcodec/svq1dec.c b/arm/android/third_party/ffmpeg/libavcodec/svq1dec.c index c7269456..8563b291 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/svq1dec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/svq1dec.c @@ -282,7 +282,7 @@ static int svq1_decode_block_non_intra(GetBitContext *bitbuf, uint8_t *pixels, SVQ1_CALC_CODEBOOK_ENTRIES(ff_svq1_inter_codebooks); for (y = 0; y < height; y++) { - for (x = 0; x < width / 4; x++, codebook++) { + for (x = 0; x < width / 4; x++) { n3 = dst[x]; /* add mean value to vector */ n1 = n4 + ((n3 & 0xFF00FF00) >> 8); @@ -290,6 +290,8 @@ static int svq1_decode_block_non_intra(GetBitContext *bitbuf, uint8_t *pixels, SVQ1_ADD_CODEBOOK() /* store result */ dst[x] = n1 << 8 | n2; + if (codebook != NULL) + codebook++; } dst += pitch / 4; } @@ -764,8 +766,7 @@ static int svq1_decode_frame(AVCodecContext *avctx, AVFrame *cur, } if (!s->nonref) { - av_frame_unref(s->prev); - result = av_frame_ref(s->prev, cur); + result = av_frame_replace(s->prev, cur); if (result < 0) return result; } @@ -778,11 +779,11 @@ static int svq1_decode_frame(AVCodecContext *avctx, AVFrame *cur, static av_cold void svq1_static_init(void) { - INIT_VLC_STATIC(&svq1_block_type, SVQ1_BLOCK_TYPE_VLC_BITS, 4, + VLC_INIT_STATIC(&svq1_block_type, SVQ1_BLOCK_TYPE_VLC_BITS, 4, &ff_svq1_block_type_vlc[0][1], 2, 1, &ff_svq1_block_type_vlc[0][0], 2, 1, 8); - INIT_VLC_STATIC(&svq1_motion_component, 7, 33, + VLC_INIT_STATIC(&svq1_motion_component, 7, 33, &ff_mvtab[0][1], 2, 1, &ff_mvtab[0][0], 2, 1, 176); @@ -793,24 +794,24 @@ static av_cold void svq1_static_init(void) svq1_intra_multistage[i].table = &table[offset]; svq1_intra_multistage[i].table_allocated = sizes[0][i]; offset += sizes[0][i]; - init_vlc(&svq1_intra_multistage[i], 3, 8, + vlc_init(&svq1_intra_multistage[i], 3, 8, &ff_svq1_intra_multistage_vlc[i][0][1], 2, 1, &ff_svq1_intra_multistage_vlc[i][0][0], 2, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); svq1_inter_multistage[i].table = &table[offset]; svq1_inter_multistage[i].table_allocated = sizes[1][i]; offset += sizes[1][i]; - init_vlc(&svq1_inter_multistage[i], 3, 8, + vlc_init(&svq1_inter_multistage[i], 3, 8, &ff_svq1_inter_multistage_vlc[i][0][1], 2, 1, &ff_svq1_inter_multistage_vlc[i][0][0], 2, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); } - INIT_VLC_STATIC(&svq1_intra_mean, 8, 256, + VLC_INIT_STATIC(&svq1_intra_mean, 8, 256, &ff_svq1_intra_mean_vlc[0][1], 4, 2, &ff_svq1_intra_mean_vlc[0][0], 4, 2, 632); - INIT_VLC_STATIC(&svq1_inter_mean, 9, 512, + VLC_INIT_STATIC(&svq1_inter_mean, 9, 512, &ff_svq1_inter_mean_vlc[0][1], 4, 2, &ff_svq1_inter_mean_vlc[0][0], 4, 2, 1434); } diff --git a/arm/android/third_party/ffmpeg/libavcodec/svq1enc.c b/arm/android/third_party/ffmpeg/libavcodec/svq1enc.c index 4651e01a..46a484e1 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/svq1enc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/svq1enc.c @@ -26,6 +26,7 @@ * http://www.pcisys.net/~melanson/codecs/ */ +#include "libavutil/emms.h" #include "avcodec.h" #include "codec_internal.h" #include "encode.h" @@ -118,7 +119,7 @@ static void svq1_write_header(SVQ1EncContext *s, PutBitContext *pb, int frame_ty /* output 5 unknown bits (2 + 2 + 1) */ put_bits(pb, 5, 2); /* 2 needed by quicktime decoder */ - i = ff_match_2uint16((void*)ff_svq1_frame_size_table, + i = ff_match_2uint16(ff_svq1_frame_size_table, FF_ARRAY_ELEMS(ff_svq1_frame_size_table), s->frame_width, s->frame_height); put_bits(pb, 3, i); diff --git a/arm/android/third_party/ffmpeg/libavcodec/tak.c b/arm/android/third_party/ffmpeg/libavcodec/tak.c index 99678e98..91feac54 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/tak.c +++ b/arm/android/third_party/ffmpeg/libavcodec/tak.c @@ -144,11 +144,11 @@ int avpriv_tak_parse_streaminfo(TAKStreamInfo *s, const uint8_t *buf, int size) return tak_parse_streaminfo(s, &gb); } -int ff_tak_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, +int ff_tak_decode_frame_header(void *logctx, GetBitContext *gb, TAKStreamInfo *ti, int log_level_offset) { if (get_bits(gb, TAK_FRAME_HEADER_SYNC_ID_BITS) != TAK_FRAME_HEADER_SYNC_ID) { - av_log(avctx, AV_LOG_ERROR + log_level_offset, "missing sync id\n"); + av_log(logctx, AV_LOG_ERROR + log_level_offset, "missing sync id\n"); return AVERROR_INVALIDDATA; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/tak.h b/arm/android/third_party/ffmpeg/libavcodec/tak.h index 5e43598d..1d1ee645 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/tak.h +++ b/arm/android/third_party/ffmpeg/libavcodec/tak.h @@ -29,7 +29,6 @@ #include -#include "avcodec.h" #include "get_bits.h" #define TAK_FORMAT_DATA_TYPE_BITS 3 @@ -151,13 +150,13 @@ int avpriv_tak_parse_streaminfo(TAKStreamInfo *s, const uint8_t *buf, int size); /** * Validate and decode a frame header. - * @param avctx AVCodecContext to use as av_log() context + * @param logctx for use as av_log() context * @param[in] gb GetBitContext from which to read frame header * @param[out] s frame information * @param log_level_offset log level offset, can be used to silence * error messages. * @return non-zero on error, 0 if OK */ -int ff_tak_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, +int ff_tak_decode_frame_header(void *logctx, GetBitContext *gb, TAKStreamInfo *s, int log_level_offset); #endif /* AVCODEC_TAK_H */ diff --git a/arm/android/third_party/ffmpeg/libavcodec/tests/.gitignore b/arm/android/third_party/ffmpeg/libavcodec/tests/.gitignore index 2acfc4e8..0df4ae10 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/tests/.gitignore +++ b/arm/android/third_party/ffmpeg/libavcodec/tests/.gitignore @@ -1,12 +1,12 @@ +/av1_levels /avcodec -/avfft /avpacket +/bitstream_be +/bitstream_le /cabac /celp_math /codec_desc /dct -/fft -/fft-fixed32 /golomb /h264_levels /h265_levels diff --git a/arm/android/third_party/ffmpeg/libavcodec/tests/av1_levels.c b/arm/android/third_party/ffmpeg/libavcodec/tests/av1_levels.c new file mode 100644 index 00000000..e862d197 --- /dev/null +++ b/arm/android/third_party/ffmpeg/libavcodec/tests/av1_levels.c @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2023 Intel Corporation + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include "libavutil/log.h" +#include "libavcodec/av1_levels.h" + +static const struct { + int width; + int height; + float framerate; + int level_idx; +} test_sizes[] = { + { 426, 240, 30.0, 0 }, + { 640, 360, 30.0, 1 }, + { 854, 480, 30.0, 4 }, + { 1280, 720, 30.0, 5 }, + { 1920, 1080, 30.0, 8 }, + { 1920, 1080, 60.0, 9 }, + { 3840, 2160, 30.0, 12 }, + { 3840, 2160, 60.0, 13 }, + { 3840, 2160, 120.0, 14 }, + { 7680, 4320, 30.0, 16 }, + { 7680, 4320, 60.0, 17 }, + { 7680, 4320, 120.0, 18 }, +}; + +static const struct { + int64_t bitrate; + int tier; + int level_idx; +} test_bitrate[] = { + { 1500000, 0, 0 }, + { 3000000, 0, 1 }, + { 6000000, 0, 4 }, + { 10000000, 0, 5 }, + { 12000000, 0, 8 }, + { 30000000, 1, 8 }, + { 20000000, 0, 9 }, + { 50000000, 1, 9 }, + { 30000000, 0, 12 }, + { 100000000, 1, 12 }, + { 40000000, 0, 13 }, + { 160000000, 1, 13 }, + { 60000000, 0, 14 }, + { 240000000, 1, 14 }, + { 100000000, 0, 17 }, + { 480000000, 1, 17 }, + { 160000000, 0, 18 }, + { 800000000, 1, 18 }, +}; + +static const struct { + int tiles; + int tile_cols; + int level_idx; +} test_tiles[] = { + { 8, 4, 0 }, + { 16, 6, 4 }, + { 32, 8, 8 }, + { 64, 8, 12 }, + { 128, 16, 16 }, +}; + +int main(void) +{ + const AV1LevelDescriptor *level; + int i; + +#define CHECK(expected, format, ...) do { \ + if (level ? (level->level_idx != expected) \ + : !level) { \ + av_log(NULL, AV_LOG_ERROR, "Incorrect level for " \ + format ": expected %d, got %d.\n", __VA_ARGS__, \ + expected, level ? level->level_idx : -1); \ + return 1; \ + } \ + } while (0) + + for (i = 0; i < FF_ARRAY_ELEMS(test_sizes); i++) { + level = ff_av1_guess_level(0, 0, + test_sizes[i].width, + test_sizes[i].height, + 0, 0, test_sizes[i].framerate); + CHECK(test_sizes[i].level_idx, "size %dx%d, framerate %f", + test_sizes[i].width, test_sizes[i].height, test_sizes[i].framerate); + } + + for (i = 0; i < FF_ARRAY_ELEMS(test_bitrate); i++) { + level = ff_av1_guess_level(test_bitrate[i].bitrate, + test_bitrate[i].tier, + 0, 0, 0, 0, 0); + CHECK(test_bitrate[i].level_idx, "bitrate %"PRId64" tier %d", + test_bitrate[i].bitrate, test_bitrate[i].tier); + } + + for (i = 0; i < FF_ARRAY_ELEMS(test_tiles); i++) { + level = ff_av1_guess_level(0, 0, 0, 0, + test_tiles[i].tiles, + test_tiles[i].tile_cols, + 0); + CHECK(test_tiles[i].level_idx, "tiles %d, tile cols %d", + test_tiles[i].tiles, + test_tiles[i].tile_cols); + } + + return 0; +} diff --git a/arm/android/third_party/ffmpeg/libavcodec/tests/codec_desc.c b/arm/android/third_party/ffmpeg/libavcodec/tests/codec_desc.c index c9b34973..bceb91a3 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/tests/codec_desc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/tests/codec_desc.c @@ -16,7 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "libavcodec/avcodec.h" +#include "libavcodec/codec_desc.h" int main(int argc, char **argv) { diff --git a/arm/android/third_party/ffmpeg/libavcodec/tests/dct.c b/arm/android/third_party/ffmpeg/libavcodec/tests/dct.c index c847af2f..010d0c1a 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/tests/dct.c +++ b/arm/android/third_party/ffmpeg/libavcodec/tests/dct.c @@ -37,12 +37,14 @@ #include "libavutil/cpu.h" #include "libavutil/common.h" +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "libavutil/lfg.h" #include "libavutil/mem_internal.h" #include "libavutil/time.h" #include "libavcodec/dct.h" +#include "libavcodec/fdctdsp.h" #include "libavcodec/idctdsp.h" #include "libavcodec/simple_idct.h" #include "libavcodec/xvididct.h" diff --git a/arm/android/third_party/ffmpeg/libavcodec/tests/h264_levels.c b/arm/android/third_party/ffmpeg/libavcodec/tests/h264_levels.c index 98febcc4..af3bfe01 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/tests/h264_levels.c +++ b/arm/android/third_party/ffmpeg/libavcodec/tests/h264_levels.c @@ -16,7 +16,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "libavutil/common.h" +#include +#include + +#include "libavutil/log.h" +#include "libavutil/macros.h" #include "libavcodec/h264_levels.h" static const struct { diff --git a/arm/android/third_party/ffmpeg/libavcodec/tests/motion.c b/arm/android/third_party/ffmpeg/libavcodec/tests/motion.c index ef6e1ff3..caa8ecb8 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/tests/motion.c +++ b/arm/android/third_party/ffmpeg/libavcodec/tests/motion.c @@ -30,6 +30,7 @@ #include "config.h" #include "libavcodec/me_cmp.h" #include "libavutil/cpu.h" +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "libavutil/lfg.h" #include "libavutil/mem.h" diff --git a/arm/android/third_party/ffmpeg/libavcodec/thread.h b/arm/android/third_party/ffmpeg/libavcodec/thread.h index 88a14cfe..4edcfc31 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/thread.h +++ b/arm/android/third_party/ffmpeg/libavcodec/thread.h @@ -52,6 +52,8 @@ void ff_thread_flush(AVCodecContext *avctx); int ff_thread_decode_frame(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, AVPacket *avpkt); +int ff_thread_can_start_frame(AVCodecContext *avctx); + /** * If the codec defines update_thread_context(), call this * when they are ready for the next thread to start decoding @@ -62,8 +64,6 @@ int ff_thread_decode_frame(AVCodecContext *avctx, AVFrame *picture, */ void ff_thread_finish_setup(AVCodecContext *avctx); -#define ff_thread_get_format ff_get_format - /** * Wrapper around get_buffer() for frame-multithreaded codecs. * Call this function instead of ff_get_buffer(f). @@ -75,12 +75,7 @@ void ff_thread_finish_setup(AVCodecContext *avctx); int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f, int flags); /** - * Wrapper around release_buffer() frame-for multithreaded codecs. - * Call this function instead of avctx->release_buffer(f). - * The AVFrame will be copied and the actual release_buffer() call - * will be performed later. The contents of data pointed to by the - * AVFrame should not be changed until ff_thread_get_buffer() is called - * on it. + * Wrapper around av_frame_unref() for frame-threaded codecs. * * @param avctx The current context. * @param f The picture being released. diff --git a/arm/android/third_party/ffmpeg/libavcodec/threadframe.h b/arm/android/third_party/ffmpeg/libavcodec/threadframe.h index d581c408..a8403c89 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/threadframe.h +++ b/arm/android/third_party/ffmpeg/libavcodec/threadframe.h @@ -87,6 +87,4 @@ int ff_thread_ref_frame(ThreadFrame *dst, const ThreadFrame *src); int ff_thread_replace_frame(AVCodecContext *avctx, ThreadFrame *dst, const ThreadFrame *src); -int ff_thread_can_start_frame(AVCodecContext *avctx); - #endif diff --git a/arm/android/third_party/ffmpeg/libavcodec/tiff.c b/arm/android/third_party/ffmpeg/libavcodec/tiff.c index 14896459..adb49e45 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/tiff.c +++ b/arm/android/third_party/ffmpeg/libavcodec/tiff.c @@ -337,7 +337,7 @@ static void av_always_inline dng_blit(TiffContext *s, uint8_t *dst, int dst_stri (split vertically in the middle). */ for (line = 0; line < height / 2; line++) { uint16_t *dst_u16 = (uint16_t *)dst; - uint16_t *src_u16 = (uint16_t *)src; + const uint16_t *src_u16 = (const uint16_t *)src; /* Blit first half of input row row to initial row of output */ for (col = 0; col < width; col++) @@ -360,7 +360,7 @@ static void av_always_inline dng_blit(TiffContext *s, uint8_t *dst, int dst_stri if (is_u16) { for (line = 0; line < height; line++) { uint16_t *dst_u16 = (uint16_t *)dst; - uint16_t *src_u16 = (uint16_t *)src; + const uint16_t *src_u16 = (const uint16_t *)src; for (col = 0; col < width; col++) *dst_u16++ = dng_process_color16(*src_u16++, s->dng_lut, @@ -570,7 +570,7 @@ static int tiff_uncompress_lzma(uint8_t *dst, uint64_t *len, const uint8_t *src, lzma_stream stream = LZMA_STREAM_INIT; lzma_ret ret; - stream.next_in = (uint8_t *)src; + stream.next_in = src; stream.avail_in = size; stream.next_out = dst; stream.avail_out = *len; diff --git a/arm/android/third_party/ffmpeg/libavcodec/trace_headers_bsf.c b/arm/android/third_party/ffmpeg/libavcodec/trace_headers_bsf.c index 028b0a1e..8781f5f1 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/trace_headers_bsf.c +++ b/arm/android/third_party/ffmpeg/libavcodec/trace_headers_bsf.c @@ -44,6 +44,8 @@ static int trace_headers_init(AVBSFContext *bsf) ctx->cbc->trace_enable = 1; ctx->cbc->trace_level = AV_LOG_INFO; + ctx->cbc->trace_context = ctx->cbc; + ctx->cbc->trace_read_callback = ff_cbs_trace_read_log; if (bsf->par_in->extradata) { CodedBitstreamFragment *frag = &ctx->fragment; diff --git a/arm/android/third_party/ffmpeg/libavcodec/truemotion2.c b/arm/android/third_party/ffmpeg/libavcodec/truemotion2.c index 73c93359..366d8aef 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/truemotion2.c +++ b/arm/android/third_party/ffmpeg/libavcodec/truemotion2.c @@ -198,7 +198,7 @@ static int tm2_build_huff_table(TM2Context *ctx, TM2Codes *code) /* convert codes to vlc_table */ if (res >= 0) { - res = ff_init_vlc_from_lengths(&code->vlc, huff.max_bits, huff.max_num, + res = ff_vlc_init_from_lengths(&code->vlc, huff.max_bits, huff.max_num, huff.lens, sizeof(huff.lens[0]), NULL, 0, 0, 0, 0, ctx->avctx); if (res < 0) @@ -222,8 +222,7 @@ out: static void tm2_free_codes(TM2Codes *code) { av_free(code->recode); - if (code->vlc.table) - ff_free_vlc(&code->vlc); + ff_vlc_free(&code->vlc); } static inline int tm2_get_token(GetBitContext *gb, TM2Codes *code) diff --git a/arm/android/third_party/ffmpeg/libavcodec/tscc2.c b/arm/android/third_party/ffmpeg/libavcodec/tscc2.c index 6e4fe503..168efe93 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/tscc2.c +++ b/arm/android/third_party/ffmpeg/libavcodec/tscc2.c @@ -61,9 +61,9 @@ static av_cold void tscc2_init_vlc(VLC *vlc, int *offset, int nb_codes, vlc->table = &vlc_buf[*offset]; vlc->table_allocated = FF_ARRAY_ELEMS(vlc_buf) - *offset; - ff_init_vlc_from_lengths(vlc, TSCC2_VLC_BITS, nb_codes, + ff_vlc_init_from_lengths(vlc, TSCC2_VLC_BITS, nb_codes, lens, 1, syms, sym_length, sym_length, 0, - INIT_VLC_STATIC_OVERLONG | INIT_VLC_OUTPUT_LE, NULL); + VLC_INIT_STATIC_OVERLONG | VLC_INIT_OUTPUT_LE, NULL); *offset += vlc->table_size; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/tta.c b/arm/android/third_party/ffmpeg/libavcodec/tta.c index 3e89571f..7763ed7f 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/tta.c +++ b/arm/android/third_party/ffmpeg/libavcodec/tta.c @@ -211,7 +211,7 @@ static av_cold int tta_decode_init(AVCodecContext * avctx) av_log(avctx, AV_LOG_DEBUG, "data_length: %d frame_length: %d last: %d total: %d\n", s->data_length, s->frame_length, s->last_frame_length, total_frames); - if(s->frame_length >= UINT_MAX / (s->channels * sizeof(int32_t))){ + if (s->frame_length >= UINT_MAX / (s->channels * sizeof(int32_t))) { av_log(avctx, AV_LOG_ERROR, "frame_length too large\n"); return AVERROR_INVALIDDATA; } @@ -306,14 +306,14 @@ static int tta_decode_frame(AVCodecContext *avctx, AVFrame *frame, rice->sum1 += value - (rice->sum1 >> 4); if (rice->k1 > 0 && rice->sum1 < ff_tta_shift_16[rice->k1]) rice->k1--; - else if(rice->sum1 > ff_tta_shift_16[rice->k1 + 1]) + else if (rice->sum1 > ff_tta_shift_16[rice->k1 + 1]) rice->k1++; value += ff_tta_shift_1[rice->k0]; default: rice->sum0 += value - (rice->sum0 >> 4); if (rice->k0 > 0 && rice->sum0 < ff_tta_shift_16[rice->k0]) rice->k0--; - else if(rice->sum0 > ff_tta_shift_16[rice->k0 + 1]) + else if (rice->sum0 > ff_tta_shift_16[rice->k0 + 1]) rice->k0++; } @@ -342,7 +342,7 @@ static int tta_decode_frame(AVCodecContext *avctx, AVFrame *frame, if (s->channels > 1) { int32_t *r = p - 1; for (*p += *r / 2; r > (int32_t*)p - s->channels; r--) - *r = *(r + 1) - *r; + *r = *(r + 1) - (unsigned)*r; } cur_chan = 0; i++; @@ -399,7 +399,8 @@ error: return ret; } -static av_cold int tta_decode_close(AVCodecContext *avctx) { +static av_cold int tta_decode_close(AVCodecContext *avctx) +{ TTAContext *s = avctx->priv_data; if (s->bps < 3) diff --git a/arm/android/third_party/ffmpeg/libavcodec/ttadata.c b/arm/android/third_party/ffmpeg/libavcodec/ttadata.c index 297d7094..2137a230 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/ttadata.c +++ b/arm/android/third_party/ffmpeg/libavcodec/ttadata.c @@ -47,7 +47,8 @@ void ff_tta_rice_init(TTARice *c, uint32_t k0, uint32_t k1) c->sum1 = ff_tta_shift_16[k1]; } -void ff_tta_filter_init(TTAFilter *c, int32_t shift) { +void ff_tta_filter_init(TTAFilter *c, int32_t shift) +{ memset(c, 0, sizeof(TTAFilter)); c->shift = shift; c->round = ff_tta_shift_1[shift-1]; diff --git a/arm/android/third_party/ffmpeg/libavcodec/ttadsp.c b/arm/android/third_party/ffmpeg/libavcodec/ttadsp.c index fe9e3c69..5dda1958 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/ttadsp.c +++ b/arm/android/third_party/ffmpeg/libavcodec/ttadsp.c @@ -22,7 +22,8 @@ static void tta_filter_process_c(int32_t *qmi, int32_t *dx, int32_t *dl, int32_t *error, int32_t *in, int32_t shift, - int32_t round) { + int32_t round) +{ uint32_t *qm = qmi; if (*error < 0) { diff --git a/arm/android/third_party/ffmpeg/libavcodec/ttmlenc.c b/arm/android/third_party/ffmpeg/libavcodec/ttmlenc.c index fb05c389..6a2ab23c 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/ttmlenc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/ttmlenc.c @@ -45,7 +45,7 @@ typedef struct { static void ttml_text_cb(void *priv, const char *text, int len) { TTMLContext *s = priv; - AVBPrint cur_line = { 0 }; + AVBPrint cur_line; AVBPrint *buffer = &s->buffer; av_bprint_init(&cur_line, len, AV_BPRINT_SIZE_UNLIMITED); diff --git a/arm/android/third_party/ffmpeg/libavcodec/utils.c b/arm/android/third_party/ffmpeg/libavcodec/utils.c index 672eb15d..8807a8c2 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/utils.c +++ b/arm/android/third_party/ffmpeg/libavcodec/utils.c @@ -35,7 +35,9 @@ #include "libavutil/pixfmt.h" #include "avcodec.h" #include "codec.h" +#include "codec_desc.h" #include "codec_internal.h" +#include "codec_par.h" #include "decode.h" #include "hwconfig.h" #include "thread.h" @@ -406,34 +408,6 @@ int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels, return ret; } -void ff_color_frame(AVFrame *frame, const int c[4]) -{ - const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format); - int p, y; - - av_assert0(desc->flags & AV_PIX_FMT_FLAG_PLANAR); - - for (p = 0; pnb_components; p++) { - uint8_t *dst = frame->data[p]; - int is_chroma = p == 1 || p == 2; - int bytes = is_chroma ? AV_CEIL_RSHIFT(frame->width, desc->log2_chroma_w) : frame->width; - int height = is_chroma ? AV_CEIL_RSHIFT(frame->height, desc->log2_chroma_h) : frame->height; - if (desc->comp[0].depth >= 9) { - ((uint16_t*)dst)[0] = c[p]; - av_memcpy_backptr(dst + 2, 2, bytes - 2); - dst += frame->linesize[p]; - for (y = 1; y < height; y++) { - memcpy(dst, frame->data[p], 2*bytes); - dst += frame->linesize[p]; - } - } else { - for (y = 0; y < height; y++) { - memset(dst, c[p], bytes); - dst += frame->linesize[p]; - } - } - } -} int avpriv_codec_get_cap_skip_frame_fill_param(const AVCodec *codec){ return !!(ffcodec(codec)->caps_internal & FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM); @@ -462,10 +436,10 @@ const char *avcodec_get_name(enum AVCodecID id) const char *av_get_profile_name(const AVCodec *codec, int profile) { const AVProfile *p; - if (profile == FF_PROFILE_UNKNOWN || !codec->profiles) + if (profile == AV_PROFILE_UNKNOWN || !codec->profiles) return NULL; - for (p = codec->profiles; p->profile != FF_PROFILE_UNKNOWN; p++) + for (p = codec->profiles; p->profile != AV_PROFILE_UNKNOWN; p++) if (p->profile == profile) return p->name; @@ -477,10 +451,10 @@ const char *avcodec_profile_name(enum AVCodecID codec_id, int profile) const AVCodecDescriptor *desc = avcodec_descriptor_get(codec_id); const AVProfile *p; - if (profile == FF_PROFILE_UNKNOWN || !desc || !desc->profiles) + if (profile == AV_PROFILE_UNKNOWN || !desc || !desc->profiles) return NULL; - for (p = desc->profiles; p->profile != FF_PROFILE_UNKNOWN; p++) + for (p = desc->profiles; p->profile != AV_PROFILE_UNKNOWN; p++) if (p->profile == profile) return p->name; @@ -1046,37 +1020,6 @@ AVCPBProperties *av_cpb_properties_alloc(size_t *size) return props; } -AVCPBProperties *ff_add_cpb_side_data(AVCodecContext *avctx) -{ - AVPacketSideData *tmp; - AVCPBProperties *props; - size_t size; - int i; - - for (i = 0; i < avctx->nb_coded_side_data; i++) - if (avctx->coded_side_data[i].type == AV_PKT_DATA_CPB_PROPERTIES) - return (AVCPBProperties *)avctx->coded_side_data[i].data; - - props = av_cpb_properties_alloc(&size); - if (!props) - return NULL; - - tmp = av_realloc_array(avctx->coded_side_data, avctx->nb_coded_side_data + 1, sizeof(*tmp)); - if (!tmp) { - av_freep(&props); - return NULL; - } - - avctx->coded_side_data = tmp; - avctx->nb_coded_side_data++; - - avctx->coded_side_data[avctx->nb_coded_side_data - 1].type = AV_PKT_DATA_CPB_PROPERTIES; - avctx->coded_side_data[avctx->nb_coded_side_data - 1].data = (uint8_t*)props; - avctx->coded_side_data[avctx->nb_coded_side_data - 1].size = size; - - return props; -} - static unsigned bcd2uint(uint8_t bcd) { unsigned low = bcd & 0xf; @@ -1170,22 +1113,3 @@ int64_t ff_guess_coded_bitrate(AVCodecContext *avctx) return bitrate; } - -int ff_int_from_list_or_default(void *ctx, const char * val_name, int val, - const int * array_valid_values, int default_value) -{ - int i = 0, ref_val; - - while (1) { - ref_val = array_valid_values[i]; - if (ref_val == INT_MAX) - break; - if (val == ref_val) - return val; - i++; - } - /* val is not a valid value */ - av_log(ctx, AV_LOG_DEBUG, - "%s %d are not supported. Set to default value : %d\n", val_name, val, default_value); - return default_value; -} diff --git a/arm/android/third_party/ffmpeg/libavcodec/utvideo.h b/arm/android/third_party/ffmpeg/libavcodec/utvideo.h index 9da9329f..b081b50a 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/utvideo.h +++ b/arm/android/third_party/ffmpeg/libavcodec/utvideo.h @@ -27,12 +27,7 @@ * Common Ut Video header */ -#include "libavutil/common.h" -#include "avcodec.h" -#include "bswapdsp.h" -#include "utvideodsp.h" -#include "lossless_videodsp.h" -#include "lossless_videoencdsp.h" +#include "libavutil/macros.h" enum { PRED_NONE = 0, @@ -61,31 +56,4 @@ enum { UTVIDEO_444 = MKTAG('Y', 'V', '2', '4'), }; -typedef struct UtvideoContext { - const AVClass *class; - AVCodecContext *avctx; - UTVideoDSPContext utdsp; - BswapDSPContext bdsp; - LLVidDSPContext llviddsp; - LLVidEncDSPContext llvidencdsp; - - uint32_t frame_info_size, flags, frame_info, offset; - int planes; - int slices; - int compression; - int interlaced; - int frame_pred; - int pro; - int pack; - - ptrdiff_t slice_stride; - uint8_t *slice_bits, *slice_buffer[4]; - int slice_bits_size; - - const uint8_t *packed_stream[4][256]; - size_t packed_stream_size[4][256]; - const uint8_t *control_stream[4][256]; - size_t control_stream_size[4][256]; -} UtvideoContext; - #endif /* AVCODEC_UTVIDEO_H */ diff --git a/arm/android/third_party/ffmpeg/libavcodec/utvideodec.c b/arm/android/third_party/ffmpeg/libavcodec/utvideodec.c index 66c84352..8a815f55 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/utvideodec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/utvideodec.c @@ -37,8 +37,35 @@ #include "bytestream.h" #include "codec_internal.h" #include "get_bits.h" +#include "lossless_videodsp.h" #include "thread.h" #include "utvideo.h" +#include "utvideodsp.h" + +typedef struct UtvideoContext { + AVCodecContext *avctx; + UTVideoDSPContext utdsp; + BswapDSPContext bdsp; + LLVidDSPContext llviddsp; + + uint32_t frame_info_size, flags, frame_info, offset; + int planes; + int slices; + int compression; + int interlaced; + int frame_pred; + int pro; + int pack; + + uint8_t *slice_bits; + int slice_bits_size; + void *buffer; + + const uint8_t *packed_stream[4][256]; + size_t packed_stream_size[4][256]; + const uint8_t *control_stream[4][256]; + size_t control_stream_size[4][256]; +} UtvideoContext; typedef struct HuffEntry { uint8_t len; @@ -46,7 +73,7 @@ typedef struct HuffEntry { } HuffEntry; static int build_huff(UtvideoContext *c, const uint8_t *src, VLC *vlc, - int *fsym, unsigned nb_elems) + VLC_MULTI *multi, int *fsym, unsigned nb_elems) { int i; HuffEntry he[1024]; @@ -82,11 +109,35 @@ static int build_huff(UtvideoContext *c, const uint8_t *src, VLC *vlc, he[--codes_count[bits[i]]] = (HuffEntry) { bits[i], i }; #define VLC_BITS 11 - return ff_init_vlc_from_lengths(vlc, VLC_BITS, codes_count[0], + return ff_vlc_init_multi_from_lengths(vlc, multi, VLC_BITS, nb_elems, codes_count[0], &he[0].len, sizeof(*he), &he[0].sym, sizeof(*he), 2, 0, 0, c->avctx); } +#define READ_PLANE(b, end) \ +{ \ + buf = !use_pred ? dest : c->buffer; \ + i = 0; \ + for (; CACHED_BITSTREAM_READER && i < width-end && get_bits_left(&gb) > 0;) {\ + ret = get_vlc_multi(&gb, (uint8_t *)buf + i * b, multi.table, \ + vlc.table, VLC_BITS, 3); \ + if (ret > 0) \ + i += ret; \ + if (ret <= 0) \ + goto fail; \ + } \ + for (; i < width && get_bits_left(&gb) > 0; i++) \ + buf[i] = get_vlc2(&gb, vlc.table, VLC_BITS, 3); \ + if (use_pred) { \ + if (b == 2) \ + c->llviddsp.add_left_pred_int16((uint16_t *)dest, (const uint16_t *)buf, 0x3ff, width, prev); \ + else \ + c->llviddsp.add_left_pred((uint8_t *)dest, (const uint8_t *)buf, width, prev); \ + } \ + prev = dest[width-1]; \ + dest += stride; \ +} + static int decode_plane10(UtvideoContext *c, int plane_no, uint16_t *dst, ptrdiff_t stride, int width, int height, @@ -95,11 +146,12 @@ static int decode_plane10(UtvideoContext *c, int plane_no, { int i, j, slice, pix, ret; int sstart, send; + VLC_MULTI multi; VLC vlc; GetBitContext gb; int prev, fsym; - if ((ret = build_huff(c, huff, &vlc, &fsym, 1024)) < 0) { + if ((ret = build_huff(c, huff, &vlc, &multi, &fsym, 1024)) < 0) { av_log(c->avctx, AV_LOG_ERROR, "Cannot build Huffman codes\n"); return ret; } @@ -131,7 +183,7 @@ static int decode_plane10(UtvideoContext *c, int plane_no, send = 0; for (slice = 0; slice < c->slices; slice++) { - uint16_t *dest; + uint16_t *dest, *buf; int slice_data_start, slice_data_end, slice_size; sstart = send; @@ -156,37 +208,20 @@ static int decode_plane10(UtvideoContext *c, int plane_no, init_get_bits(&gb, c->slice_bits, slice_size * 8); prev = 0x200; - for (j = sstart; j < send; j++) { - for (i = 0; i < width; i++) { - pix = get_vlc2(&gb, vlc.table, VLC_BITS, 3); - if (pix < 0) { - av_log(c->avctx, AV_LOG_ERROR, "Decoding error\n"); - goto fail; - } - if (use_pred) { - prev += pix; - prev &= 0x3FF; - pix = prev; - } - dest[i] = pix; - } - dest += stride; - if (get_bits_left(&gb) < 0) { - av_log(c->avctx, AV_LOG_ERROR, - "Slice decoding ran out of bits\n"); - goto fail; - } - } + for (j = sstart; j < send; j++) + READ_PLANE(2, 3) if (get_bits_left(&gb) > 32) av_log(c->avctx, AV_LOG_WARNING, "%d bits left after decoding slice\n", get_bits_left(&gb)); } - ff_free_vlc(&vlc); + ff_vlc_free(&vlc); + ff_vlc_free_multi(&multi); return 0; fail: - ff_free_vlc(&vlc); + ff_vlc_free(&vlc); + ff_vlc_free_multi(&multi); return AVERROR_INVALIDDATA; } @@ -207,6 +242,7 @@ static int decode_plane(UtvideoContext *c, int plane_no, { int i, j, slice, pix; int sstart, send; + VLC_MULTI multi; VLC vlc; GetBitContext gb; int ret, prev, fsym; @@ -259,7 +295,7 @@ static int decode_plane(UtvideoContext *c, int plane_no, return 0; } - if (build_huff(c, src, &vlc, &fsym, 256)) { + if (build_huff(c, src, &vlc, &multi, &fsym, 256)) { av_log(c->avctx, AV_LOG_ERROR, "Cannot build Huffman codes\n"); return AVERROR_INVALIDDATA; } @@ -292,7 +328,7 @@ static int decode_plane(UtvideoContext *c, int plane_no, send = 0; for (slice = 0; slice < c->slices; slice++) { - uint8_t *dest; + uint8_t *dest, *buf; int slice_data_start, slice_data_end, slice_size; sstart = send; @@ -317,36 +353,20 @@ static int decode_plane(UtvideoContext *c, int plane_no, init_get_bits(&gb, c->slice_bits, slice_size * 8); prev = 0x80; - for (j = sstart; j < send; j++) { - for (i = 0; i < width; i++) { - pix = get_vlc2(&gb, vlc.table, VLC_BITS, 3); - if (pix < 0) { - av_log(c->avctx, AV_LOG_ERROR, "Decoding error\n"); - goto fail; - } - if (use_pred) { - prev += pix; - pix = prev; - } - dest[i] = pix; - } - if (get_bits_left(&gb) < 0) { - av_log(c->avctx, AV_LOG_ERROR, - "Slice decoding ran out of bits\n"); - goto fail; - } - dest += stride; - } + for (j = sstart; j < send; j++) + READ_PLANE(1, 5) if (get_bits_left(&gb) > 32) av_log(c->avctx, AV_LOG_WARNING, "%d bits left after decoding slice\n", get_bits_left(&gb)); } - ff_free_vlc(&vlc); + ff_vlc_free(&vlc); + ff_vlc_free_multi(&multi); return 0; fail: - ff_free_vlc(&vlc); + ff_vlc_free(&vlc); + ff_vlc_free_multi(&multi); return AVERROR_INVALIDDATA; } @@ -1039,6 +1059,10 @@ static av_cold int decode_init(AVCodecContext *avctx) return AVERROR_INVALIDDATA; } + c->buffer = av_calloc(avctx->width + 8, c->pro?2:1); + if (!c->buffer) + return AVERROR(ENOMEM); + return 0; } @@ -1047,6 +1071,7 @@ static av_cold int decode_end(AVCodecContext *avctx) UtvideoContext * const c = avctx->priv_data; av_freep(&c->slice_bits); + av_freep(&c->buffer); return 0; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/utvideoenc.c b/arm/android/third_party/ffmpeg/libavcodec/utvideoenc.c index 6e87bbc2..1fcb6854 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/utvideoenc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/utvideoenc.c @@ -33,11 +33,28 @@ #include "encode.h" #include "bswapdsp.h" #include "bytestream.h" +#include "lossless_videoencdsp.h" #include "put_bits.h" #include "mathops.h" #include "utvideo.h" #include "huffman.h" +typedef struct UtvideoContext { + const AVClass *class; + BswapDSPContext bdsp; + LLVidEncDSPContext llvidencdsp; + + uint32_t frame_info_size, flags; + int planes; + int slices; + int compression; + int frame_pred; + + ptrdiff_t slice_stride; + uint8_t *slice_bits, *slice_buffer[4]; + int slice_bits_size; +} UtvideoContext; + typedef struct HuffEntry { uint16_t sym; uint8_t len; @@ -76,7 +93,6 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx) int i, subsampled_height; uint32_t original_format; - c->avctx = avctx; c->frame_info_size = 4; c->slice_stride = FFALIGN(avctx->width, 32); diff --git a/arm/android/third_party/ffmpeg/libavcodec/v210dec.c b/arm/android/third_party/ffmpeg/libavcodec/v210dec.c index 814d65bb..d80fb4e7 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/v210dec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/v210dec.c @@ -33,7 +33,7 @@ typedef struct ThreadData { AVFrame *frame; - uint8_t *buf; + const uint8_t *buf; int stride; } ThreadData; @@ -111,7 +111,7 @@ static int v210_decode_slice(AVCodecContext *avctx, void *arg, int jobnr, int th int stride = td->stride; int slice_start = (avctx->height * jobnr) / s->thread_count; int slice_end = (avctx->height * (jobnr+1)) / s->thread_count; - uint8_t *psrc = td->buf + stride * slice_start; + const uint8_t *psrc = td->buf + stride * slice_start; int16_t *py = (uint16_t*)frame->data[0] + slice_start * frame->linesize[0] / 2; int16_t *pu = (uint16_t*)frame->data[1] + slice_start * frame->linesize[1] / 2; int16_t *pv = (uint16_t*)frame->data[2] + slice_start * frame->linesize[2] / 2; @@ -191,7 +191,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *pic, if (stride) { td.stride = stride; - td.buf = (uint8_t*)psrc; + td.buf = psrc; td.frame = pic; avctx->execute2(avctx, v210_decode_slice, &td, NULL, s->thread_count); } else { @@ -201,7 +201,8 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *pic, if (ret < 0) return ret; decode_row((const uint32_t *)psrc, (uint16_t *)pointers[0], (uint16_t *)pointers[1], (uint16_t *)pointers[2], avctx->width * avctx->height, s->unpack_frame); - av_image_copy(pic->data, pic->linesize, (const uint8_t **)pointers, linesizes, avctx->pix_fmt, avctx->width, avctx->height); + av_image_copy2(pic->data, pic->linesize, pointers, linesizes, + avctx->pix_fmt, avctx->width, avctx->height); av_freep(&pointers[0]); } diff --git a/arm/android/third_party/ffmpeg/libavcodec/v4l2_context.c b/arm/android/third_party/ffmpeg/libavcodec/v4l2_context.c index a40be946..f20f713e 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/v4l2_context.c +++ b/arm/android/third_party/ffmpeg/libavcodec/v4l2_context.c @@ -325,9 +325,13 @@ start: /* 0. handle errors */ if (pfd.revents & POLLERR) { - /* if we are trying to get free buffers but none have been queued yet - no need to raise a warning */ + /* if we are trying to get free buffers but none have been queued yet, + * or if no buffers have been allocated yet, no need to raise a warning + */ if (timeout == 0) { + if (!ctx->buffers) + return NULL; + for (i = 0; i < ctx->num_buffers; i++) { if (ctx->buffers[i].status != V4L2BUF_AVAILABLE) av_log(logger(ctx), AV_LOG_WARNING, "%s POLLERR\n", ctx->name); diff --git a/arm/android/third_party/ffmpeg/libavcodec/v4l2_m2m_enc.c b/arm/android/third_party/ffmpeg/libavcodec/v4l2_m2m_enc.c index 9a0837ec..e08db5d5 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/v4l2_m2m_enc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/v4l2_m2m_enc.c @@ -103,17 +103,17 @@ static inline unsigned int v4l2_h264_profile_from_ff(int p) unsigned int ffmpeg_val; unsigned int v4l2_val; } profile[] = { - { FF_PROFILE_H264_CONSTRAINED_BASELINE, MPEG_VIDEO(H264_PROFILE_CONSTRAINED_BASELINE) }, - { FF_PROFILE_H264_HIGH_444_PREDICTIVE, MPEG_VIDEO(H264_PROFILE_HIGH_444_PREDICTIVE) }, - { FF_PROFILE_H264_HIGH_422_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_422_INTRA) }, - { FF_PROFILE_H264_HIGH_444_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_444_INTRA) }, - { FF_PROFILE_H264_HIGH_10_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_10_INTRA) }, - { FF_PROFILE_H264_HIGH_422, MPEG_VIDEO(H264_PROFILE_HIGH_422) }, - { FF_PROFILE_H264_BASELINE, MPEG_VIDEO(H264_PROFILE_BASELINE) }, - { FF_PROFILE_H264_EXTENDED, MPEG_VIDEO(H264_PROFILE_EXTENDED) }, - { FF_PROFILE_H264_HIGH_10, MPEG_VIDEO(H264_PROFILE_HIGH_10) }, - { FF_PROFILE_H264_MAIN, MPEG_VIDEO(H264_PROFILE_MAIN) }, - { FF_PROFILE_H264_HIGH, MPEG_VIDEO(H264_PROFILE_HIGH) }, + { AV_PROFILE_H264_CONSTRAINED_BASELINE, MPEG_VIDEO(H264_PROFILE_CONSTRAINED_BASELINE) }, + { AV_PROFILE_H264_HIGH_444_PREDICTIVE, MPEG_VIDEO(H264_PROFILE_HIGH_444_PREDICTIVE) }, + { AV_PROFILE_H264_HIGH_422_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_422_INTRA) }, + { AV_PROFILE_H264_HIGH_444_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_444_INTRA) }, + { AV_PROFILE_H264_HIGH_10_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_10_INTRA) }, + { AV_PROFILE_H264_HIGH_422, MPEG_VIDEO(H264_PROFILE_HIGH_422) }, + { AV_PROFILE_H264_BASELINE, MPEG_VIDEO(H264_PROFILE_BASELINE) }, + { AV_PROFILE_H264_EXTENDED, MPEG_VIDEO(H264_PROFILE_EXTENDED) }, + { AV_PROFILE_H264_HIGH_10, MPEG_VIDEO(H264_PROFILE_HIGH_10) }, + { AV_PROFILE_H264_MAIN, MPEG_VIDEO(H264_PROFILE_MAIN) }, + { AV_PROFILE_H264_HIGH, MPEG_VIDEO(H264_PROFILE_HIGH) }, }; int i; @@ -130,11 +130,11 @@ static inline int v4l2_mpeg4_profile_from_ff(int p) unsigned int ffmpeg_val; unsigned int v4l2_val; } profile[] = { - { FF_PROFILE_MPEG4_ADVANCED_CODING, MPEG_VIDEO(MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY) }, - { FF_PROFILE_MPEG4_ADVANCED_SIMPLE, MPEG_VIDEO(MPEG4_PROFILE_ADVANCED_SIMPLE) }, - { FF_PROFILE_MPEG4_SIMPLE_SCALABLE, MPEG_VIDEO(MPEG4_PROFILE_SIMPLE_SCALABLE) }, - { FF_PROFILE_MPEG4_SIMPLE, MPEG_VIDEO(MPEG4_PROFILE_SIMPLE) }, - { FF_PROFILE_MPEG4_CORE, MPEG_VIDEO(MPEG4_PROFILE_CORE) }, + { AV_PROFILE_MPEG4_ADVANCED_CODING, MPEG_VIDEO(MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY) }, + { AV_PROFILE_MPEG4_ADVANCED_SIMPLE, MPEG_VIDEO(MPEG4_PROFILE_ADVANCED_SIMPLE) }, + { AV_PROFILE_MPEG4_SIMPLE_SCALABLE, MPEG_VIDEO(MPEG4_PROFILE_SIMPLE_SCALABLE) }, + { AV_PROFILE_MPEG4_SIMPLE, MPEG_VIDEO(MPEG4_PROFILE_SIMPLE) }, + { AV_PROFILE_MPEG4_CORE, MPEG_VIDEO(MPEG4_PROFILE_CORE) }, }; int i; @@ -206,7 +206,7 @@ static int v4l2_prepare_encoder(V4L2m2mContext *s) switch (avctx->codec_id) { case AV_CODEC_ID_H264: - if (avctx->profile != FF_PROFILE_UNKNOWN) { + if (avctx->profile != AV_PROFILE_UNKNOWN) { val = v4l2_h264_profile_from_ff(avctx->profile); if (val < 0) av_log(avctx, AV_LOG_WARNING, "h264 profile not found\n"); @@ -219,7 +219,7 @@ static int v4l2_prepare_encoder(V4L2m2mContext *s) qmax = 51; break; case AV_CODEC_ID_MPEG4: - if (avctx->profile != FF_PROFILE_UNKNOWN) { + if (avctx->profile != AV_PROFILE_UNKNOWN) { val = v4l2_mpeg4_profile_from_ff(avctx->profile); if (val < 0) av_log(avctx, AV_LOG_WARNING, "mpeg4 profile not found\n"); diff --git a/arm/android/third_party/ffmpeg/libavcodec/vaapi_av1.c b/arm/android/third_party/ffmpeg/libavcodec/vaapi_av1.c index d0339b27..85b50843 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vaapi_av1.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vaapi_av1.c @@ -19,8 +19,7 @@ */ #include "libavutil/frame.h" -#include "libavutil/pixdesc.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "vaapi_decode.h" #include "internal.h" #include "av1dec.h" @@ -434,11 +433,11 @@ static int vaapi_av1_decode_slice(AVCodecContext *avctx, return 0; } -const AVHWAccel ff_av1_vaapi_hwaccel = { - .name = "av1_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AV1, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_av1_vaapi_hwaccel = { + .p.name = "av1_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = vaapi_av1_start_frame, .end_frame = vaapi_av1_end_frame, .decode_slice = vaapi_av1_decode_slice, diff --git a/arm/android/third_party/ffmpeg/libavcodec/vaapi_decode.c b/arm/android/third_party/ffmpeg/libavcodec/vaapi_decode.c index dd55cbd6..ceac769c 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vaapi_decode.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vaapi_decode.c @@ -23,6 +23,7 @@ #include "libavutil/pixdesc.h" #include "avcodec.h" +#include "codec_desc.h" #include "decode.h" #include "internal.h" #include "vaapi_decode.h" @@ -390,7 +391,7 @@ static const struct { VAProfile va_profile; VAProfile (*profile_parser)(AVCodecContext *avctx); } vaapi_profile_map[] = { -#define MAP(c, p, v, ...) { AV_CODEC_ID_ ## c, FF_PROFILE_ ## p, VAProfile ## v, __VA_ARGS__ } +#define MAP(c, p, v, ...) { AV_CODEC_ID_ ## c, AV_PROFILE_ ## p, VAProfile ## v, __VA_ARGS__ } MAP(MPEG2VIDEO, MPEG2_SIMPLE, MPEG2Simple ), MAP(MPEG2VIDEO, MPEG2_MAIN, MPEG2Main ), MAP(H263, UNKNOWN, H263Baseline), @@ -497,7 +498,7 @@ static int vaapi_decode_make_config(AVCodecContext *avctx, if (avctx->codec_id != vaapi_profile_map[i].codec_id) continue; if (avctx->profile == vaapi_profile_map[i].codec_profile || - vaapi_profile_map[i].codec_profile == FF_PROFILE_UNKNOWN) + vaapi_profile_map[i].codec_profile == AV_PROFILE_UNKNOWN) profile_match = 1; va_profile = vaapi_profile_map[i].profile_parser ? diff --git a/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode.c b/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode.c index bfca315a..e3820956 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode.c @@ -276,21 +276,34 @@ static int vaapi_encode_issue(AVCodecContext *avctx, av_log(avctx, AV_LOG_DEBUG, "Issuing encode for pic %"PRId64"/%"PRId64" " "as type %s.\n", pic->display_order, pic->encode_order, picture_type_name[pic->type]); - if (pic->nb_refs == 0) { + if (pic->nb_refs[0] == 0 && pic->nb_refs[1] == 0) { av_log(avctx, AV_LOG_DEBUG, "No reference pictures.\n"); } else { - av_log(avctx, AV_LOG_DEBUG, "Refers to:"); - for (i = 0; i < pic->nb_refs; i++) { + av_log(avctx, AV_LOG_DEBUG, "L0 refers to"); + for (i = 0; i < pic->nb_refs[0]; i++) { av_log(avctx, AV_LOG_DEBUG, " %"PRId64"/%"PRId64, - pic->refs[i]->display_order, pic->refs[i]->encode_order); + pic->refs[0][i]->display_order, pic->refs[0][i]->encode_order); } av_log(avctx, AV_LOG_DEBUG, ".\n"); + + if (pic->nb_refs[1]) { + av_log(avctx, AV_LOG_DEBUG, "L1 refers to"); + for (i = 0; i < pic->nb_refs[1]; i++) { + av_log(avctx, AV_LOG_DEBUG, " %"PRId64"/%"PRId64, + pic->refs[1][i]->display_order, pic->refs[1][i]->encode_order); + } + av_log(avctx, AV_LOG_DEBUG, ".\n"); + } } av_assert0(!pic->encode_issued); - for (i = 0; i < pic->nb_refs; i++) { - av_assert0(pic->refs[i]); - av_assert0(pic->refs[i]->encode_issued); + for (i = 0; i < pic->nb_refs[0]; i++) { + av_assert0(pic->refs[0][i]); + av_assert0(pic->refs[0][i]->encode_issued); + } + for (i = 0; i < pic->nb_refs[1]; i++) { + av_assert0(pic->refs[1][i]); + av_assert0(pic->refs[1][i]->encode_issued); } av_log(avctx, AV_LOG_DEBUG, "Input surface is %#x.\n", pic->input_surface); @@ -650,46 +663,11 @@ fail_at_end: return err; } -static int vaapi_encode_output(AVCodecContext *avctx, - VAAPIEncodePicture *pic, AVPacket *pkt) +static int vaapi_encode_set_output_property(AVCodecContext *avctx, + VAAPIEncodePicture *pic, + AVPacket *pkt) { VAAPIEncodeContext *ctx = avctx->priv_data; - VACodedBufferSegment *buf_list, *buf; - VAStatus vas; - int total_size = 0; - uint8_t *ptr; - int err; - - err = vaapi_encode_wait(avctx, pic); - if (err < 0) - return err; - - buf_list = NULL; - vas = vaMapBuffer(ctx->hwctx->display, pic->output_buffer, - (void**)&buf_list); - if (vas != VA_STATUS_SUCCESS) { - av_log(avctx, AV_LOG_ERROR, "Failed to map output buffers: " - "%d (%s).\n", vas, vaErrorStr(vas)); - err = AVERROR(EIO); - goto fail; - } - - for (buf = buf_list; buf; buf = buf->next) - total_size += buf->size; - - err = ff_get_encode_buffer(avctx, pkt, total_size, 0); - ptr = pkt->data; - - if (err < 0) - goto fail_mapped; - - for (buf = buf_list; buf; buf = buf->next) { - av_log(avctx, AV_LOG_DEBUG, "Output buffer: %u bytes " - "(status %08x).\n", buf->size, buf->status); - - memcpy(ptr, buf->buf, buf->size); - ptr += buf->size; - } if (pic->type == PICTURE_TYPE_IDR) pkt->flags |= AV_PKT_FLAG_KEY; @@ -697,14 +675,6 @@ static int vaapi_encode_output(AVCodecContext *avctx, pkt->pts = pic->pts; pkt->duration = pic->duration; - vas = vaUnmapBuffer(ctx->hwctx->display, pic->output_buffer); - if (vas != VA_STATUS_SUCCESS) { - av_log(avctx, AV_LOG_ERROR, "Failed to unmap output buffers: " - "%d (%s).\n", vas, vaErrorStr(vas)); - err = AVERROR(EIO); - goto fail; - } - // for no-delay encoders this is handled in generic codec if (avctx->codec->capabilities & AV_CODEC_CAP_DELAY && avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { @@ -713,16 +683,180 @@ static int vaapi_encode_output(AVCodecContext *avctx, pic->opaque_ref = NULL; } + if (ctx->codec->flags & FLAG_TIMESTAMP_NO_DELAY) { + pkt->dts = pkt->pts; + return 0; + } + + if (ctx->output_delay == 0) { + pkt->dts = pkt->pts; + } else if (pic->encode_order < ctx->decode_delay) { + if (ctx->ts_ring[pic->encode_order] < INT64_MIN + ctx->dts_pts_diff) + pkt->dts = INT64_MIN; + else + pkt->dts = ctx->ts_ring[pic->encode_order] - ctx->dts_pts_diff; + } else { + pkt->dts = ctx->ts_ring[(pic->encode_order - ctx->decode_delay) % + (3 * ctx->output_delay + ctx->async_depth)]; + } + + return 0; +} + +static int vaapi_encode_get_coded_buffer_size(AVCodecContext *avctx, VABufferID buf_id) +{ + VAAPIEncodeContext *ctx = avctx->priv_data; + VACodedBufferSegment *buf_list, *buf; + int size = 0; + VAStatus vas; + int err; + + vas = vaMapBuffer(ctx->hwctx->display, buf_id, + (void**)&buf_list); + if (vas != VA_STATUS_SUCCESS) { + av_log(avctx, AV_LOG_ERROR, "Failed to map output buffers: " + "%d (%s).\n", vas, vaErrorStr(vas)); + err = AVERROR(EIO); + return err; + } + + for (buf = buf_list; buf; buf = buf->next) + size += buf->size; + + vas = vaUnmapBuffer(ctx->hwctx->display, buf_id); + if (vas != VA_STATUS_SUCCESS) { + av_log(avctx, AV_LOG_ERROR, "Failed to unmap output buffers: " + "%d (%s).\n", vas, vaErrorStr(vas)); + err = AVERROR(EIO); + return err; + } + + return size; +} + +static int vaapi_encode_get_coded_buffer_data(AVCodecContext *avctx, + VABufferID buf_id, uint8_t **dst) +{ + VAAPIEncodeContext *ctx = avctx->priv_data; + VACodedBufferSegment *buf_list, *buf; + VAStatus vas; + int err; + + vas = vaMapBuffer(ctx->hwctx->display, buf_id, + (void**)&buf_list); + if (vas != VA_STATUS_SUCCESS) { + av_log(avctx, AV_LOG_ERROR, "Failed to map output buffers: " + "%d (%s).\n", vas, vaErrorStr(vas)); + err = AVERROR(EIO); + return err; + } + + for (buf = buf_list; buf; buf = buf->next) { + av_log(avctx, AV_LOG_DEBUG, "Output buffer: %u bytes " + "(status %08x).\n", buf->size, buf->status); + + memcpy(*dst, buf->buf, buf->size); + *dst += buf->size; + } + + vas = vaUnmapBuffer(ctx->hwctx->display, buf_id); + if (vas != VA_STATUS_SUCCESS) { + av_log(avctx, AV_LOG_ERROR, "Failed to unmap output buffers: " + "%d (%s).\n", vas, vaErrorStr(vas)); + err = AVERROR(EIO); + return err; + } + + return 0; +} + +static int vaapi_encode_get_coded_data(AVCodecContext *avctx, + VAAPIEncodePicture *pic, AVPacket *pkt) +{ + VAAPIEncodeContext *ctx = avctx->priv_data; + VABufferID output_buffer_prev; + int total_size = 0; + uint8_t *ptr; + int ret; + + if (ctx->coded_buffer_ref) { + output_buffer_prev = (VABufferID)(uintptr_t)ctx->coded_buffer_ref->data; + ret = vaapi_encode_get_coded_buffer_size(avctx, output_buffer_prev); + if (ret < 0) + goto end; + total_size += ret; + } + + ret = vaapi_encode_get_coded_buffer_size(avctx, pic->output_buffer); + if (ret < 0) + goto end; + total_size += ret; + + ret = ff_get_encode_buffer(avctx, pkt, total_size, 0); + if (ret < 0) + goto end; + ptr = pkt->data; + + if (ctx->coded_buffer_ref) { + ret = vaapi_encode_get_coded_buffer_data(avctx, output_buffer_prev, &ptr); + if (ret < 0) + goto end; + } + + ret = vaapi_encode_get_coded_buffer_data(avctx, pic->output_buffer, &ptr); + if (ret < 0) + goto end; + +end: + if (ctx->coded_buffer_ref) { + av_buffer_unref(&ctx->coded_buffer_ref); + } av_buffer_unref(&pic->output_buffer_ref); pic->output_buffer = VA_INVALID_ID; + return ret; +} + +static int vaapi_encode_output(AVCodecContext *avctx, + VAAPIEncodePicture *pic, AVPacket *pkt) +{ + VAAPIEncodeContext *ctx = avctx->priv_data; + AVPacket *pkt_ptr = pkt; + int err; + + err = vaapi_encode_wait(avctx, pic); + if (err < 0) + return err; + + if (pic->non_independent_frame) { + av_assert0(!ctx->coded_buffer_ref); + ctx->coded_buffer_ref = av_buffer_ref(pic->output_buffer_ref); + + if (pic->tail_size) { + if (ctx->tail_pkt->size) { + err = AVERROR(AVERROR_BUG); + goto end; + } + + err = ff_get_encode_buffer(avctx, ctx->tail_pkt, pic->tail_size, 0); + if (err < 0) + goto end; + + memcpy(ctx->tail_pkt->data, pic->tail_data, pic->tail_size); + pkt_ptr = ctx->tail_pkt; + } + } else { + err = vaapi_encode_get_coded_data(avctx, pic, pkt); + if (err < 0) + goto end; + } + av_log(avctx, AV_LOG_DEBUG, "Output read for pic %"PRId64"/%"PRId64".\n", pic->display_order, pic->encode_order); - return 0; -fail_mapped: - vaUnmapBuffer(ctx->hwctx->display, pic->output_buffer); -fail: + vaapi_encode_set_output_property(avctx, pic, pkt_ptr); + +end: av_buffer_unref(&pic->output_buffer_ref); pic->output_buffer = VA_INVALID_ID; return err; @@ -811,8 +945,12 @@ static void vaapi_encode_add_ref(AVCodecContext *avctx, if (is_ref) { av_assert0(pic != target); - av_assert0(pic->nb_refs < MAX_PICTURE_REFERENCES); - pic->refs[pic->nb_refs++] = target; + av_assert0(pic->nb_refs[0] < MAX_PICTURE_REFERENCES && + pic->nb_refs[1] < MAX_PICTURE_REFERENCES); + if (target->display_order < pic->display_order) + pic->refs[0][pic->nb_refs[0]++] = target; + else + pic->refs[1][pic->nb_refs[1]++] = target; ++refs; } @@ -841,10 +979,16 @@ static void vaapi_encode_remove_refs(AVCodecContext *avctx, if (pic->ref_removed[level]) return; - for (i = 0; i < pic->nb_refs; i++) { - av_assert0(pic->refs[i]); - --pic->refs[i]->ref_count[level]; - av_assert0(pic->refs[i]->ref_count[level] >= 0); + for (i = 0; i < pic->nb_refs[0]; i++) { + av_assert0(pic->refs[0][i]); + --pic->refs[0][i]->ref_count[level]; + av_assert0(pic->refs[0][i]->ref_count[level] >= 0); + } + + for (i = 0; i < pic->nb_refs[1]; i++) { + av_assert0(pic->refs[1][i]); + --pic->refs[1][i]->ref_count[level]; + av_assert0(pic->refs[1][i]->ref_count[level] >= 0); } for (i = 0; i < pic->nb_dpb_pics; i++) { @@ -889,7 +1033,7 @@ static void vaapi_encode_set_b_pictures(AVCodecContext *avctx, vaapi_encode_add_ref(avctx, pic, end, 1, 1, 0); vaapi_encode_add_ref(avctx, pic, prev, 0, 0, 1); - for (ref = end->refs[1]; ref; ref = ref->refs[1]) + for (ref = end->refs[1][0]; ref; ref = ref->refs[1][0]) vaapi_encode_add_ref(avctx, pic, ref, 0, 1, 0); } *last = prev; @@ -912,7 +1056,7 @@ static void vaapi_encode_set_b_pictures(AVCodecContext *avctx, vaapi_encode_add_ref(avctx, pic, end, 1, 1, 0); vaapi_encode_add_ref(avctx, pic, prev, 0, 0, 1); - for (ref = end->refs[1]; ref; ref = ref->refs[1]) + for (ref = end->refs[1][0]; ref; ref = ref->refs[1][0]) vaapi_encode_add_ref(avctx, pic, ref, 0, 1, 0); if (i > 1) @@ -926,11 +1070,44 @@ static void vaapi_encode_set_b_pictures(AVCodecContext *avctx, } } +static void vaapi_encode_add_next_prev(AVCodecContext *avctx, + VAAPIEncodePicture *pic) +{ + VAAPIEncodeContext *ctx = avctx->priv_data; + int i; + + if (!pic) + return; + + if (pic->type == PICTURE_TYPE_IDR) { + for (i = 0; i < ctx->nb_next_prev; i++) { + --ctx->next_prev[i]->ref_count[0]; + ctx->next_prev[i] = NULL; + } + ctx->next_prev[0] = pic; + ++pic->ref_count[0]; + ctx->nb_next_prev = 1; + + return; + } + + if (ctx->nb_next_prev < MAX_PICTURE_REFERENCES) { + ctx->next_prev[ctx->nb_next_prev++] = pic; + ++pic->ref_count[0]; + } else { + --ctx->next_prev[0]->ref_count[0]; + for (i = 0; i < MAX_PICTURE_REFERENCES - 1; i++) + ctx->next_prev[i] = ctx->next_prev[i + 1]; + ctx->next_prev[i] = pic; + ++pic->ref_count[0]; + } +} + static int vaapi_encode_pick_next(AVCodecContext *avctx, VAAPIEncodePicture **pic_out) { VAAPIEncodeContext *ctx = avctx->priv_data; - VAAPIEncodePicture *pic = NULL, *next, *start; + VAAPIEncodePicture *pic = NULL, *prev = NULL, *next, *start; int i, b_counter, closed_gop_end; // If there are any B-frames already queued, the next one to encode @@ -941,11 +1118,18 @@ static int vaapi_encode_pick_next(AVCodecContext *avctx, continue; if (pic->type != PICTURE_TYPE_B) continue; - for (i = 0; i < pic->nb_refs; i++) { - if (!pic->refs[i]->encode_issued) + for (i = 0; i < pic->nb_refs[0]; i++) { + if (!pic->refs[0][i]->encode_issued) break; } - if (i == pic->nb_refs) + if (i != pic->nb_refs[0]) + continue; + + for (i = 0; i < pic->nb_refs[1]; i++) { + if (!pic->refs[1][i]->encode_issued) + break; + } + if (i == pic->nb_refs[1]) break; } @@ -1044,21 +1228,30 @@ static int vaapi_encode_pick_next(AVCodecContext *avctx, vaapi_encode_add_ref(avctx, pic, pic, 0, 1, 0); if (pic->type != PICTURE_TYPE_IDR) { - vaapi_encode_add_ref(avctx, pic, start, - pic->type == PICTURE_TYPE_P, - b_counter > 0, 0); - vaapi_encode_add_ref(avctx, pic, ctx->next_prev, 0, 0, 1); + // TODO: apply both previous and forward multi reference for all vaapi encoders. + // And L0/L1 reference frame number can be set dynamically through query + // VAConfigAttribEncMaxRefFrames attribute. + if (avctx->codec_id == AV_CODEC_ID_AV1) { + for (i = 0; i < ctx->nb_next_prev; i++) + vaapi_encode_add_ref(avctx, pic, ctx->next_prev[i], + pic->type == PICTURE_TYPE_P, + b_counter > 0, 0); + } else + vaapi_encode_add_ref(avctx, pic, start, + pic->type == PICTURE_TYPE_P, + b_counter > 0, 0); + + vaapi_encode_add_ref(avctx, pic, ctx->next_prev[ctx->nb_next_prev - 1], 0, 0, 1); } - if (ctx->next_prev) - --ctx->next_prev->ref_count[0]; if (b_counter > 0) { vaapi_encode_set_b_pictures(avctx, start, pic, pic, 1, - &ctx->next_prev); + &prev); } else { - ctx->next_prev = pic; + prev = pic; } - ++ctx->next_prev->ref_count[0]; + vaapi_encode_add_next_prev(avctx, prev); + return 0; } @@ -1205,10 +1398,23 @@ fail: int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt) { VAAPIEncodeContext *ctx = avctx->priv_data; - VAAPIEncodePicture *pic; + VAAPIEncodePicture *pic = NULL; AVFrame *frame = ctx->frame; int err; +start: + /** if no B frame before repeat P frame, sent repeat P frame out. */ + if (ctx->tail_pkt->size) { + for (VAAPIEncodePicture *tmp = ctx->pic_start; tmp; tmp = tmp->next) { + if (tmp->type == PICTURE_TYPE_B && tmp->pts < ctx->tail_pkt->pts) + break; + else if (!tmp->next) { + av_packet_move_ref(pkt, ctx->tail_pkt); + goto end; + } + } + } + err = ff_encode_get_frame(avctx, frame); if (err < 0 && err != AVERROR_EOF) return err; @@ -1228,8 +1434,6 @@ int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt) } if (ctx->has_sync_buffer_func) { - pic = NULL; - if (av_fifo_can_write(ctx->encode_fifo)) { err = vaapi_encode_pick_next(avctx, &pic); if (!err) { @@ -1255,7 +1459,6 @@ int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt) av_fifo_read(ctx->encode_fifo, &pic, 1); ctx->encode_order = pic->encode_order + 1; } else { - pic = NULL; err = vaapi_encode_pick_next(avctx, &pic); if (err < 0) return err; @@ -1276,27 +1479,21 @@ int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt) return err; } - if (ctx->output_delay == 0) { - pkt->dts = pkt->pts; - } else if (pic->encode_order < ctx->decode_delay) { - if (ctx->ts_ring[pic->encode_order] < INT64_MIN + ctx->dts_pts_diff) - pkt->dts = INT64_MIN; - else - pkt->dts = ctx->ts_ring[pic->encode_order] - ctx->dts_pts_diff; - } else { - pkt->dts = ctx->ts_ring[(pic->encode_order - ctx->decode_delay) % - (3 * ctx->output_delay + ctx->async_depth)]; - } - av_log(avctx, AV_LOG_DEBUG, "Output packet: pts %"PRId64" dts %"PRId64".\n", - pkt->pts, pkt->dts); - ctx->output_order = pic->encode_order; vaapi_encode_clear_old(avctx); + /** loop to get an available pkt in encoder flushing. */ + if (ctx->end_of_stream && !pkt->size) + goto start; + +end: + if (pkt->size) + av_log(avctx, AV_LOG_DEBUG, "Output packet: pts %"PRId64", dts %"PRId64", " + "size %d bytes.\n", pkt->pts, pkt->dts, pkt->size); + return 0; } - static av_cold void vaapi_encode_add_global_param(AVCodecContext *avctx, int type, void *buffer, size_t size) { @@ -1414,7 +1611,7 @@ static av_cold int vaapi_encode_profile_entrypoint(AVCodecContext *avctx) av_assert0(ctx->codec->profiles); for (i = 0; (ctx->codec->profiles[i].av_profile != - FF_PROFILE_UNKNOWN); i++) { + AV_PROFILE_UNKNOWN); i++) { profile = &ctx->codec->profiles[i]; if (depth != profile->depth || desc->nb_components != profile->nb_components) @@ -1424,7 +1621,7 @@ static av_cold int vaapi_encode_profile_entrypoint(AVCodecContext *avctx) desc->log2_chroma_h != profile->log2_chroma_h)) continue; if (avctx->profile != profile->av_profile && - avctx->profile != FF_PROFILE_UNKNOWN) + avctx->profile != AV_PROFILE_UNKNOWN) continue; #if VA_CHECK_VERSION(1, 0, 0) @@ -2597,6 +2794,12 @@ av_cold int ff_vaapi_encode_init(AVCodecContext *avctx) ctx->device = (AVHWDeviceContext*)ctx->device_ref->data; ctx->hwctx = ctx->device->hwctx; + ctx->tail_pkt = av_packet_alloc(); + if (!ctx->tail_pkt) { + err = AVERROR(ENOMEM); + goto fail; + } + err = vaapi_encode_profile_entrypoint(avctx); if (err < 0) goto fail; @@ -2789,6 +2992,7 @@ av_cold int ff_vaapi_encode_close(AVCodecContext *avctx) } av_frame_free(&ctx->frame); + av_packet_free(&ctx->tail_pkt); av_freep(&ctx->codec_sequence_params); av_freep(&ctx->codec_picture_params); diff --git a/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode.h b/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode.h index a1e639f5..d0d6cc2a 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode.h +++ b/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode.h @@ -49,6 +49,7 @@ enum { // A.4.1: table A.6 allows at most 20 tile columns for any level. MAX_TILE_COLS = 20, MAX_ASYNC_DEPTH = 64, + MAX_REFERENCE_LIST_NUM = 2, }; extern const AVCodecHWConfigInternal *const ff_vaapi_encode_hw_configs[]; @@ -116,10 +117,11 @@ typedef struct VAAPIEncodePicture { // but not if it isn't. int nb_dpb_pics; struct VAAPIEncodePicture *dpb[MAX_DPB_SIZE]; - // The reference pictures used in decoding this picture. If they are - // used by later pictures they will also appear in the DPB. - int nb_refs; - struct VAAPIEncodePicture *refs[MAX_PICTURE_REFERENCES]; + // The reference pictures used in decoding this picture. If they are + // used by later pictures they will also appear in the DPB. ref[0][] for + // previous reference frames. ref[1][] for future reference frames. + int nb_refs[MAX_REFERENCE_LIST_NUM]; + struct VAAPIEncodePicture *refs[MAX_REFERENCE_LIST_NUM][MAX_PICTURE_REFERENCES]; // The previous reference picture in encode order. Must be in at least // one of the reference list and DPB list. struct VAAPIEncodePicture *prev; @@ -131,10 +133,21 @@ typedef struct VAAPIEncodePicture { int nb_slices; VAAPIEncodeSlice *slices; + + /** + * indicate if current frame is an independent frame that the coded data + * can be pushed to downstream directly. Coded of non-independent frame + * data will be concatenated into next independent frame. + */ + int non_independent_frame; + /** Tail data of current pic, used only for repeat header of AV1. */ + char tail_data[MAX_PARAM_BUFFER_SIZE]; + /** Byte length of tail_data. */ + size_t tail_size; } VAAPIEncodePicture; typedef struct VAAPIEncodeProfile { - // lavc profile value (FF_PROFILE_*). + // lavc profile value (AV_PROFILE_*). int av_profile; // Supported bit depth. int depth; @@ -290,8 +303,9 @@ typedef struct VAAPIEncodeContext { // Current encoding window, in display (input) order. VAAPIEncodePicture *pic_start, *pic_end; // The next picture to use as the previous reference picture in - // encoding order. - VAAPIEncodePicture *next_prev; + // encoding order. Order from small to large in encoding order. + VAAPIEncodePicture *next_prev[MAX_PICTURE_REFERENCES]; + int nb_next_prev; // Next input order index (display order). int64_t input_order; @@ -364,6 +378,16 @@ typedef struct VAAPIEncodeContext { AVFifo *encode_fifo; // Max number of frame buffered in encoder. int async_depth; + + /** Head data for current output pkt, used only for AV1. */ + //void *header_data; + //size_t header_data_size; + + /** Buffered coded data of a pic if it is an non-independent frame. */ + AVBufferRef *coded_buffer_ref; + + /** Tail data of a pic, now only used for av1 repeat frame header. */ + AVPacket *tail_pkt; } VAAPIEncodeContext; enum { @@ -380,11 +404,14 @@ enum { // Codec supports non-IDR key pictures (that is, key pictures do // not necessarily empty the DPB). FLAG_NON_IDR_KEY_PICTURES = 1 << 5, + // Codec output packet without timestamp delay, which means the + // output packet has same PTS and DTS. + FLAG_TIMESTAMP_NO_DELAY = 1 << 6, }; typedef struct VAAPIEncodeType { // List of supported profiles and corresponding VAAPI profiles. - // (Must end with FF_PROFILE_UNKNOWN.) + // (Must end with AV_PROFILE_UNKNOWN.) const VAAPIEncodeProfile *profiles; // Codec feature flags. diff --git a/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode_av1.c b/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode_av1.c new file mode 100644 index 00000000..5a9ff0f7 --- /dev/null +++ b/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode_av1.c @@ -0,0 +1,951 @@ +/* + * Copyright (c) 2023 Intel Corporation + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include + +#include "libavutil/pixdesc.h" +#include "libavutil/opt.h" + +#include "cbs_av1.h" +#include "put_bits.h" +#include "codec_internal.h" +#include "av1_levels.h" +#include "vaapi_encode.h" + +#define AV1_MAX_QUANT 255 + +typedef struct VAAPIEncodeAV1Picture { + int64_t last_idr_frame; + int slot; +} VAAPIEncodeAV1Picture; + +typedef struct VAAPIEncodeAV1Context { + VAAPIEncodeContext common; + AV1RawOBU sh; /**< sequence header.*/ + AV1RawOBU fh; /**< frame header.*/ + CodedBitstreamContext *cbc; + CodedBitstreamFragment current_obu; + VAConfigAttribValEncAV1 attr; + VAConfigAttribValEncAV1Ext1 attr_ext1; + VAConfigAttribValEncAV1Ext2 attr_ext2; + + char sh_data[MAX_PARAM_BUFFER_SIZE]; /**< coded sequence header data. */ + size_t sh_data_len; /**< bit length of sh_data. */ + char fh_data[MAX_PARAM_BUFFER_SIZE]; /**< coded frame header data. */ + size_t fh_data_len; /**< bit length of fh_data. */ + + uint8_t uniform_tile; + uint8_t use_128x128_superblock; + int sb_cols; + int sb_rows; + int tile_cols_log2; + int tile_rows_log2; + int max_tile_width_sb; + int max_tile_height_sb; + uint8_t width_in_sbs_minus_1[AV1_MAX_TILE_COLS]; + uint8_t height_in_sbs_minus_1[AV1_MAX_TILE_ROWS]; + + int min_log2_tile_cols; + int max_log2_tile_cols; + int min_log2_tile_rows; + int max_log2_tile_rows; + + int q_idx_idr; + int q_idx_p; + int q_idx_b; + + /** bit positions in current frame header */ + int qindex_offset; + int loopfilter_offset; + int cdef_start_offset; + int cdef_param_size; + + /** user options */ + int profile; + int level; + int tier; + int tile_cols, tile_rows; + int tile_groups; +} VAAPIEncodeAV1Context; + +static void vaapi_encode_av1_trace_write_log(void *ctx, + PutBitContext *pbc, int length, + const char *str, const int *subscripts, + int64_t value) +{ + VAAPIEncodeAV1Context *priv = ctx; + int position; + + position = put_bits_count(pbc); + av_assert0(position >= length); + + if (!strcmp(str, "base_q_idx")) + priv->qindex_offset = position - length; + else if (!strcmp(str, "loop_filter_level[0]")) + priv->loopfilter_offset = position - length; + else if (!strcmp(str, "cdef_damping_minus_3")) + priv->cdef_start_offset = position - length; + else if (!strcmp(str, "cdef_uv_sec_strength[i]")) + priv->cdef_param_size = position - priv->cdef_start_offset; +} + +static av_cold int vaapi_encode_av1_get_encoder_caps(AVCodecContext *avctx) +{ + VAAPIEncodeContext *ctx = avctx->priv_data; + VAAPIEncodeAV1Context *priv = avctx->priv_data; + + // Surfaces must be aligned to superblock boundaries. + ctx->surface_width = FFALIGN(avctx->width, priv->use_128x128_superblock ? 128 : 64); + ctx->surface_height = FFALIGN(avctx->height, priv->use_128x128_superblock ? 128 : 64); + + return 0; +} + +static av_cold int vaapi_encode_av1_configure(AVCodecContext *avctx) +{ + VAAPIEncodeContext *ctx = avctx->priv_data; + VAAPIEncodeAV1Context *priv = avctx->priv_data; + int ret; + + ret = ff_cbs_init(&priv->cbc, AV_CODEC_ID_AV1, avctx); + if (ret < 0) + return ret; + priv->cbc->trace_enable = 1; + priv->cbc->trace_level = AV_LOG_DEBUG; + priv->cbc->trace_context = ctx; + priv->cbc->trace_write_callback = vaapi_encode_av1_trace_write_log; + + if (ctx->rc_mode->quality) { + priv->q_idx_p = av_clip(ctx->rc_quality, 0, AV1_MAX_QUANT); + if (fabs(avctx->i_quant_factor) > 0.0) + priv->q_idx_idr = + av_clip((fabs(avctx->i_quant_factor) * priv->q_idx_p + + avctx->i_quant_offset) + 0.5, + 0, AV1_MAX_QUANT); + else + priv->q_idx_idr = priv->q_idx_p; + + if (fabs(avctx->b_quant_factor) > 0.0) + priv->q_idx_b = + av_clip((fabs(avctx->b_quant_factor) * priv->q_idx_p + + avctx->b_quant_offset) + 0.5, + 0, AV1_MAX_QUANT); + else + priv->q_idx_b = priv->q_idx_p; + } else { + /** Arbitrary value */ + priv->q_idx_idr = priv->q_idx_p = priv->q_idx_b = 128; + } + + return 0; +} + +static int vaapi_encode_av1_add_obu(AVCodecContext *avctx, + CodedBitstreamFragment *au, + uint8_t type, + void *obu_unit) +{ + int ret; + + ret = ff_cbs_insert_unit_content(au, -1, + type, obu_unit, NULL); + if (ret < 0) { + av_log(avctx, AV_LOG_ERROR, "Failed to add OBU unit: " + "type = %d.\n", type); + return ret; + } + + return 0; +} + +static int vaapi_encode_av1_write_obu(AVCodecContext *avctx, + char *data, size_t *data_len, + CodedBitstreamFragment *bs) +{ + VAAPIEncodeAV1Context *priv = avctx->priv_data; + int ret; + + ret = ff_cbs_write_fragment_data(priv->cbc, bs); + if (ret < 0) { + av_log(avctx, AV_LOG_ERROR, "Failed to write packed header.\n"); + return ret; + } + + if ((size_t)8 * MAX_PARAM_BUFFER_SIZE < 8 * bs->data_size - bs->data_bit_padding) { + av_log(avctx, AV_LOG_ERROR, "Access unit too large: " + "%zu < %zu.\n", (size_t)8 * MAX_PARAM_BUFFER_SIZE, + 8 * bs->data_size - bs->data_bit_padding); + return AVERROR(ENOSPC); + } + + memcpy(data, bs->data, bs->data_size); + *data_len = 8 * bs->data_size - bs->data_bit_padding; + + return 0; +} + +static int tile_log2(int blkSize, int target) { + int k; + for (k = 0; (blkSize << k) < target; k++); + return k; +} + +static int vaapi_encode_av1_set_tile(AVCodecContext *avctx) +{ + VAAPIEncodeAV1Context *priv = avctx->priv_data; + int mi_cols, mi_rows, sb_shift, sb_size; + int max_tile_area_sb, max_tile_area_sb_varied; + int tile_width_sb, tile_height_sb, widest_tile_sb; + int tile_cols, tile_rows; + int min_log2_tiles; + int i; + + if (priv->tile_cols > AV1_MAX_TILE_COLS || + priv->tile_rows > AV1_MAX_TILE_ROWS) { + av_log(avctx, AV_LOG_ERROR, "Invalid tile number %dx%d, should less than %dx%d.\n", + priv->tile_cols, priv->tile_rows, AV1_MAX_TILE_COLS, AV1_MAX_TILE_ROWS); + return AVERROR(EINVAL); + } + + mi_cols = 2 * ((avctx->width + 7) >> 3); + mi_rows = 2 * ((avctx->height + 7) >> 3); + priv->sb_cols = priv->use_128x128_superblock ? + ((mi_cols + 31) >> 5) : ((mi_cols + 15) >> 4); + priv->sb_rows = priv->use_128x128_superblock ? + ((mi_rows + 31) >> 5) : ((mi_rows + 15) >> 4); + sb_shift = priv->use_128x128_superblock ? 5 : 4; + sb_size = sb_shift + 2; + priv->max_tile_width_sb = AV1_MAX_TILE_WIDTH >> sb_size; + max_tile_area_sb = AV1_MAX_TILE_AREA >> (2 * sb_size); + + priv->min_log2_tile_cols = tile_log2(priv->max_tile_width_sb, priv->sb_cols); + priv->max_log2_tile_cols = tile_log2(1, FFMIN(priv->sb_cols, AV1_MAX_TILE_COLS)); + priv->max_log2_tile_rows = tile_log2(1, FFMIN(priv->sb_rows, AV1_MAX_TILE_ROWS)); + min_log2_tiles = FFMAX(priv->min_log2_tile_cols, + tile_log2(max_tile_area_sb, priv->sb_rows * priv->sb_cols)); + + tile_cols = av_clip(priv->tile_cols, (priv->sb_cols + priv->max_tile_width_sb - 1) / priv->max_tile_width_sb, priv->sb_cols); + + if (!priv->tile_cols) + priv->tile_cols = tile_cols; + else if (priv->tile_cols != tile_cols){ + av_log(avctx, AV_LOG_ERROR, "Invalid tile cols %d, should be in range of %d~%d\n", + priv->tile_cols, + (priv->sb_cols + priv->max_tile_width_sb - 1) / priv->max_tile_width_sb, + priv->sb_cols); + return AVERROR(EINVAL); + } + + priv->tile_cols_log2 = tile_log2(1, priv->tile_cols); + tile_width_sb = (priv->sb_cols + (1 << priv->tile_cols_log2) - 1) >> + priv->tile_cols_log2; + + if (priv->tile_rows > priv->sb_rows) { + av_log(avctx, AV_LOG_ERROR, "Invalid tile rows %d, should be less than %d.\n", + priv->tile_rows, priv->sb_rows); + return AVERROR(EINVAL); + } + + /** Try user setting tile rows number first. */ + tile_rows = priv->tile_rows ? priv->tile_rows : 1; + for (; tile_rows <= priv->sb_rows && tile_rows <= AV1_MAX_TILE_ROWS; tile_rows++) { + /** try uniformed tile. */ + priv->tile_rows_log2 = tile_log2(1, tile_rows); + if ((priv->sb_cols + tile_width_sb - 1) / tile_width_sb == priv->tile_cols) { + for (i = 0; i < priv->tile_cols - 1; i++) + priv->width_in_sbs_minus_1[i] = tile_width_sb - 1; + priv->width_in_sbs_minus_1[i] = priv->sb_cols - (priv->tile_cols - 1) * tile_width_sb - 1; + + tile_height_sb = (priv->sb_rows + (1 << priv->tile_rows_log2) - 1) >> + priv->tile_rows_log2; + + if ((priv->sb_rows + tile_height_sb - 1) / tile_height_sb == tile_rows && + tile_height_sb <= max_tile_area_sb / tile_width_sb) { + for (i = 0; i < tile_rows - 1; i++) + priv->height_in_sbs_minus_1[i] = tile_height_sb - 1; + priv->height_in_sbs_minus_1[i] = priv->sb_rows - (tile_rows - 1) * tile_height_sb - 1; + + priv->uniform_tile = 1; + priv->min_log2_tile_rows = FFMAX(min_log2_tiles - priv->tile_cols_log2, 0); + + break; + } + } + + /** try non-uniformed tile. */ + widest_tile_sb = 0; + for (i = 0; i < priv->tile_cols; i++) { + priv->width_in_sbs_minus_1[i] = (i + 1) * priv->sb_cols / priv->tile_cols - i * priv->sb_cols / priv->tile_cols - 1; + widest_tile_sb = FFMAX(widest_tile_sb, priv->width_in_sbs_minus_1[i] + 1); + } + + if (min_log2_tiles) + max_tile_area_sb_varied = (priv->sb_rows * priv->sb_cols) >> (min_log2_tiles + 1); + else + max_tile_area_sb_varied = priv->sb_rows * priv->sb_cols; + priv->max_tile_height_sb = FFMAX(1, max_tile_area_sb_varied / widest_tile_sb); + + if (tile_rows == av_clip(tile_rows, (priv->sb_rows + priv->max_tile_height_sb - 1) / priv->max_tile_height_sb, priv->sb_rows)) { + for (i = 0; i < tile_rows; i++) + priv->height_in_sbs_minus_1[i] = (i + 1) * priv->sb_rows / tile_rows - i * priv->sb_rows / tile_rows - 1; + + break; + } + + /** Return invalid parameter if explicit tile rows is set. */ + if (priv->tile_rows) { + av_log(avctx, AV_LOG_ERROR, "Invalid tile rows %d.\n", priv->tile_rows); + return AVERROR(EINVAL); + } + } + + priv->tile_rows = tile_rows; + av_log(avctx, AV_LOG_DEBUG, "Setting tile cols/rows to %d/%d.\n", + priv->tile_cols, priv->tile_rows); + + /** check if tile cols/rows is supported by driver. */ + if (priv->attr_ext2.bits.max_tile_num_minus1) { + if ((priv->tile_cols * priv->tile_rows - 1) > priv->attr_ext2.bits.max_tile_num_minus1) { + av_log(avctx, AV_LOG_ERROR, "Unsupported tile num %d * %d = %d by driver, " + "should be at most %d.\n", priv->tile_cols, priv->tile_rows, + priv->tile_cols * priv->tile_rows, + priv->attr_ext2.bits.max_tile_num_minus1 + 1); + return AVERROR(EINVAL); + } + } + + /** check if tile group numbers is valid. */ + if (priv->tile_groups > priv->tile_cols * priv->tile_rows) { + av_log(avctx, AV_LOG_WARNING, "Invalid tile groups number %d, " + "correct to %d.\n", priv->tile_groups, priv->tile_cols * priv->tile_rows); + priv->tile_groups = priv->tile_cols * priv->tile_rows; + } + + return 0; +} + +static int vaapi_encode_av1_write_sequence_header(AVCodecContext *avctx, + char *data, size_t *data_len) +{ + VAAPIEncodeAV1Context *priv = avctx->priv_data; + + memcpy(data, &priv->sh_data, MAX_PARAM_BUFFER_SIZE * sizeof(char)); + *data_len = priv->sh_data_len; + + return 0; +} + +static int vaapi_encode_av1_init_sequence_params(AVCodecContext *avctx) +{ + VAAPIEncodeContext *ctx = avctx->priv_data; + VAAPIEncodeAV1Context *priv = avctx->priv_data; + AV1RawOBU *sh_obu = &priv->sh; + AV1RawSequenceHeader *sh = &sh_obu->obu.sequence_header; + VAEncSequenceParameterBufferAV1 *vseq = ctx->codec_sequence_params; + CodedBitstreamFragment *obu = &priv->current_obu; + const AVPixFmtDescriptor *desc; + int ret; + + memset(sh_obu, 0, sizeof(*sh_obu)); + sh_obu->header.obu_type = AV1_OBU_SEQUENCE_HEADER; + + desc = av_pix_fmt_desc_get(priv->common.input_frames->sw_format); + av_assert0(desc); + + sh->seq_profile = avctx->profile; + if (!sh->seq_force_screen_content_tools) + sh->seq_force_integer_mv = AV1_SELECT_INTEGER_MV; + sh->frame_width_bits_minus_1 = av_log2(avctx->width); + sh->frame_height_bits_minus_1 = av_log2(avctx->height); + sh->max_frame_width_minus_1 = avctx->width - 1; + sh->max_frame_height_minus_1 = avctx->height - 1; + sh->seq_tier[0] = priv->tier; + /** enable order hint and reserve maximum 8 bits for it by default. */ + sh->enable_order_hint = 1; + sh->order_hint_bits_minus_1 = 7; + + sh->color_config = (AV1RawColorConfig) { + .high_bitdepth = desc->comp[0].depth == 8 ? 0 : 1, + .color_primaries = avctx->color_primaries, + .transfer_characteristics = avctx->color_trc, + .matrix_coefficients = avctx->colorspace, + .color_description_present_flag = (avctx->color_primaries != AVCOL_PRI_UNSPECIFIED || + avctx->color_trc != AVCOL_TRC_UNSPECIFIED || + avctx->colorspace != AVCOL_SPC_UNSPECIFIED), + .color_range = avctx->color_range == AVCOL_RANGE_JPEG, + .subsampling_x = desc->log2_chroma_w, + .subsampling_y = desc->log2_chroma_h, + }; + + switch (avctx->chroma_sample_location) { + case AVCHROMA_LOC_LEFT: + sh->color_config.chroma_sample_position = AV1_CSP_VERTICAL; + break; + case AVCHROMA_LOC_TOPLEFT: + sh->color_config.chroma_sample_position = AV1_CSP_COLOCATED; + break; + default: + sh->color_config.chroma_sample_position = AV1_CSP_UNKNOWN; + break; + } + + if (avctx->level != AV_LEVEL_UNKNOWN) { + sh->seq_level_idx[0] = avctx->level; + } else { + const AV1LevelDescriptor *level; + float framerate; + + if (avctx->framerate.num > 0 && avctx->framerate.den > 0) + framerate = avctx->framerate.num / avctx->framerate.den; + else + framerate = 0; + + level = ff_av1_guess_level(avctx->bit_rate, priv->tier, + ctx->surface_width, ctx->surface_height, + priv->tile_rows * priv->tile_cols, + priv->tile_cols, framerate); + if (level) { + av_log(avctx, AV_LOG_VERBOSE, "Using level %s.\n", level->name); + sh->seq_level_idx[0] = level->level_idx; + } else { + av_log(avctx, AV_LOG_VERBOSE, "Stream will not conform to " + "any normal level, using maximum parameters level by default.\n"); + sh->seq_level_idx[0] = 31; + sh->seq_tier[0] = 1; + } + } + vseq->seq_profile = sh->seq_profile; + vseq->seq_level_idx = sh->seq_level_idx[0]; + vseq->seq_tier = sh->seq_tier[0]; + vseq->order_hint_bits_minus_1 = sh->order_hint_bits_minus_1; + vseq->intra_period = ctx->gop_size; + vseq->ip_period = ctx->b_per_p + 1; + + vseq->seq_fields.bits.enable_order_hint = sh->enable_order_hint; + + if (!(ctx->va_rc_mode & VA_RC_CQP)) { + vseq->bits_per_second = ctx->va_bit_rate; + vseq->seq_fields.bits.enable_cdef = sh->enable_cdef = 1; + } + + ret = vaapi_encode_av1_add_obu(avctx, obu, AV1_OBU_SEQUENCE_HEADER, &priv->sh); + if (ret < 0) + goto end; + + ret = vaapi_encode_av1_write_obu(avctx, priv->sh_data, &priv->sh_data_len, obu); + if (ret < 0) + goto end; + +end: + ff_cbs_fragment_reset(obu); + return ret; +} + +static int vaapi_encode_av1_init_picture_params(AVCodecContext *avctx, + VAAPIEncodePicture *pic) +{ + VAAPIEncodeContext *ctx = avctx->priv_data; + VAAPIEncodeAV1Context *priv = avctx->priv_data; + VAAPIEncodeAV1Picture *hpic = pic->priv_data; + AV1RawOBU *fh_obu = &priv->fh; + AV1RawFrameHeader *fh = &fh_obu->obu.frame.header; + VAEncPictureParameterBufferAV1 *vpic = pic->codec_picture_params; + CodedBitstreamFragment *obu = &priv->current_obu; + VAAPIEncodePicture *ref; + VAAPIEncodeAV1Picture *href; + int slot, i; + int ret; + static const int8_t default_loop_filter_ref_deltas[AV1_TOTAL_REFS_PER_FRAME] = + { 1, 0, 0, 0, -1, 0, -1, -1 }; + + memset(fh_obu, 0, sizeof(*fh_obu)); + pic->nb_slices = priv->tile_groups; + pic->non_independent_frame = pic->encode_order < pic->display_order; + fh_obu->header.obu_type = AV1_OBU_FRAME_HEADER; + fh_obu->header.obu_has_size_field = 1; + + switch (pic->type) { + case PICTURE_TYPE_IDR: + av_assert0(pic->nb_refs[0] == 0 || pic->nb_refs[1]); + fh->frame_type = AV1_FRAME_KEY; + fh->refresh_frame_flags = 0xFF; + fh->base_q_idx = priv->q_idx_idr; + hpic->slot = 0; + hpic->last_idr_frame = pic->display_order; + break; + case PICTURE_TYPE_P: + av_assert0(pic->nb_refs[0]); + fh->frame_type = AV1_FRAME_INTER; + fh->base_q_idx = priv->q_idx_p; + ref = pic->refs[0][pic->nb_refs[0] - 1]; + href = ref->priv_data; + hpic->slot = !href->slot; + hpic->last_idr_frame = href->last_idr_frame; + fh->refresh_frame_flags = 1 << hpic->slot; + + /** set the nearest frame in L0 as all reference frame. */ + for (i = 0; i < AV1_REFS_PER_FRAME; i++) { + fh->ref_frame_idx[i] = href->slot; + } + fh->primary_ref_frame = href->slot; + fh->ref_order_hint[href->slot] = ref->display_order - href->last_idr_frame; + vpic->ref_frame_ctrl_l0.fields.search_idx0 = AV1_REF_FRAME_LAST; + + /** set the 2nd nearest frame in L0 as Golden frame. */ + if (pic->nb_refs[0] > 1) { + ref = pic->refs[0][pic->nb_refs[0] - 2]; + href = ref->priv_data; + fh->ref_frame_idx[3] = href->slot; + fh->ref_order_hint[href->slot] = ref->display_order - href->last_idr_frame; + vpic->ref_frame_ctrl_l0.fields.search_idx1 = AV1_REF_FRAME_GOLDEN; + } + break; + case PICTURE_TYPE_B: + av_assert0(pic->nb_refs[0] && pic->nb_refs[1]); + fh->frame_type = AV1_FRAME_INTER; + fh->base_q_idx = priv->q_idx_b; + fh->refresh_frame_flags = 0x0; + fh->reference_select = 1; + + /** B frame will not be referenced, disable its recon frame. */ + vpic->picture_flags.bits.disable_frame_recon = 1; + + /** Use LAST_FRAME and BWDREF_FRAME for reference. */ + vpic->ref_frame_ctrl_l0.fields.search_idx0 = AV1_REF_FRAME_LAST; + vpic->ref_frame_ctrl_l1.fields.search_idx0 = AV1_REF_FRAME_BWDREF; + + ref = pic->refs[0][pic->nb_refs[0] - 1]; + href = ref->priv_data; + hpic->last_idr_frame = href->last_idr_frame; + fh->primary_ref_frame = href->slot; + fh->ref_order_hint[href->slot] = ref->display_order - href->last_idr_frame; + for (i = 0; i < AV1_REF_FRAME_GOLDEN; i++) { + fh->ref_frame_idx[i] = href->slot; + } + + ref = pic->refs[1][pic->nb_refs[1] - 1]; + href = ref->priv_data; + fh->ref_order_hint[href->slot] = ref->display_order - href->last_idr_frame; + for (i = AV1_REF_FRAME_GOLDEN; i < AV1_REFS_PER_FRAME; i++) { + fh->ref_frame_idx[i] = href->slot; + } + break; + default: + av_assert0(0 && "invalid picture type"); + } + + fh->show_frame = pic->display_order <= pic->encode_order; + fh->showable_frame = fh->frame_type != AV1_FRAME_KEY; + fh->frame_width_minus_1 = avctx->width - 1; + fh->frame_height_minus_1 = avctx->height - 1; + fh->render_width_minus_1 = fh->frame_width_minus_1; + fh->render_height_minus_1 = fh->frame_height_minus_1; + fh->order_hint = pic->display_order - hpic->last_idr_frame; + fh->tile_cols = priv->tile_cols; + fh->tile_rows = priv->tile_rows; + fh->tile_cols_log2 = priv->tile_cols_log2; + fh->tile_rows_log2 = priv->tile_rows_log2; + fh->uniform_tile_spacing_flag = priv->uniform_tile; + fh->tile_size_bytes_minus1 = priv->attr_ext2.bits.tile_size_bytes_minus1; + + /** ignore ONLY_4x4 mode for codedlossless is not fully implemented. */ + if (priv->attr_ext2.bits.tx_mode_support & 0x04) + fh->tx_mode = AV1_TX_MODE_SELECT; + else if (priv->attr_ext2.bits.tx_mode_support & 0x02) + fh->tx_mode = AV1_TX_MODE_LARGEST; + else { + av_log(avctx, AV_LOG_ERROR, "No available tx mode found.\n"); + return AVERROR(EINVAL); + } + + for (i = 0; i < fh->tile_cols; i++) + fh->width_in_sbs_minus_1[i] = vpic->width_in_sbs_minus_1[i] = priv->width_in_sbs_minus_1[i]; + + for (i = 0; i < fh->tile_rows; i++) + fh->height_in_sbs_minus_1[i] = vpic->height_in_sbs_minus_1[i] = priv->height_in_sbs_minus_1[i]; + + memcpy(fh->loop_filter_ref_deltas, default_loop_filter_ref_deltas, + AV1_TOTAL_REFS_PER_FRAME * sizeof(int8_t)); + + if (fh->frame_type == AV1_FRAME_KEY && fh->show_frame) { + fh->error_resilient_mode = 1; + } + + if (fh->frame_type == AV1_FRAME_KEY || fh->error_resilient_mode) + fh->primary_ref_frame = AV1_PRIMARY_REF_NONE; + + vpic->base_qindex = fh->base_q_idx; + vpic->frame_width_minus_1 = fh->frame_width_minus_1; + vpic->frame_height_minus_1 = fh->frame_height_minus_1; + vpic->primary_ref_frame = fh->primary_ref_frame; + vpic->reconstructed_frame = pic->recon_surface; + vpic->coded_buf = pic->output_buffer; + vpic->tile_cols = fh->tile_cols; + vpic->tile_rows = fh->tile_rows; + vpic->order_hint = fh->order_hint; +#if VA_CHECK_VERSION(1, 15, 0) + vpic->refresh_frame_flags = fh->refresh_frame_flags; +#endif + + vpic->picture_flags.bits.enable_frame_obu = 0; + vpic->picture_flags.bits.frame_type = fh->frame_type; + vpic->picture_flags.bits.reduced_tx_set = fh->reduced_tx_set; + vpic->picture_flags.bits.error_resilient_mode = fh->error_resilient_mode; + + /** let driver decide to use single or compound reference prediction mode. */ + vpic->mode_control_flags.bits.reference_mode = fh->reference_select ? 2 : 0; + vpic->mode_control_flags.bits.tx_mode = fh->tx_mode; + + vpic->tile_group_obu_hdr_info.bits.obu_has_size_field = 1; + + /** set reference. */ + for (i = 0; i < AV1_REFS_PER_FRAME; i++) + vpic->ref_frame_idx[i] = fh->ref_frame_idx[i]; + + for (i = 0; i < FF_ARRAY_ELEMS(vpic->reference_frames); i++) + vpic->reference_frames[i] = VA_INVALID_SURFACE; + + for (i = 0; i < MAX_REFERENCE_LIST_NUM; i++) { + for (int j = 0; j < pic->nb_refs[i]; j++) { + VAAPIEncodePicture *ref_pic = pic->refs[i][j]; + + slot = ((VAAPIEncodeAV1Picture*)ref_pic->priv_data)->slot; + av_assert0(vpic->reference_frames[slot] == VA_INVALID_SURFACE); + + vpic->reference_frames[slot] = ref_pic->recon_surface; + } + } + + ret = vaapi_encode_av1_add_obu(avctx, obu, AV1_OBU_FRAME_HEADER, &priv->fh); + if (ret < 0) + goto end; + + ret = vaapi_encode_av1_write_obu(avctx, priv->fh_data, &priv->fh_data_len, obu); + if (ret < 0) + goto end; + + if (!(ctx->va_rc_mode & VA_RC_CQP)) { + vpic->min_base_qindex = av_clip(avctx->qmin, 1, AV1_MAX_QUANT); + vpic->max_base_qindex = av_clip(avctx->qmax, 1, AV1_MAX_QUANT); + + vpic->bit_offset_qindex = priv->qindex_offset; + vpic->bit_offset_loopfilter_params = priv->loopfilter_offset; + vpic->bit_offset_cdef_params = priv->cdef_start_offset; + vpic->size_in_bits_cdef_params = priv->cdef_param_size; + vpic->size_in_bits_frame_hdr_obu = priv->fh_data_len; + vpic->byte_offset_frame_hdr_obu_size = (((pic->type == PICTURE_TYPE_IDR) ? + priv->sh_data_len / 8 : 0) + + (fh_obu->header.obu_extension_flag ? + 2 : 1)); + } + +end: + ff_cbs_fragment_reset(obu); + return ret; +} + +static int vaapi_encode_av1_init_slice_params(AVCodecContext *avctx, + VAAPIEncodePicture *pic, + VAAPIEncodeSlice *slice) +{ + VAAPIEncodeAV1Context *priv = avctx->priv_data; + VAEncTileGroupBufferAV1 *vslice = slice->codec_slice_params; + CodedBitstreamAV1Context *cbctx = priv->cbc->priv_data; + int div; + + /** Set tile group info. */ + div = priv->tile_cols * priv->tile_rows / priv->tile_groups; + vslice->tg_start = slice->index * div; + if (slice->index == (priv->tile_groups - 1)) { + vslice->tg_end = priv->tile_cols * priv->tile_rows - 1; + cbctx->seen_frame_header = 0; + } else { + vslice->tg_end = (slice->index + 1) * div - 1; + } + + return 0; +} + +static int vaapi_encode_av1_write_picture_header(AVCodecContext *avctx, + VAAPIEncodePicture *pic, + char *data, size_t *data_len) +{ + VAAPIEncodeAV1Context *priv = avctx->priv_data; + CodedBitstreamFragment *obu = &priv->current_obu; + CodedBitstreamAV1Context *cbctx = priv->cbc->priv_data; + AV1RawOBU *fh_obu = &priv->fh; + AV1RawFrameHeader *rep_fh = &fh_obu->obu.frame_header; + VAAPIEncodeAV1Picture *href; + int ret = 0; + + pic->tail_size = 0; + /** Pack repeat frame header. */ + if (pic->display_order > pic->encode_order) { + memset(fh_obu, 0, sizeof(*fh_obu)); + href = pic->refs[0][pic->nb_refs[0] - 1]->priv_data; + fh_obu->header.obu_type = AV1_OBU_FRAME_HEADER; + fh_obu->header.obu_has_size_field = 1; + + rep_fh->show_existing_frame = 1; + rep_fh->frame_to_show_map_idx = href->slot == 0; + rep_fh->frame_type = AV1_FRAME_INTER; + rep_fh->frame_width_minus_1 = avctx->width - 1; + rep_fh->frame_height_minus_1 = avctx->height - 1; + rep_fh->render_width_minus_1 = rep_fh->frame_width_minus_1; + rep_fh->render_height_minus_1 = rep_fh->frame_height_minus_1; + + cbctx->seen_frame_header = 0; + + ret = vaapi_encode_av1_add_obu(avctx, obu, AV1_OBU_FRAME_HEADER, &priv->fh); + if (ret < 0) + goto end; + + ret = vaapi_encode_av1_write_obu(avctx, pic->tail_data, &pic->tail_size, obu); + if (ret < 0) + goto end; + + pic->tail_size /= 8; + } + + memcpy(data, &priv->fh_data, MAX_PARAM_BUFFER_SIZE * sizeof(char)); + *data_len = priv->fh_data_len; + +end: + ff_cbs_fragment_reset(obu); + return ret; +} + +static const VAAPIEncodeProfile vaapi_encode_av1_profiles[] = { + { AV_PROFILE_AV1_MAIN, 8, 3, 1, 1, VAProfileAV1Profile0 }, + { AV_PROFILE_AV1_MAIN, 10, 3, 1, 1, VAProfileAV1Profile0 }, + { AV_PROFILE_UNKNOWN } +}; + +static const VAAPIEncodeType vaapi_encode_type_av1 = { + .profiles = vaapi_encode_av1_profiles, + .flags = FLAG_B_PICTURES | FLAG_TIMESTAMP_NO_DELAY, + .default_quality = 25, + + .get_encoder_caps = &vaapi_encode_av1_get_encoder_caps, + .configure = &vaapi_encode_av1_configure, + + .sequence_header_type = VAEncPackedHeaderSequence, + .sequence_params_size = sizeof(VAEncSequenceParameterBufferAV1), + .init_sequence_params = &vaapi_encode_av1_init_sequence_params, + .write_sequence_header = &vaapi_encode_av1_write_sequence_header, + + .picture_priv_data_size = sizeof(VAAPIEncodeAV1Picture), + .picture_header_type = VAEncPackedHeaderPicture, + .picture_params_size = sizeof(VAEncPictureParameterBufferAV1), + .init_picture_params = &vaapi_encode_av1_init_picture_params, + .write_picture_header = &vaapi_encode_av1_write_picture_header, + + .slice_params_size = sizeof(VAEncTileGroupBufferAV1), + .init_slice_params = &vaapi_encode_av1_init_slice_params, +}; + +static av_cold int vaapi_encode_av1_init(AVCodecContext *avctx) +{ + VAAPIEncodeContext *ctx = avctx->priv_data; + VAAPIEncodeAV1Context *priv = avctx->priv_data; + VAConfigAttrib attr; + VAStatus vas; + int ret; + + ctx->codec = &vaapi_encode_type_av1; + + ctx->desired_packed_headers = + VA_ENC_PACKED_HEADER_SEQUENCE | + VA_ENC_PACKED_HEADER_PICTURE; + + if (avctx->profile == AV_PROFILE_UNKNOWN) + avctx->profile = priv->profile; + if (avctx->level == AV_LEVEL_UNKNOWN) + avctx->level = priv->level; + + if (avctx->level != AV_LEVEL_UNKNOWN && avctx->level & ~0x1f) { + av_log(avctx, AV_LOG_ERROR, "Invalid level %d\n", avctx->level); + return AVERROR(EINVAL); + } + + ret = ff_vaapi_encode_init(avctx); + if (ret < 0) + return ret; + + attr.type = VAConfigAttribEncAV1; + vas = vaGetConfigAttributes(ctx->hwctx->display, + ctx->va_profile, + ctx->va_entrypoint, + &attr, 1); + if (vas != VA_STATUS_SUCCESS) { + av_log(avctx, AV_LOG_ERROR, "Failed to query " + "config attribute: %d (%s).\n", vas, vaErrorStr(vas)); + return AVERROR_EXTERNAL; + } else if (attr.value == VA_ATTRIB_NOT_SUPPORTED) { + priv->attr.value = 0; + av_log(avctx, AV_LOG_WARNING, "Attribute type:%d is not " + "supported.\n", attr.type); + } else { + priv->attr.value = attr.value; + } + + attr.type = VAConfigAttribEncAV1Ext1; + vas = vaGetConfigAttributes(ctx->hwctx->display, + ctx->va_profile, + ctx->va_entrypoint, + &attr, 1); + if (vas != VA_STATUS_SUCCESS) { + av_log(avctx, AV_LOG_ERROR, "Failed to query " + "config attribute: %d (%s).\n", vas, vaErrorStr(vas)); + return AVERROR_EXTERNAL; + } else if (attr.value == VA_ATTRIB_NOT_SUPPORTED) { + priv->attr_ext1.value = 0; + av_log(avctx, AV_LOG_WARNING, "Attribute type:%d is not " + "supported.\n", attr.type); + } else { + priv->attr_ext1.value = attr.value; + } + + /** This attr provides essential indicators, return error if not support. */ + attr.type = VAConfigAttribEncAV1Ext2; + vas = vaGetConfigAttributes(ctx->hwctx->display, + ctx->va_profile, + ctx->va_entrypoint, + &attr, 1); + if (vas != VA_STATUS_SUCCESS || attr.value == VA_ATTRIB_NOT_SUPPORTED) { + av_log(avctx, AV_LOG_ERROR, "Failed to query " + "config attribute: %d (%s).\n", vas, vaErrorStr(vas)); + return AVERROR_EXTERNAL; + } else { + priv->attr_ext2.value = attr.value; + } + + av_opt_set_int(priv->cbc->priv_data, "fixed_obu_size_length", + priv->attr_ext2.bits.obu_size_bytes_minus1 + 1, 0); + + ret = vaapi_encode_av1_set_tile(avctx); + if (ret < 0) + return ret; + + return 0; +} + +static av_cold int vaapi_encode_av1_close(AVCodecContext *avctx) +{ + VAAPIEncodeAV1Context *priv = avctx->priv_data; + + ff_cbs_fragment_free(&priv->current_obu); + ff_cbs_close(&priv->cbc); + + return ff_vaapi_encode_close(avctx); +} + +#define OFFSET(x) offsetof(VAAPIEncodeAV1Context, x) +#define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM) + +static const AVOption vaapi_encode_av1_options[] = { + VAAPI_ENCODE_COMMON_OPTIONS, + VAAPI_ENCODE_RC_OPTIONS, + { "profile", "Set profile (seq_profile)", + OFFSET(profile), AV_OPT_TYPE_INT, + { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, 0xff, FLAGS, "profile" }, + +#define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \ + { .i64 = value }, 0, 0, FLAGS, "profile" + { PROFILE("main", AV_PROFILE_AV1_MAIN) }, + { PROFILE("high", AV_PROFILE_AV1_HIGH) }, + { PROFILE("professional", AV_PROFILE_AV1_PROFESSIONAL) }, +#undef PROFILE + + { "tier", "Set tier (seq_tier)", + OFFSET(tier), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS, "tier" }, + { "main", NULL, 0, AV_OPT_TYPE_CONST, + { .i64 = 0 }, 0, 0, FLAGS, "tier" }, + { "high", NULL, 0, AV_OPT_TYPE_CONST, + { .i64 = 1 }, 0, 0, FLAGS, "tier" }, + { "level", "Set level (seq_level_idx)", + OFFSET(level), AV_OPT_TYPE_INT, + { .i64 = AV_LEVEL_UNKNOWN }, AV_LEVEL_UNKNOWN, 0x1f, FLAGS, "level" }, + +#define LEVEL(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \ + { .i64 = value }, 0, 0, FLAGS, "level" + { LEVEL("2.0", 0) }, + { LEVEL("2.1", 1) }, + { LEVEL("3.0", 4) }, + { LEVEL("3.1", 5) }, + { LEVEL("4.0", 8) }, + { LEVEL("4.1", 9) }, + { LEVEL("5.0", 12) }, + { LEVEL("5.1", 13) }, + { LEVEL("5.2", 14) }, + { LEVEL("5.3", 15) }, + { LEVEL("6.0", 16) }, + { LEVEL("6.1", 17) }, + { LEVEL("6.2", 18) }, + { LEVEL("6.3", 19) }, +#undef LEVEL + + { "tiles", "Tile columns x rows (Use minimal tile column/row number automatically by default)", + OFFSET(tile_cols), AV_OPT_TYPE_IMAGE_SIZE, { .str = NULL }, 0, 0, FLAGS }, + { "tile_groups", "Number of tile groups for encoding", + OFFSET(tile_groups), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, AV1_MAX_TILE_ROWS * AV1_MAX_TILE_COLS, FLAGS }, + + { NULL }, +}; + +static const FFCodecDefault vaapi_encode_av1_defaults[] = { + { "b", "0" }, + { "bf", "2" }, + { "g", "120" }, + { "qmin", "1" }, + { "qmax", "255" }, + { NULL }, +}; + +static const AVClass vaapi_encode_av1_class = { + .class_name = "av1_vaapi", + .item_name = av_default_item_name, + .option = vaapi_encode_av1_options, + .version = LIBAVUTIL_VERSION_INT, +}; + +const FFCodec ff_av1_vaapi_encoder = { + .p.name = "av1_vaapi", + CODEC_LONG_NAME("AV1 (VAAPI)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, + .priv_data_size = sizeof(VAAPIEncodeAV1Context), + .init = &vaapi_encode_av1_init, + FF_CODEC_RECEIVE_PACKET_CB(&ff_vaapi_encode_receive_packet), + .close = &vaapi_encode_av1_close, + .p.priv_class = &vaapi_encode_av1_class, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | + AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | + FF_CODEC_CAP_INIT_CLEANUP, + .defaults = vaapi_encode_av1_defaults, + .p.pix_fmts = (const enum AVPixelFormat[]) { + AV_PIX_FMT_VAAPI, + AV_PIX_FMT_NONE, + }, + .hw_configs = ff_vaapi_encode_hw_configs, + .p.wrapper_name = "vaapi", +}; diff --git a/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode_h264.c b/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode_h264.c index 9ad017d5..57b5ea2b 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode_h264.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode_h264.c @@ -322,15 +322,15 @@ static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx) sps->profile_idc = avctx->profile & 0xff; - if (avctx->profile == FF_PROFILE_H264_CONSTRAINED_BASELINE || - avctx->profile == FF_PROFILE_H264_MAIN) + if (avctx->profile == AV_PROFILE_H264_CONSTRAINED_BASELINE || + avctx->profile == AV_PROFILE_H264_MAIN) sps->constraint_set1_flag = 1; - if (avctx->profile == FF_PROFILE_H264_HIGH || avctx->profile == FF_PROFILE_H264_HIGH_10) + if (avctx->profile == AV_PROFILE_H264_HIGH || avctx->profile == AV_PROFILE_H264_HIGH_10) sps->constraint_set3_flag = ctx->gop_size == 1; - if (avctx->profile == FF_PROFILE_H264_MAIN || - avctx->profile == FF_PROFILE_H264_HIGH || avctx->profile == FF_PROFILE_H264_HIGH_10) { + if (avctx->profile == AV_PROFILE_H264_MAIN || + avctx->profile == AV_PROFILE_H264_HIGH || avctx->profile == AV_PROFILE_H264_HIGH_10) { sps->constraint_set4_flag = 1; sps->constraint_set5_flag = ctx->b_per_p == 0; } @@ -340,7 +340,7 @@ static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx) else priv->dpb_frames = 1 + ctx->max_b_depth; - if (avctx->level != FF_LEVEL_UNKNOWN) { + if (avctx->level != AV_LEVEL_UNKNOWN) { sps->level_idc = avctx->level; } else { const H264LevelDescriptor *level; @@ -512,9 +512,9 @@ static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx) pps->seq_parameter_set_id = 0; pps->entropy_coding_mode_flag = - !(sps->profile_idc == FF_PROFILE_H264_BASELINE || - sps->profile_idc == FF_PROFILE_H264_EXTENDED || - sps->profile_idc == FF_PROFILE_H264_CAVLC_444); + !(sps->profile_idc == AV_PROFILE_H264_BASELINE || + sps->profile_idc == AV_PROFILE_H264_EXTENDED || + sps->profile_idc == AV_PROFILE_H264_CAVLC_444); if (!priv->coder && pps->entropy_coding_mode_flag) pps->entropy_coding_mode_flag = 0; @@ -523,9 +523,9 @@ static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx) pps->pic_init_qp_minus26 = priv->fixed_qp_idr - 26; - if (sps->profile_idc == FF_PROFILE_H264_BASELINE || - sps->profile_idc == FF_PROFILE_H264_EXTENDED || - sps->profile_idc == FF_PROFILE_H264_MAIN) { + if (sps->profile_idc == AV_PROFILE_H264_BASELINE || + sps->profile_idc == AV_PROFILE_H264_EXTENDED || + sps->profile_idc == AV_PROFILE_H264_MAIN) { pps->more_rbsp_data = 0; } else { pps->more_rbsp_data = 1; @@ -628,7 +628,7 @@ static int vaapi_encode_h264_init_picture_params(AVCodecContext *avctx, VAAPIEncodePicture *prev = pic->prev; VAAPIEncodeH264Picture *hprev = prev ? prev->priv_data : NULL; VAEncPictureParameterBufferH264 *vpic = pic->codec_picture_params; - int i; + int i, j = 0; if (pic->type == PICTURE_TYPE_IDR) { av_assert0(pic->display_order == pic->encode_order); @@ -729,24 +729,26 @@ static int vaapi_encode_h264_init_picture_params(AVCodecContext *avctx, .TopFieldOrderCnt = hpic->pic_order_cnt, .BottomFieldOrderCnt = hpic->pic_order_cnt, }; + for (int k = 0; k < MAX_REFERENCE_LIST_NUM; k++) { + for (i = 0; i < pic->nb_refs[k]; i++) { + VAAPIEncodePicture *ref = pic->refs[k][i]; + VAAPIEncodeH264Picture *href; - for (i = 0; i < pic->nb_refs; i++) { - VAAPIEncodePicture *ref = pic->refs[i]; - VAAPIEncodeH264Picture *href; + av_assert0(ref && ref->encode_order < pic->encode_order); + href = ref->priv_data; - av_assert0(ref && ref->encode_order < pic->encode_order); - href = ref->priv_data; - - vpic->ReferenceFrames[i] = (VAPictureH264) { - .picture_id = ref->recon_surface, - .frame_idx = href->frame_num, - .flags = VA_PICTURE_H264_SHORT_TERM_REFERENCE, - .TopFieldOrderCnt = href->pic_order_cnt, - .BottomFieldOrderCnt = href->pic_order_cnt, - }; + vpic->ReferenceFrames[j++] = (VAPictureH264) { + .picture_id = ref->recon_surface, + .frame_idx = href->frame_num, + .flags = VA_PICTURE_H264_SHORT_TERM_REFERENCE, + .TopFieldOrderCnt = href->pic_order_cnt, + .BottomFieldOrderCnt = href->pic_order_cnt, + }; + } } - for (; i < FF_ARRAY_ELEMS(vpic->ReferenceFrames); i++) { - vpic->ReferenceFrames[i] = (VAPictureH264) { + + for (; j < FF_ARRAY_ELEMS(vpic->ReferenceFrames); j++) { + vpic->ReferenceFrames[j] = (VAPictureH264) { .picture_id = VA_INVALID_ID, .flags = VA_PICTURE_H264_INVALID, }; @@ -948,17 +950,17 @@ static int vaapi_encode_h264_init_slice_params(AVCodecContext *avctx, if (pic->type == PICTURE_TYPE_P) { int need_rplm = 0; - for (i = 0; i < pic->nb_refs; i++) { - av_assert0(pic->refs[i]); - if (pic->refs[i] != def_l0[i]) + for (i = 0; i < pic->nb_refs[0]; i++) { + av_assert0(pic->refs[0][i]); + if (pic->refs[0][i] != def_l0[i]) need_rplm = 1; } sh->ref_pic_list_modification_flag_l0 = need_rplm; if (need_rplm) { int pic_num = hpic->frame_num; - for (i = 0; i < pic->nb_refs; i++) { - href = pic->refs[i]->priv_data; + for (i = 0; i < pic->nb_refs[0]; i++) { + href = pic->refs[0][i]->priv_data; av_assert0(href->frame_num != pic_num); if (href->frame_num < pic_num) { sh->rplm_l0[i].modification_of_pic_nums_idc = 0; @@ -977,28 +979,29 @@ static int vaapi_encode_h264_init_slice_params(AVCodecContext *avctx, } else { int need_rplm_l0 = 0, need_rplm_l1 = 0; int n0 = 0, n1 = 0; - for (i = 0; i < pic->nb_refs; i++) { - av_assert0(pic->refs[i]); - href = pic->refs[i]->priv_data; - av_assert0(href->pic_order_cnt != hpic->pic_order_cnt); - if (href->pic_order_cnt < hpic->pic_order_cnt) { - if (pic->refs[i] != def_l0[n0]) - need_rplm_l0 = 1; - ++n0; - } else { - if (pic->refs[i] != def_l1[n1]) - need_rplm_l1 = 1; - ++n1; - } + for (i = 0; i < pic->nb_refs[0]; i++) { + av_assert0(pic->refs[0][i]); + href = pic->refs[0][i]->priv_data; + av_assert0(href->pic_order_cnt < hpic->pic_order_cnt); + if (pic->refs[0][i] != def_l0[n0]) + need_rplm_l0 = 1; + ++n0; + } + + for (i = 0; i < pic->nb_refs[1]; i++) { + av_assert0(pic->refs[1][i]); + href = pic->refs[1][i]->priv_data; + av_assert0(href->pic_order_cnt > hpic->pic_order_cnt); + if (pic->refs[1][i] != def_l1[n1]) + need_rplm_l1 = 1; + ++n1; } sh->ref_pic_list_modification_flag_l0 = need_rplm_l0; if (need_rplm_l0) { int pic_num = hpic->frame_num; - for (i = j = 0; i < pic->nb_refs; i++) { - href = pic->refs[i]->priv_data; - if (href->pic_order_cnt > hpic->pic_order_cnt) - continue; + for (i = j = 0; i < pic->nb_refs[0]; i++) { + href = pic->refs[0][i]->priv_data; av_assert0(href->frame_num != pic_num); if (href->frame_num < pic_num) { sh->rplm_l0[j].modification_of_pic_nums_idc = 0; @@ -1019,10 +1022,8 @@ static int vaapi_encode_h264_init_slice_params(AVCodecContext *avctx, sh->ref_pic_list_modification_flag_l1 = need_rplm_l1; if (need_rplm_l1) { int pic_num = hpic->frame_num; - for (i = j = 0; i < pic->nb_refs; i++) { - href = pic->refs[i]->priv_data; - if (href->pic_order_cnt < hpic->pic_order_cnt) - continue; + for (i = j = 0; i < pic->nb_refs[1]; i++) { + href = pic->refs[1][i]->priv_data; av_assert0(href->frame_num != pic_num); if (href->frame_num < pic_num) { sh->rplm_l1[j].modification_of_pic_nums_idc = 0; @@ -1062,14 +1063,13 @@ static int vaapi_encode_h264_init_slice_params(AVCodecContext *avctx, vslice->RefPicList1[i].flags = VA_PICTURE_H264_INVALID; } - av_assert0(pic->nb_refs <= 2); - if (pic->nb_refs >= 1) { + if (pic->nb_refs[0]) { // Backward reference for P- or B-frame. av_assert0(pic->type == PICTURE_TYPE_P || pic->type == PICTURE_TYPE_B); vslice->RefPicList0[0] = vpic->ReferenceFrames[0]; } - if (pic->nb_refs >= 2) { + if (pic->nb_refs[1]) { // Forward reference for B-frame. av_assert0(pic->type == PICTURE_TYPE_B); vslice->RefPicList1[0] = vpic->ReferenceFrames[1]; @@ -1159,13 +1159,13 @@ static av_cold int vaapi_encode_h264_configure(AVCodecContext *avctx) static const VAAPIEncodeProfile vaapi_encode_h264_profiles[] = { #if VA_CHECK_VERSION(1, 18, 0) - { FF_PROFILE_H264_HIGH_10, 10, 3, 1, 1, VAProfileH264High10 }, + { AV_PROFILE_H264_HIGH_10, 10, 3, 1, 1, VAProfileH264High10 }, #endif - { FF_PROFILE_H264_HIGH, 8, 3, 1, 1, VAProfileH264High }, - { FF_PROFILE_H264_MAIN, 8, 3, 1, 1, VAProfileH264Main }, - { FF_PROFILE_H264_CONSTRAINED_BASELINE, + { AV_PROFILE_H264_HIGH, 8, 3, 1, 1, VAProfileH264High }, + { AV_PROFILE_H264_MAIN, 8, 3, 1, 1, VAProfileH264Main }, + { AV_PROFILE_H264_CONSTRAINED_BASELINE, 8, 3, 1, 1, VAProfileH264ConstrainedBaseline }, - { FF_PROFILE_UNKNOWN } + { AV_PROFILE_UNKNOWN } }; static const VAAPIEncodeType vaapi_encode_type_h264 = { @@ -1207,40 +1207,40 @@ static av_cold int vaapi_encode_h264_init(AVCodecContext *avctx) ctx->codec = &vaapi_encode_type_h264; - if (avctx->profile == FF_PROFILE_UNKNOWN) + if (avctx->profile == AV_PROFILE_UNKNOWN) avctx->profile = priv->profile; - if (avctx->level == FF_LEVEL_UNKNOWN) + if (avctx->level == AV_LEVEL_UNKNOWN) avctx->level = priv->level; if (avctx->compression_level == FF_COMPRESSION_DEFAULT) avctx->compression_level = priv->quality; // Reject unsupported profiles. switch (avctx->profile) { - case FF_PROFILE_H264_BASELINE: + case AV_PROFILE_H264_BASELINE: av_log(avctx, AV_LOG_WARNING, "H.264 baseline profile is not " "supported, using constrained baseline profile instead.\n"); - avctx->profile = FF_PROFILE_H264_CONSTRAINED_BASELINE; + avctx->profile = AV_PROFILE_H264_CONSTRAINED_BASELINE; break; - case FF_PROFILE_H264_EXTENDED: + case AV_PROFILE_H264_EXTENDED: av_log(avctx, AV_LOG_ERROR, "H.264 extended profile " "is not supported.\n"); return AVERROR_PATCHWELCOME; - case FF_PROFILE_H264_HIGH_10_INTRA: + case AV_PROFILE_H264_HIGH_10_INTRA: av_log(avctx, AV_LOG_ERROR, "H.264 high 10 intra profile " "is not supported.\n"); return AVERROR_PATCHWELCOME; - case FF_PROFILE_H264_HIGH_422: - case FF_PROFILE_H264_HIGH_422_INTRA: - case FF_PROFILE_H264_HIGH_444: - case FF_PROFILE_H264_HIGH_444_PREDICTIVE: - case FF_PROFILE_H264_HIGH_444_INTRA: - case FF_PROFILE_H264_CAVLC_444: + case AV_PROFILE_H264_HIGH_422: + case AV_PROFILE_H264_HIGH_422_INTRA: + case AV_PROFILE_H264_HIGH_444: + case AV_PROFILE_H264_HIGH_444_PREDICTIVE: + case AV_PROFILE_H264_HIGH_444_INTRA: + case AV_PROFILE_H264_CAVLC_444: av_log(avctx, AV_LOG_ERROR, "H.264 non-4:2:0 profiles " "are not supported.\n"); return AVERROR_PATCHWELCOME; } - if (avctx->level != FF_LEVEL_UNKNOWN && avctx->level & ~0xff) { + if (avctx->level != AV_LEVEL_UNKNOWN && avctx->level & ~0xff) { av_log(avctx, AV_LOG_ERROR, "Invalid level %d: must fit " "in 8-bit unsigned integer.\n", avctx->level); return AVERROR(EINVAL); @@ -1313,19 +1313,19 @@ static const AVOption vaapi_encode_h264_options[] = { { "profile", "Set profile (profile_idc and constraint_set*_flag)", OFFSET(profile), AV_OPT_TYPE_INT, - { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, 0xffff, FLAGS, "profile" }, + { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, 0xffff, FLAGS, "profile" }, #define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \ { .i64 = value }, 0, 0, FLAGS, "profile" - { PROFILE("constrained_baseline", FF_PROFILE_H264_CONSTRAINED_BASELINE) }, - { PROFILE("main", FF_PROFILE_H264_MAIN) }, - { PROFILE("high", FF_PROFILE_H264_HIGH) }, - { PROFILE("high10", FF_PROFILE_H264_HIGH_10) }, + { PROFILE("constrained_baseline", AV_PROFILE_H264_CONSTRAINED_BASELINE) }, + { PROFILE("main", AV_PROFILE_H264_MAIN) }, + { PROFILE("high", AV_PROFILE_H264_HIGH) }, + { PROFILE("high10", AV_PROFILE_H264_HIGH_10) }, #undef PROFILE { "level", "Set level (level_idc)", OFFSET(level), AV_OPT_TYPE_INT, - { .i64 = FF_LEVEL_UNKNOWN }, FF_LEVEL_UNKNOWN, 0xff, FLAGS, "level" }, + { .i64 = AV_LEVEL_UNKNOWN }, AV_LEVEL_UNKNOWN, 0xff, FLAGS, "level" }, #define LEVEL(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \ { .i64 = value }, 0, 0, FLAGS, "level" diff --git a/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode_h265.c b/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode_h265.c index aa7e532f..239ef235 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode_h265.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode_h265.c @@ -346,7 +346,7 @@ static int vaapi_encode_h265_init_sequence_params(AVCodecContext *avctx) ptl->general_lower_bit_rate_constraint_flag = 1; - if (avctx->level != FF_LEVEL_UNKNOWN) { + if (avctx->level != AV_LEVEL_UNKNOWN) { ptl->general_level_idc = avctx->level; } else { const H265LevelDescriptor *level; @@ -764,7 +764,7 @@ static int vaapi_encode_h265_init_picture_params(AVCodecContext *avctx, VAAPIEncodePicture *prev = pic->prev; VAAPIEncodeH265Picture *hprev = prev ? prev->priv_data : NULL; VAEncPictureParameterBufferHEVC *vpic = pic->codec_picture_params; - int i; + int i, j = 0; if (pic->type == PICTURE_TYPE_IDR) { av_assert0(pic->display_order == pic->encode_order); @@ -789,8 +789,8 @@ static int vaapi_encode_h265_init_picture_params(AVCodecContext *avctx, hpic->pic_type = 1; } else { VAAPIEncodePicture *irap_ref; - av_assert0(pic->refs[0] && pic->refs[1]); - for (irap_ref = pic; irap_ref; irap_ref = irap_ref->refs[1]) { + av_assert0(pic->refs[0][0] && pic->refs[1][0]); + for (irap_ref = pic; irap_ref; irap_ref = irap_ref->refs[1][0]) { if (irap_ref->type == PICTURE_TYPE_I) break; } @@ -915,24 +915,27 @@ static int vaapi_encode_h265_init_picture_params(AVCodecContext *avctx, .flags = 0, }; - for (i = 0; i < pic->nb_refs; i++) { - VAAPIEncodePicture *ref = pic->refs[i]; - VAAPIEncodeH265Picture *href; + for (int k = 0; k < MAX_REFERENCE_LIST_NUM; k++) { + for (i = 0; i < pic->nb_refs[k]; i++) { + VAAPIEncodePicture *ref = pic->refs[k][i]; + VAAPIEncodeH265Picture *href; - av_assert0(ref && ref->encode_order < pic->encode_order); - href = ref->priv_data; + av_assert0(ref && ref->encode_order < pic->encode_order); + href = ref->priv_data; - vpic->reference_frames[i] = (VAPictureHEVC) { - .picture_id = ref->recon_surface, - .pic_order_cnt = href->pic_order_cnt, - .flags = (ref->display_order < pic->display_order ? - VA_PICTURE_HEVC_RPS_ST_CURR_BEFORE : 0) | - (ref->display_order > pic->display_order ? - VA_PICTURE_HEVC_RPS_ST_CURR_AFTER : 0), - }; + vpic->reference_frames[j++] = (VAPictureHEVC) { + .picture_id = ref->recon_surface, + .pic_order_cnt = href->pic_order_cnt, + .flags = (ref->display_order < pic->display_order ? + VA_PICTURE_HEVC_RPS_ST_CURR_BEFORE : 0) | + (ref->display_order > pic->display_order ? + VA_PICTURE_HEVC_RPS_ST_CURR_AFTER : 0), + }; + } } - for (; i < FF_ARRAY_ELEMS(vpic->reference_frames); i++) { - vpic->reference_frames[i] = (VAPictureHEVC) { + + for (; j < FF_ARRAY_ELEMS(vpic->reference_frames); j++) { + vpic->reference_frames[j] = (VAPictureHEVC) { .picture_id = VA_INVALID_ID, .flags = VA_PICTURE_HEVC_INVALID, }; @@ -1016,21 +1019,33 @@ static int vaapi_encode_h265_init_slice_params(AVCodecContext *avctx, memset(rps, 0, sizeof(*rps)); rps_pics = 0; - for (i = 0; i < pic->nb_refs; i++) { - strp = pic->refs[i]->priv_data; - rps_poc[rps_pics] = strp->pic_order_cnt; - rps_used[rps_pics] = 1; - ++rps_pics; + for (i = 0; i < MAX_REFERENCE_LIST_NUM; i++) { + for (j = 0; j < pic->nb_refs[i]; j++) { + strp = pic->refs[i][j]->priv_data; + rps_poc[rps_pics] = strp->pic_order_cnt; + rps_used[rps_pics] = 1; + ++rps_pics; + } } + for (i = 0; i < pic->nb_dpb_pics; i++) { if (pic->dpb[i] == pic) continue; - for (j = 0; j < pic->nb_refs; j++) { - if (pic->dpb[i] == pic->refs[j]) + + for (j = 0; j < pic->nb_refs[0]; j++) { + if (pic->dpb[i] == pic->refs[0][j]) break; } - if (j < pic->nb_refs) + if (j < pic->nb_refs[0]) continue; + + for (j = 0; j < pic->nb_refs[1]; j++) { + if (pic->dpb[i] == pic->refs[1][j]) + break; + } + if (j < pic->nb_refs[1]) + continue; + strp = pic->dpb[i]->priv_data; rps_poc[rps_pics] = strp->pic_order_cnt; rps_used[rps_pics] = 0; @@ -1155,8 +1170,7 @@ static int vaapi_encode_h265_init_slice_params(AVCodecContext *avctx, vslice->ref_pic_list1[i].flags = VA_PICTURE_HEVC_INVALID; } - av_assert0(pic->nb_refs <= 2); - if (pic->nb_refs >= 1) { + if (pic->nb_refs[0]) { // Backward reference for P- or B-frame. av_assert0(pic->type == PICTURE_TYPE_P || pic->type == PICTURE_TYPE_B); @@ -1165,7 +1179,7 @@ static int vaapi_encode_h265_init_slice_params(AVCodecContext *avctx, // Reference for GPB B-frame, L0 == L1 vslice->ref_pic_list1[0] = vpic->reference_frames[0]; } - if (pic->nb_refs >= 2) { + if (pic->nb_refs[1]) { // Forward reference for B-frame. av_assert0(pic->type == PICTURE_TYPE_B); vslice->ref_pic_list1[0] = vpic->reference_frames[1]; @@ -1290,22 +1304,22 @@ static av_cold int vaapi_encode_h265_configure(AVCodecContext *avctx) } static const VAAPIEncodeProfile vaapi_encode_h265_profiles[] = { - { FF_PROFILE_HEVC_MAIN, 8, 3, 1, 1, VAProfileHEVCMain }, - { FF_PROFILE_HEVC_REXT, 8, 3, 1, 1, VAProfileHEVCMain }, + { AV_PROFILE_HEVC_MAIN, 8, 3, 1, 1, VAProfileHEVCMain }, + { AV_PROFILE_HEVC_REXT, 8, 3, 1, 1, VAProfileHEVCMain }, #if VA_CHECK_VERSION(0, 37, 0) - { FF_PROFILE_HEVC_MAIN_10, 10, 3, 1, 1, VAProfileHEVCMain10 }, - { FF_PROFILE_HEVC_REXT, 10, 3, 1, 1, VAProfileHEVCMain10 }, + { AV_PROFILE_HEVC_MAIN_10, 10, 3, 1, 1, VAProfileHEVCMain10 }, + { AV_PROFILE_HEVC_REXT, 10, 3, 1, 1, VAProfileHEVCMain10 }, #endif #if VA_CHECK_VERSION(1, 2, 0) - { FF_PROFILE_HEVC_REXT, 12, 3, 1, 1, VAProfileHEVCMain12 }, - { FF_PROFILE_HEVC_REXT, 8, 3, 1, 0, VAProfileHEVCMain422_10 }, - { FF_PROFILE_HEVC_REXT, 10, 3, 1, 0, VAProfileHEVCMain422_10 }, - { FF_PROFILE_HEVC_REXT, 12, 3, 1, 0, VAProfileHEVCMain422_12 }, - { FF_PROFILE_HEVC_REXT, 8, 3, 0, 0, VAProfileHEVCMain444 }, - { FF_PROFILE_HEVC_REXT, 10, 3, 0, 0, VAProfileHEVCMain444_10 }, - { FF_PROFILE_HEVC_REXT, 12, 3, 0, 0, VAProfileHEVCMain444_12 }, + { AV_PROFILE_HEVC_REXT, 12, 3, 1, 1, VAProfileHEVCMain12 }, + { AV_PROFILE_HEVC_REXT, 8, 3, 1, 0, VAProfileHEVCMain422_10 }, + { AV_PROFILE_HEVC_REXT, 10, 3, 1, 0, VAProfileHEVCMain422_10 }, + { AV_PROFILE_HEVC_REXT, 12, 3, 1, 0, VAProfileHEVCMain422_12 }, + { AV_PROFILE_HEVC_REXT, 8, 3, 0, 0, VAProfileHEVCMain444 }, + { AV_PROFILE_HEVC_REXT, 10, 3, 0, 0, VAProfileHEVCMain444_10 }, + { AV_PROFILE_HEVC_REXT, 12, 3, 0, 0, VAProfileHEVCMain444_12 }, #endif - { FF_PROFILE_UNKNOWN } + { AV_PROFILE_UNKNOWN } }; static const VAAPIEncodeType vaapi_encode_type_h265 = { @@ -1348,12 +1362,12 @@ static av_cold int vaapi_encode_h265_init(AVCodecContext *avctx) ctx->codec = &vaapi_encode_type_h265; - if (avctx->profile == FF_PROFILE_UNKNOWN) + if (avctx->profile == AV_PROFILE_UNKNOWN) avctx->profile = priv->profile; - if (avctx->level == FF_LEVEL_UNKNOWN) + if (avctx->level == AV_LEVEL_UNKNOWN) avctx->level = priv->level; - if (avctx->level != FF_LEVEL_UNKNOWN && avctx->level & ~0xff) { + if (avctx->level != AV_LEVEL_UNKNOWN && avctx->level & ~0xff) { av_log(avctx, AV_LOG_ERROR, "Invalid level %d: must fit " "in 8-bit unsigned integer.\n", avctx->level); return AVERROR(EINVAL); @@ -1395,13 +1409,13 @@ static const AVOption vaapi_encode_h265_options[] = { { "profile", "Set profile (general_profile_idc)", OFFSET(profile), AV_OPT_TYPE_INT, - { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, 0xff, FLAGS, "profile" }, + { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, 0xff, FLAGS, "profile" }, #define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \ { .i64 = value }, 0, 0, FLAGS, "profile" - { PROFILE("main", FF_PROFILE_HEVC_MAIN) }, - { PROFILE("main10", FF_PROFILE_HEVC_MAIN_10) }, - { PROFILE("rext", FF_PROFILE_HEVC_REXT) }, + { PROFILE("main", AV_PROFILE_HEVC_MAIN) }, + { PROFILE("main10", AV_PROFILE_HEVC_MAIN_10) }, + { PROFILE("rext", AV_PROFILE_HEVC_REXT) }, #undef PROFILE { "tier", "Set tier (general_tier_flag)", @@ -1414,7 +1428,7 @@ static const AVOption vaapi_encode_h265_options[] = { { "level", "Set level (general_level_idc)", OFFSET(level), AV_OPT_TYPE_INT, - { .i64 = FF_LEVEL_UNKNOWN }, FF_LEVEL_UNKNOWN, 0xff, FLAGS, "level" }, + { .i64 = AV_LEVEL_UNKNOWN }, AV_LEVEL_UNKNOWN, 0xff, FLAGS, "level" }, #define LEVEL(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \ { .i64 = value }, 0, 0, FLAGS, "level" diff --git a/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode_mjpeg.c b/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode_mjpeg.c index cb7588b9..c17747e3 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode_mjpeg.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode_mjpeg.c @@ -480,15 +480,15 @@ static av_cold int vaapi_encode_mjpeg_configure(AVCodecContext *avctx) } static const VAAPIEncodeProfile vaapi_encode_mjpeg_profiles[] = { - { FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, + { AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, 8, 1, 0, 0, VAProfileJPEGBaseline }, - { FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, + { AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, 8, 3, 1, 1, VAProfileJPEGBaseline }, - { FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, + { AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, 8, 3, 1, 0, VAProfileJPEGBaseline }, - { FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, + { AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, 8, 3, 0, 0, VAProfileJPEGBaseline }, - { FF_PROFILE_UNKNOWN } + { AV_PROFILE_UNKNOWN } }; static const VAAPIEncodeType vaapi_encode_type_mjpeg = { diff --git a/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode_mpeg2.c b/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode_mpeg2.c index 9261d19a..d1904bf4 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode_mpeg2.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode_mpeg2.c @@ -458,12 +458,12 @@ static int vaapi_encode_mpeg2_init_picture_params(AVCodecContext *avctx, break; case PICTURE_TYPE_P: vpic->picture_type = VAEncPictureTypePredictive; - vpic->forward_reference_picture = pic->refs[0]->recon_surface; + vpic->forward_reference_picture = pic->refs[0][0]->recon_surface; break; case PICTURE_TYPE_B: vpic->picture_type = VAEncPictureTypeBidirectional; - vpic->forward_reference_picture = pic->refs[0]->recon_surface; - vpic->backward_reference_picture = pic->refs[1]->recon_surface; + vpic->forward_reference_picture = pic->refs[0][0]->recon_surface; + vpic->backward_reference_picture = pic->refs[1][0]->recon_surface; break; default: av_assert0(0 && "invalid picture type"); @@ -558,9 +558,9 @@ static av_cold int vaapi_encode_mpeg2_configure(AVCodecContext *avctx) } static const VAAPIEncodeProfile vaapi_encode_mpeg2_profiles[] = { - { FF_PROFILE_MPEG2_MAIN, 8, 3, 1, 1, VAProfileMPEG2Main }, - { FF_PROFILE_MPEG2_SIMPLE, 8, 3, 1, 1, VAProfileMPEG2Simple }, - { FF_PROFILE_UNKNOWN } + { AV_PROFILE_MPEG2_MAIN, 8, 3, 1, 1, VAProfileMPEG2Main }, + { AV_PROFILE_MPEG2_SIMPLE, 8, 3, 1, 1, VAProfileMPEG2Simple }, + { AV_PROFILE_UNKNOWN } }; static const VAAPIEncodeType vaapi_encode_type_mpeg2 = { @@ -595,9 +595,9 @@ static av_cold int vaapi_encode_mpeg2_init(AVCodecContext *avctx) ctx->codec = &vaapi_encode_type_mpeg2; - if (avctx->profile == FF_PROFILE_UNKNOWN) + if (avctx->profile == AV_PROFILE_UNKNOWN) avctx->profile = priv->profile; - if (avctx->level == FF_LEVEL_UNKNOWN) + if (avctx->level == AV_LEVEL_UNKNOWN) avctx->level = priv->level; // Reject unknown levels (these are required to set f_code for @@ -644,12 +644,12 @@ static const AVOption vaapi_encode_mpeg2_options[] = { { "profile", "Set profile (in profile_and_level_indication)", OFFSET(profile), AV_OPT_TYPE_INT, - { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, 7, FLAGS, "profile" }, + { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, 7, FLAGS, "profile" }, #define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \ { .i64 = value }, 0, 0, FLAGS, "profile" - { PROFILE("simple", FF_PROFILE_MPEG2_SIMPLE) }, - { PROFILE("main", FF_PROFILE_MPEG2_MAIN) }, + { PROFILE("simple", AV_PROFILE_MPEG2_SIMPLE) }, + { PROFILE("main", AV_PROFILE_MPEG2_MAIN) }, #undef PROFILE { "level", "Set level (in profile_and_level_indication)", diff --git a/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode_vp8.c b/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode_vp8.c index ae6a8d31..8a557b96 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode_vp8.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode_vp8.c @@ -86,7 +86,7 @@ static int vaapi_encode_vp8_init_picture_params(AVCodecContext *avctx, switch (pic->type) { case PICTURE_TYPE_IDR: case PICTURE_TYPE_I: - av_assert0(pic->nb_refs == 0); + av_assert0(pic->nb_refs[0] == 0 && pic->nb_refs[1] == 0); vpic->ref_flags.bits.force_kf = 1; vpic->ref_last_frame = vpic->ref_gf_frame = @@ -94,14 +94,14 @@ static int vaapi_encode_vp8_init_picture_params(AVCodecContext *avctx, VA_INVALID_SURFACE; break; case PICTURE_TYPE_P: - av_assert0(pic->nb_refs == 1); + av_assert0(!pic->nb_refs[1]); vpic->ref_flags.bits.no_ref_last = 0; vpic->ref_flags.bits.no_ref_gf = 1; vpic->ref_flags.bits.no_ref_arf = 1; vpic->ref_last_frame = vpic->ref_gf_frame = vpic->ref_arf_frame = - pic->refs[0]->recon_surface; + pic->refs[0][0]->recon_surface; break; default: av_assert0(0 && "invalid picture type"); @@ -180,7 +180,7 @@ static av_cold int vaapi_encode_vp8_configure(AVCodecContext *avctx) static const VAAPIEncodeProfile vaapi_encode_vp8_profiles[] = { { 0 /* VP8 has no profiles */, 8, 3, 1, 1, VAProfileVP8Version0_3 }, - { FF_PROFILE_UNKNOWN } + { AV_PROFILE_UNKNOWN } }; static const VAAPIEncodeType vaapi_encode_type_vp8 = { diff --git a/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode_vp9.c b/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode_vp9.c index af1353ce..c2a8dec7 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode_vp9.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vaapi_encode_vp9.c @@ -96,15 +96,15 @@ static int vaapi_encode_vp9_init_picture_params(AVCodecContext *avctx, switch (pic->type) { case PICTURE_TYPE_IDR: - av_assert0(pic->nb_refs == 0); + av_assert0(pic->nb_refs[0] == 0 && pic->nb_refs[1] == 0); vpic->ref_flags.bits.force_kf = 1; vpic->refresh_frame_flags = 0xff; hpic->slot = 0; break; case PICTURE_TYPE_P: - av_assert0(pic->nb_refs == 1); + av_assert0(!pic->nb_refs[1]); { - VAAPIEncodeVP9Picture *href = pic->refs[0]->priv_data; + VAAPIEncodeVP9Picture *href = pic->refs[0][0]->priv_data; av_assert0(href->slot == 0 || href->slot == 1); if (ctx->max_b_depth > 0) { @@ -120,10 +120,10 @@ static int vaapi_encode_vp9_init_picture_params(AVCodecContext *avctx, } break; case PICTURE_TYPE_B: - av_assert0(pic->nb_refs == 2); + av_assert0(pic->nb_refs[0] && pic->nb_refs[1]); { - VAAPIEncodeVP9Picture *href0 = pic->refs[0]->priv_data, - *href1 = pic->refs[1]->priv_data; + VAAPIEncodeVP9Picture *href0 = pic->refs[0][0]->priv_data, + *href1 = pic->refs[1][0]->priv_data; av_assert0(href0->slot < pic->b_depth + 1 && href1->slot < pic->b_depth + 1); @@ -157,12 +157,14 @@ static int vaapi_encode_vp9_init_picture_params(AVCodecContext *avctx, for (i = 0; i < FF_ARRAY_ELEMS(vpic->reference_frames); i++) vpic->reference_frames[i] = VA_INVALID_SURFACE; - for (i = 0; i < pic->nb_refs; i++) { - VAAPIEncodePicture *ref_pic = pic->refs[i]; - int slot; - slot = ((VAAPIEncodeVP9Picture*)ref_pic->priv_data)->slot; - av_assert0(vpic->reference_frames[slot] == VA_INVALID_SURFACE); - vpic->reference_frames[slot] = ref_pic->recon_surface; + for (i = 0; i < MAX_REFERENCE_LIST_NUM; i++) { + for (int j = 0; j < pic->nb_refs[i]; j++) { + VAAPIEncodePicture *ref_pic = pic->refs[i][j]; + int slot; + slot = ((VAAPIEncodeVP9Picture*)ref_pic->priv_data)->slot; + av_assert0(vpic->reference_frames[slot] == VA_INVALID_SURFACE); + vpic->reference_frames[slot] = ref_pic->recon_surface; + } } vpic->pic_flags.bits.frame_type = (pic->type != PICTURE_TYPE_IDR); @@ -227,11 +229,11 @@ static av_cold int vaapi_encode_vp9_configure(AVCodecContext *avctx) } static const VAAPIEncodeProfile vaapi_encode_vp9_profiles[] = { - { FF_PROFILE_VP9_0, 8, 3, 1, 1, VAProfileVP9Profile0 }, - { FF_PROFILE_VP9_1, 8, 3, 0, 0, VAProfileVP9Profile1 }, - { FF_PROFILE_VP9_2, 10, 3, 1, 1, VAProfileVP9Profile2 }, - { FF_PROFILE_VP9_3, 10, 3, 0, 0, VAProfileVP9Profile3 }, - { FF_PROFILE_UNKNOWN } + { AV_PROFILE_VP9_0, 8, 3, 1, 1, VAProfileVP9Profile0 }, + { AV_PROFILE_VP9_1, 8, 3, 0, 0, VAProfileVP9Profile1 }, + { AV_PROFILE_VP9_2, 10, 3, 1, 1, VAProfileVP9Profile2 }, + { AV_PROFILE_VP9_3, 10, 3, 0, 0, VAProfileVP9Profile3 }, + { AV_PROFILE_UNKNOWN } }; static const VAAPIEncodeType vaapi_encode_type_vp9 = { diff --git a/arm/android/third_party/ffmpeg/libavcodec/vaapi_h264.c b/arm/android/third_party/ffmpeg/libavcodec/vaapi_h264.c index 9332aa6f..55cf5a05 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vaapi_h264.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vaapi_h264.c @@ -22,7 +22,7 @@ #include "h264dec.h" #include "h264_ps.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "vaapi_decode.h" /** @@ -385,11 +385,11 @@ static int vaapi_h264_decode_slice(AVCodecContext *avctx, return 0; } -const AVHWAccel ff_h264_vaapi_hwaccel = { - .name = "h264_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_h264_vaapi_hwaccel = { + .p.name = "h264_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = &vaapi_h264_start_frame, .end_frame = &vaapi_h264_end_frame, .decode_slice = &vaapi_h264_decode_slice, diff --git a/arm/android/third_party/ffmpeg/libavcodec/vaapi_hevc.c b/arm/android/third_party/ffmpeg/libavcodec/vaapi_hevc.c index 8b12484f..3bdd2dd1 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vaapi_hevc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vaapi_hevc.c @@ -25,7 +25,7 @@ #include "avcodec.h" #include "hevcdec.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "vaapi_decode.h" #include "vaapi_hevc.h" #include "h265_profile_level.h" @@ -227,8 +227,8 @@ static int vaapi_hevc_start_frame(AVCodecContext *avctx, } #if VA_CHECK_VERSION(1, 2, 0) - if (avctx->profile == FF_PROFILE_HEVC_REXT || - avctx->profile == FF_PROFILE_HEVC_SCC) { + if (avctx->profile == AV_PROFILE_HEVC_REXT || + avctx->profile == AV_PROFILE_HEVC_SCC) { pic->pic_param.rext = (VAPictureParameterBufferHEVCRext) { .range_extension_pic_fields.bits = { .transform_skip_rotation_enabled_flag = sps->transform_skip_rotation_enabled_flag, @@ -262,7 +262,7 @@ static int vaapi_hevc_start_frame(AVCodecContext *avctx, sps->sps_num_palette_predictor_initializers : 0); - if (avctx->profile == FF_PROFILE_HEVC_SCC) { + if (avctx->profile == AV_PROFILE_HEVC_SCC) { pic->pic_param.scc = (VAPictureParameterBufferHEVCScc) { .screen_content_pic_fields.bits = { .pps_curr_pic_ref_enabled_flag = pps->pps_curr_pic_ref_enabled_flag, @@ -294,7 +294,7 @@ static int vaapi_hevc_start_frame(AVCodecContext *avctx, } #endif - pic_param_size = avctx->profile >= FF_PROFILE_HEVC_REXT ? + pic_param_size = avctx->profile >= AV_PROFILE_HEVC_REXT ? sizeof(pic->pic_param) : sizeof(VAPictureParameterBufferHEVC); err = ff_vaapi_decode_make_param_buffer(avctx, &pic->pic, @@ -347,7 +347,7 @@ static int vaapi_hevc_end_frame(AVCodecContext *avctx) VASliceParameterBufferHEVC *last_slice_param = (VASliceParameterBufferHEVC *)&pic->last_slice_param; int ret; - int slice_param_size = avctx->profile >= FF_PROFILE_HEVC_REXT ? + int slice_param_size = avctx->profile >= AV_PROFILE_HEVC_REXT ? sizeof(pic->last_slice_param) : sizeof(VASliceParameterBufferHEVC); if (pic->last_size) { @@ -377,10 +377,10 @@ static void fill_pred_weight_table(AVCodecContext *avctx, { int i; #if VA_CHECK_VERSION(1, 2, 0) - int is_rext = avctx->profile >= FF_PROFILE_HEVC_REXT; + int is_rext = avctx->profile >= AV_PROFILE_HEVC_REXT; #else int is_rext = 0; - if (avctx->profile >= FF_PROFILE_HEVC_REXT) + if (avctx->profile >= AV_PROFILE_HEVC_REXT) av_log(avctx, AV_LOG_WARNING, "Please consider to update to VAAPI 1.2.0 " "or above, which can support REXT related setting correctly.\n"); #endif @@ -461,7 +461,7 @@ static int vaapi_hevc_decode_slice(AVCodecContext *avctx, VAAPIDecodePictureHEVC *pic = h->ref->hwaccel_picture_private; VASliceParameterBufferHEVC *last_slice_param = (VASliceParameterBufferHEVC *)&pic->last_slice_param; - int slice_param_size = avctx->profile >= FF_PROFILE_HEVC_REXT ? + int slice_param_size = avctx->profile >= AV_PROFILE_HEVC_REXT ? sizeof(pic->last_slice_param) : sizeof(VASliceParameterBufferHEVC); int nb_list = (sh->slice_type == HEVC_SLICE_B) ? @@ -526,7 +526,7 @@ static int vaapi_hevc_decode_slice(AVCodecContext *avctx, fill_pred_weight_table(avctx, h, sh, last_slice_param); #if VA_CHECK_VERSION(1, 2, 0) - if (avctx->profile >= FF_PROFILE_HEVC_REXT) { + if (avctx->profile >= AV_PROFILE_HEVC_REXT) { pic->last_slice_param.rext = (VASliceParameterBufferHEVCRext) { .slice_ext_flags.bits = { .cu_chroma_qp_offset_enabled_flag = sh->cu_chroma_qp_offset_enabled_flag, @@ -654,11 +654,11 @@ end: return VAProfileNone; } -const AVHWAccel ff_hevc_vaapi_hwaccel = { - .name = "hevc_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_hevc_vaapi_hwaccel = { + .p.name = "hevc_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = vaapi_hevc_start_frame, .end_frame = vaapi_hevc_end_frame, .decode_slice = vaapi_hevc_decode_slice, diff --git a/arm/android/third_party/ffmpeg/libavcodec/vaapi_mjpeg.c b/arm/android/third_party/ffmpeg/libavcodec/vaapi_mjpeg.c index 81582114..5b8d47bb 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vaapi_mjpeg.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vaapi_mjpeg.c @@ -19,7 +19,7 @@ #include #include -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "vaapi_decode.h" #include "mjpegdec.h" @@ -142,11 +142,11 @@ fail: return err; } -const AVHWAccel ff_mjpeg_vaapi_hwaccel = { - .name = "mjpeg_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MJPEG, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_mjpeg_vaapi_hwaccel = { + .p.name = "mjpeg_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MJPEG, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = &vaapi_mjpeg_start_frame, .end_frame = &vaapi_mjpeg_end_frame, .decode_slice = &vaapi_mjpeg_decode_slice, diff --git a/arm/android/third_party/ffmpeg/libavcodec/vaapi_mpeg2.c b/arm/android/third_party/ffmpeg/libavcodec/vaapi_mpeg2.c index 5e2b8891..eeb4e873 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vaapi_mpeg2.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vaapi_mpeg2.c @@ -20,7 +20,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "mpegutils.h" #include "mpegvideo.h" #include "mpegvideodec.h" @@ -172,11 +172,11 @@ static int vaapi_mpeg2_decode_slice(AVCodecContext *avctx, const uint8_t *buffer return 0; } -const AVHWAccel ff_mpeg2_vaapi_hwaccel = { - .name = "mpeg2_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG2VIDEO, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_mpeg2_vaapi_hwaccel = { + .p.name = "mpeg2_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG2VIDEO, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = &vaapi_mpeg2_start_frame, .end_frame = &vaapi_mpeg2_end_frame, .decode_slice = &vaapi_mpeg2_decode_slice, diff --git a/arm/android/third_party/ffmpeg/libavcodec/vaapi_mpeg4.c b/arm/android/third_party/ffmpeg/libavcodec/vaapi_mpeg4.c index 4e74e038..363b686e 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vaapi_mpeg4.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vaapi_mpeg4.c @@ -23,7 +23,7 @@ #include "config_components.h" #include "h263.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "mpeg4videodec.h" #include "mpegvideo.h" #include "mpegvideodec.h" @@ -180,11 +180,11 @@ static int vaapi_mpeg4_decode_slice(AVCodecContext *avctx, const uint8_t *buffer } #if CONFIG_MPEG4_VAAPI_HWACCEL -const AVHWAccel ff_mpeg4_vaapi_hwaccel = { - .name = "mpeg4_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG4, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_mpeg4_vaapi_hwaccel = { + .p.name = "mpeg4_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG4, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = &vaapi_mpeg4_start_frame, .end_frame = &vaapi_mpeg4_end_frame, .decode_slice = &vaapi_mpeg4_decode_slice, @@ -198,11 +198,11 @@ const AVHWAccel ff_mpeg4_vaapi_hwaccel = { #endif #if CONFIG_H263_VAAPI_HWACCEL -const AVHWAccel ff_h263_vaapi_hwaccel = { - .name = "h263_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H263, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_h263_vaapi_hwaccel = { + .p.name = "h263_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H263, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = &vaapi_mpeg4_start_frame, .end_frame = &vaapi_mpeg4_end_frame, .decode_slice = &vaapi_mpeg4_decode_slice, diff --git a/arm/android/third_party/ffmpeg/libavcodec/vaapi_vc1.c b/arm/android/third_party/ffmpeg/libavcodec/vaapi_vc1.c index fb2132e8..09a5c852 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vaapi_vc1.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vaapi_vc1.c @@ -22,11 +22,10 @@ #include "config_components.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "mpegvideodec.h" #include "vaapi_decode.h" #include "vc1.h" -#include "vc1data.h" /** Translate FFmpeg MV modes to VA API */ static int get_VAMvModeVC1(enum MVModes mv_mode) @@ -501,11 +500,11 @@ static int vaapi_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, } #if CONFIG_WMV3_VAAPI_HWACCEL -const AVHWAccel ff_wmv3_vaapi_hwaccel = { - .name = "wmv3_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WMV3, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_wmv3_vaapi_hwaccel = { + .p.name = "wmv3_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WMV3, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = &vaapi_vc1_start_frame, .end_frame = &vaapi_vc1_end_frame, .decode_slice = &vaapi_vc1_decode_slice, @@ -518,11 +517,11 @@ const AVHWAccel ff_wmv3_vaapi_hwaccel = { }; #endif -const AVHWAccel ff_vc1_vaapi_hwaccel = { - .name = "vc1_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VC1, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_vc1_vaapi_hwaccel = { + .p.name = "vc1_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VC1, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = &vaapi_vc1_start_frame, .end_frame = &vaapi_vc1_end_frame, .decode_slice = &vaapi_vc1_decode_slice, diff --git a/arm/android/third_party/ffmpeg/libavcodec/vaapi_vp8.c b/arm/android/third_party/ffmpeg/libavcodec/vaapi_vp8.c index 5b18bf8f..31137a45 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vaapi_vp8.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vaapi_vp8.c @@ -19,7 +19,7 @@ #include #include -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "vaapi_decode.h" #include "vp8.h" @@ -220,11 +220,11 @@ fail: return err; } -const AVHWAccel ff_vp8_vaapi_hwaccel = { - .name = "vp8_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP8, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_vp8_vaapi_hwaccel = { + .p.name = "vp8_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP8, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = &vaapi_vp8_start_frame, .end_frame = &vaapi_vp8_end_frame, .decode_slice = &vaapi_vp8_decode_slice, diff --git a/arm/android/third_party/ffmpeg/libavcodec/vaapi_vp9.c b/arm/android/third_party/ffmpeg/libavcodec/vaapi_vp9.c index 776382f6..9dc7d5e7 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vaapi_vp9.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vaapi_vp9.c @@ -22,7 +22,7 @@ #include "libavutil/pixdesc.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "vaapi_decode.h" #include "vp9shared.h" @@ -168,11 +168,11 @@ static int vaapi_vp9_decode_slice(AVCodecContext *avctx, return 0; } -const AVHWAccel ff_vp9_vaapi_hwaccel = { - .name = "vp9_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP9, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_vp9_vaapi_hwaccel = { + .p.name = "vp9_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP9, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = vaapi_vp9_start_frame, .end_frame = vaapi_vp9_end_frame, .decode_slice = vaapi_vp9_decode_slice, diff --git a/arm/android/third_party/ffmpeg/libavcodec/vc1dec.c b/arm/android/third_party/ffmpeg/libavcodec/vc1dec.c index 9e343d00..449d2fea 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vc1dec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vc1dec.c @@ -34,6 +34,7 @@ #include "decode.h" #include "get_bits.h" #include "h263dec.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "mpeg_er.h" #include "mpegvideo.h" @@ -483,108 +484,108 @@ static av_cold void vc1_init_static(void) { static VLCElem vlc_table[32372]; - INIT_VLC_STATIC(&ff_vc1_norm2_vlc, VC1_NORM2_VLC_BITS, 4, + VLC_INIT_STATIC(&ff_vc1_norm2_vlc, VC1_NORM2_VLC_BITS, 4, vc1_norm2_bits, 1, 1, vc1_norm2_codes, 1, 1, 1 << VC1_NORM2_VLC_BITS); - INIT_VLC_STATIC(&ff_vc1_norm6_vlc, VC1_NORM6_VLC_BITS, 64, + VLC_INIT_STATIC(&ff_vc1_norm6_vlc, VC1_NORM6_VLC_BITS, 64, vc1_norm6_bits, 1, 1, vc1_norm6_codes, 2, 2, 556); - INIT_VLC_STATIC(&ff_vc1_imode_vlc, VC1_IMODE_VLC_BITS, 7, + VLC_INIT_STATIC(&ff_vc1_imode_vlc, VC1_IMODE_VLC_BITS, 7, vc1_imode_bits, 1, 1, vc1_imode_codes, 1, 1, 1 << VC1_IMODE_VLC_BITS); for (int i = 0; i < 3; i++) { ff_vc1_ttmb_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 0]]; ff_vc1_ttmb_vlc[i].table_allocated = vlc_offs[i * 3 + 1] - vlc_offs[i * 3 + 0]; - init_vlc(&ff_vc1_ttmb_vlc[i], VC1_TTMB_VLC_BITS, 16, + vlc_init(&ff_vc1_ttmb_vlc[i], VC1_TTMB_VLC_BITS, 16, vc1_ttmb_bits[i], 1, 1, - vc1_ttmb_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC); + vc1_ttmb_codes[i], 2, 2, VLC_INIT_USE_STATIC); ff_vc1_ttblk_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 1]]; ff_vc1_ttblk_vlc[i].table_allocated = vlc_offs[i * 3 + 2] - vlc_offs[i * 3 + 1]; - init_vlc(&ff_vc1_ttblk_vlc[i], VC1_TTBLK_VLC_BITS, 8, + vlc_init(&ff_vc1_ttblk_vlc[i], VC1_TTBLK_VLC_BITS, 8, vc1_ttblk_bits[i], 1, 1, - vc1_ttblk_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + vc1_ttblk_codes[i], 1, 1, VLC_INIT_USE_STATIC); ff_vc1_subblkpat_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 2]]; ff_vc1_subblkpat_vlc[i].table_allocated = vlc_offs[i * 3 + 3] - vlc_offs[i * 3 + 2]; - init_vlc(&ff_vc1_subblkpat_vlc[i], VC1_SUBBLKPAT_VLC_BITS, 15, + vlc_init(&ff_vc1_subblkpat_vlc[i], VC1_SUBBLKPAT_VLC_BITS, 15, vc1_subblkpat_bits[i], 1, 1, - vc1_subblkpat_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + vc1_subblkpat_codes[i], 1, 1, VLC_INIT_USE_STATIC); } for (int i = 0; i < 4; i++) { ff_vc1_4mv_block_pattern_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 9]]; ff_vc1_4mv_block_pattern_vlc[i].table_allocated = vlc_offs[i * 3 + 10] - vlc_offs[i * 3 + 9]; - init_vlc(&ff_vc1_4mv_block_pattern_vlc[i], VC1_4MV_BLOCK_PATTERN_VLC_BITS, 16, + vlc_init(&ff_vc1_4mv_block_pattern_vlc[i], VC1_4MV_BLOCK_PATTERN_VLC_BITS, 16, vc1_4mv_block_pattern_bits[i], 1, 1, - vc1_4mv_block_pattern_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + vc1_4mv_block_pattern_codes[i], 1, 1, VLC_INIT_USE_STATIC); ff_vc1_cbpcy_p_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 10]]; ff_vc1_cbpcy_p_vlc[i].table_allocated = vlc_offs[i * 3 + 11] - vlc_offs[i * 3 + 10]; - init_vlc(&ff_vc1_cbpcy_p_vlc[i], VC1_CBPCY_P_VLC_BITS, 64, + vlc_init(&ff_vc1_cbpcy_p_vlc[i], VC1_CBPCY_P_VLC_BITS, 64, vc1_cbpcy_p_bits[i], 1, 1, - vc1_cbpcy_p_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC); + vc1_cbpcy_p_codes[i], 2, 2, VLC_INIT_USE_STATIC); ff_vc1_mv_diff_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 11]]; ff_vc1_mv_diff_vlc[i].table_allocated = vlc_offs[i * 3 + 12] - vlc_offs[i * 3 + 11]; - init_vlc(&ff_vc1_mv_diff_vlc[i], VC1_MV_DIFF_VLC_BITS, 73, + vlc_init(&ff_vc1_mv_diff_vlc[i], VC1_MV_DIFF_VLC_BITS, 73, vc1_mv_diff_bits[i], 1, 1, - vc1_mv_diff_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC); + vc1_mv_diff_codes[i], 2, 2, VLC_INIT_USE_STATIC); } for (int i = 0; i < 8; i++) { ff_vc1_ac_coeff_table[i].table = &vlc_table[vlc_offs[i * 2 + 21]]; ff_vc1_ac_coeff_table[i].table_allocated = vlc_offs[i * 2 + 22] - vlc_offs[i * 2 + 21]; - init_vlc(&ff_vc1_ac_coeff_table[i], AC_VLC_BITS, ff_vc1_ac_sizes[i], + vlc_init(&ff_vc1_ac_coeff_table[i], AC_VLC_BITS, ff_vc1_ac_sizes[i], &vc1_ac_tables[i][0][1], 8, 4, - &vc1_ac_tables[i][0][0], 8, 4, INIT_VLC_USE_NEW_STATIC); + &vc1_ac_tables[i][0][0], 8, 4, VLC_INIT_USE_STATIC); /* initialize interlaced MVDATA tables (2-Ref) */ ff_vc1_2ref_mvdata_vlc[i].table = &vlc_table[vlc_offs[i * 2 + 22]]; ff_vc1_2ref_mvdata_vlc[i].table_allocated = vlc_offs[i * 2 + 23] - vlc_offs[i * 2 + 22]; - init_vlc(&ff_vc1_2ref_mvdata_vlc[i], VC1_2REF_MVDATA_VLC_BITS, 126, + vlc_init(&ff_vc1_2ref_mvdata_vlc[i], VC1_2REF_MVDATA_VLC_BITS, 126, vc1_2ref_mvdata_bits[i], 1, 1, - vc1_2ref_mvdata_codes[i], 4, 4, INIT_VLC_USE_NEW_STATIC); + vc1_2ref_mvdata_codes[i], 4, 4, VLC_INIT_USE_STATIC); } for (int i = 0; i < 4; i++) { /* initialize 4MV MBMODE VLC tables for interlaced frame P picture */ ff_vc1_intfr_4mv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 37]]; ff_vc1_intfr_4mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 38] - vlc_offs[i * 3 + 37]; - init_vlc(&ff_vc1_intfr_4mv_mbmode_vlc[i], VC1_INTFR_4MV_MBMODE_VLC_BITS, 15, + vlc_init(&ff_vc1_intfr_4mv_mbmode_vlc[i], VC1_INTFR_4MV_MBMODE_VLC_BITS, 15, vc1_intfr_4mv_mbmode_bits[i], 1, 1, - vc1_intfr_4mv_mbmode_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC); + vc1_intfr_4mv_mbmode_codes[i], 2, 2, VLC_INIT_USE_STATIC); /* initialize NON-4MV MBMODE VLC tables for the same */ ff_vc1_intfr_non4mv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 38]]; ff_vc1_intfr_non4mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 39] - vlc_offs[i * 3 + 38]; - init_vlc(&ff_vc1_intfr_non4mv_mbmode_vlc[i], VC1_INTFR_NON4MV_MBMODE_VLC_BITS, 9, + vlc_init(&ff_vc1_intfr_non4mv_mbmode_vlc[i], VC1_INTFR_NON4MV_MBMODE_VLC_BITS, 9, vc1_intfr_non4mv_mbmode_bits[i], 1, 1, - vc1_intfr_non4mv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + vc1_intfr_non4mv_mbmode_codes[i], 1, 1, VLC_INIT_USE_STATIC); /* initialize interlaced MVDATA tables (1-Ref) */ ff_vc1_1ref_mvdata_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 39]]; ff_vc1_1ref_mvdata_vlc[i].table_allocated = vlc_offs[i * 3 + 40] - vlc_offs[i * 3 + 39]; - init_vlc(&ff_vc1_1ref_mvdata_vlc[i], VC1_1REF_MVDATA_VLC_BITS, 72, + vlc_init(&ff_vc1_1ref_mvdata_vlc[i], VC1_1REF_MVDATA_VLC_BITS, 72, vc1_1ref_mvdata_bits[i], 1, 1, - vc1_1ref_mvdata_codes[i], 4, 4, INIT_VLC_USE_NEW_STATIC); + vc1_1ref_mvdata_codes[i], 4, 4, VLC_INIT_USE_STATIC); } for (int i = 0; i < 4; i++) { /* Initialize 2MV Block pattern VLC tables */ ff_vc1_2mv_block_pattern_vlc[i].table = &vlc_table[vlc_offs[i + 49]]; ff_vc1_2mv_block_pattern_vlc[i].table_allocated = vlc_offs[i + 50] - vlc_offs[i + 49]; - init_vlc(&ff_vc1_2mv_block_pattern_vlc[i], VC1_2MV_BLOCK_PATTERN_VLC_BITS, 4, + vlc_init(&ff_vc1_2mv_block_pattern_vlc[i], VC1_2MV_BLOCK_PATTERN_VLC_BITS, 4, vc1_2mv_block_pattern_bits[i], 1, 1, - vc1_2mv_block_pattern_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + vc1_2mv_block_pattern_codes[i], 1, 1, VLC_INIT_USE_STATIC); } for (int i = 0; i < 8; i++) { /* Initialize interlaced CBPCY VLC tables (Table 124 - Table 131) */ ff_vc1_icbpcy_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 53]]; ff_vc1_icbpcy_vlc[i].table_allocated = vlc_offs[i * 3 + 54] - vlc_offs[i * 3 + 53]; - init_vlc(&ff_vc1_icbpcy_vlc[i], VC1_ICBPCY_VLC_BITS, 63, + vlc_init(&ff_vc1_icbpcy_vlc[i], VC1_ICBPCY_VLC_BITS, 63, vc1_icbpcy_p_bits[i], 1, 1, - vc1_icbpcy_p_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC); + vc1_icbpcy_p_codes[i], 2, 2, VLC_INIT_USE_STATIC); /* Initialize interlaced field picture MBMODE VLC tables */ ff_vc1_if_mmv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 54]]; ff_vc1_if_mmv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 55] - vlc_offs[i * 3 + 54]; - init_vlc(&ff_vc1_if_mmv_mbmode_vlc[i], VC1_IF_MMV_MBMODE_VLC_BITS, 8, + vlc_init(&ff_vc1_if_mmv_mbmode_vlc[i], VC1_IF_MMV_MBMODE_VLC_BITS, 8, vc1_if_mmv_mbmode_bits[i], 1, 1, - vc1_if_mmv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + vc1_if_mmv_mbmode_codes[i], 1, 1, VLC_INIT_USE_STATIC); ff_vc1_if_1mv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 55]]; ff_vc1_if_1mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 56] - vlc_offs[i * 3 + 55]; - init_vlc(&ff_vc1_if_1mv_mbmode_vlc[i], VC1_IF_1MV_MBMODE_VLC_BITS, 6, + vlc_init(&ff_vc1_if_1mv_mbmode_vlc[i], VC1_IF_1MV_MBMODE_VLC_BITS, 6, vc1_if_1mv_mbmode_bits[i], 1, 1, - vc1_if_1mv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + vc1_if_1mv_mbmode_codes[i], 1, 1, VLC_INIT_USE_STATIC); } ff_msmp4_vc1_vlcs_init_once(); } @@ -1096,19 +1097,26 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, } if (avctx->hwaccel) { + const FFHWAccel *hwaccel = ffhwaccel(avctx->hwaccel); s->mb_y = 0; if (v->field_mode && buf_start_second_field) { // decode first field s->picture_structure = PICT_BOTTOM_FIELD - v->tff; - if ((ret = avctx->hwaccel->start_frame(avctx, buf_start, buf_start_second_field - buf_start)) < 0) + ret = hwaccel->start_frame(avctx, buf_start, + buf_start_second_field - buf_start); + if (ret < 0) goto err; if (n_slices1 == -1) { // no slices, decode the field as-is - if ((ret = avctx->hwaccel->decode_slice(avctx, buf_start, buf_start_second_field - buf_start)) < 0) + ret = hwaccel->decode_slice(avctx, buf_start, + buf_start_second_field - buf_start); + if (ret < 0) goto err; } else { - if ((ret = avctx->hwaccel->decode_slice(avctx, buf_start, slices[0].rawbuf - buf_start)) < 0) + ret = hwaccel->decode_slice(avctx, buf_start, + slices[0].rawbuf - buf_start); + if (ret < 0) goto err; for (i = 0 ; i < n_slices1 + 1; i++) { @@ -1126,12 +1134,14 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, } } - if ((ret = avctx->hwaccel->decode_slice(avctx, slices[i].rawbuf, slices[i].raw_size)) < 0) + ret = hwaccel->decode_slice(avctx, slices[i].rawbuf, + slices[i].raw_size); + if (ret < 0) goto err; } } - if ((ret = avctx->hwaccel->end_frame(avctx)) < 0) + if ((ret = hwaccel->end_frame(avctx)) < 0) goto err; // decode second field @@ -1147,15 +1157,21 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, } v->s.current_picture_ptr->f->pict_type = v->s.pict_type; - if ((ret = avctx->hwaccel->start_frame(avctx, buf_start_second_field, (buf + buf_size) - buf_start_second_field)) < 0) + ret = hwaccel->start_frame(avctx, buf_start_second_field, + (buf + buf_size) - buf_start_second_field); + if (ret < 0) goto err; if (n_slices - n_slices1 == 2) { // no slices, decode the field as-is - if ((ret = avctx->hwaccel->decode_slice(avctx, buf_start_second_field, (buf + buf_size) - buf_start_second_field)) < 0) + ret = hwaccel->decode_slice(avctx, buf_start_second_field, + (buf + buf_size) - buf_start_second_field); + if (ret < 0) goto err; } else { - if ((ret = avctx->hwaccel->decode_slice(avctx, buf_start_second_field, slices[n_slices1 + 2].rawbuf - buf_start_second_field)) < 0) + ret = hwaccel->decode_slice(avctx, buf_start_second_field, + slices[n_slices1 + 2].rawbuf - buf_start_second_field); + if (ret < 0) goto err; for (i = n_slices1 + 2; i < n_slices; i++) { @@ -1173,25 +1189,33 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, } } - if ((ret = avctx->hwaccel->decode_slice(avctx, slices[i].rawbuf, slices[i].raw_size)) < 0) + ret = hwaccel->decode_slice(avctx, slices[i].rawbuf, + slices[i].raw_size); + if (ret < 0) goto err; } } - if ((ret = avctx->hwaccel->end_frame(avctx)) < 0) + if ((ret = hwaccel->end_frame(avctx)) < 0) goto err; } else { s->picture_structure = PICT_FRAME; - if ((ret = avctx->hwaccel->start_frame(avctx, buf_start, (buf + buf_size) - buf_start)) < 0) + ret = hwaccel->start_frame(avctx, buf_start, + (buf + buf_size) - buf_start); + if (ret < 0) goto err; if (n_slices == 0) { // no slices, decode the frame as-is - if ((ret = avctx->hwaccel->decode_slice(avctx, buf_start, (buf + buf_size) - buf_start)) < 0) + ret = hwaccel->decode_slice(avctx, buf_start, + (buf + buf_size) - buf_start); + if (ret < 0) goto err; } else { // decode the frame part as the first slice - if ((ret = avctx->hwaccel->decode_slice(avctx, buf_start, slices[0].rawbuf - buf_start)) < 0) + ret = hwaccel->decode_slice(avctx, buf_start, + slices[0].rawbuf - buf_start); + if (ret < 0) goto err; // and process the slices as additional slices afterwards @@ -1210,11 +1234,13 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, } } - if ((ret = avctx->hwaccel->decode_slice(avctx, slices[i].rawbuf, slices[i].raw_size)) < 0) + ret = hwaccel->decode_slice(avctx, slices[i].rawbuf, + slices[i].raw_size); + if (ret < 0) goto err; } } - if ((ret = avctx->hwaccel->end_frame(avctx)) < 0) + if ((ret = hwaccel->end_frame(avctx)) < 0) goto err; } } else { @@ -1322,7 +1348,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, if ( !v->field_mode && avctx->codec_id != AV_CODEC_ID_WMV3IMAGE && avctx->codec_id != AV_CODEC_ID_VC1IMAGE) - ff_er_frame_end(&s->er); + ff_er_frame_end(&s->er, NULL); } ff_mpv_frame_end(s); diff --git a/arm/android/third_party/ffmpeg/libavcodec/vdpau.c b/arm/android/third_party/ffmpeg/libavcodec/vdpau.c index 0bb793c0..2b9b78d8 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vdpau.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vdpau.c @@ -27,6 +27,7 @@ #include "avcodec.h" #include "decode.h" +#include "hwaccel_internal.h" #include "internal.h" #include "mpegvideodec.h" #include "vc1.h" @@ -324,8 +325,8 @@ static int ff_vdpau_common_reinit(AVCodecContext *avctx) avctx->coded_height == vdctx->height && (!hwctx || !hwctx->reset)) return 0; - avctx->hwaccel->uninit(avctx); - return avctx->hwaccel->init(avctx); + FF_HW_SIMPLE_CALL(avctx, uninit); + return FF_HW_SIMPLE_CALL(avctx, init); } int ff_vdpau_common_start_frame(struct vdpau_picture_context *pic_ctx, diff --git a/arm/android/third_party/ffmpeg/libavcodec/vdpau_av1.c b/arm/android/third_party/ffmpeg/libavcodec/vdpau_av1.c index 3c3c8e61..80923092 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vdpau_av1.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vdpau_av1.c @@ -25,7 +25,7 @@ #include "avcodec.h" #include "internal.h" #include "av1dec.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "vdpau.h" #include "vdpau_internal.h" @@ -337,13 +337,13 @@ static int vdpau_av1_init(AVCodecContext *avctx) uint32_t level = avctx->level; switch (avctx->profile) { - case FF_PROFILE_AV1_MAIN: + case AV_PROFILE_AV1_MAIN: profile = VDP_DECODER_PROFILE_AV1_MAIN; break; - case FF_PROFILE_AV1_HIGH: + case AV_PROFILE_AV1_HIGH: profile = VDP_DECODER_PROFILE_AV1_HIGH; break; - case FF_PROFILE_AV1_PROFESSIONAL: + case AV_PROFILE_AV1_PROFESSIONAL: profile = VDP_DECODER_PROFILE_AV1_PROFESSIONAL; break; default: @@ -353,11 +353,11 @@ static int vdpau_av1_init(AVCodecContext *avctx) return ff_vdpau_common_init(avctx, profile, level); } -const AVHWAccel ff_av1_vdpau_hwaccel = { - .name = "av1_vdpau", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AV1, - .pix_fmt = AV_PIX_FMT_VDPAU, +const FFHWAccel ff_av1_vdpau_hwaccel = { + .p.name = "av1_vdpau", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, + .p.pix_fmt = AV_PIX_FMT_VDPAU, .start_frame = vdpau_av1_start_frame, .end_frame = vdpau_av1_end_frame, .decode_slice = vdpau_av1_decode_slice, diff --git a/arm/android/third_party/ffmpeg/libavcodec/vdpau_h264.c b/arm/android/third_party/ffmpeg/libavcodec/vdpau_h264.c index 525e2084..9c08e404 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vdpau_h264.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vdpau_h264.c @@ -26,7 +26,7 @@ #include "avcodec.h" #include "h264dec.h" #include "h264_ps.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "mpegutils.h" #include "vdpau.h" #include "vdpau_internal.h" @@ -219,35 +219,35 @@ static int vdpau_h264_init(AVCodecContext *avctx) VdpDecoderProfile profile; uint32_t level = avctx->level; - switch (avctx->profile & ~FF_PROFILE_H264_INTRA) { - case FF_PROFILE_H264_BASELINE: + switch (avctx->profile & ~AV_PROFILE_H264_INTRA) { + case AV_PROFILE_H264_BASELINE: profile = VDP_DECODER_PROFILE_H264_BASELINE; break; - case FF_PROFILE_H264_CONSTRAINED_BASELINE: + case AV_PROFILE_H264_CONSTRAINED_BASELINE: #ifdef VDP_DECODER_PROFILE_H264_CONSTRAINED_BASELINE profile = VDP_DECODER_PROFILE_H264_CONSTRAINED_BASELINE; break; #endif - case FF_PROFILE_H264_MAIN: + case AV_PROFILE_H264_MAIN: profile = VDP_DECODER_PROFILE_H264_MAIN; break; - case FF_PROFILE_H264_HIGH: + case AV_PROFILE_H264_HIGH: profile = VDP_DECODER_PROFILE_H264_HIGH; break; #ifdef VDP_DECODER_PROFILE_H264_EXTENDED - case FF_PROFILE_H264_EXTENDED: + case AV_PROFILE_H264_EXTENDED: profile = VDP_DECODER_PROFILE_H264_EXTENDED; break; #endif - case FF_PROFILE_H264_HIGH_10: + case AV_PROFILE_H264_HIGH_10: /* XXX: High 10 can be treated as High so long as only 8 bits per * format are supported. */ profile = VDP_DECODER_PROFILE_H264_HIGH; break; #ifdef VDP_DECODER_PROFILE_H264_HIGH_444_PREDICTIVE - case FF_PROFILE_H264_HIGH_422: - case FF_PROFILE_H264_HIGH_444_PREDICTIVE: - case FF_PROFILE_H264_CAVLC_444: + case AV_PROFILE_H264_HIGH_422: + case AV_PROFILE_H264_HIGH_444_PREDICTIVE: + case AV_PROFILE_H264_CAVLC_444: profile = VDP_DECODER_PROFILE_H264_HIGH_444_PREDICTIVE; break; #endif @@ -255,17 +255,17 @@ static int vdpau_h264_init(AVCodecContext *avctx) return AVERROR(ENOTSUP); } - if ((avctx->profile & FF_PROFILE_H264_INTRA) && avctx->level == 11) + if ((avctx->profile & AV_PROFILE_H264_INTRA) && avctx->level == 11) level = VDP_DECODER_LEVEL_H264_1b; return ff_vdpau_common_init(avctx, profile, level); } -const AVHWAccel ff_h264_vdpau_hwaccel = { - .name = "h264_vdpau", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, - .pix_fmt = AV_PIX_FMT_VDPAU, +const FFHWAccel ff_h264_vdpau_hwaccel = { + .p.name = "h264_vdpau", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, + .p.pix_fmt = AV_PIX_FMT_VDPAU, .start_frame = vdpau_h264_start_frame, .end_frame = vdpau_h264_end_frame, .decode_slice = vdpau_h264_decode_slice, diff --git a/arm/android/third_party/ffmpeg/libavcodec/vdpau_hevc.c b/arm/android/third_party/ffmpeg/libavcodec/vdpau_hevc.c index 2669040f..4cd7ce56 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vdpau_hevc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vdpau_hevc.c @@ -25,7 +25,7 @@ #include "avcodec.h" #include "hevc_data.h" #include "hevcdec.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "vdpau.h" #include "vdpau_internal.h" #include "h265_profile_level.h" @@ -519,16 +519,16 @@ static int vdpau_hevc_init(AVCodecContext *avctx) int ret; switch (avctx->profile) { - case FF_PROFILE_HEVC_MAIN: + case AV_PROFILE_HEVC_MAIN: profile = VDP_DECODER_PROFILE_HEVC_MAIN; break; - case FF_PROFILE_HEVC_MAIN_10: + case AV_PROFILE_HEVC_MAIN_10: profile = VDP_DECODER_PROFILE_HEVC_MAIN_10; break; - case FF_PROFILE_HEVC_MAIN_STILL_PICTURE: + case AV_PROFILE_HEVC_MAIN_STILL_PICTURE: profile = VDP_DECODER_PROFILE_HEVC_MAIN_STILL; break; - case FF_PROFILE_HEVC_REXT: + case AV_PROFILE_HEVC_REXT: ret = vdpau_hevc_parse_rext_profile(avctx, &profile); if (ret) return AVERROR(ENOTSUP); @@ -540,11 +540,11 @@ static int vdpau_hevc_init(AVCodecContext *avctx) return ff_vdpau_common_init(avctx, profile, level); } -const AVHWAccel ff_hevc_vdpau_hwaccel = { - .name = "hevc_vdpau", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, - .pix_fmt = AV_PIX_FMT_VDPAU, +const FFHWAccel ff_hevc_vdpau_hwaccel = { + .p.name = "hevc_vdpau", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, + .p.pix_fmt = AV_PIX_FMT_VDPAU, .start_frame = vdpau_hevc_start_frame, .end_frame = vdpau_hevc_end_frame, .decode_slice = vdpau_hevc_decode_slice, diff --git a/arm/android/third_party/ffmpeg/libavcodec/vdpau_mpeg12.c b/arm/android/third_party/ffmpeg/libavcodec/vdpau_mpeg12.c index 79007aa1..bbf76eb4 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vdpau_mpeg12.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vdpau_mpeg12.c @@ -26,7 +26,7 @@ #include #include "avcodec.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "mpegvideo.h" #include "vdpau.h" #include "vdpau_internal.h" @@ -106,11 +106,11 @@ static int vdpau_mpeg1_init(AVCodecContext *avctx) VDP_DECODER_LEVEL_MPEG1_NA); } -const AVHWAccel ff_mpeg1_vdpau_hwaccel = { - .name = "mpeg1_vdpau", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG1VIDEO, - .pix_fmt = AV_PIX_FMT_VDPAU, +const FFHWAccel ff_mpeg1_vdpau_hwaccel = { + .p.name = "mpeg1_vdpau", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG1VIDEO, + .p.pix_fmt = AV_PIX_FMT_VDPAU, .start_frame = vdpau_mpeg_start_frame, .end_frame = ff_vdpau_mpeg_end_frame, .decode_slice = vdpau_mpeg_decode_slice, @@ -128,10 +128,10 @@ static int vdpau_mpeg2_init(AVCodecContext *avctx) VdpDecoderProfile profile; switch (avctx->profile) { - case FF_PROFILE_MPEG2_MAIN: + case AV_PROFILE_MPEG2_MAIN: profile = VDP_DECODER_PROFILE_MPEG2_MAIN; break; - case FF_PROFILE_MPEG2_SIMPLE: + case AV_PROFILE_MPEG2_SIMPLE: profile = VDP_DECODER_PROFILE_MPEG2_SIMPLE; break; default: @@ -141,11 +141,11 @@ static int vdpau_mpeg2_init(AVCodecContext *avctx) return ff_vdpau_common_init(avctx, profile, VDP_DECODER_LEVEL_MPEG2_HL); } -const AVHWAccel ff_mpeg2_vdpau_hwaccel = { - .name = "mpeg2_vdpau", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG2VIDEO, - .pix_fmt = AV_PIX_FMT_VDPAU, +const FFHWAccel ff_mpeg2_vdpau_hwaccel = { + .p.name = "mpeg2_vdpau", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG2VIDEO, + .p.pix_fmt = AV_PIX_FMT_VDPAU, .start_frame = vdpau_mpeg_start_frame, .end_frame = ff_vdpau_mpeg_end_frame, .decode_slice = vdpau_mpeg_decode_slice, diff --git a/arm/android/third_party/ffmpeg/libavcodec/vdpau_mpeg4.c b/arm/android/third_party/ffmpeg/libavcodec/vdpau_mpeg4.c index 1211b1df..055426b9 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vdpau_mpeg4.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vdpau_mpeg4.c @@ -24,7 +24,7 @@ #include #include "avcodec.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "mpeg4videodec.h" #include "vdpau.h" #include "vdpau_internal.h" @@ -95,13 +95,13 @@ static int vdpau_mpeg4_init(AVCodecContext *avctx) VdpDecoderProfile profile; switch (avctx->profile) { - case FF_PROFILE_MPEG4_SIMPLE: + case AV_PROFILE_MPEG4_SIMPLE: profile = VDP_DECODER_PROFILE_MPEG4_PART2_SP; break; // As any ASP decoder must be able to decode SP, this // should be a safe fallback if profile is unknown/unspecified. - case FF_PROFILE_UNKNOWN: - case FF_PROFILE_MPEG4_ADVANCED_SIMPLE: + case AV_PROFILE_UNKNOWN: + case AV_PROFILE_MPEG4_ADVANCED_SIMPLE: profile = VDP_DECODER_PROFILE_MPEG4_PART2_ASP; break; default: @@ -111,11 +111,11 @@ static int vdpau_mpeg4_init(AVCodecContext *avctx) return ff_vdpau_common_init(avctx, profile, avctx->level); } -const AVHWAccel ff_mpeg4_vdpau_hwaccel = { - .name = "mpeg4_vdpau", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG4, - .pix_fmt = AV_PIX_FMT_VDPAU, +const FFHWAccel ff_mpeg4_vdpau_hwaccel = { + .p.name = "mpeg4_vdpau", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG4, + .p.pix_fmt = AV_PIX_FMT_VDPAU, .start_frame = vdpau_mpeg4_start_frame, .end_frame = ff_vdpau_mpeg_end_frame, .decode_slice = vdpau_mpeg4_decode_slice, diff --git a/arm/android/third_party/ffmpeg/libavcodec/vdpau_vc1.c b/arm/android/third_party/ffmpeg/libavcodec/vdpau_vc1.c index 00b33f42..4e5ee144 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vdpau_vc1.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vdpau_vc1.c @@ -26,7 +26,7 @@ #include #include "avcodec.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "vc1.h" #include "vdpau.h" #include "vdpau_internal.h" @@ -121,13 +121,13 @@ static int vdpau_vc1_init(AVCodecContext *avctx) VdpDecoderProfile profile; switch (avctx->profile) { - case FF_PROFILE_VC1_SIMPLE: + case AV_PROFILE_VC1_SIMPLE: profile = VDP_DECODER_PROFILE_VC1_SIMPLE; break; - case FF_PROFILE_VC1_MAIN: + case AV_PROFILE_VC1_MAIN: profile = VDP_DECODER_PROFILE_VC1_MAIN; break; - case FF_PROFILE_VC1_ADVANCED: + case AV_PROFILE_VC1_ADVANCED: profile = VDP_DECODER_PROFILE_VC1_ADVANCED; break; default: @@ -138,11 +138,11 @@ static int vdpau_vc1_init(AVCodecContext *avctx) } #if CONFIG_WMV3_VDPAU_HWACCEL -const AVHWAccel ff_wmv3_vdpau_hwaccel = { - .name = "wm3_vdpau", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WMV3, - .pix_fmt = AV_PIX_FMT_VDPAU, +const FFHWAccel ff_wmv3_vdpau_hwaccel = { + .p.name = "wm3_vdpau", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WMV3, + .p.pix_fmt = AV_PIX_FMT_VDPAU, .start_frame = vdpau_vc1_start_frame, .end_frame = ff_vdpau_mpeg_end_frame, .decode_slice = vdpau_vc1_decode_slice, @@ -155,11 +155,11 @@ const AVHWAccel ff_wmv3_vdpau_hwaccel = { }; #endif -const AVHWAccel ff_vc1_vdpau_hwaccel = { - .name = "vc1_vdpau", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VC1, - .pix_fmt = AV_PIX_FMT_VDPAU, +const FFHWAccel ff_vc1_vdpau_hwaccel = { + .p.name = "vc1_vdpau", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VC1, + .p.pix_fmt = AV_PIX_FMT_VDPAU, .start_frame = vdpau_vc1_start_frame, .end_frame = ff_vdpau_mpeg_end_frame, .decode_slice = vdpau_vc1_decode_slice, diff --git a/arm/android/third_party/ffmpeg/libavcodec/vdpau_vp9.c b/arm/android/third_party/ffmpeg/libavcodec/vdpau_vp9.c index 49fe1818..424e2e60 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vdpau_vp9.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vdpau_vp9.c @@ -23,9 +23,8 @@ #include #include "libavutil/pixdesc.h" #include "avcodec.h" -#include "vp9data.h" +#include "hwaccel_internal.h" #include "vp9dec.h" -#include "hwconfig.h" #include "vdpau.h" #include "vdpau_internal.h" @@ -204,16 +203,16 @@ static int vdpau_vp9_init(AVCodecContext *avctx) uint32_t level = avctx->level; switch (avctx->profile) { - case FF_PROFILE_VP9_0: + case AV_PROFILE_VP9_0: profile = VDP_DECODER_PROFILE_VP9_PROFILE_0; break; - case FF_PROFILE_VP9_1: + case AV_PROFILE_VP9_1: profile = VDP_DECODER_PROFILE_VP9_PROFILE_1; break; - case FF_PROFILE_VP9_2: + case AV_PROFILE_VP9_2: profile = VDP_DECODER_PROFILE_VP9_PROFILE_2; break; - case FF_PROFILE_VP9_3: + case AV_PROFILE_VP9_3: profile = VDP_DECODER_PROFILE_VP9_PROFILE_3; break; default: @@ -223,11 +222,11 @@ static int vdpau_vp9_init(AVCodecContext *avctx) return ff_vdpau_common_init(avctx, profile, level); } -const AVHWAccel ff_vp9_vdpau_hwaccel = { - .name = "vp9_vdpau", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP9, - .pix_fmt = AV_PIX_FMT_VDPAU, +const FFHWAccel ff_vp9_vdpau_hwaccel = { + .p.name = "vp9_vdpau", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP9, + .p.pix_fmt = AV_PIX_FMT_VDPAU, .start_frame = vdpau_vp9_start_frame, .end_frame = vdpau_vp9_end_frame, .decode_slice = vdpau_vp9_decode_slice, diff --git a/arm/android/third_party/ffmpeg/libavcodec/version.h b/arm/android/third_party/ffmpeg/libavcodec/version.h index 9411511e..87b7284a 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/version.h +++ b/arm/android/third_party/ffmpeg/libavcodec/version.h @@ -29,7 +29,7 @@ #include "version_major.h" -#define LIBAVCODEC_VERSION_MINOR 22 +#define LIBAVCODEC_VERSION_MINOR 28 #define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ diff --git a/arm/android/third_party/ffmpeg/libavcodec/version_major.h b/arm/android/third_party/ffmpeg/libavcodec/version_major.h index 95c5aec0..b9164fe5 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/version_major.h +++ b/arm/android/third_party/ffmpeg/libavcodec/version_major.h @@ -50,6 +50,9 @@ #define FF_API_TICKS_PER_FRAME (LIBAVCODEC_VERSION_MAJOR < 61) #define FF_API_DROPCHANGED (LIBAVCODEC_VERSION_MAJOR < 61) +#define FF_API_AVFFT (LIBAVCODEC_VERSION_MAJOR < 62) +#define FF_API_FF_PROFILE_LEVEL (LIBAVCODEC_VERSION_MAJOR < 62) + // reminder to remove CrystalHD decoders on next major bump #define FF_CODEC_CRYSTAL_HD (LIBAVCODEC_VERSION_MAJOR < 61) diff --git a/arm/android/third_party/ffmpeg/libavcodec/videotoolbox.c b/arm/android/third_party/ffmpeg/libavcodec/videotoolbox.c index 64443255..963379d4 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/videotoolbox.c +++ b/arm/android/third_party/ffmpeg/libavcodec/videotoolbox.c @@ -33,6 +33,7 @@ #include "internal.h" #include "h264dec.h" #include "hevcdec.h" +#include "hwaccel_internal.h" #include "mpegvideo.h" #include "proresdec.h" #include @@ -1284,11 +1285,11 @@ int ff_videotoolbox_frame_params(AVCodecContext *avctx, return 0; } -const AVHWAccel ff_h263_videotoolbox_hwaccel = { - .name = "h263_videotoolbox", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H263, - .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, +const FFHWAccel ff_h263_videotoolbox_hwaccel = { + .p.name = "h263_videotoolbox", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H263, + .p.pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, .alloc_frame = ff_videotoolbox_alloc_frame, .start_frame = videotoolbox_mpeg_start_frame, .decode_slice = videotoolbox_mpeg_decode_slice, @@ -1299,11 +1300,11 @@ const AVHWAccel ff_h263_videotoolbox_hwaccel = { .priv_data_size = sizeof(VTContext), }; -const AVHWAccel ff_hevc_videotoolbox_hwaccel = { - .name = "hevc_videotoolbox", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, - .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, +const FFHWAccel ff_hevc_videotoolbox_hwaccel = { + .p.name = "hevc_videotoolbox", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, + .p.pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, .alloc_frame = ff_videotoolbox_alloc_frame, .start_frame = videotoolbox_hevc_start_frame, .decode_slice = videotoolbox_hevc_decode_slice, @@ -1315,11 +1316,11 @@ const AVHWAccel ff_hevc_videotoolbox_hwaccel = { .priv_data_size = sizeof(VTContext), }; -const AVHWAccel ff_h264_videotoolbox_hwaccel = { - .name = "h264_videotoolbox", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, - .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, +const FFHWAccel ff_h264_videotoolbox_hwaccel = { + .p.name = "h264_videotoolbox", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, + .p.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, @@ -1331,11 +1332,11 @@ const AVHWAccel ff_h264_videotoolbox_hwaccel = { .priv_data_size = sizeof(VTContext), }; -const AVHWAccel ff_mpeg1_videotoolbox_hwaccel = { - .name = "mpeg1_videotoolbox", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG1VIDEO, - .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, +const FFHWAccel ff_mpeg1_videotoolbox_hwaccel = { + .p.name = "mpeg1_videotoolbox", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG1VIDEO, + .p.pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, .alloc_frame = ff_videotoolbox_alloc_frame, .start_frame = videotoolbox_mpeg_start_frame, .decode_slice = videotoolbox_mpeg_decode_slice, @@ -1346,11 +1347,11 @@ const AVHWAccel ff_mpeg1_videotoolbox_hwaccel = { .priv_data_size = sizeof(VTContext), }; -const AVHWAccel ff_mpeg2_videotoolbox_hwaccel = { - .name = "mpeg2_videotoolbox", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG2VIDEO, - .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, +const FFHWAccel ff_mpeg2_videotoolbox_hwaccel = { + .p.name = "mpeg2_videotoolbox", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG2VIDEO, + .p.pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, .alloc_frame = ff_videotoolbox_alloc_frame, .start_frame = videotoolbox_mpeg_start_frame, .decode_slice = videotoolbox_mpeg_decode_slice, @@ -1361,11 +1362,11 @@ const AVHWAccel ff_mpeg2_videotoolbox_hwaccel = { .priv_data_size = sizeof(VTContext), }; -const AVHWAccel ff_mpeg4_videotoolbox_hwaccel = { - .name = "mpeg4_videotoolbox", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG4, - .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, +const FFHWAccel ff_mpeg4_videotoolbox_hwaccel = { + .p.name = "mpeg4_videotoolbox", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG4, + .p.pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, .alloc_frame = ff_videotoolbox_alloc_frame, .start_frame = videotoolbox_mpeg_start_frame, .decode_slice = videotoolbox_mpeg_decode_slice, @@ -1376,11 +1377,11 @@ const AVHWAccel ff_mpeg4_videotoolbox_hwaccel = { .priv_data_size = sizeof(VTContext), }; -const AVHWAccel ff_prores_videotoolbox_hwaccel = { - .name = "prores_videotoolbox", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PRORES, - .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, +const FFHWAccel ff_prores_videotoolbox_hwaccel = { + .p.name = "prores_videotoolbox", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PRORES, + .p.pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, .alloc_frame = ff_videotoolbox_alloc_frame, .start_frame = videotoolbox_prores_start_frame, .decode_slice = videotoolbox_prores_decode_slice, diff --git a/arm/android/third_party/ffmpeg/libavcodec/videotoolbox_vp9.c b/arm/android/third_party/ffmpeg/libavcodec/videotoolbox_vp9.c index a998f36d..f5489854 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/videotoolbox_vp9.c +++ b/arm/android/third_party/ffmpeg/libavcodec/videotoolbox_vp9.c @@ -31,6 +31,7 @@ #include "libavutil/intreadwrite.h" #include "libavutil/pixdesc.h" #include "decode.h" +#include "hwaccel_internal.h" #include "internal.h" #include "vp9shared.h" @@ -125,11 +126,11 @@ static int videotoolbox_vp9_end_frame(AVCodecContext *avctx) return ff_videotoolbox_common_end_frame(avctx, frame); } -const AVHWAccel ff_vp9_videotoolbox_hwaccel = { - .name = "vp9_videotoolbox", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP9, - .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, +const FFHWAccel ff_vp9_videotoolbox_hwaccel = { + .p.name = "vp9_videotoolbox", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP9, + .p.pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, .alloc_frame = ff_videotoolbox_alloc_frame, .start_frame = videotoolbox_vp9_start_frame, .decode_slice = videotoolbox_vp9_decode_slice, diff --git a/arm/android/third_party/ffmpeg/libavcodec/videotoolboxenc.c b/arm/android/third_party/ffmpeg/libavcodec/videotoolboxenc.c index 61143513..1d159532 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/videotoolboxenc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/videotoolboxenc.c @@ -206,7 +206,7 @@ static void loadVTEncSymbols(void){ GET_SYM(kVTCompressionPropertyKey_MinAllowedFrameQP, "MinAllowedFrameQP"); } -#define H264_PROFILE_CONSTRAINED_HIGH (FF_PROFILE_H264_HIGH | FF_PROFILE_H264_CONSTRAINED) +#define H264_PROFILE_CONSTRAINED_HIGH (AV_PROFILE_H264_HIGH | AV_PROFILE_H264_CONSTRAINED) typedef enum VTH264Entropy{ VT_ENTROPY_NOT_SET, @@ -232,6 +232,7 @@ typedef struct VTEncContext { AVClass *class; enum AVCodecID codec_id; VTCompressionSessionRef session; + CFDictionaryRef supported_props; CFStringRef ycbcr_matrix; CFStringRef color_primaries; CFStringRef transfer_function; @@ -321,6 +322,34 @@ static void clear_frame_queue(VTEncContext *vtctx) set_async_error(vtctx, 0); } +static void vtenc_reset(VTEncContext *vtctx) +{ + if (vtctx->session) { + CFRelease(vtctx->session); + vtctx->session = NULL; + } + + if (vtctx->supported_props) { + CFRelease(vtctx->supported_props); + vtctx->supported_props = NULL; + } + + if (vtctx->color_primaries) { + CFRelease(vtctx->color_primaries); + vtctx->color_primaries = NULL; + } + + if (vtctx->transfer_function) { + CFRelease(vtctx->transfer_function); + vtctx->transfer_function = NULL; + } + + if (vtctx->ycbcr_matrix) { + CFRelease(vtctx->ycbcr_matrix); + vtctx->ycbcr_matrix = NULL; + } +} + static int vtenc_q_pop(VTEncContext *vtctx, bool wait, CMSampleBufferRef *buf, ExtraSEI **sei) { BufNode *info; @@ -455,22 +484,22 @@ static CMVideoCodecType get_cm_codec_type(AVCodecContext *avctx, return kCMVideoCodecType_HEVC; case AV_CODEC_ID_PRORES: switch (profile) { - case FF_PROFILE_PRORES_PROXY: + case AV_PROFILE_PRORES_PROXY: return MKBETAG('a','p','c','o'); // kCMVideoCodecType_AppleProRes422Proxy - case FF_PROFILE_PRORES_LT: + case AV_PROFILE_PRORES_LT: return MKBETAG('a','p','c','s'); // kCMVideoCodecType_AppleProRes422LT - case FF_PROFILE_PRORES_STANDARD: + case AV_PROFILE_PRORES_STANDARD: return MKBETAG('a','p','c','n'); // kCMVideoCodecType_AppleProRes422 - case FF_PROFILE_PRORES_HQ: + case AV_PROFILE_PRORES_HQ: return MKBETAG('a','p','c','h'); // kCMVideoCodecType_AppleProRes422HQ - case FF_PROFILE_PRORES_4444: + case AV_PROFILE_PRORES_4444: return MKBETAG('a','p','4','h'); // kCMVideoCodecType_AppleProRes4444 - case FF_PROFILE_PRORES_XQ: + case AV_PROFILE_PRORES_XQ: return MKBETAG('a','p','4','x'); // kCMVideoCodecType_AppleProRes4444XQ default: av_log(avctx, AV_LOG_ERROR, "Unknown profile ID: %d, using auto\n", profile); - case FF_PROFILE_UNKNOWN: + case AV_PROFILE_UNKNOWN: if (desc && ((desc->flags & AV_PIX_FMT_FLAG_ALPHA) || desc->log2_chroma_w == 0)) @@ -736,18 +765,18 @@ static bool get_vt_h264_profile_level(AVCodecContext *avctx, VTEncContext *vtctx = avctx->priv_data; int profile = vtctx->profile; - if (profile == FF_PROFILE_UNKNOWN && vtctx->level) { + if (profile == AV_PROFILE_UNKNOWN && vtctx->level) { //Need to pick a profile if level is not auto-selected. - profile = vtctx->has_b_frames ? FF_PROFILE_H264_MAIN : FF_PROFILE_H264_BASELINE; + profile = vtctx->has_b_frames ? AV_PROFILE_H264_MAIN : AV_PROFILE_H264_BASELINE; } *profile_level_val = NULL; switch (profile) { - case FF_PROFILE_UNKNOWN: + case AV_PROFILE_UNKNOWN: return true; - case FF_PROFILE_H264_BASELINE: + case AV_PROFILE_H264_BASELINE: switch (vtctx->level) { case 0: *profile_level_val = compat_keys.kVTProfileLevel_H264_Baseline_AutoLevel; break; @@ -769,7 +798,7 @@ static bool get_vt_h264_profile_level(AVCodecContext *avctx, } break; - case FF_PROFILE_H264_CONSTRAINED_BASELINE: + case AV_PROFILE_H264_CONSTRAINED_BASELINE: *profile_level_val = compat_keys.kVTProfileLevel_H264_ConstrainedBaseline_AutoLevel; if (vtctx->level != 0) { @@ -781,7 +810,7 @@ static bool get_vt_h264_profile_level(AVCodecContext *avctx, } break; - case FF_PROFILE_H264_MAIN: + case AV_PROFILE_H264_MAIN: switch (vtctx->level) { case 0: *profile_level_val = compat_keys.kVTProfileLevel_H264_Main_AutoLevel; break; @@ -812,7 +841,7 @@ static bool get_vt_h264_profile_level(AVCodecContext *avctx, } break; - case FF_PROFILE_H264_HIGH: + case AV_PROFILE_H264_HIGH: switch (vtctx->level) { case 0: *profile_level_val = compat_keys.kVTProfileLevel_H264_High_AutoLevel; break; @@ -835,7 +864,7 @@ static bool get_vt_h264_profile_level(AVCodecContext *avctx, compat_keys.kVTProfileLevel_H264_High_5_2; break; } break; - case FF_PROFILE_H264_EXTENDED: + case AV_PROFILE_H264_EXTENDED: switch (vtctx->level) { case 0: *profile_level_val = compat_keys.kVTProfileLevel_H264_Extended_AutoLevel; break; @@ -868,13 +897,13 @@ static bool get_vt_hevc_profile_level(AVCodecContext *avctx, *profile_level_val = NULL; switch (profile) { - case FF_PROFILE_UNKNOWN: + case AV_PROFILE_UNKNOWN: return true; - case FF_PROFILE_HEVC_MAIN: + case AV_PROFILE_HEVC_MAIN: *profile_level_val = compat_keys.kVTProfileLevel_HEVC_Main_AutoLevel; break; - case FF_PROFILE_HEVC_MAIN_10: + case AV_PROFILE_HEVC_MAIN_10: *profile_level_val = compat_keys.kVTProfileLevel_HEVC_Main10_AutoLevel; break; @@ -1001,132 +1030,20 @@ pbinfo_nomem: return AVERROR(ENOMEM); } -static int get_cv_color_primaries(AVCodecContext *avctx, - CFStringRef *primaries) -{ - enum AVColorPrimaries pri = avctx->color_primaries; - switch (pri) { - case AVCOL_PRI_UNSPECIFIED: - *primaries = NULL; - break; - - case AVCOL_PRI_BT470BG: - *primaries = kCVImageBufferColorPrimaries_EBU_3213; - break; - - case AVCOL_PRI_SMPTE170M: - *primaries = kCVImageBufferColorPrimaries_SMPTE_C; - break; - - case AVCOL_PRI_BT709: - *primaries = kCVImageBufferColorPrimaries_ITU_R_709_2; - break; - - case AVCOL_PRI_BT2020: - *primaries = compat_keys.kCVImageBufferColorPrimaries_ITU_R_2020; - break; - - default: - av_log(avctx, AV_LOG_ERROR, "Color primaries %s is not supported.\n", av_color_primaries_name(pri)); - *primaries = NULL; - return -1; - } - - return 0; -} - -static int get_cv_transfer_function(AVCodecContext *avctx, - CFStringRef *transfer_fnc, - CFNumberRef *gamma_level) +static int get_cv_gamma(AVCodecContext *avctx, + CFNumberRef *gamma_level) { enum AVColorTransferCharacteristic trc = avctx->color_trc; - Float32 gamma; + Float32 gamma = 0; *gamma_level = NULL; - switch (trc) { - case AVCOL_TRC_UNSPECIFIED: - *transfer_fnc = NULL; - break; - - case AVCOL_TRC_BT709: - *transfer_fnc = kCVImageBufferTransferFunction_ITU_R_709_2; - break; - - case AVCOL_TRC_SMPTE240M: - *transfer_fnc = kCVImageBufferTransferFunction_SMPTE_240M_1995; - break; - -#if HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_SMPTE_ST_2084_PQ - case AVCOL_TRC_SMPTE2084: - *transfer_fnc = kCVImageBufferTransferFunction_SMPTE_ST_2084_PQ; - break; -#endif -#if HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_LINEAR - case AVCOL_TRC_LINEAR: - *transfer_fnc = kCVImageBufferTransferFunction_Linear; - break; -#endif -#if HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_ITU_R_2100_HLG - case AVCOL_TRC_ARIB_STD_B67: - *transfer_fnc = kCVImageBufferTransferFunction_ITU_R_2100_HLG; - break; -#endif - - case AVCOL_TRC_GAMMA22: - gamma = 2.2; - *transfer_fnc = kCVImageBufferTransferFunction_UseGamma; - *gamma_level = CFNumberCreate(NULL, kCFNumberFloat32Type, &gamma); - break; - - case AVCOL_TRC_GAMMA28: - gamma = 2.8; - *transfer_fnc = kCVImageBufferTransferFunction_UseGamma; - *gamma_level = CFNumberCreate(NULL, kCFNumberFloat32Type, &gamma); - break; - - case AVCOL_TRC_BT2020_10: - case AVCOL_TRC_BT2020_12: - *transfer_fnc = compat_keys.kCVImageBufferTransferFunction_ITU_R_2020; - break; - - default: - *transfer_fnc = NULL; - av_log(avctx, AV_LOG_ERROR, "Transfer function %s is not supported.\n", av_color_transfer_name(trc)); - return -1; - } - - return 0; -} - -static int get_cv_ycbcr_matrix(AVCodecContext *avctx, CFStringRef *matrix) { - switch(avctx->colorspace) { - case AVCOL_SPC_BT709: - *matrix = kCVImageBufferYCbCrMatrix_ITU_R_709_2; - break; - - case AVCOL_SPC_UNSPECIFIED: - case AVCOL_SPC_RGB: - *matrix = NULL; - break; - - case AVCOL_SPC_BT470BG: - case AVCOL_SPC_SMPTE170M: - *matrix = kCVImageBufferYCbCrMatrix_ITU_R_601_4; - break; - - case AVCOL_SPC_SMPTE240M: - *matrix = kCVImageBufferYCbCrMatrix_SMPTE_240M_1995; - break; - - case AVCOL_SPC_BT2020_NCL: - *matrix = compat_keys.kCVImageBufferYCbCrMatrix_ITU_R_2020; - break; - - default: - av_log(avctx, AV_LOG_ERROR, "Color space %s is not supported.\n", av_color_space_name(avctx->colorspace)); - return -1; - } + if (trc == AVCOL_TRC_GAMMA22) + gamma = 2.2; + else if (trc == AVCOL_TRC_GAMMA28) + gamma = 2.8; + if (gamma != 0) + *gamma_level = CFNumberCreate(NULL, kCFNumberFloat32Type, &gamma); return 0; } @@ -1222,6 +1139,50 @@ static int vtenc_create_encoder(AVCodecContext *avctx, return AVERROR_EXTERNAL; } +#if defined (MAC_OS_X_VERSION_10_13) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_13) + if (__builtin_available(macOS 10.13, *)) { + status = VTCopySupportedPropertyDictionaryForEncoder(avctx->width, + avctx->height, + codec_type, + enc_info, + NULL, + &vtctx->supported_props); + + if (status != noErr) { + av_log(avctx, AV_LOG_ERROR,"Error retrieving the supported property dictionary err=%"PRId64"\n", (int64_t)status); + return AVERROR_EXTERNAL; + } + } +#endif + + // Dump the init encoder + { + CFStringRef encoderID = NULL; + status = VTSessionCopyProperty(vtctx->session, + kVTCompressionPropertyKey_EncoderID, + kCFAllocatorDefault, + &encoderID); + if (status == noErr) { + CFIndex length = CFStringGetLength(encoderID); + CFIndex max_size = CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8); + char *name = av_malloc(max_size); + if (!name) { + CFRelease(encoderID); + return AVERROR(ENOMEM); + } + + CFStringGetCString(encoderID, + name, + max_size, + kCFStringEncodingUTF8); + av_log(avctx, AV_LOG_DEBUG, "Init the encoder: %s\n", name); + + av_freep(&name); + } + if (encoderID != NULL) + CFRelease(encoderID); + } + if (avctx->flags & AV_CODEC_FLAG_QSCALE && !vtenc_qscale_enabled()) { av_log(avctx, AV_LOG_ERROR, "Error: -q:v qscale not available for encoder. Use -b:v bitrate instead.\n"); return AVERROR_EXTERNAL; @@ -1633,12 +1594,12 @@ static int vtenc_configure_encoder(AVCodecContext *avctx) vtctx->get_param_set_func = CMVideoFormatDescriptionGetH264ParameterSetAtIndex; vtctx->has_b_frames = avctx->max_b_frames > 0; - if(vtctx->has_b_frames && (0xFF & vtctx->profile) == FF_PROFILE_H264_BASELINE){ + if(vtctx->has_b_frames && (0xFF & vtctx->profile) == AV_PROFILE_H264_BASELINE){ av_log(avctx, AV_LOG_WARNING, "Cannot use B-frames with baseline profile. Output will not contain B-frames.\n"); vtctx->has_b_frames = 0; } - if (vtctx->entropy == VT_CABAC && (0xFF & vtctx->profile) == FF_PROFILE_H264_BASELINE) { + if (vtctx->entropy == VT_CABAC && (0xFF & vtctx->profile) == AV_PROFILE_H264_BASELINE) { av_log(avctx, AV_LOG_WARNING, "CABAC entropy requires 'main' or 'high' profile, but baseline was requested. Encode will not use CABAC entropy.\n"); vtctx->entropy = VT_ENTROPY_NOT_SET; } @@ -1694,9 +1655,10 @@ static int vtenc_configure_encoder(AVCodecContext *avctx) vtctx->dts_delta = vtctx->has_b_frames ? -1 : 0; - get_cv_transfer_function(avctx, &vtctx->transfer_function, &gamma_level); - get_cv_ycbcr_matrix(avctx, &vtctx->ycbcr_matrix); - get_cv_color_primaries(avctx, &vtctx->color_primaries); + get_cv_gamma(avctx, &gamma_level); + vtctx->transfer_function = av_map_videotoolbox_color_trc_from_av(avctx->color_trc); + vtctx->ycbcr_matrix = av_map_videotoolbox_color_matrix_from_av(avctx->colorspace); + vtctx->color_primaries = av_map_videotoolbox_color_primaries_from_av(avctx->color_primaries); if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) { @@ -1743,9 +1705,8 @@ static av_cold int vtenc_init(AVCodecContext *avctx) pthread_cond_init(&vtctx->cv_sample_sent, NULL); // It can happen when user set avctx->profile directly. - if (vtctx->profile == FF_PROFILE_UNKNOWN) + if (vtctx->profile == AV_PROFILE_UNKNOWN) vtctx->profile = avctx->profile; - vtctx->session = NULL; status = vtenc_configure_encoder(avctx); if (status) return status; @@ -2514,8 +2475,8 @@ static int create_cv_pixel_buffer(AVCodecContext *avctx, vtstatus = VTCompressionSessionPrepareToEncodeFrames(vtctx->session); if (vtstatus == kVTInvalidSessionErr) { - CFRelease(vtctx->session); - vtctx->session = NULL; + vtenc_reset(vtctx); + status = vtenc_configure_encoder(avctx); if (status == 0) pix_buf_pool = VTCompressionSessionGetPixelBufferPool(vtctx->session); @@ -2771,10 +2732,7 @@ static int vtenc_populate_extradata(AVCodecContext *avctx, pe_cleanup: CVPixelBufferRelease(pix_buf); - if(vtctx->session) - CFRelease(vtctx->session); - - vtctx->session = NULL; + vtenc_reset(vtctx); vtctx->frame_ct_out = 0; av_assert0(status != 0 || (avctx->extradata && avctx->extradata_size > 0)); @@ -2797,23 +2755,8 @@ static av_cold int vtenc_close(AVCodecContext *avctx) clear_frame_queue(vtctx); pthread_cond_destroy(&vtctx->cv_sample_sent); pthread_mutex_destroy(&vtctx->lock); - CFRelease(vtctx->session); - vtctx->session = NULL; - if (vtctx->color_primaries) { - CFRelease(vtctx->color_primaries); - vtctx->color_primaries = NULL; - } - - if (vtctx->transfer_function) { - CFRelease(vtctx->transfer_function); - vtctx->transfer_function = NULL; - } - - if (vtctx->ycbcr_matrix) { - CFRelease(vtctx->ycbcr_matrix); - vtctx->ycbcr_matrix = NULL; - } + vtenc_reset(vtctx); return 0; } @@ -2889,13 +2832,13 @@ static const enum AVPixelFormat prores_pix_fmts[] = { #define OFFSET(x) offsetof(VTEncContext, x) static const AVOption h264_options[] = { - { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, INT_MAX, VE, "profile" }, - { "baseline", "Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_BASELINE }, INT_MIN, INT_MAX, VE, "profile" }, - { "constrained_baseline", "Constrained Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_CONSTRAINED_BASELINE }, INT_MIN, INT_MAX, VE, "profile" }, - { "main", "Main Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_MAIN }, INT_MIN, INT_MAX, VE, "profile" }, - { "high", "High Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_HIGH }, INT_MIN, INT_MAX, VE, "profile" }, + { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, INT_MAX, VE, "profile" }, + { "baseline", "Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_BASELINE }, INT_MIN, INT_MAX, VE, "profile" }, + { "constrained_baseline", "Constrained Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_CONSTRAINED_BASELINE }, INT_MIN, INT_MAX, VE, "profile" }, + { "main", "Main Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_MAIN }, INT_MIN, INT_MAX, VE, "profile" }, + { "high", "High Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_HIGH }, INT_MIN, INT_MAX, VE, "profile" }, { "constrained_high", "Constrained High Profile", 0, AV_OPT_TYPE_CONST, { .i64 = H264_PROFILE_CONSTRAINED_HIGH }, INT_MIN, INT_MAX, VE, "profile" }, - { "extended", "Extend Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_EXTENDED }, INT_MIN, INT_MAX, VE, "profile" }, + { "extended", "Extend Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_EXTENDED }, INT_MIN, INT_MAX, VE, "profile" }, { "level", "Level", OFFSET(level), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 52, VE, "level" }, { "1.3", "Level 1.3, only available with Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = 13 }, INT_MIN, INT_MAX, VE, "level" }, @@ -2946,9 +2889,9 @@ const FFCodec ff_h264_videotoolbox_encoder = { }; static const AVOption hevc_options[] = { - { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, INT_MAX, VE, "profile" }, - { "main", "Main Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_HEVC_MAIN }, INT_MIN, INT_MAX, VE, "profile" }, - { "main10", "Main10 Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_HEVC_MAIN_10 }, INT_MIN, INT_MAX, VE, "profile" }, + { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, INT_MAX, VE, "profile" }, + { "main", "Main Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_HEVC_MAIN }, INT_MIN, INT_MAX, VE, "profile" }, + { "main10", "Main10 Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_HEVC_MAIN_10 }, INT_MIN, INT_MAX, VE, "profile" }, { "alpha_quality", "Compression quality for the alpha channel", OFFSET(alpha_quality), AV_OPT_TYPE_DOUBLE, { .dbl = 0.0 }, 0.0, 1.0, VE }, @@ -2983,14 +2926,14 @@ const FFCodec ff_hevc_videotoolbox_encoder = { }; static const AVOption prores_options[] = { - { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, FF_PROFILE_PRORES_XQ, VE, "profile" }, - { "auto", "Automatically determine based on input format", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, VE, "profile" }, - { "proxy", "ProRes 422 Proxy", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_PROXY }, INT_MIN, INT_MAX, VE, "profile" }, - { "lt", "ProRes 422 LT", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_LT }, INT_MIN, INT_MAX, VE, "profile" }, - { "standard", "ProRes 422", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_STANDARD }, INT_MIN, INT_MAX, VE, "profile" }, - { "hq", "ProRes 422 HQ", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_HQ }, INT_MIN, INT_MAX, VE, "profile" }, - { "4444", "ProRes 4444", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_4444 }, INT_MIN, INT_MAX, VE, "profile" }, - { "xq", "ProRes 4444 XQ", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_XQ }, INT_MIN, INT_MAX, VE, "profile" }, + { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, AV_PROFILE_PRORES_XQ, VE, "profile" }, + { "auto", "Automatically determine based on input format", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, VE, "profile" }, + { "proxy", "ProRes 422 Proxy", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_PROXY }, INT_MIN, INT_MAX, VE, "profile" }, + { "lt", "ProRes 422 LT", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_LT }, INT_MIN, INT_MAX, VE, "profile" }, + { "standard", "ProRes 422", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_STANDARD }, INT_MIN, INT_MAX, VE, "profile" }, + { "hq", "ProRes 422 HQ", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_HQ }, INT_MIN, INT_MAX, VE, "profile" }, + { "4444", "ProRes 4444", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_4444 }, INT_MIN, INT_MAX, VE, "profile" }, + { "xq", "ProRes 4444 XQ", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_XQ }, INT_MIN, INT_MAX, VE, "profile" }, COMMON_OPTIONS { NULL }, diff --git a/arm/android/third_party/ffmpeg/libavcodec/vlc.c b/arm/android/third_party/ffmpeg/libavcodec/vlc.c index 96f2b28c..e4bbf294 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vlc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vlc.c @@ -30,6 +30,7 @@ #include "libavutil/avassert.h" #include "libavutil/error.h" #include "libavutil/internal.h" +#include "libavutil/intreadwrite.h" #include "libavutil/log.h" #include "libavutil/macros.h" #include "libavutil/mem.h" @@ -63,7 +64,7 @@ static int alloc_table(VLC *vlc, int size, int use_static) vlc->table_size += size; if (vlc->table_size > vlc->table_allocated) { if (use_static) - abort(); // cannot do anything, init_vlc() is used with too little memory + abort(); // cannot do anything, vlc_init() is used with too little memory vlc->table_allocated += (1 << vlc->bits); vlc->table = av_realloc_f(vlc->table, vlc->table_allocated, sizeof(*vlc->table)); if (!vlc->table) { @@ -99,7 +100,7 @@ static int vlc_common_init(VLC *vlc, int nb_bits, int nb_codes, { vlc->bits = nb_bits; vlc->table_size = 0; - if (flags & INIT_VLC_USE_NEW_STATIC) { + if (flags & VLC_INIT_USE_STATIC) { av_assert0(nb_codes <= LOCALBUF_ELEMS); } else { vlc->table = NULL; @@ -143,7 +144,7 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes, if (table_nb_bits > 30) return AVERROR(EINVAL); table_size = 1 << table_nb_bits; - table_index = alloc_table(vlc, table_size, flags & INIT_VLC_USE_NEW_STATIC); + table_index = alloc_table(vlc, table_size, flags & VLC_INIT_USE_STATIC); ff_dlog(NULL, "new table index=%d size=%d\n", table_index, table_size); if (table_index < 0) return table_index; @@ -161,7 +162,7 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes, int nb = 1 << (table_nb_bits - n); int inc = 1; - if (flags & INIT_VLC_OUTPUT_LE) { + if (flags & VLC_INIT_OUTPUT_LE) { j = bitswap_32(code); inc = 1 << n; } @@ -199,7 +200,7 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes, subtable_bits = FFMAX(subtable_bits, n); } subtable_bits = FFMIN(subtable_bits, table_nb_bits); - j = (flags & INIT_VLC_OUTPUT_LE) ? bitswap_32(code_prefix) >> (32 - table_nb_bits) : code_prefix; + j = (flags & VLC_INIT_OUTPUT_LE) ? bitswap_32(code_prefix) >> (32 - table_nb_bits) : code_prefix; table[j].len = -subtable_bits; ff_dlog(NULL, "%4x: n=%d (subtable)\n", j, codes[i].bits + table_nb_bits); @@ -230,9 +231,9 @@ static int vlc_common_end(VLC *vlc, int nb_bits, int nb_codes, VLCcode *codes, { int ret = build_table(vlc, nb_bits, nb_codes, codes, flags); - if (flags & INIT_VLC_USE_NEW_STATIC) { + if (flags & VLC_INIT_USE_STATIC) { if (vlc->table_size != vlc->table_allocated && - !(flags & (INIT_VLC_STATIC_OVERLONG & ~INIT_VLC_USE_NEW_STATIC))) + !(flags & (VLC_INIT_STATIC_OVERLONG & ~VLC_INIT_USE_STATIC))) av_log(NULL, AV_LOG_ERROR, "needed %d had %d\n", vlc->table_size, vlc->table_allocated); av_assert0(ret >= 0); } else { @@ -246,30 +247,7 @@ static int vlc_common_end(VLC *vlc, int nb_bits, int nb_codes, VLCcode *codes, return 0; } -/* Build VLC decoding tables suitable for use with get_vlc(). - - 'nb_bits' sets the decoding table size (2^nb_bits) entries. The - bigger it is, the faster is the decoding. But it should not be too - big to save memory and L1 cache. '9' is a good compromise. - - 'nb_codes' : number of vlcs codes - - 'bits' : table which gives the size (in bits) of each vlc code. - - 'codes' : table which gives the bit pattern of of each vlc code. - - 'symbols' : table which gives the values to be returned from get_vlc(). - - 'xxx_wrap' : give the number of bytes between each entry of the - 'bits' or 'codes' tables. - - 'xxx_size' : gives the number of bytes of each entry of the 'bits' - or 'codes' tables. Currently 1,2 and 4 are supported. - - 'wrap' and 'size' make it possible to use any memory configuration and types - (byte/word/long) to store the 'bits', 'codes', and 'symbols' tables. -*/ -int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, +int ff_vlc_init_sparse(VLC *vlc, int nb_bits, int nb_codes, const void *bits, int bits_wrap, int bits_size, const void *codes, int codes_wrap, int codes_size, const void *symbols, int symbols_wrap, int symbols_size, @@ -291,7 +269,7 @@ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, if (!(condition)) \ continue; \ if (len > 3*nb_bits || len > 32) { \ - av_log(NULL, AV_LOG_ERROR, "Too long VLC (%u) in init_vlc\n", len);\ + av_log(NULL, AV_LOG_ERROR, "Too long VLC (%u) in vlc_init\n", len);\ if (buf != localbuf) \ av_free(buf); \ return AVERROR(EINVAL); \ @@ -300,12 +278,12 @@ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, GET_DATA(buf[j].code, codes, i, codes_wrap, codes_size); \ if (buf[j].code >= (1LL< nb_bits); - // qsort is the slowest part of init_vlc, and could probably be improved or avoided + // qsort is the slowest part of vlc_init, and could probably be improved or avoided AV_QSORT(buf, j, struct VLCcode, compare_vlcspec); COPY(len && len <= nb_bits); nb_codes = j; @@ -325,7 +303,7 @@ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, flags, localbuf); } -int ff_init_vlc_from_lengths(VLC *vlc, int nb_bits, int nb_codes, +int ff_vlc_init_from_lengths(VLC *vlc, int nb_bits, int nb_codes, const int8_t *lens, int lens_wrap, const void *symbols, int symbols_wrap, int symbols_size, int offset, int flags, void *logctx) @@ -372,7 +350,153 @@ fail: return AVERROR_INVALIDDATA; } -void ff_free_vlc(VLC *vlc) +static void add_level(VLC_MULTI_ELEM *table, const int nb_elems, + const int num, const int numbits, + const VLCcode *buf, + uint32_t curcode, int curlen, + int curlimit, int curlevel, + const int minlen, const int max, + unsigned* levelcnt, VLC_MULTI_ELEM *info) +{ + if (nb_elems > 256 && curlevel > 2) + return; // No room + for (int i = num-1; i > max; i--) { + for (int j = 0; j < 2; j++) { + int newlimit, sym; + int t = j ? i-1 : i; + int l = buf[t].bits; + uint32_t code; + + sym = buf[t].symbol; + if (l >= curlimit) + return; + code = curcode + (buf[t].code >> curlen); + newlimit = curlimit - l; + l += curlen; + if (nb_elems>256) AV_WN16(info->val+2*curlevel, sym); + else info->val[curlevel] = sym&0xFF; + + if (curlevel) { // let's not add single entries + uint32_t val = code >> (32 - numbits); + uint32_t nb = val + (1U << (numbits - l)); + info->len = l; + info->num = curlevel+1; + for (; val < nb; val++) + AV_COPY64(table+val, info); + levelcnt[curlevel-1]++; + } + + if (curlevel+1 < VLC_MULTI_MAX_SYMBOLS && newlimit >= minlen) { + add_level(table, nb_elems, num, numbits, buf, + code, l, newlimit, curlevel+1, + minlen, max, levelcnt, info); + } + } + } +} + +static int vlc_multi_gen(VLC_MULTI_ELEM *table, const VLC *single, + const int nb_elems, const int nb_codes, const int numbits, + VLCcode *buf, void *logctx) +{ + int minbits, maxbits, max = nb_codes-1; + unsigned count[VLC_MULTI_MAX_SYMBOLS-1] = { 0, }; + VLC_MULTI_ELEM info = { { 0, }, 0, 0, }; + + minbits = buf[0].bits; + maxbits = buf[0].bits; + + for (int n = 1; n < nb_codes; n++) { + minbits = FFMIN(minbits, buf[n].bits); + maxbits = FFMAX(maxbits, buf[n].bits); + } + maxbits = FFMIN(maxbits, numbits); + + while (max >= nb_codes/2) { + if (buf[max].bits+minbits > maxbits) + break; + max--; + } + + for (int j = 0; j < 1<table[j].len; + table[j].num = single->table[j].len > 0 ? 1 : 0; + AV_WN16(table[j].val, single->table[j].sym); + } + + add_level(table, nb_elems, nb_codes, numbits, buf, + 0, 0, FFMIN(maxbits, numbits), 0, minbits, max, count, &info); + + av_log(logctx, AV_LOG_DEBUG, "Joint: %d/%d/%d/%d/%d codes min=%ubits max=%u\n", + count[0], count[1], count[2], count[3], count[4], minbits, max); + + return 0; +} + +int ff_vlc_init_multi_from_lengths(VLC *vlc, VLC_MULTI *multi, int nb_bits, int nb_elems, + int nb_codes, const int8_t *lens, int lens_wrap, + const void *symbols, int symbols_wrap, int symbols_size, + int offset, int flags, void *logctx) +{ + VLCcode localbuf[LOCALBUF_ELEMS], *buf = localbuf; + uint64_t code; + int ret, j, len_max = FFMIN(32, 3 * nb_bits); + + ret = vlc_common_init(vlc, nb_bits, nb_codes, &buf, flags); + if (ret < 0) + return ret; + + multi->table = av_malloc(sizeof(*multi->table) << nb_bits); + if (!multi->table) + return AVERROR(ENOMEM); + + j = code = 0; + for (int i = 0; i < nb_codes; i++, lens += lens_wrap) { + int len = *lens; + if (len > 0) { + unsigned sym; + + buf[j].bits = len; + if (symbols) + GET_DATA(sym, symbols, i, symbols_wrap, symbols_size) + else + sym = i; + buf[j].symbol = sym + offset; + buf[j++].code = code; + } else if (len < 0) { + len = -len; + } else + continue; + if (len > len_max || code & ((1U << (32 - len)) - 1)) { + av_log(logctx, AV_LOG_ERROR, "Invalid VLC (length %u)\n", len); + goto fail; + } + code += 1U << (32 - len); + if (code > UINT32_MAX + 1ULL) { + av_log(logctx, AV_LOG_ERROR, "Overdetermined VLC tree\n"); + goto fail; + } + } + ret = vlc_common_end(vlc, nb_bits, j, buf, flags, buf); + if (ret < 0) + goto fail; + ret = vlc_multi_gen(multi->table, vlc, nb_elems, j, nb_bits, buf, logctx); + if (buf != localbuf) + av_free(buf); + return ret; +fail: + if (buf != localbuf) + av_free(buf); + ff_vlc_free_multi(multi); + return AVERROR_INVALIDDATA; +} + +void ff_vlc_free_multi(VLC_MULTI *vlc) +{ + av_freep(&vlc->table); +} + +void ff_vlc_free(VLC *vlc) { av_freep(&vlc->table); } diff --git a/arm/android/third_party/ffmpeg/libavcodec/vlc.h b/arm/android/third_party/ffmpeg/libavcodec/vlc.h index e63c4847..3f7c033a 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vlc.h +++ b/arm/android/third_party/ffmpeg/libavcodec/vlc.h @@ -21,6 +21,8 @@ #include +#define VLC_MULTI_MAX_SYMBOLS 6 + // When changing this, be sure to also update tableprint_vlc.h accordingly. typedef int16_t VLCBaseType; @@ -34,22 +36,62 @@ typedef struct VLC { int table_size, table_allocated; } VLC; +typedef struct VLC_MULTI_ELEM { + uint8_t val[VLC_MULTI_MAX_SYMBOLS]; + int8_t len; // -31,32 + uint8_t num; +} VLC_MULTI_ELEM; + +typedef struct VLC_MULTI { + VLC_MULTI_ELEM *table; + int table_size, table_allocated; +} VLC_MULTI; + typedef struct RL_VLC_ELEM { int16_t level; int8_t len; uint8_t run; } RL_VLC_ELEM; -#define init_vlc(vlc, nb_bits, nb_codes, \ +#define vlc_init(vlc, nb_bits, nb_codes, \ bits, bits_wrap, bits_size, \ codes, codes_wrap, codes_size, \ flags) \ - ff_init_vlc_sparse(vlc, nb_bits, nb_codes, \ + ff_vlc_init_sparse(vlc, nb_bits, nb_codes, \ bits, bits_wrap, bits_size, \ codes, codes_wrap, codes_size, \ NULL, 0, 0, flags) -int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, +/** + * Build VLC decoding tables suitable for use with get_vlc2(). + * + * @param[in,out] vlc The VLC to be initialized; table and table_allocated + * must have been set when initializing a static VLC, + * otherwise this will be treated as uninitialized. + * @param[in] nb_bits The number of bits to use for the VLC table; + * higher values take up more memory and cache, but + * allow to read codes with fewer reads. + * Corresponds to the `bits` parameter of get_vlc2(). + * @param[in] nb_codes The number of provided bits, codes and (if supplied) + * symbol entries. + * @param[in] bits The lengths (in bits) of the codes. Entries > 0 + * correspond to valid codes; entries == 0 will be skipped. + * @param[in] bits_wrap Stride (in bytes) of the bits table. + * @param[in] codes_size Size of the bits. 1, 2 and 4 are supported. + * @param[in] codes Table which gives the bit pattern of of each vlc code. + * @param[in] codes_wrap Stride (in bytes) of the codes table. + * @param[in] codes_size Size of the codes. 1, 2 and 4 are supported. + * @param[in] symbols The symbols, i.e. what is returned from get_vlc2() + * when the corresponding code is encountered. + * May be NULL, then 0, 1, 2, 3, 4,... will be used. + * @param[in] symbols_wrap Stride (in bytes) of the symbols table. + * @param[in] symbols_size Size of the symbols. 1 and 2 are supported. + * @param[in] flags A combination of the VLC_INIT_* flags. + * + * 'wrap' and 'size' make it possible to use any memory configuration and types + * (byte/word/int) to store the 'bits', 'codes', and 'symbols' tables. + */ +int ff_vlc_init_sparse(VLC *vlc, int nb_bits, int nb_codes, const void *bits, int bits_wrap, int bits_size, const void *codes, int codes_wrap, int codes_size, const void *symbols, int symbols_wrap, int symbols_size, @@ -81,63 +123,103 @@ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, * @param[in] symbols_wrap Stride (in bytes) of the symbols. * @param[in] symbols_size Size of the symbols. 1 and 2 are supported. * @param[in] offset An offset to apply to all the valid symbols. - * @param[in] flags A combination of the INIT_VLC_* flags; notice that - * INIT_VLC_INPUT_LE is pointless and ignored. + * @param[in] flags A combination of the VLC_INIT_* flags; notice that + * VLC_INIT_INPUT_LE is pointless and ignored. */ -int ff_init_vlc_from_lengths(VLC *vlc, int nb_bits, int nb_codes, +int ff_vlc_init_from_lengths(VLC *vlc, int nb_bits, int nb_codes, const int8_t *lens, int lens_wrap, const void *symbols, int symbols_wrap, int symbols_size, int offset, int flags, void *logctx); -void ff_free_vlc(VLC *vlc); +/** + * Build VLC decoding tables suitable for use with get_vlc_multi() + * + * This function takes lengths and symbols and calculates the codes from them. + * For this the input lengths and symbols have to be sorted according to "left + * nodes in the corresponding tree first". + * + * @param[in,out] vlc The VLC to be initialized; table and table_allocated + * must have been set when initializing a static VLC, + * otherwise this will be treated as uninitialized. + * @param[in,out] multi The VLC_MULTI to be initialized; table and table_allocated + * must have been set when initializing a static VLC, + * otherwise this will be treated as uninitialized. + * @param[in] nb_bits The number of bits to use for the VLC table; + * higher values take up more memory and cache, but + * allow to read codes with fewer reads. + * @param[in] nb_elems The max possible number of elements. + * @param[in] nb_codes The number of provided length and (if supplied) symbol + * entries. + * @param[in] lens The lengths of the codes. Entries > 0 correspond to + * valid codes; entries == 0 will be skipped and entries + * with len < 0 indicate that the tree is incomplete and + * has an open end of length -len at this position. + * @param[in] lens_wrap Stride (in bytes) of the lengths. + * @param[in] symbols The symbols, i.e. what is returned from get_vlc2() + * when the corresponding code is encountered. + * May be NULL, then 0, 1, 2, 3, 4,... will be used. + * @param[in] symbols_wrap Stride (in bytes) of the symbols. + * @param[in] symbols_size Size of the symbols. 1 and 2 are supported. + * @param[in] offset An offset to apply to all the valid symbols. + * @param[in] flags A combination of the VLC_INIT_* flags; notice that + * VLC_INIT_INPUT_LE is pointless and ignored. + */ +int ff_vlc_init_multi_from_lengths(VLC *vlc, VLC_MULTI *multi, int nb_bits, int nb_elems, + int nb_codes, const int8_t *lens, int lens_wrap, + const void *symbols, int symbols_wrap, int symbols_size, + int offset, int flags, void *logctx); -/* If INIT_VLC_INPUT_LE is set, the LSB bit of the codes used to + +void ff_vlc_free_multi(VLC_MULTI *vlc); +void ff_vlc_free(VLC *vlc); + +#define VLC_INIT_USE_STATIC 1 +#define VLC_INIT_STATIC_OVERLONG (2 | VLC_INIT_USE_STATIC) +/* If VLC_INIT_INPUT_LE is set, the LSB bit of the codes used to * initialize the VLC table is the first bit to be read. */ -#define INIT_VLC_INPUT_LE 2 +#define VLC_INIT_INPUT_LE 4 /* If set the VLC is intended for a little endian bitstream reader. */ -#define INIT_VLC_OUTPUT_LE 8 -#define INIT_VLC_LE (INIT_VLC_INPUT_LE | INIT_VLC_OUTPUT_LE) -#define INIT_VLC_USE_NEW_STATIC 4 -#define INIT_VLC_STATIC_OVERLONG (1 | INIT_VLC_USE_NEW_STATIC) +#define VLC_INIT_OUTPUT_LE 8 +#define VLC_INIT_LE (VLC_INIT_INPUT_LE | VLC_INIT_OUTPUT_LE) -#define INIT_CUSTOM_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \ +#define VLC_INIT_CUSTOM_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \ h, i, j, flags, static_size) \ do { \ static VLCElem table[static_size]; \ (vlc)->table = table; \ (vlc)->table_allocated = static_size; \ - ff_init_vlc_sparse(vlc, bits, a, b, c, d, e, f, g, h, i, j, \ - flags | INIT_VLC_USE_NEW_STATIC); \ + ff_vlc_init_sparse(vlc, bits, a, b, c, d, e, f, g, h, i, j, \ + flags | VLC_INIT_USE_STATIC); \ } while (0) -#define INIT_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, h, i, j, static_size) \ - INIT_CUSTOM_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \ +#define VLC_INIT_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, h, i, j, static_size) \ + VLC_INIT_CUSTOM_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \ h, i, j, 0, static_size) -#define INIT_LE_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, h, i, j, static_size) \ - INIT_CUSTOM_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \ - h, i, j, INIT_VLC_LE, static_size) +#define VLC_INIT_LE_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, h, i, j, static_size) \ + VLC_INIT_CUSTOM_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \ + h, i, j, VLC_INIT_LE, static_size) -#define INIT_CUSTOM_VLC_STATIC(vlc, bits, a, b, c, d, e, f, g, flags, static_size) \ - INIT_CUSTOM_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \ +#define VLC_INIT_CUSTOM_STATIC(vlc, bits, a, b, c, d, e, f, g, flags, static_size) \ + VLC_INIT_CUSTOM_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \ NULL, 0, 0, flags, static_size) -#define INIT_VLC_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size) \ - INIT_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, NULL, 0, 0, static_size) +#define VLC_INIT_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size) \ + VLC_INIT_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, NULL, 0, 0, static_size) -#define INIT_LE_VLC_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size) \ - INIT_LE_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, NULL, 0, 0, static_size) +#define VLC_INIT_LE_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size) \ + VLC_INIT_LE_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, NULL, 0, 0, static_size) -#define INIT_VLC_STATIC_FROM_LENGTHS(vlc, bits, nb_codes, lens, len_wrap, \ +#define VLC_INIT_STATIC_FROM_LENGTHS(vlc, bits, nb_codes, lens, len_wrap, \ symbols, symbols_wrap, symbols_size, \ offset, flags, static_size) \ do { \ static VLCElem table[static_size]; \ (vlc)->table = table; \ (vlc)->table_allocated = static_size; \ - ff_init_vlc_from_lengths(vlc, bits, nb_codes, lens, len_wrap, \ + ff_vlc_init_from_lengths(vlc, bits, nb_codes, lens, len_wrap, \ symbols, symbols_wrap, symbols_size, \ - offset, flags | INIT_VLC_USE_NEW_STATIC, \ + offset, flags | VLC_INIT_USE_STATIC, \ NULL); \ } while (0) diff --git a/arm/android/third_party/ffmpeg/libavcodec/vmdvideo.c b/arm/android/third_party/ffmpeg/libavcodec/vmdvideo.c index 226ae0d3..2da8af31 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vmdvideo.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vmdvideo.c @@ -454,8 +454,7 @@ static int vmdvideo_decode_frame(AVCodecContext *avctx, AVFrame *frame, memcpy(frame->data[1], s->palette, PALETTE_COUNT * 4); /* shuffle frames */ - av_frame_unref(s->prev_frame); - if ((ret = av_frame_ref(s->prev_frame, frame)) < 0) + if ((ret = av_frame_replace(s->prev_frame, frame)) < 0) return ret; *got_frame = 1; diff --git a/arm/android/third_party/ffmpeg/libavcodec/vmixdec.c b/arm/android/third_party/ffmpeg/libavcodec/vmixdec.c index d0f2219a..d6b6e355 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vmixdec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vmixdec.c @@ -23,7 +23,6 @@ #include #include -#include "libavutil/avassert.h" #include "libavutil/intreadwrite.h" #include "libavutil/mem_internal.h" @@ -45,18 +44,28 @@ typedef struct SliceContext { typedef struct VMIXContext { int nb_slices; + int lshift; int16_t factors[64]; uint8_t scan[64]; - SliceContext slices[255]; + SliceContext *slices; + unsigned int slices_size; IDCTDSPContext idsp; } VMIXContext; -static const uint8_t quality[25] = { - 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, - 18, 20, 22, 24, 28, 32, 36, 40, 44, 48, 52, 56, 64, +static const uint8_t quality[] = { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1,64,63,62,61, + 60,59,58,57,56,55,54,53,52,51, + 50,49,48,47,46,45,44,43,42,41, + 40,39,38,37,36,35,34,33,32,31, + 30,29,28,27,26,25,24,23,22,21, + 20,19,18,17,16,15,14,13,12,11, + 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, }; static const uint8_t quant[64] = { @@ -107,6 +116,7 @@ static int decode_dcac(AVCodecContext *avctx, const uint8_t *scan = s->scan; const int add = plane ? 0 : 1024; int i, dc_v = 0, ac_v = 0, dc = 0; + const int lshift = s->lshift; for (int y = 0; y < 2; y++) { for (int x = 0; x < width; x += 8) { @@ -115,8 +125,10 @@ static int decode_dcac(AVCodecContext *avctx, if (dc_run > 0) { dc_run--; } else { + if (get_bits_left(dc_gb) < 1) + return AVERROR_INVALIDDATA; dc_v = get_se_golomb_vmix(dc_gb); - dc += dc_v; + dc += (unsigned)dc_v; if (!dc_v) dc_run = get_ue_golomb_long(dc_gb); } @@ -127,14 +139,16 @@ static int decode_dcac(AVCodecContext *avctx, continue; } + if (get_bits_left(ac_gb) < 1) + return AVERROR_INVALIDDATA; ac_v = get_se_golomb_vmix(ac_gb); i = scan[n]; - block[i] = (ac_v * factors[i]) >> 4; + block[i] = ((unsigned)ac_v * factors[i]) >> 4; if (!ac_v) ac_run = get_ue_golomb_long(ac_gb); } - block[0] = ((dc + add) * 16) >> 4; + block[0] = ((unsigned)dc << lshift) + (unsigned)add; s->idsp.idct_put(dst + x, linesize, block); } @@ -208,22 +222,27 @@ static int decode_frame(AVCodecContext *avctx, AVPacket *avpkt) { VMIXContext *s = avctx->priv_data; - unsigned offset = 3, q; + unsigned offset, q; int ret; if (avpkt->size <= 7) return AVERROR_INVALIDDATA; - if (avpkt->data[0] != 0x01) + s->lshift = 0; + offset = 2 + avpkt->data[0]; + if (offset == 5) + s->lshift = avpkt->data[1]; + else if (offset != 3) return AVERROR_INVALIDDATA; - q = av_clip(99 - av_clip(avpkt->data[1], 0, 99), 0, FF_ARRAY_ELEMS(quality) - 1); + q = quality[FFMIN(avpkt->data[offset - 2], FF_ARRAY_ELEMS(quality)-1)]; for (int n = 0; n < 64; n++) - s->factors[n] = quant[n] * quality[q]; + s->factors[n] = quant[n] * q; - s->nb_slices = avpkt->data[2]; - if (!s->nb_slices || s->nb_slices > (avctx->height + 15) / 16) - return AVERROR_INVALIDDATA; + s->nb_slices = (avctx->height + 15) / 16; + av_fast_mallocz(&s->slices, &s->slices_size, s->nb_slices * sizeof(*s->slices)); + if (!s->slices) + return AVERROR(ENOMEM); for (int n = 0; n < s->nb_slices; n++) { unsigned slice_size; @@ -275,6 +294,13 @@ static int decode_frame(AVCodecContext *avctx, return avpkt->size; } +static av_cold int decode_end(AVCodecContext *avctx) +{ + VMIXContext *s = avctx->priv_data; + av_freep(&s->slices); + return 0; +} + const FFCodec ff_vmix_decoder = { .p.name = "vmix", CODEC_LONG_NAME("vMix Video"), @@ -282,6 +308,7 @@ const FFCodec ff_vmix_decoder = { .p.id = AV_CODEC_ID_VMIX, .priv_data_size = sizeof(VMIXContext), .init = decode_init, + .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS, diff --git a/arm/android/third_party/ffmpeg/libavcodec/vorbis.c b/arm/android/third_party/ffmpeg/libavcodec/vorbis.c index d0b660b4..3d859975 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vorbis.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vorbis.c @@ -27,8 +27,10 @@ */ #include "libavutil/common.h" +#include "libavutil/error.h" +#include "libavutil/log.h" +#include "libavutil/macros.h" -#include "avcodec.h" #include "vorbis.h" #include "vorbis_data.h" @@ -104,7 +106,7 @@ int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num) return 0; } -int ff_vorbis_ready_floor1_list(AVCodecContext *avctx, +int ff_vorbis_ready_floor1_list(void *logctx, vorbis_floor1_entry *list, int values) { int i; @@ -130,7 +132,7 @@ int ff_vorbis_ready_floor1_list(AVCodecContext *avctx, int j; for (j = i + 1; j < values; j++) { if (list[i].x == list[j].x) { - av_log(avctx, AV_LOG_ERROR, + av_log(logctx, AV_LOG_ERROR, "Duplicate value found in floor 1 X coordinates\n"); return AVERROR_INVALIDDATA; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/vorbis.h b/arm/android/third_party/ffmpeg/libavcodec/vorbis.h index aa1ec571..7190465f 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vorbis.h +++ b/arm/android/third_party/ffmpeg/libavcodec/vorbis.h @@ -23,8 +23,6 @@ #include -#include "avcodec.h" - typedef struct vorbis_floor1_entry { uint16_t x; uint16_t sort; @@ -32,7 +30,7 @@ typedef struct vorbis_floor1_entry { uint16_t high; } vorbis_floor1_entry; -int ff_vorbis_ready_floor1_list(AVCodecContext *avctx, +int ff_vorbis_ready_floor1_list(void *logctx, vorbis_floor1_entry *list, int values); unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n); // x^(1/n) int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num); diff --git a/arm/android/third_party/ffmpeg/libavcodec/vorbisdec.c b/arm/android/third_party/ffmpeg/libavcodec/vorbisdec.c index 1d2a0997..faeaeadd 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vorbisdec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vorbisdec.c @@ -210,7 +210,7 @@ static void vorbis_free(vorbis_context *vc) if (vc->codebooks) for (i = 0; i < vc->codebook_count; ++i) { av_freep(&vc->codebooks[i].codevectors); - ff_free_vlc(&vc->codebooks[i].vlc); + ff_vlc_free(&vc->codebooks[i].vlc); } av_freep(&vc->codebooks); @@ -454,11 +454,11 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc) codebook_setup->maxdepth = (codebook_setup->maxdepth+codebook_setup->nb_bits - 1) / codebook_setup->nb_bits; - if ((ret = init_vlc(&codebook_setup->vlc, codebook_setup->nb_bits, + if ((ret = vlc_init(&codebook_setup->vlc, codebook_setup->nb_bits, entries, tmp_vlc_bits, sizeof(*tmp_vlc_bits), sizeof(*tmp_vlc_bits), tmp_vlc_codes, sizeof(*tmp_vlc_codes), sizeof(*tmp_vlc_codes), - INIT_VLC_LE))) { + VLC_INIT_LE))) { av_log(vc->avctx, AV_LOG_ERROR, " Error generating vlc tables. \n"); goto error; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/vp3.c b/arm/android/third_party/ffmpeg/libavcodec/vp3.c index 9e097c89..98dabfc9 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vp3.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vp3.c @@ -35,6 +35,7 @@ #include #include +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/mem_internal.h" @@ -346,7 +347,6 @@ static void vp3_decode_flush(AVCodecContext *avctx) static av_cold int vp3_decode_end(AVCodecContext *avctx) { Vp3DecodeContext *s = avctx->priv_data; - int i, j; free_tables(avctx); av_freep(&s->edge_emu_buffer); @@ -359,20 +359,20 @@ static av_cold int vp3_decode_end(AVCodecContext *avctx) av_frame_free(&s->last_frame.f); av_frame_free(&s->golden_frame.f); - for (i = 0; i < FF_ARRAY_ELEMS(s->coeff_vlc); i++) - ff_free_vlc(&s->coeff_vlc[i]); + for (int i = 0; i < FF_ARRAY_ELEMS(s->coeff_vlc); i++) + ff_vlc_free(&s->coeff_vlc[i]); - ff_free_vlc(&s->superblock_run_length_vlc); - ff_free_vlc(&s->fragment_run_length_vlc); - ff_free_vlc(&s->mode_code_vlc); - ff_free_vlc(&s->motion_vector_vlc); + ff_vlc_free(&s->superblock_run_length_vlc); + ff_vlc_free(&s->fragment_run_length_vlc); + ff_vlc_free(&s->mode_code_vlc); + ff_vlc_free(&s->motion_vector_vlc); - for (j = 0; j < 2; j++) - for (i = 0; i < 7; i++) - ff_free_vlc(&s->vp4_mv_vlc[j][i]); + for (int j = 0; j < 2; j++) + for (int i = 0; i < 7; i++) + ff_vlc_free(&s->vp4_mv_vlc[j][i]); - for (i = 0; i < 2; i++) - ff_free_vlc(&s->block_pattern_vlc[i]); + for (int i = 0; i < 2; i++) + ff_vlc_free(&s->block_pattern_vlc[i]); return 0; } @@ -385,10 +385,9 @@ static av_cold int vp3_decode_end(AVCodecContext *avctx) */ static int init_block_mapping(Vp3DecodeContext *s) { - int sb_x, sb_y, plane; - int x, y, i, j = 0; + int j = 0; - for (plane = 0; plane < 3; plane++) { + for (int plane = 0; plane < 3; plane++) { int sb_width = plane ? s->c_superblock_width : s->y_superblock_width; int sb_height = plane ? s->c_superblock_height @@ -396,11 +395,11 @@ static int init_block_mapping(Vp3DecodeContext *s) int frag_width = s->fragment_width[!!plane]; int frag_height = s->fragment_height[!!plane]; - for (sb_y = 0; sb_y < sb_height; sb_y++) - for (sb_x = 0; sb_x < sb_width; sb_x++) - for (i = 0; i < 16; i++) { - x = 4 * sb_x + hilbert_offset[i][0]; - y = 4 * sb_y + hilbert_offset[i][1]; + for (int sb_y = 0; sb_y < sb_height; sb_y++) + for (int sb_x = 0; sb_x < sb_width; sb_x++) + for (int i = 0; i < 16; i++) { + int x = 4 * sb_x + hilbert_offset[i][0]; + int y = 4 * sb_y + hilbert_offset[i][1]; if (x < frag_width && y < frag_height) s->superblock_fragments[j++] = s->fragment_start[plane] + @@ -420,12 +419,11 @@ static int init_block_mapping(Vp3DecodeContext *s) static void init_dequantizer(Vp3DecodeContext *s, int qpi) { int ac_scale_factor = s->coded_ac_scale_factor[s->qps[qpi]]; - int i, plane, inter, qri, bmi, bmj, qistart; - for (inter = 0; inter < 2; inter++) { - for (plane = 0; plane < 3; plane++) { + for (int inter = 0; inter < 2; inter++) { + for (int plane = 0; plane < 3; plane++) { int dc_scale_factor = s->coded_dc_scale_factor[!!plane][s->qps[qpi]]; - int sum = 0; + int sum = 0, bmi, bmj, qistart, qri; for (qri = 0; qri < s->qr_count[inter][plane]; qri++) { sum += s->qr_size[inter][plane][qri]; if (s->qps[qpi] <= sum) @@ -434,7 +432,7 @@ static void init_dequantizer(Vp3DecodeContext *s, int qpi) qistart = sum - s->qr_size[inter][plane][qri]; bmi = s->qr_base[inter][plane][qri]; bmj = s->qr_base[inter][plane][qri + 1]; - for (i = 0; i < 64; i++) { + for (int i = 0; i < 64; i++) { int coeff = (2 * (sum - s->qps[qpi]) * s->base_matrix[bmi][i] - 2 * (qistart - s->qps[qpi]) * s->base_matrix[bmj][i] + s->qr_size[inter][plane][qri]) / @@ -471,7 +469,7 @@ static void init_loop_filter(Vp3DecodeContext *s) */ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) { - int superblock_starts[3] = { + const int superblock_starts[3] = { 0, s->u_superblock_start, s->v_superblock_start }; int bit = 0; @@ -479,9 +477,7 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) int current_run = 0; int num_partial_superblocks = 0; - int i, j; int current_fragment; - int plane; int plane0_num_coded_frags = 0; if (s->keyframe) { @@ -536,7 +532,7 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) if (current_run == 34) current_run += get_bits(gb, 12); - for (j = 0; j < current_run; current_superblock++) { + for (int j = 0; j < current_run; current_superblock++) { if (current_superblock >= s->superblock_count) { av_log(s->avctx, AV_LOG_ERROR, "Invalid fully coded superblock run length\n"); @@ -572,7 +568,7 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) s->coded_fragment_list[0] = s->keyframe ? s->kf_coded_fragment_list : s->nkf_coded_fragment_list; - for (plane = 0; plane < 3; plane++) { + for (int plane = 0; plane < 3; plane++) { int sb_start = superblock_starts[plane]; int sb_end = sb_start + (plane ? s->c_superblock_count : s->y_superblock_count); @@ -580,9 +576,9 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) if (s->keyframe) { if (s->num_kf_coded_fragment[plane] == -1) { - for (i = sb_start; i < sb_end; i++) { + for (int i = sb_start; i < sb_end; i++) { /* iterate through all 16 fragments in a superblock */ - for (j = 0; j < 16; j++) { + for (int j = 0; j < 16; j++) { /* if the fragment is in bounds, check its coding status */ current_fragment = s->superblock_fragments[i * 16 + j]; if (current_fragment != -1) { @@ -595,12 +591,12 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) } else num_coded_frags = s->num_kf_coded_fragment[plane]; } else { - for (i = sb_start; i < sb_end && get_bits_left(gb) > 0; i++) { + for (int i = sb_start; i < sb_end && get_bits_left(gb) > 0; i++) { if (get_bits_left(gb) < plane0_num_coded_frags >> 2) { return AVERROR_INVALIDDATA; } /* iterate through all 16 fragments in a superblock */ - for (j = 0; j < 16; j++) { + for (int j = 0; j < 16; j++) { /* if the fragment is in bounds, check its coding status */ current_fragment = s->superblock_fragments[i * 16 + j]; if (current_fragment != -1) { @@ -635,7 +631,7 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) if (!plane) plane0_num_coded_frags = num_coded_frags; s->total_num_coded_frags += num_coded_frags; - for (i = 0; i < 64; i++) + for (int i = 0; i < 64; i++) s->num_coded_frags[plane][i] = num_coded_frags; if (plane < 2) s->coded_fragment_list[plane + 1] = s->coded_fragment_list[plane] + @@ -697,7 +693,7 @@ static int vp4_get_block_pattern(Vp3DecodeContext *s, GetBitContext *gb, int *ne static int vp4_unpack_macroblocks(Vp3DecodeContext *s, GetBitContext *gb) { - int plane, i, j, k, fragment; + int fragment; int next_block_pattern_table; int bit, current_run, has_partial; @@ -708,7 +704,7 @@ static int vp4_unpack_macroblocks(Vp3DecodeContext *s, GetBitContext *gb) has_partial = 0; bit = get_bits1(gb); - for (i = 0; i < s->yuv_macroblock_count; i += current_run) { + for (int i = 0; i < s->yuv_macroblock_count; i += current_run) { if (get_bits_left(gb) <= 0) return AVERROR_INVALIDDATA; current_run = vp4_get_mb_count(s, gb); @@ -724,7 +720,7 @@ static int vp4_unpack_macroblocks(Vp3DecodeContext *s, GetBitContext *gb) return AVERROR_INVALIDDATA; bit = get_bits1(gb); current_run = vp4_get_mb_count(s, gb); - for (i = 0; i < s->yuv_macroblock_count; i++) { + for (int i = 0; i < s->yuv_macroblock_count; i++) { if (!s->superblock_coding[i]) { if (!current_run) { bit ^= 1; @@ -739,9 +735,7 @@ static int vp4_unpack_macroblocks(Vp3DecodeContext *s, GetBitContext *gb) } next_block_pattern_table = 0; - i = 0; - for (plane = 0; plane < 3; plane++) { - int sb_x, sb_y; + for (int plane = 0, i = 0; plane < 3; plane++) { int sb_width = plane ? s->c_superblock_width : s->y_superblock_width; int sb_height = plane ? s->c_superblock_height : s->y_superblock_height; int mb_width = plane ? s->c_macroblock_width : s->macroblock_width; @@ -749,9 +743,9 @@ static int vp4_unpack_macroblocks(Vp3DecodeContext *s, GetBitContext *gb) int fragment_width = s->fragment_width[!!plane]; int fragment_height = s->fragment_height[!!plane]; - for (sb_y = 0; sb_y < sb_height; sb_y++) { - for (sb_x = 0; sb_x < sb_width; sb_x++) { - for (j = 0; j < 4; j++) { + for (int sb_y = 0; sb_y < sb_height; sb_y++) { + for (int sb_x = 0; sb_x < sb_width; sb_x++) { + for (int j = 0; j < 4; j++) { int mb_x = 2 * sb_x + (j >> 1); int mb_y = 2 * sb_y + (j >> 1) ^ (j & 1); int mb_coded, pattern, coded; @@ -768,7 +762,7 @@ static int vp4_unpack_macroblocks(Vp3DecodeContext *s, GetBitContext *gb) else pattern = 0; - for (k = 0; k < 4; k++) { + for (int k = 0; k < 4; k++) { if (BLOCK_X >= fragment_width || BLOCK_Y >= fragment_height) continue; fragment = s->fragment_start[plane] + BLOCK_Y * fragment_width + BLOCK_X; @@ -791,7 +785,6 @@ static int vp4_unpack_macroblocks(Vp3DecodeContext *s, GetBitContext *gb) */ static int unpack_modes(Vp3DecodeContext *s, GetBitContext *gb) { - int i, j, k, sb_x, sb_y; int scheme; int current_macroblock; int current_fragment; @@ -801,7 +794,7 @@ static int unpack_modes(Vp3DecodeContext *s, GetBitContext *gb) Vp3Fragment *frag; if (s->keyframe) { - for (i = 0; i < s->fragment_count; i++) + for (int i = 0; i < s->fragment_count; i++) s->all_fragments[i].coding_method = MODE_INTRA; } else { /* fetch the mode coding scheme for this frame */ @@ -809,9 +802,9 @@ static int unpack_modes(Vp3DecodeContext *s, GetBitContext *gb) /* is it a custom coding scheme? */ if (scheme == 0) { - for (i = 0; i < 8; i++) + for (int i = 0; i < 8; i++) custom_mode_alphabet[i] = MODE_INTER_NO_MV; - for (i = 0; i < 8; i++) + for (int i = 0; i < 8; i++) custom_mode_alphabet[get_bits(gb, 3)] = i; alphabet = custom_mode_alphabet; } else @@ -819,12 +812,13 @@ static int unpack_modes(Vp3DecodeContext *s, GetBitContext *gb) /* iterate through all of the macroblocks that contain 1 or more * coded fragments */ - for (sb_y = 0; sb_y < s->y_superblock_height; sb_y++) { - for (sb_x = 0; sb_x < s->y_superblock_width; sb_x++) { + for (int sb_y = 0; sb_y < s->y_superblock_height; sb_y++) { + for (int sb_x = 0; sb_x < s->y_superblock_width; sb_x++) { if (get_bits_left(gb) <= 0) return -1; - for (j = 0; j < 4; j++) { + for (int j = 0; j < 4; j++) { + int k; int mb_x = 2 * sb_x + (j >> 1); int mb_y = 2 * sb_y + (((j >> 1) + j) & 1); current_macroblock = mb_y * s->macroblock_width + mb_x; @@ -905,7 +899,6 @@ static int vp4_get_mv(Vp3DecodeContext *s, GetBitContext *gb, int axis, int last */ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb) { - int j, k, sb_x, sb_y; int coding_mode; int motion_x[4]; int motion_y[4]; @@ -927,12 +920,12 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb) /* iterate through all of the macroblocks that contain 1 or more * coded fragments */ - for (sb_y = 0; sb_y < s->y_superblock_height; sb_y++) { - for (sb_x = 0; sb_x < s->y_superblock_width; sb_x++) { + for (int sb_y = 0; sb_y < s->y_superblock_height; sb_y++) { + for (int sb_x = 0; sb_x < s->y_superblock_width; sb_x++) { if (get_bits_left(gb) <= 0) return -1; - for (j = 0; j < 4; j++) { + for (int j = 0; j < 4; j++) { int mb_x = 2 * sb_x + (j >> 1); int mb_y = 2 * sb_y + (((j >> 1) + j) & 1); current_macroblock = mb_y * s->macroblock_width + mb_x; @@ -980,7 +973,7 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb) /* fetch 4 vectors from the bitstream, one for each * Y fragment, then average for the C fragment vectors */ - for (k = 0; k < 4; k++) { + for (int k = 0; k < 4; k++) { current_fragment = BLOCK_Y * s->fragment_width[0] + BLOCK_X; if (s->all_fragments[current_fragment].coding_method != MODE_COPY) { if (coding_mode == 0) { @@ -1036,7 +1029,7 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb) } /* assign the motion vectors to the correct fragments */ - for (k = 0; k < 4; k++) { + for (int k = 0; k < 4; k++) { current_fragment = BLOCK_Y * s->fragment_width[0] + BLOCK_X; if (s->macroblock_coding[current_macroblock] == MODE_INTER_FOURMV) { @@ -1077,13 +1070,13 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb) motion_x[1] = (motion_x[1] >> 1) | (motion_x[1] & 1); } frag = 2 * mb_y * s->fragment_width[1] + mb_x; - for (k = 0; k < 2; k++) { + for (int k = 0; k < 2; k++) { s->motion_val[1][frag][0] = motion_x[k]; s->motion_val[1][frag][1] = motion_y[k]; frag += s->fragment_width[1]; } } else { - for (k = 0; k < 4; k++) { + for (int k = 0; k < 4; k++) { frag = BLOCK_Y * s->fragment_width[1] + BLOCK_X; if (s->macroblock_coding[current_macroblock] == MODE_INTER_FOURMV) { s->motion_val[1][frag][0] = motion_x[k]; @@ -1103,11 +1096,11 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb) static int unpack_block_qpis(Vp3DecodeContext *s, GetBitContext *gb) { - int qpi, i, j, bit, run_length, blocks_decoded, num_blocks_at_qpi; int num_blocks = s->total_num_coded_frags; - for (qpi = 0; qpi < s->nqps - 1 && num_blocks > 0; qpi++) { - i = blocks_decoded = num_blocks_at_qpi = 0; + for (int qpi = 0; qpi < s->nqps - 1 && num_blocks > 0; qpi++) { + int i = 0, blocks_decoded = 0, num_blocks_at_qpi = 0; + int bit, run_length; bit = get_bits1(gb) ^ 1; run_length = 0; @@ -1127,7 +1120,7 @@ static int unpack_block_qpis(Vp3DecodeContext *s, GetBitContext *gb) if (!bit) num_blocks_at_qpi += run_length; - for (j = 0; j < run_length; i++) { + for (int j = 0; j < run_length; i++) { if (i >= s->total_num_coded_frags) return -1; @@ -1181,11 +1174,11 @@ static inline int get_coeff(GetBitContext *gb, int token, int16_t *coeff) * be passed into the next call to this same function. */ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb, - VLC *table, int coeff_index, + const VLC *table, int coeff_index, int plane, int eob_run) { - int i, j = 0; + int j = 0; int token; int zero_run = 0; int16_t coeff = 0; @@ -1195,7 +1188,7 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb, int16_t *dct_tokens = s->dct_tokens[plane][coeff_index]; /* local references to structure members to avoid repeated dereferences */ - int *coded_fragment_list = s->coded_fragment_list[plane]; + const int *coded_fragment_list = s->coded_fragment_list[plane]; Vp3Fragment *all_fragments = s->all_fragments; const VLCElem *vlc_table = table->table; @@ -1266,7 +1259,7 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb, // zero runs code multiple coefficients, // so don't try to decode coeffs for those higher levels - for (i = coeff_index + 1; i <= coeff_index + zero_run; i++) + for (int i = coeff_index + 1; i <= coeff_index + zero_run; i++) s->num_coded_frags[plane][i]--; coeff_i++; } else { @@ -1281,7 +1274,7 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb, // decrement the number of blocks that have higher coefficients for each // EOB run at this level if (blocks_ended) - for (i = coeff_index + 1; i < 64; i++) + for (int i = coeff_index + 1; i < 64; i++) s->num_coded_frags[plane][i] -= blocks_ended; // setup the next buffer @@ -1303,7 +1296,6 @@ static void reverse_dc_prediction(Vp3DecodeContext *s, */ static int unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb) { - int i; int dc_y_table; int dc_c_table; int ac_y_table; @@ -1357,29 +1349,29 @@ static int unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb) ac_c_table = get_bits(gb, 4); /* build tables of AC VLC tables */ - for (i = 1; i <= 5; i++) { + for (int i = 1; i <= 5; i++) { /* AC VLC table group 1 */ y_tables[i] = &s->coeff_vlc[ac_y_table + 16]; c_tables[i] = &s->coeff_vlc[ac_c_table + 16]; } - for (i = 6; i <= 14; i++) { + for (int i = 6; i <= 14; i++) { /* AC VLC table group 2 */ y_tables[i] = &s->coeff_vlc[ac_y_table + 32]; c_tables[i] = &s->coeff_vlc[ac_c_table + 32]; } - for (i = 15; i <= 27; i++) { + for (int i = 15; i <= 27; i++) { /* AC VLC table group 3 */ y_tables[i] = &s->coeff_vlc[ac_y_table + 48]; c_tables[i] = &s->coeff_vlc[ac_c_table + 48]; } - for (i = 28; i <= 63; i++) { + for (int i = 28; i <= 63; i++) { /* AC VLC table group 4 */ y_tables[i] = &s->coeff_vlc[ac_y_table + 64]; c_tables[i] = &s->coeff_vlc[ac_c_table + 64]; } /* decode all AC coefficients */ - for (i = 1; i <= 63; i++) { + for (int i = 1; i <= 63; i++) { residual_eob_run = unpack_vlcs(s, gb, y_tables[i], i, 0, residual_eob_run); if (residual_eob_run < 0) @@ -1406,7 +1398,7 @@ static int unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb) * @return < 0 on error */ static int vp4_unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb, - VLC *vlc_tables[64], + const VLC *vlc_tables[64], int plane, int eob_tracker[64], int fragment) { int token; @@ -1466,24 +1458,20 @@ static void vp4_dc_predictor_reset(VP4Predictor *p) static void vp4_dc_pred_before(const Vp3DecodeContext *s, VP4Predictor dc_pred[6][6], int sb_x) { - int i, j; - - for (i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) dc_pred[0][i + 1] = s->dc_pred_row[sb_x * 4 + i]; - for (j = 1; j < 5; j++) - for (i = 0; i < 4; i++) + for (int j = 1; j < 5; j++) + for (int i = 0; i < 4; i++) vp4_dc_predictor_reset(&dc_pred[j][i + 1]); } static void vp4_dc_pred_after(Vp3DecodeContext *s, VP4Predictor dc_pred[6][6], int sb_x) { - int i; - - for (i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) s->dc_pred_row[sb_x * 4 + i] = dc_pred[4][i + 1]; - for (i = 1; i < 5; i++) + for (int i = 1; i < 5; i++) dc_pred[i][0] = dc_pred[i][4]; } @@ -1519,10 +1507,9 @@ static int vp4_dc_pred(const Vp3DecodeContext *s, const VP4Predictor * dc_pred, static void vp4_set_tokens_base(Vp3DecodeContext *s) { - int plane, i; int16_t *base = s->dct_tokens_base; - for (plane = 0; plane < 3; plane++) { - for (i = 0; i < 64; i++) { + for (int plane = 0; plane < 3; plane++) { + for (int i = 0; i < 64; i++) { s->dct_tokens[plane][i] = base; base += s->fragment_width[!!plane] * s->fragment_height[!!plane]; } @@ -1531,13 +1518,11 @@ static void vp4_set_tokens_base(Vp3DecodeContext *s) static int vp4_unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb) { - int i, j; int dc_y_table; int dc_c_table; int ac_y_table; int ac_c_table; - VLC *tables[2][64]; - int plane, sb_y, sb_x; + const VLC *tables[2][64]; int eob_tracker[64]; VP4Predictor dc_pred[6][6]; int last_dc[NB_VP4_DC_TYPES]; @@ -1557,22 +1542,22 @@ static int vp4_unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb) /* DC table group */ tables[0][0] = &s->coeff_vlc[dc_y_table]; tables[1][0] = &s->coeff_vlc[dc_c_table]; - for (i = 1; i <= 5; i++) { + for (int i = 1; i <= 5; i++) { /* AC VLC table group 1 */ tables[0][i] = &s->coeff_vlc[ac_y_table + 16]; tables[1][i] = &s->coeff_vlc[ac_c_table + 16]; } - for (i = 6; i <= 14; i++) { + for (int i = 6; i <= 14; i++) { /* AC VLC table group 2 */ tables[0][i] = &s->coeff_vlc[ac_y_table + 32]; tables[1][i] = &s->coeff_vlc[ac_c_table + 32]; } - for (i = 15; i <= 27; i++) { + for (int i = 15; i <= 27; i++) { /* AC VLC table group 3 */ tables[0][i] = &s->coeff_vlc[ac_y_table + 48]; tables[1][i] = &s->coeff_vlc[ac_c_table + 48]; } - for (i = 28; i <= 63; i++) { + for (int i = 28; i <= 63; i++) { /* AC VLC table group 4 */ tables[0][i] = &s->coeff_vlc[ac_y_table + 64]; tables[1][i] = &s->coeff_vlc[ac_c_table + 64]; @@ -1582,21 +1567,21 @@ static int vp4_unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb) memset(last_dc, 0, sizeof(last_dc)); - for (plane = 0; plane < ((s->avctx->flags & AV_CODEC_FLAG_GRAY) ? 1 : 3); plane++) { + for (int plane = 0; plane < ((s->avctx->flags & AV_CODEC_FLAG_GRAY) ? 1 : 3); plane++) { memset(eob_tracker, 0, sizeof(eob_tracker)); /* initialise dc prediction */ - for (i = 0; i < s->fragment_width[!!plane]; i++) + for (int i = 0; i < s->fragment_width[!!plane]; i++) vp4_dc_predictor_reset(&s->dc_pred_row[i]); - for (j = 0; j < 6; j++) - for (i = 0; i < 6; i++) + for (int j = 0; j < 6; j++) + for (int i = 0; i < 6; i++) vp4_dc_predictor_reset(&dc_pred[j][i]); - for (sb_y = 0; sb_y * 4 < s->fragment_height[!!plane]; sb_y++) { - for (sb_x = 0; sb_x *4 < s->fragment_width[!!plane]; sb_x++) { + for (int sb_y = 0; sb_y * 4 < s->fragment_height[!!plane]; sb_y++) { + for (int sb_x = 0; sb_x *4 < s->fragment_width[!!plane]; sb_x++) { vp4_dc_pred_before(s, dc_pred, sb_x); - for (j = 0; j < 16; j++) { + for (int j = 0; j < 16; j++) { int hx = hilbert_offset[j][0]; int hy = hilbert_offset[j][1]; int x = 4 * sb_x + hx; @@ -1653,7 +1638,6 @@ static void reverse_dc_prediction(Vp3DecodeContext *s, #define PUR 2 #define PL 1 - int x, y; int i = first_fragment; int predicted_dc; @@ -1723,9 +1707,9 @@ static void reverse_dc_prediction(Vp3DecodeContext *s, last_dc[2] = 0; /* for each fragment row... */ - for (y = 0; y < fragment_height; y++) { + for (int y = 0; y < fragment_height; y++) { /* for each fragment in a row... */ - for (x = 0; x < fragment_width; x++, i++) { + for (int x = 0; x < fragment_width; x++, i++) { /* reverse prediction if this block was coded */ if (s->all_fragments[i].coding_method != MODE_COPY) { @@ -1796,7 +1780,6 @@ static void reverse_dc_prediction(Vp3DecodeContext *s, static void apply_loop_filter(Vp3DecodeContext *s, int plane, int ystart, int yend) { - int x, y; int *bounding_values = s->bounding_values_array + 127; int width = s->fragment_width[!!plane]; @@ -1808,8 +1791,8 @@ static void apply_loop_filter(Vp3DecodeContext *s, int plane, stride = -stride; plane_data += s->data_offset[plane] + 8 * ystart * stride; - for (y = ystart; y < yend; y++) { - for (x = 0; x < width; x++) { + for (int y = ystart; y < yend; y++) { + for (int x = 0; x < width; x++) { /* This code basically just deblocks on the edges of coded blocks. * However, it has to be much more complicated because of the * brain damaged deblock ordering used in VP3/Theora. Order matters @@ -1860,11 +1843,11 @@ static void apply_loop_filter(Vp3DecodeContext *s, int plane, * Pull DCT tokens from the 64 levels to decode and dequant the coefficients * for the next block in coding order */ -static inline int vp3_dequant(Vp3DecodeContext *s, Vp3Fragment *frag, +static inline int vp3_dequant(Vp3DecodeContext *s, const Vp3Fragment *frag, int plane, int inter, int16_t block[64]) { - int16_t *dequantizer = s->qmat[frag->qpi][inter][plane]; - uint8_t *perm = s->idct_scantable; + const int16_t *dequantizer = s->qmat[frag->qpi][inter][plane]; + const uint8_t *perm = s->idct_scantable; int i = 0; do { @@ -1907,7 +1890,7 @@ end: */ static void vp3_draw_horiz_band(Vp3DecodeContext *s, int y) { - int h, cy, i; + int h, cy; int offset[AV_NUM_DATA_POINTERS]; if (HAVE_THREADS && s->avctx->active_thread_type & FF_THREAD_FRAME) { @@ -1936,7 +1919,7 @@ static void vp3_draw_horiz_band(Vp3DecodeContext *s, int y) offset[0] = s->current_frame.f->linesize[0] * y; offset[1] = s->current_frame.f->linesize[1] * cy; offset[2] = s->current_frame.f->linesize[2] * cy; - for (i = 3; i < AV_NUM_DATA_POINTERS; i++) + for (int i = 3; i < AV_NUM_DATA_POINTERS; i++) offset[i] = 0; emms_c(); @@ -1947,7 +1930,7 @@ static void vp3_draw_horiz_band(Vp3DecodeContext *s, int y) * Wait for the reference frame of the current fragment. * The progress value is in luma pixel rows. */ -static void await_reference_row(Vp3DecodeContext *s, Vp3Fragment *fragment, +static void await_reference_row(Vp3DecodeContext *s, const Vp3Fragment *fragment, int motion_y, int y) { const ThreadFrame *ref_frame; @@ -1971,13 +1954,13 @@ static void await_reference_row(Vp3DecodeContext *s, Vp3Fragment *fragment, * @return non-zero if temp (edge_emu_buffer) was populated */ static int vp4_mc_loop_filter(Vp3DecodeContext *s, int plane, int motion_x, int motion_y, int bx, int by, - uint8_t * motion_source, int stride, int src_x, int src_y, uint8_t *temp) + const uint8_t *motion_source, ptrdiff_t stride, + int src_x, int src_y, uint8_t *temp) { int motion_shift = plane ? 4 : 2; int subpel_mask = plane ? 3 : 1; int *bounding_values = s->bounding_values_array + 127; - int i; int x, y; int x2, y2; int x_subpel, y_subpel; @@ -2058,7 +2041,7 @@ static int vp4_mc_loop_filter(Vp3DecodeContext *s, int plane, int motion_x, int safe_loop_filter(v_loop_filter, loop + (y_offset + 1)*loop_stride + 1, loop_stride, bounding_values); } - for (i = 0; i < 9; i++) + for (int i = 0; i < 9; i++) memcpy(temp + i*stride, loop + (i + 1) * loop_stride + 1, 9); return 1; @@ -2071,29 +2054,35 @@ static int vp4_mc_loop_filter(Vp3DecodeContext *s, int plane, int motion_x, int */ static void render_slice(Vp3DecodeContext *s, int slice) { - int x, y, i, j, fragment; int16_t *block = s->block; int motion_x = 0xdeadbeef, motion_y = 0xdeadbeef; + /* When decoding keyframes, the earlier frames may not be available, + * so to avoid using undefined pointer arithmetic on them we just + * use the current frame instead. Nothing is ever read from these + * frames in case of a keyframe. */ + const AVFrame *last_frame = s->last_frame.f->data[0] ? + s->last_frame.f : s->current_frame.f; + const AVFrame *golden_frame = s->golden_frame.f->data[0] ? + s->golden_frame.f : s->current_frame.f; int motion_halfpel_index; - uint8_t *motion_source; - int plane, first_pixel; + int first_pixel; if (slice >= s->c_superblock_height) return; - for (plane = 0; plane < 3; plane++) { + for (int plane = 0; plane < 3; plane++) { uint8_t *output_plane = s->current_frame.f->data[plane] + s->data_offset[plane]; - uint8_t *last_plane = s->last_frame.f->data[plane] + + const uint8_t *last_plane = last_frame->data[plane] + s->data_offset[plane]; - uint8_t *golden_plane = s->golden_frame.f->data[plane] + + const uint8_t *golden_plane = golden_frame->data[plane] + s->data_offset[plane]; ptrdiff_t stride = s->current_frame.f->linesize[plane]; int plane_width = s->width >> (plane && s->chroma_x_shift); int plane_height = s->height >> (plane && s->chroma_y_shift); - int8_t(*motion_val)[2] = s->motion_val[!!plane]; + const int8_t (*motion_val)[2] = s->motion_val[!!plane]; - int sb_x, sb_y = slice << (!plane && s->chroma_y_shift); + int sb_y = slice << (!plane && s->chroma_y_shift); int slice_height = sb_y + 1 + (!plane && s->chroma_y_shift); int slice_width = plane ? s->c_superblock_width : s->y_superblock_width; @@ -2113,14 +2102,14 @@ static void render_slice(Vp3DecodeContext *s, int slice) /* for each superblock row in the slice (both of them)... */ for (; sb_y < slice_height; sb_y++) { /* for each superblock in a row... */ - for (sb_x = 0; sb_x < slice_width; sb_x++) { + for (int sb_x = 0; sb_x < slice_width; sb_x++) { /* for each block in a superblock... */ - for (j = 0; j < 16; j++) { - x = 4 * sb_x + hilbert_offset[j][0]; - y = 4 * sb_y + hilbert_offset[j][1]; - fragment = y * fragment_width + x; + for (int j = 0; j < 16; j++) { + int x = 4 * sb_x + hilbert_offset[j][0]; + int y = 4 * sb_y + hilbert_offset[j][1]; + int fragment = y * fragment_width + x; - i = fragment_start + fragment; + int i = fragment_start + fragment; // bounds check if (x >= fragment_width || y >= fragment_height) @@ -2136,6 +2125,7 @@ static void render_slice(Vp3DecodeContext *s, int slice) /* transform if this block was coded */ if (s->all_fragments[i].coding_method != MODE_COPY) { + const uint8_t *motion_source; if ((s->all_fragments[i].coding_method == MODE_USING_GOLDEN) || (s->all_fragments[i].coding_method == MODE_GOLDEN_MV)) motion_source = golden_plane; @@ -2327,13 +2317,10 @@ static av_cold int init_frames(Vp3DecodeContext *s) static av_cold int vp3_decode_init(AVCodecContext *avctx) { Vp3DecodeContext *s = avctx->priv_data; - int i, inter, plane, ret; + int ret; int c_width; int c_height; int y_fragment_count, c_fragment_count; -#if CONFIG_VP4_DECODER - int j; -#endif ret = init_frames(s); if (ret < 0) @@ -2362,7 +2349,7 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) ff_videodsp_init(&s->vdsp, 8); ff_vp3dsp_init(&s->vp3dsp, avctx->flags); - for (i = 0; i < 64; i++) { + for (int i = 0; i < 64; i++) { #define TRANSPOSE(x) (((x) >> 3) | (((x) & 7) << 3)) s->idct_permutation[i] = TRANSPOSE(i); s->idct_scantable[i] = TRANSPOSE(ff_zigzag_direct[i]); @@ -2371,7 +2358,7 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) /* initialize to an impossible value which will force a recalculation * in the first frame decode */ - for (i = 0; i < 3; i++) + for (int i = 0; i < 3; i++) s->qps[i] = -1; ret = av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &s->chroma_x_shift, &s->chroma_y_shift); @@ -2416,7 +2403,7 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) if (!s->theora_tables) { const uint8_t (*bias_tabs)[32][2]; - for (i = 0; i < 64; i++) { + for (int i = 0; i < 64; i++) { s->coded_dc_scale_factor[0][i] = s->version < 2 ? vp31_dc_scale_factor[i] : vp4_y_dc_scale_factor[i]; s->coded_dc_scale_factor[1][i] = s->version < 2 ? vp31_dc_scale_factor[i] : vp4_uv_dc_scale_factor[i]; s->coded_ac_scale_factor[i] = s->version < 2 ? vp31_ac_scale_factor[i] : vp4_ac_scale_factor[i]; @@ -2426,8 +2413,8 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) s->filter_limit_values[i] = s->version < 2 ? vp31_filter_limit_values[i] : vp4_filter_limit_values[i]; } - for (inter = 0; inter < 2; inter++) { - for (plane = 0; plane < 3; plane++) { + for (int inter = 0; inter < 2; inter++) { + for (int plane = 0; plane < 3; plane++) { s->qr_count[inter][plane] = 1; s->qr_size[inter][plane][0] = 63; s->qr_base[inter][plane][0] = @@ -2438,7 +2425,7 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) /* init VLC tables */ bias_tabs = CONFIG_VP4_DECODER && s->version >= 2 ? vp4_bias : vp3_bias; for (int i = 0; i < FF_ARRAY_ELEMS(s->coeff_vlc); i++) { - ret = ff_init_vlc_from_lengths(&s->coeff_vlc[i], 11, 32, + ret = ff_vlc_init_from_lengths(&s->coeff_vlc[i], 11, 32, &bias_tabs[i][0][1], 2, &bias_tabs[i][0][0], 2, 1, 0, 0, avctx); @@ -2446,10 +2433,10 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) return ret; } } else { - for (i = 0; i < FF_ARRAY_ELEMS(s->coeff_vlc); i++) { + for (int i = 0; i < FF_ARRAY_ELEMS(s->coeff_vlc); i++) { const HuffTable *tab = &s->huffman_table[i]; - ret = ff_init_vlc_from_lengths(&s->coeff_vlc[i], 11, tab->nb_entries, + ret = ff_vlc_init_from_lengths(&s->coeff_vlc[i], 11, tab->nb_entries, &tab->entries[0].len, sizeof(*tab->entries), &tab->entries[0].sym, sizeof(*tab->entries), 1, 0, 0, avctx); @@ -2458,25 +2445,25 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) } } - ret = ff_init_vlc_from_lengths(&s->superblock_run_length_vlc, SUPERBLOCK_VLC_BITS, 34, + ret = ff_vlc_init_from_lengths(&s->superblock_run_length_vlc, SUPERBLOCK_VLC_BITS, 34, superblock_run_length_vlc_lens, 1, NULL, 0, 0, 1, 0, avctx); if (ret < 0) return ret; - ret = ff_init_vlc_from_lengths(&s->fragment_run_length_vlc, 5, 30, + ret = ff_vlc_init_from_lengths(&s->fragment_run_length_vlc, 5, 30, fragment_run_length_vlc_len, 1, NULL, 0, 0, 0, 0, avctx); if (ret < 0) return ret; - ret = ff_init_vlc_from_lengths(&s->mode_code_vlc, 3, 8, + ret = ff_vlc_init_from_lengths(&s->mode_code_vlc, 3, 8, mode_code_vlc_len, 1, NULL, 0, 0, 0, 0, avctx); if (ret < 0) return ret; - ret = ff_init_vlc_from_lengths(&s->motion_vector_vlc, VP3_MV_VLC_BITS, 63, + ret = ff_vlc_init_from_lengths(&s->motion_vector_vlc, VP3_MV_VLC_BITS, 63, &motion_vector_vlc_table[0][1], 2, &motion_vector_vlc_table[0][0], 2, 1, -31, 0, avctx); @@ -2484,9 +2471,9 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) return ret; #if CONFIG_VP4_DECODER - for (j = 0; j < 2; j++) - for (i = 0; i < 7; i++) { - ret = ff_init_vlc_from_lengths(&s->vp4_mv_vlc[j][i], VP4_MV_VLC_BITS, 63, + for (int j = 0; j < 2; j++) + for (int i = 0; i < 7; i++) { + ret = ff_vlc_init_from_lengths(&s->vp4_mv_vlc[j][i], VP4_MV_VLC_BITS, 63, &vp4_mv_vlc[j][i][0][1], 2, &vp4_mv_vlc[j][i][0][0], 2, 1, -31, 0, avctx); @@ -2495,8 +2482,8 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) } /* version >= 2 */ - for (i = 0; i < 2; i++) - if ((ret = init_vlc(&s->block_pattern_vlc[i], 3, 14, + for (int i = 0; i < 2; i++) + if ((ret = vlc_init(&s->block_pattern_vlc[i], 3, 14, &vp4_block_pattern_vlc[i][0][1], 2, 1, &vp4_block_pattern_vlc[i][0][0], 2, 1, 0)) < 0) return ret; @@ -2511,24 +2498,19 @@ static int update_frames(AVCodecContext *avctx) Vp3DecodeContext *s = avctx->priv_data; int ret = 0; - /* shuffle frames (last = current) */ - ff_thread_release_ext_buffer(avctx, &s->last_frame); - ret = ff_thread_ref_frame(&s->last_frame, &s->current_frame); - if (ret < 0) - goto fail; - if (s->keyframe) { ff_thread_release_ext_buffer(avctx, &s->golden_frame); ret = ff_thread_ref_frame(&s->golden_frame, &s->current_frame); } + /* shuffle frames */ + ff_thread_release_ext_buffer(avctx, &s->last_frame); + FFSWAP(ThreadFrame, s->last_frame, s->current_frame); -fail: - ff_thread_release_ext_buffer(avctx, &s->current_frame); return ret; } #if HAVE_THREADS -static int ref_frame(Vp3DecodeContext *s, ThreadFrame *dst, ThreadFrame *src) +static int ref_frame(Vp3DecodeContext *s, ThreadFrame *dst, const ThreadFrame *src) { ff_thread_release_ext_buffer(s->avctx, dst); if (src->f->data[0]) @@ -2536,7 +2518,7 @@ static int ref_frame(Vp3DecodeContext *s, ThreadFrame *dst, ThreadFrame *src) return 0; } -static int ref_frames(Vp3DecodeContext *dst, Vp3DecodeContext *src) +static int ref_frames(Vp3DecodeContext *dst, const Vp3DecodeContext *src) { int ret; if ((ret = ref_frame(dst, &dst->current_frame, &src->current_frame)) < 0 || @@ -2548,8 +2530,9 @@ static int ref_frames(Vp3DecodeContext *dst, Vp3DecodeContext *src) static int vp3_update_thread_context(AVCodecContext *dst, const AVCodecContext *src) { - Vp3DecodeContext *s = dst->priv_data, *s1 = src->priv_data; - int qps_changed = 0, i, err; + Vp3DecodeContext *s = dst->priv_data; + const Vp3DecodeContext *s1 = src->priv_data; + int qps_changed = 0, err; if (!s1->current_frame.f->data[0] || s->width != s1->width || s->height != s1->height) { @@ -2566,7 +2549,7 @@ static int vp3_update_thread_context(AVCodecContext *dst, const AVCodecContext * s->keyframe = s1->keyframe; // copy qscale data if necessary - for (i = 0; i < 3; i++) { + for (int i = 0; i < 3; i++) { if (s->qps[i] != s1->qps[1]) { qps_changed = 1; memcpy(&s->qmat[i], &s1->qmat[i], sizeof(s->qmat[i])); @@ -2595,7 +2578,7 @@ static int vp3_decode_frame(AVCodecContext *avctx, AVFrame *frame, int buf_size = avpkt->size; Vp3DecodeContext *s = avctx->priv_data; GetBitContext gb; - int i, ret; + int ret; if ((ret = init_get_bits8(&gb, buf, buf_size)) < 0) return ret; @@ -2645,14 +2628,14 @@ static int vp3_decode_frame(AVCodecContext *avctx, AVFrame *frame, } if (!s->theora) skip_bits(&gb, 1); - for (i = 0; i < 3; i++) + for (int i = 0; i < 3; i++) s->last_qps[i] = s->qps[i]; s->nqps = 0; do { s->qps[s->nqps++] = get_bits(&gb, 6); } while (s->theora >= 0x030200 && s->nqps < 3 && get_bits1(&gb)); - for (i = s->nqps; i < 3; i++) + for (int i = s->nqps; i < 3; i++) s->qps[i] = -1; if (s->avctx->debug & FF_DEBUG_PICT_INFO) @@ -2666,7 +2649,7 @@ static int vp3_decode_frame(AVCodecContext *avctx, AVFrame *frame, if (s->qps[0] != s->last_qps[0]) init_loop_filter(s); - for (i = 0; i < s->nqps; i++) + for (int i = 0; i < s->nqps; i++) // reinit all dequantizers if the first one changed, because // the DC of the first quantizer must be used for all matrices if (s->qps[i] != s->last_qps[i] || s->qps[0] != s->last_qps[0]) @@ -2756,9 +2739,9 @@ static int vp3_decode_frame(AVCodecContext *avctx, AVFrame *frame, ff_thread_report_progress(&s->last_frame, INT_MAX, 0); } } + ff_thread_finish_setup(avctx); memset(s->all_fragments, 0, s->fragment_count * sizeof(Vp3Fragment)); - ff_thread_finish_setup(avctx); if (s->version < 2) { if ((ret = unpack_superblocks(s, &gb)) < 0) { @@ -2800,7 +2783,7 @@ static int vp3_decode_frame(AVCodecContext *avctx, AVFrame *frame, #endif } - for (i = 0; i < 3; i++) { + for (int i = 0; i < 3; i++) { int height = s->height >> (i && s->chroma_y_shift); if (s->flipped_image) s->data_offset[i] = 0; @@ -2809,12 +2792,12 @@ static int vp3_decode_frame(AVCodecContext *avctx, AVFrame *frame, } s->last_slice_end = 0; - for (i = 0; i < s->c_superblock_height; i++) + for (int i = 0; i < s->c_superblock_height; i++) render_slice(s, i); // filter the last row if (s->version < 2) - for (i = 0; i < 3; i++) { + for (int i = 0; i < 3; i++) { int row = (s->height >> (3 + (i && s->chroma_y_shift))) - 1; apply_loop_filter(s, i, row, row + 1); } @@ -3003,7 +2986,7 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb) static int theora_decode_tables(AVCodecContext *avctx, GetBitContext *gb) { Vp3DecodeContext *s = avctx->priv_data; - int i, n, matrices, inter, plane, ret; + int n, matrices, ret; if (!s->theora_header) return AVERROR_INVALIDDATA; @@ -3012,7 +2995,7 @@ static int theora_decode_tables(AVCodecContext *avctx, GetBitContext *gb) n = get_bits(gb, 3); /* loop filter limit values table */ if (n) - for (i = 0; i < 64; i++) + for (int i = 0; i < 64; i++) s->filter_limit_values[i] = get_bits(gb, n); } @@ -3021,7 +3004,7 @@ static int theora_decode_tables(AVCodecContext *avctx, GetBitContext *gb) else n = 16; /* quality threshold table */ - for (i = 0; i < 64; i++) + for (int i = 0; i < 64; i++) s->coded_ac_scale_factor[i] = get_bits(gb, n); if (s->theora >= 0x030200) @@ -3029,7 +3012,7 @@ static int theora_decode_tables(AVCodecContext *avctx, GetBitContext *gb) else n = 16; /* dc scale factor table */ - for (i = 0; i < 64; i++) + for (int i = 0; i < 64; i++) s->coded_dc_scale_factor[0][i] = s->coded_dc_scale_factor[1][i] = get_bits(gb, n); @@ -3043,12 +3026,12 @@ static int theora_decode_tables(AVCodecContext *avctx, GetBitContext *gb) return -1; } - for (n = 0; n < matrices; n++) - for (i = 0; i < 64; i++) - s->base_matrix[n][i] = get_bits(gb, 8); + for (int j = 0; j < matrices; j++) + for (int i = 0; i < 64; i++) + s->base_matrix[j][i] = get_bits(gb, 8); - for (inter = 0; inter <= 1; inter++) { - for (plane = 0; plane <= 2; plane++) { + for (int inter = 0; inter <= 1; inter++) { + for (int plane = 0; plane <= 2; plane++) { int newqr = 1; if (inter || plane > 0) newqr = get_bits1(gb); @@ -3071,7 +3054,7 @@ static int theora_decode_tables(AVCodecContext *avctx, GetBitContext *gb) int qi = 0; for (;;) { - i = get_bits(gb, av_log2(matrices - 1) + 1); + int i = get_bits(gb, av_log2(matrices - 1) + 1); if (i >= matrices) { av_log(avctx, AV_LOG_ERROR, "invalid base matrix index\n"); @@ -3113,7 +3096,6 @@ static av_cold int theora_decode_init(AVCodecContext *avctx) int ptype; const uint8_t *header_start[3]; int header_len[3]; - int i; int ret; avctx->pix_fmt = AV_PIX_FMT_YUV420P; @@ -3131,7 +3113,7 @@ static av_cold int theora_decode_init(AVCodecContext *avctx) return -1; } - for (i = 0; i < 3; i++) { + for (int i = 0; i < 3; i++) { if (header_len[i] <= 0) continue; ret = init_get_bits8(&gb, header_start[i], header_len[i]); diff --git a/arm/android/third_party/ffmpeg/libavcodec/vp56.c b/arm/android/third_party/ffmpeg/libavcodec/vp56.c index a5c5b236..f2ee3faf 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vp56.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vp56.c @@ -607,8 +607,7 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, AVFrame *rframe, } if (avctx->pix_fmt == AV_PIX_FMT_YUVA420P) { - av_frame_unref(s->alpha_context->frames[VP56_FRAME_CURRENT]); - if ((ret = av_frame_ref(s->alpha_context->frames[VP56_FRAME_CURRENT], p)) < 0) { + if ((ret = av_frame_replace(s->alpha_context->frames[VP56_FRAME_CURRENT], p)) < 0) { av_frame_unref(p); if (res == VP56_SIZE_CHANGE) ff_set_dimensions(avctx, 0, 0); @@ -764,8 +763,7 @@ static int ff_vp56_decode_mbs(AVCodecContext *avctx, void *data, next: if ((p->flags & AV_FRAME_FLAG_KEY) || s->golden_frame) { - av_frame_unref(s->frames[VP56_FRAME_GOLDEN]); - if ((res = av_frame_ref(s->frames[VP56_FRAME_GOLDEN], p)) < 0) + if ((res = av_frame_replace(s->frames[VP56_FRAME_GOLDEN], p)) < 0) return res; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/vp6.c b/arm/android/third_party/ffmpeg/libavcodec/vp6.c index 7a519cf1..97d63a58 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vp6.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vp6.c @@ -279,7 +279,7 @@ static int vp6_build_huff_tree(VP56Context *s, uint8_t coeff_model[], nodes[map[2*i+1]].count = b + !b; } - ff_free_vlc(vlc); + ff_vlc_free(vlc); /* then build the huffman tree according to probabilities */ return ff_huff_build_tree(s->avctx, vlc, size, FF_HUFFMAN_BITS, nodes, vp6_huff_cmp, @@ -708,11 +708,11 @@ static av_cold void vp6_decode_free_context(VP56Context *s) ff_vp56_free_context(s); for (pt=0; pt<2; pt++) { - ff_free_vlc(&s->dccv_vlc[pt]); - ff_free_vlc(&s->runv_vlc[pt]); + ff_vlc_free(&s->dccv_vlc[pt]); + ff_vlc_free(&s->runv_vlc[pt]); for (ct=0; ct<3; ct++) for (cg=0; cg<6; cg++) - ff_free_vlc(&s->ract_vlc[pt][ct][cg]); + ff_vlc_free(&s->ract_vlc[pt][ct][cg]); } } diff --git a/arm/android/third_party/ffmpeg/libavcodec/vp8.c b/arm/android/third_party/ffmpeg/libavcodec/vp8.c index 50afe19b..64b1c7f6 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vp8.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vp8.c @@ -31,6 +31,7 @@ #include "avcodec.h" #include "codec_internal.h" #include "decode.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "mathops.h" #include "thread.h" @@ -104,23 +105,21 @@ static int vp8_alloc_frame(VP8Context *s, VP8Frame *f, int ref) if ((ret = ff_thread_get_ext_buffer(s->avctx, &f->tf, ref ? AV_GET_BUFFER_FLAG_REF : 0)) < 0) return ret; - if (!(f->seg_map = av_buffer_allocz(s->mb_width * s->mb_height))) + if (!(f->seg_map = av_buffer_allocz(s->mb_width * s->mb_height))) { + ret = AVERROR(ENOMEM); goto fail; - if (s->avctx->hwaccel) { - const AVHWAccel *hwaccel = s->avctx->hwaccel; - if (hwaccel->frame_priv_data_size) { - f->hwaccel_priv_buf = ff_hwaccel_frame_priv_alloc(s->avctx, hwaccel); - if (!f->hwaccel_priv_buf) - goto fail; - f->hwaccel_picture_private = f->hwaccel_priv_buf->data; - } } + ret = ff_hwaccel_frame_priv_alloc(s->avctx, &f->hwaccel_picture_private, + &f->hwaccel_priv_buf); + if (ret < 0) + goto fail; + return 0; fail: av_buffer_unref(&f->seg_map); ff_thread_release_ext_buffer(s->avctx, &f->tf); - return AVERROR(ENOMEM); + return ret; } static void vp8_release_frame(VP8Context *s, VP8Frame *f) @@ -168,8 +167,8 @@ static void vp8_decode_flush_impl(AVCodecContext *avctx, int free_mem) if (free_mem) free_buffers(s); - if (avctx->hwaccel && avctx->hwaccel->flush) - avctx->hwaccel->flush(avctx); + if (FF_HW_HAS_CB(avctx, flush)) + FF_HW_SIMPLE_CALL(avctx, flush); } static void vp8_decode_flush(AVCodecContext *avctx) @@ -2766,15 +2765,16 @@ int vp78_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, ff_thread_finish_setup(avctx); if (avctx->hwaccel) { - ret = avctx->hwaccel->start_frame(avctx, avpkt->data, avpkt->size); + const FFHWAccel *hwaccel = ffhwaccel(avctx->hwaccel); + ret = hwaccel->start_frame(avctx, avpkt->data, avpkt->size); if (ret < 0) goto err; - ret = avctx->hwaccel->decode_slice(avctx, avpkt->data, avpkt->size); + ret = hwaccel->decode_slice(avctx, avpkt->data, avpkt->size); if (ret < 0) goto err; - ret = avctx->hwaccel->end_frame(avctx); + ret = hwaccel->end_frame(avctx); if (ret < 0) goto err; diff --git a/arm/android/third_party/ffmpeg/libavcodec/vp9.c b/arm/android/third_party/ffmpeg/libavcodec/vp9.c index 4f704ec0..3cc27aa8 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vp9.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vp9.c @@ -27,6 +27,7 @@ #include "codec_internal.h" #include "decode.h" #include "get_bits.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "profiles.h" #include "thread.h" @@ -119,12 +120,14 @@ static int vp9_frame_alloc(AVCodecContext *avctx, VP9Frame *f) s->frame_extradata_pool = av_buffer_pool_init(sz * (1 + sizeof(VP9mvrefPair)), NULL); if (!s->frame_extradata_pool) { s->frame_extradata_pool_size = 0; + ret = AVERROR(ENOMEM); goto fail; } s->frame_extradata_pool_size = sz; } f->extradata = av_buffer_pool_get(s->frame_extradata_pool); if (!f->extradata) { + ret = AVERROR(ENOMEM); goto fail; } memset(f->extradata->data, 0, f->extradata->size); @@ -132,22 +135,16 @@ static int vp9_frame_alloc(AVCodecContext *avctx, VP9Frame *f) f->segmentation_map = f->extradata->data; f->mv = (VP9mvrefPair *) (f->extradata->data + sz); - if (avctx->hwaccel) { - const AVHWAccel *hwaccel = avctx->hwaccel; - av_assert0(!f->hwaccel_picture_private); - if (hwaccel->frame_priv_data_size) { - f->hwaccel_priv_buf = ff_hwaccel_frame_priv_alloc(avctx, hwaccel); - if (!f->hwaccel_priv_buf) - goto fail; - f->hwaccel_picture_private = f->hwaccel_priv_buf->data; - } - } + ret = ff_hwaccel_frame_priv_alloc(avctx, &f->hwaccel_picture_private, + &f->hwaccel_priv_buf); + if (ret < 0) + goto fail; return 0; fail: vp9_frame_unref(avctx, f); - return AVERROR(ENOMEM); + return ret; } static int vp9_frame_ref(AVCodecContext *avctx, VP9Frame *dst, VP9Frame *src) @@ -253,7 +250,7 @@ static int update_size(AVCodecContext *avctx, int w, int h) *fmtp++ = s->pix_fmt; *fmtp = AV_PIX_FMT_NONE; - ret = ff_thread_get_format(avctx, pix_fmts); + ret = ff_get_format(avctx, pix_fmts); if (ret < 0) return ret; @@ -1639,13 +1636,14 @@ static int vp9_decode_frame(AVCodecContext *avctx, AVFrame *frame, } if (avctx->hwaccel) { - ret = avctx->hwaccel->start_frame(avctx, NULL, 0); + const FFHWAccel *hwaccel = ffhwaccel(avctx->hwaccel); + ret = hwaccel->start_frame(avctx, NULL, 0); if (ret < 0) return ret; - ret = avctx->hwaccel->decode_slice(avctx, pkt->data, pkt->size); + ret = hwaccel->decode_slice(avctx, pkt->data, pkt->size); if (ret < 0) return ret; - ret = avctx->hwaccel->end_frame(avctx); + ret = hwaccel->end_frame(avctx); if (ret < 0) return ret; goto finish; @@ -1802,8 +1800,8 @@ static void vp9_decode_flush(AVCodecContext *avctx) for (i = 0; i < 8; i++) ff_thread_release_ext_buffer(avctx, &s->s.refs[i]); - if (avctx->hwaccel && avctx->hwaccel->flush) - avctx->hwaccel->flush(avctx); + if (FF_HW_HAS_CB(avctx, flush)) + FF_HW_SIMPLE_CALL(avctx, flush); } static av_cold int vp9_decode_init(AVCodecContext *avctx) diff --git a/arm/android/third_party/ffmpeg/libavcodec/vqcdec.c b/arm/android/third_party/ffmpeg/libavcodec/vqcdec.c index c3bce879..462d810a 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vqcdec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vqcdec.c @@ -53,7 +53,7 @@ static VLC vector_vlc; static av_cold void vqc_init_static_data(void) { - INIT_VLC_STATIC_FROM_LENGTHS(&vector_vlc, VECTOR_VLC_BITS, FF_ARRAY_ELEMS(vector_nbits), + VLC_INIT_STATIC_FROM_LENGTHS(&vector_vlc, VECTOR_VLC_BITS, FF_ARRAY_ELEMS(vector_nbits), vector_nbits, 1, vector_symbols, 1, 1, 0, 0, 1 << VECTOR_VLC_BITS); diff --git a/arm/android/third_party/ffmpeg/libavcodec/vulkan_av1.c b/arm/android/third_party/ffmpeg/libavcodec/vulkan_av1.c index d0f40192..b1373722 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vulkan_av1.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vulkan_av1.c @@ -104,12 +104,9 @@ static int vk_av1_fill_pict(AVCodecContext *avctx, const AV1Frame **ref_src, static int vk_av1_create_params(AVCodecContext *avctx, AVBufferRef **buf) { - VkResult ret; - const AV1DecContext *s = avctx->priv_data; FFVulkanDecodeContext *dec = avctx->internal->hwaccel_priv_data; FFVulkanDecodeShared *ctx = (FFVulkanDecodeShared *)dec->shared_ref->data; - FFVulkanFunctions *vk = &ctx->s.vkfn; const AV1RawSequenceHeader *seq = s->raw_seq; @@ -118,10 +115,7 @@ static int vk_av1_create_params(AVCodecContext *avctx, AVBufferRef **buf) VkVideoDecodeAV1SessionParametersCreateInfoMESA av1_params; VkVideoSessionParametersCreateInfoKHR session_params_create; - AVBufferRef *tmp; - VkVideoSessionParametersKHR *par = av_malloc(sizeof(*par)); - if (!par) - return AVERROR(ENOMEM); + int err; av1_sequence_header = (StdVideoAV1MESASequenceHeader) { .flags = (StdVideoAV1MESASequenceHeaderFlags) { @@ -189,26 +183,12 @@ static int vk_av1_create_params(AVCodecContext *avctx, AVBufferRef **buf) .videoSessionParametersTemplate = NULL, }; - /* Create session parameters */ - ret = vk->CreateVideoSessionParametersKHR(ctx->s.hwctx->act_dev, &session_params_create, - ctx->s.hwctx->alloc, par); - if (ret != VK_SUCCESS) { - av_log(avctx, AV_LOG_ERROR, "Unable to create Vulkan video session parameters: %s!\n", - ff_vk_ret2str(ret)); - return AVERROR_EXTERNAL; - } - - tmp = av_buffer_create((uint8_t *)par, sizeof(*par), ff_vk_decode_free_params, - ctx, 0); - if (!tmp) { - ff_vk_decode_free_params(ctx, (uint8_t *)par); - return AVERROR(ENOMEM); - } + err = ff_vk_decode_create_params(buf, avctx, ctx, &session_params_create); + if (err < 0) + return err; av_log(avctx, AV_LOG_DEBUG, "Created frame parameters\n"); - *buf = tmp; - return 0; } @@ -572,11 +552,11 @@ static void vk_av1_free_frame_priv(void *_hwctx, uint8_t *data) av_free(ap); } -const AVHWAccel ff_av1_vulkan_hwaccel = { - .name = "av1_vulkan", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AV1, - .pix_fmt = AV_PIX_FMT_VULKAN, +const FFHWAccel ff_av1_vulkan_hwaccel = { + .p.name = "av1_vulkan", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, + .p.pix_fmt = AV_PIX_FMT_VULKAN, .start_frame = &vk_av1_start_frame, .decode_slice = &vk_av1_decode_slice, .end_frame = &vk_av1_end_frame, diff --git a/arm/android/third_party/ffmpeg/libavcodec/vulkan_decode.c b/arm/android/third_party/ffmpeg/libavcodec/vulkan_decode.c index f20733fb..ef4a1c38 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vulkan_decode.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vulkan_decode.c @@ -176,6 +176,7 @@ int ff_vk_decode_prepare_frame(FFVulkanDecodeContext *dec, AVFrame *pic, { int err; FFVulkanDecodeShared *ctx = (FFVulkanDecodeShared *)dec->shared_ref->data; + FFVulkanFunctions *vk = &ctx->s.vkfn; vkpic->slices_size = 0; @@ -189,6 +190,9 @@ int ff_vk_decode_prepare_frame(FFVulkanDecodeContext *dec, AVFrame *pic, vkpic->img_view_out = NULL; vkpic->img_view_dest = NULL; + vkpic->destroy_image_view = vk->DestroyImageView; + vkpic->wait_semaphores = vk->WaitSemaphores; + if (dec->layered_dpb && alloc_dpb) { vkpic->img_view_ref = ctx->layered_view; vkpic->img_aspect_ref = ctx->layered_aspect; @@ -554,9 +558,6 @@ int ff_vk_decode_frame(AVCodecContext *avctx, void ff_vk_decode_free_frame(AVHWDeviceContext *dev_ctx, FFVulkanDecodePicture *vp) { AVVulkanDeviceContext *hwctx = dev_ctx->hwctx; - PFN_vkGetDeviceProcAddr device_proc_addr; - PFN_vkWaitSemaphores wait_semaphores; - PFN_vkDestroyImageView destroy_image_view; VkSemaphoreWaitInfo sem_wait = (VkSemaphoreWaitInfo) { .sType = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO, @@ -565,27 +566,22 @@ void ff_vk_decode_free_frame(AVHWDeviceContext *dev_ctx, FFVulkanDecodePicture * .semaphoreCount = 1, }; - /* Guaranteed to exist */ - device_proc_addr = (PFN_vkGetDeviceProcAddr)hwctx->get_proc_addr(hwctx->inst, "vkGetDeviceProcAddr"); - destroy_image_view = (PFN_vkDestroyImageView)device_proc_addr(hwctx->act_dev, "vkDestroyImageView"); - wait_semaphores = (PFN_vkWaitSemaphores)device_proc_addr(hwctx->act_dev, "vkWaitSemaphores"); - /* We do not have to lock the frame here because we're not interested * in the actual current semaphore value, but only that it's later than * the time we submitted the image for decoding. */ if (vp->sem) - wait_semaphores(hwctx->act_dev, &sem_wait, UINT64_MAX); + vp->wait_semaphores(hwctx->act_dev, &sem_wait, UINT64_MAX); /* Free slices data */ av_buffer_unref(&vp->slices_buf); /* Destroy image view (out) */ if (vp->img_view_out && vp->img_view_out != vp->img_view_dest) - destroy_image_view(hwctx->act_dev, vp->img_view_out, hwctx->alloc); + vp->destroy_image_view(hwctx->act_dev, vp->img_view_out, hwctx->alloc); /* Destroy image view (ref, unlayered) */ if (vp->img_view_dest) - destroy_image_view(hwctx->act_dev, vp->img_view_dest, hwctx->alloc); + vp->destroy_image_view(hwctx->act_dev, vp->img_view_dest, hwctx->alloc); av_frame_free(&vp->dpb_frame); } @@ -682,7 +678,7 @@ static VkResult vulkan_setup_profile(AVCodecContext *avctx, VkVideoProfileListInfoKHR *profile_list = &prof->profile_list; VkVideoDecodeH264ProfileInfoKHR *h264_profile = &prof->h264_profile; - VkVideoDecodeH264ProfileInfoKHR *h265_profile = &prof->h265_profile; + VkVideoDecodeH265ProfileInfoKHR *h265_profile = &prof->h265_profile; VkVideoDecodeAV1ProfileInfoMESA *av1_profile = &prof->av1_profile; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->sw_pix_fmt); @@ -696,8 +692,8 @@ static VkResult vulkan_setup_profile(AVCodecContext *avctx, /* Vulkan transmits all the constrant_set flags, rather than wanting them * merged in the profile IDC */ - h264_profile->stdProfileIdc = cur_profile & ~(FF_PROFILE_H264_CONSTRAINED | - FF_PROFILE_H264_INTRA); + h264_profile->stdProfileIdc = cur_profile & ~(AV_PROFILE_H264_CONSTRAINED | + AV_PROFILE_H264_INTRA); h264_profile->pictureLayout = avctx->field_order == AV_FIELD_UNKNOWN || avctx->field_order == AV_FIELD_PROGRESSIVE ? @@ -789,8 +785,8 @@ static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_ } cur_profile = avctx->profile; - base_profile = avctx->codec_id == AV_CODEC_ID_H264 ? FF_PROFILE_H264_CONSTRAINED_BASELINE : - avctx->codec_id == AV_CODEC_ID_H265 ? FF_PROFILE_HEVC_MAIN : + base_profile = avctx->codec_id == AV_CODEC_ID_H264 ? AV_PROFILE_H264_CONSTRAINED_BASELINE : + avctx->codec_id == AV_CODEC_ID_H265 ? AV_PROFILE_HEVC_MAIN : avctx->codec_id == AV_CODEC_ID_AV1 ? STD_VIDEO_AV1_MESA_PROFILE_MAIN : 0; @@ -837,8 +833,8 @@ static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_ return AVERROR_EXTERNAL; } - max_level = avctx->codec_id == AV_CODEC_ID_H264 ? h264_caps.maxLevelIdc : - avctx->codec_id == AV_CODEC_ID_H265 ? h265_caps.maxLevelIdc : + max_level = avctx->codec_id == AV_CODEC_ID_H264 ? ff_vk_h264_level_to_av(h264_caps.maxLevelIdc) : + avctx->codec_id == AV_CODEC_ID_H265 ? ff_vk_h265_level_to_av(h265_caps.maxLevelIdc) : avctx->codec_id == AV_CODEC_ID_AV1 ? av1_caps.maxLevelIdc : 0; @@ -863,6 +859,9 @@ static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_ caps->maxDpbSlots); av_log(avctx, AV_LOG_VERBOSE, " Maximum active references: %u\n", caps->maxActiveReferencePictures); + av_log(avctx, AV_LOG_VERBOSE, " Codec header name: '%s' (driver), '%s' (compiled)\n", + caps->stdHeaderVersion.extensionName, + dec_ext[avctx->codec_id]->extensionName); av_log(avctx, AV_LOG_VERBOSE, " Codec header version: %i.%i.%i (driver), %i.%i.%i (compiled)\n", CODEC_VER(caps->stdHeaderVersion.specVersion), CODEC_VER(dec_ext[avctx->codec_id]->specVersion)); @@ -1054,7 +1053,7 @@ int ff_vk_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx) return err; } -void ff_vk_decode_free_params(void *opaque, uint8_t *data) +static void vk_decode_free_params(void *opaque, uint8_t *data) { FFVulkanDecodeShared *ctx = opaque; FFVulkanFunctions *vk = &ctx->s.vkfn; @@ -1064,6 +1063,35 @@ void ff_vk_decode_free_params(void *opaque, uint8_t *data) av_free(par); } +int ff_vk_decode_create_params(AVBufferRef **par_ref, void *logctx, FFVulkanDecodeShared *ctx, + const VkVideoSessionParametersCreateInfoKHR *session_params_create) +{ + VkVideoSessionParametersKHR *par = av_malloc(sizeof(*par)); + const FFVulkanFunctions *vk = &ctx->s.vkfn; + VkResult ret; + + if (!par) + return AVERROR(ENOMEM); + + /* Create session parameters */ + ret = vk->CreateVideoSessionParametersKHR(ctx->s.hwctx->act_dev, session_params_create, + ctx->s.hwctx->alloc, par); + if (ret != VK_SUCCESS) { + av_log(logctx, AV_LOG_ERROR, "Unable to create Vulkan video session parameters: %s!\n", + ff_vk_ret2str(ret)); + av_free(par); + return AVERROR_EXTERNAL; + } + *par_ref = av_buffer_create((uint8_t *)par, sizeof(*par), + vk_decode_free_params, ctx, 0); + if (!*par_ref) { + vk_decode_free_params(ctx, (uint8_t *)par); + return AVERROR(ENOMEM); + } + + return 0; +} + int ff_vk_decode_uninit(AVCodecContext *avctx) { FFVulkanDecodeContext *dec = avctx->internal->hwaccel_priv_data; @@ -1072,7 +1100,7 @@ int ff_vk_decode_uninit(AVCodecContext *avctx) /* Wait on and free execution pool */ ff_vk_exec_pool_free(&ctx->s, &dec->exec_pool); - av_buffer_pool_uninit(&dec->tmp_pool); + av_freep(&dec->hevc_headers); av_buffer_unref(&dec->session_params); av_buffer_unref(&dec->shared_ref); av_freep(&dec->slice_off); diff --git a/arm/android/third_party/ffmpeg/libavcodec/vulkan_decode.h b/arm/android/third_party/ffmpeg/libavcodec/vulkan_decode.h index 1b4e1cc7..c983b440 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vulkan_decode.h +++ b/arm/android/third_party/ffmpeg/libavcodec/vulkan_decode.h @@ -20,14 +20,14 @@ #define AVCODEC_VULKAN_DECODE_H #include "decode.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "internal.h" #include "vulkan_video.h" typedef struct FFVulkanDecodeProfileData { VkVideoDecodeH264ProfileInfoKHR h264_profile; - VkVideoDecodeH264ProfileInfoKHR h265_profile; + VkVideoDecodeH265ProfileInfoKHR h265_profile; VkVideoDecodeAV1ProfileInfoMESA av1_profile; VkVideoDecodeUsageInfoKHR usage; VkVideoProfileInfoKHR profile; @@ -64,8 +64,8 @@ typedef struct FFVulkanDecodeContext { uint32_t frame_id_alloc_mask; /* For AV1 only */ /* Thread-local state below */ - AVBufferPool *tmp_pool; /* Pool for temporary data, if needed (HEVC) */ - size_t tmp_pool_ele_size; + struct HEVCHeaderSet *hevc_headers; + size_t hevc_headers_size; uint32_t *slice_off; unsigned int slice_off_max; @@ -97,6 +97,10 @@ typedef struct FFVulkanDecodePicture { /* Slice data */ AVBufferRef *slices_buf; size_t slices_size; + + /* Vulkan functions needed for destruction, as no other context is guaranteed to exist */ + PFN_vkWaitSemaphores wait_semaphores; + PFN_vkDestroyImageView destroy_image_view; } FFVulkanDecodePicture; /** @@ -156,9 +160,10 @@ int ff_vk_get_decode_buffer(FFVulkanDecodeContext *ctx, AVBufferRef **buf, void *create_pNext, size_t size); /** - * Free VkVideoSessionParametersKHR. + * Create VkVideoSessionParametersKHR wrapped in an AVBufferRef. */ -void ff_vk_decode_free_params(void *opaque, uint8_t *data); +int ff_vk_decode_create_params(AVBufferRef **par_ref, void *logctx, FFVulkanDecodeShared *ctx, + const VkVideoSessionParametersCreateInfoKHR *session_params_create); /** * Flush decoder. diff --git a/arm/android/third_party/ffmpeg/libavcodec/vulkan_h264.c b/arm/android/third_party/ffmpeg/libavcodec/vulkan_h264.c index 84bcef79..32ef32d6 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vulkan_h264.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vulkan_h264.c @@ -43,6 +43,8 @@ typedef struct H264VulkanDecodePicture { VkVideoDecodeH264PictureInfoKHR h264_pic_info; } H264VulkanDecodePicture; +const static int h264_scaling_list8_order[] = { 0, 3, 1, 4, 2, 5 }; + static int vk_h264_fill_pict(AVCodecContext *avctx, H264Picture **ref_src, VkVideoReferenceSlotInfoKHR *ref_slot, /* Main structure */ VkVideoPictureResourceInfoKHR *ref, /* Goes in ^ */ @@ -143,12 +145,13 @@ static void set_sps(const SPS *sps, }; for (int i = 0; i < STD_VIDEO_H264_SCALING_LIST_4X4_NUM_LISTS; i++) - memcpy(vksps_scaling->ScalingList4x4[i], sps->scaling_matrix4[i], - STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS * sizeof(**sps->scaling_matrix4)); + for (int j = 0; j < STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS; j++) + vksps_scaling->ScalingList4x4[i][j] = sps->scaling_matrix4[i][ff_zigzag_scan[j]]; for (int i = 0; i < STD_VIDEO_H264_SCALING_LIST_8X8_NUM_LISTS; i++) - memcpy(vksps_scaling->ScalingList8x8[i], sps->scaling_matrix8[i], - STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS * sizeof(**sps->scaling_matrix8)); + for (int j = 0; j < STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS; j++) + vksps_scaling->ScalingList8x8[i][j] = + sps->scaling_matrix8[h264_scaling_list8_order[i]][ff_zigzag_direct[j]]; *vksps_vui_header = (StdVideoH264HrdParameters) { .cpb_cnt_minus1 = sps->cpb_cnt - 1, @@ -248,12 +251,13 @@ static void set_pps(const PPS *pps, const SPS *sps, }; for (int i = 0; i < STD_VIDEO_H264_SCALING_LIST_4X4_NUM_LISTS; i++) - memcpy(vkpps_scaling->ScalingList4x4[i], pps->scaling_matrix4[i], - STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS * sizeof(**pps->scaling_matrix4)); + for (int j = 0; j < STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS; j++) + vkpps_scaling->ScalingList4x4[i][j] = pps->scaling_matrix4[i][ff_zigzag_scan[j]]; for (int i = 0; i < STD_VIDEO_H264_SCALING_LIST_8X8_NUM_LISTS; i++) - memcpy(vkpps_scaling->ScalingList8x8[i], pps->scaling_matrix8[i], - STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS * sizeof(**pps->scaling_matrix8)); + for (int j = 0; j < STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS; j++) + vkpps_scaling->ScalingList8x8[i][j] = + pps->scaling_matrix8[h264_scaling_list8_order[i]][ff_zigzag_direct[j]]; *vkpps = (StdVideoH264PictureParameterSet) { .seq_parameter_set_id = pps->sps_id, @@ -281,10 +285,9 @@ static void set_pps(const PPS *pps, const SPS *sps, static int vk_h264_create_params(AVCodecContext *avctx, AVBufferRef **buf) { - VkResult ret; + int err; FFVulkanDecodeContext *dec = avctx->internal->hwaccel_priv_data; FFVulkanDecodeShared *ctx = (FFVulkanDecodeShared *)dec->shared_ref->data; - FFVulkanFunctions *vk = &ctx->s.vkfn; const H264Context *h = avctx->priv_data; /* SPS */ @@ -315,11 +318,6 @@ static int vk_h264_create_params(AVCodecContext *avctx, AVBufferRef **buf) .videoSessionParametersTemplate = NULL, }; - AVBufferRef *tmp; - VkVideoSessionParametersKHR *par = av_malloc(sizeof(*par)); - if (!par) - return AVERROR(ENOMEM); - /* SPS list */ for (int i = 0; i < FF_ARRAY_ELEMS(h->ps.sps_list); i++) { if (h->ps.sps_list[i]) { @@ -343,27 +341,13 @@ static int vk_h264_create_params(AVCodecContext *avctx, AVBufferRef **buf) h264_params.maxStdSPSCount = h264_params_info.stdSPSCount; h264_params.maxStdPPSCount = h264_params_info.stdPPSCount; - /* Create session parameters */ - ret = vk->CreateVideoSessionParametersKHR(ctx->s.hwctx->act_dev, &session_params_create, - ctx->s.hwctx->alloc, par); - if (ret != VK_SUCCESS) { - av_log(avctx, AV_LOG_ERROR, "Unable to create Vulkan video session parameters: %s!\n", - ff_vk_ret2str(ret)); - return AVERROR_EXTERNAL; - } - - tmp = av_buffer_create((uint8_t *)par, sizeof(*par), ff_vk_decode_free_params, - ctx, 0); - if (!tmp) { - ff_vk_decode_free_params(ctx, (uint8_t *)par); - return AVERROR(ENOMEM); - } + err = ff_vk_decode_create_params(buf, avctx, ctx, &session_params_create); + if (err < 0) + return err; av_log(avctx, AV_LOG_DEBUG, "Created frame parameters: %i SPS %i PPS\n", h264_params_info.stdSPSCount, h264_params_info.stdPPSCount); - *buf = tmp; - return 0; } @@ -558,11 +542,11 @@ static void vk_h264_free_frame_priv(void *_hwctx, uint8_t *data) av_free(hp); } -const AVHWAccel ff_h264_vulkan_hwaccel = { - .name = "h264_vulkan", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, - .pix_fmt = AV_PIX_FMT_VULKAN, +const FFHWAccel ff_h264_vulkan_hwaccel = { + .p.name = "h264_vulkan", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, + .p.pix_fmt = AV_PIX_FMT_VULKAN, .start_frame = &vk_h264_start_frame, .decode_slice = &vk_h264_decode_slice, .end_frame = &vk_h264_end_frame, diff --git a/arm/android/third_party/ffmpeg/libavcodec/vulkan_hevc.c b/arm/android/third_party/ffmpeg/libavcodec/vulkan_hevc.c index ab0f6b96..52f223ce 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vulkan_hevc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vulkan_hevc.c @@ -17,6 +17,7 @@ */ #include "hevcdec.h" +#include "hevc_data.h" #include "hevc_ps.h" #include "vulkan_decode.h" @@ -67,49 +68,33 @@ typedef struct HEVCHeaderSet { HEVCHeaderVPS *hvps; } HEVCHeaderSet; -static int get_data_set_buf(FFVulkanDecodeContext *s, AVBufferRef **data_buf, - int nb_vps, AVBufferRef * const vps_list[HEVC_MAX_VPS_COUNT]) +static int alloc_hevc_header_structs(FFVulkanDecodeContext *s, + int nb_vps, + AVBufferRef * const vps_list[HEVC_MAX_VPS_COUNT]) { uint8_t *data_ptr; HEVCHeaderSet *hdr; - size_t base_size = sizeof(StdVideoH265SequenceParameterSet)*HEVC_MAX_SPS_COUNT + - sizeof(HEVCHeaderSPS)*HEVC_MAX_SPS_COUNT + - sizeof(StdVideoH265PictureParameterSet)*HEVC_MAX_PPS_COUNT + - sizeof(HEVCHeaderPPS)*HEVC_MAX_PPS_COUNT + - sizeof(StdVideoH265VideoParameterSet)*HEVC_MAX_VPS_COUNT + - sizeof(HEVCHeaderVPS *); - - size_t vps_size = sizeof(StdVideoH265ProfileTierLevel) + - sizeof(StdVideoH265DecPicBufMgr) + - sizeof(StdVideoH265HrdParameters)*HEVC_MAX_LAYER_SETS + - sizeof(HEVCHeaderVPSSet *); - - size_t buf_size = base_size + vps_size*nb_vps; - + size_t buf_size = sizeof(HEVCHeaderSet) + nb_vps*sizeof(HEVCHeaderVPS); for (int i = 0; i < nb_vps; i++) { const HEVCVPS *vps = (const HEVCVPS *)vps_list[i]->data; buf_size += sizeof(HEVCHeaderVPSSet)*vps->vps_num_hrd_parameters; } - if (buf_size > s->tmp_pool_ele_size) { - av_buffer_pool_uninit(&s->tmp_pool); - s->tmp_pool_ele_size = 0; - s->tmp_pool = av_buffer_pool_init(buf_size, NULL); - if (!s->tmp_pool) + if (buf_size > s->hevc_headers_size) { + av_freep(&s->hevc_headers); + s->hevc_headers_size = 0; + s->hevc_headers = av_mallocz(buf_size); + if (!s->hevc_headers) return AVERROR(ENOMEM); - s->tmp_pool_ele_size = buf_size; + s->hevc_headers_size = buf_size; } - *data_buf = av_buffer_pool_get(s->tmp_pool); - if (!(*data_buf)) - return AVERROR(ENOMEM); - - /* Setup pointers */ - data_ptr = (*data_buf)->data; - hdr = (HEVCHeaderSet *)data_ptr; - hdr->hvps = (HEVCHeaderVPS *)(data_ptr + base_size); - data_ptr += base_size + vps_size*nb_vps; + /* Setup struct pointers */ + hdr = s->hevc_headers; + data_ptr = (uint8_t *)hdr; + hdr->hvps = (HEVCHeaderVPS *)(data_ptr + sizeof(HEVCHeaderSet)); + data_ptr += sizeof(HEVCHeaderSet) + nb_vps*sizeof(HEVCHeaderVPS); for (int i = 0; i < nb_vps; i++) { const HEVCVPS *vps = (const HEVCVPS *)vps_list[i]->data; hdr->hvps[i].sls = (HEVCHeaderVPSSet *)data_ptr; @@ -205,6 +190,43 @@ static StdVideoH265LevelIdc convert_to_vk_level_idc(int level_idc) } } +static void copy_scaling_list(const ScalingList *sl, StdVideoH265ScalingLists *vksl) +{ + for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_4X4_NUM_LISTS; i++) { + for (int j = 0; j < STD_VIDEO_H265_SCALING_LIST_4X4_NUM_ELEMENTS; j++) { + uint8_t pos = 4 * ff_hevc_diag_scan4x4_y[j] + ff_hevc_diag_scan4x4_x[j]; + vksl->ScalingList4x4[i][j] = sl->sl[0][i][pos]; + } + } + + for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_8X8_NUM_LISTS; i++) { + for (int j = 0; j < STD_VIDEO_H265_SCALING_LIST_8X8_NUM_ELEMENTS; j++) { + uint8_t pos = 8 * ff_hevc_diag_scan8x8_y[j] + ff_hevc_diag_scan8x8_x[j]; + vksl->ScalingList8x8[i][j] = sl->sl[1][i][pos]; + } + } + + for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS; i++) { + for (int j = 0; j < STD_VIDEO_H265_SCALING_LIST_16X16_NUM_ELEMENTS; j++) { + uint8_t pos = 8 * ff_hevc_diag_scan8x8_y[j] + ff_hevc_diag_scan8x8_x[j]; + vksl->ScalingList16x16[i][j] = sl->sl[2][i][pos]; + } + } + + for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS; i++) { + for (int j = 0; j < STD_VIDEO_H265_SCALING_LIST_32X32_NUM_ELEMENTS; j++) { + uint8_t pos = 8 * ff_hevc_diag_scan8x8_y[j] + ff_hevc_diag_scan8x8_x[j]; + vksl->ScalingList32x32[i][j] = sl->sl[3][i * 3][pos]; + } + } + + memcpy(vksl->ScalingListDCCoef16x16, sl->sl_dc[0], + STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS * sizeof(*vksl->ScalingListDCCoef16x16)); + + for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS; i++) + vksl->ScalingListDCCoef32x32[i] = sl->sl_dc[1][i * 3]; +} + static void set_sps(const HEVCSPS *sps, int sps_idx, StdVideoH265ScalingLists *vksps_scaling, StdVideoH265HrdParameters *vksps_vui_header, @@ -218,27 +240,7 @@ static void set_sps(const HEVCSPS *sps, int sps_idx, StdVideoH265ShortTermRefPicSet *str, StdVideoH265LongTermRefPicsSps *ltr) { - for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_4X4_NUM_LISTS; i++) - memcpy(vksps_scaling->ScalingList4x4[i], sps->scaling_list.sl[0][i], - STD_VIDEO_H265_SCALING_LIST_4X4_NUM_ELEMENTS * sizeof(**vksps_scaling->ScalingList4x4)); - - for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_8X8_NUM_LISTS; i++) - memcpy(vksps_scaling->ScalingList8x8[i], sps->scaling_list.sl[1][i], - STD_VIDEO_H265_SCALING_LIST_8X8_NUM_ELEMENTS * sizeof(**vksps_scaling->ScalingList8x8)); - - for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS; i++) - memcpy(vksps_scaling->ScalingList16x16[i], sps->scaling_list.sl[2][i], - STD_VIDEO_H265_SCALING_LIST_16X16_NUM_ELEMENTS * sizeof(**vksps_scaling->ScalingList16x16)); - - for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS; i++) - memcpy(vksps_scaling->ScalingList32x32[i], sps->scaling_list.sl[3][i * 3], - STD_VIDEO_H265_SCALING_LIST_32X32_NUM_ELEMENTS * sizeof(**vksps_scaling->ScalingList32x32)); - - memcpy(vksps_scaling->ScalingListDCCoef16x16, sps->scaling_list.sl_dc[0], - STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS * sizeof(*vksps_scaling->ScalingListDCCoef16x16)); - - for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS; i++) - vksps_scaling->ScalingListDCCoef32x32[i] = sps->scaling_list.sl_dc[1][i * 3]; + copy_scaling_list(&sps->scaling_list, vksps_scaling); *vksps_vui_header = (StdVideoH265HrdParameters) { .flags = (StdVideoH265HrdFlags) { @@ -464,27 +466,7 @@ static void set_pps(const HEVCPPS *pps, const HEVCSPS *sps, StdVideoH265PictureParameterSet *vkpps, StdVideoH265PredictorPaletteEntries *pal) { - for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_4X4_NUM_LISTS; i++) - memcpy(vkpps_scaling->ScalingList4x4[i], pps->scaling_list.sl[0][i], - STD_VIDEO_H265_SCALING_LIST_4X4_NUM_ELEMENTS * sizeof(**vkpps_scaling->ScalingList4x4)); - - for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_8X8_NUM_LISTS; i++) - memcpy(vkpps_scaling->ScalingList8x8[i], pps->scaling_list.sl[1][i], - STD_VIDEO_H265_SCALING_LIST_8X8_NUM_ELEMENTS * sizeof(**vkpps_scaling->ScalingList8x8)); - - for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS; i++) - memcpy(vkpps_scaling->ScalingList16x16[i], pps->scaling_list.sl[2][i], - STD_VIDEO_H265_SCALING_LIST_16X16_NUM_ELEMENTS * sizeof(**vkpps_scaling->ScalingList16x16)); - - for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS; i++) - memcpy(vkpps_scaling->ScalingList32x32[i], pps->scaling_list.sl[3][i * 3], - STD_VIDEO_H265_SCALING_LIST_32X32_NUM_ELEMENTS * sizeof(**vkpps_scaling->ScalingList32x32)); - - memcpy(vkpps_scaling->ScalingListDCCoef16x16, pps->scaling_list.sl_dc[0], - STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS * sizeof(*vkpps_scaling->ScalingListDCCoef16x16)); - - for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS; i++) - vkpps_scaling->ScalingListDCCoef32x32[i] = sps->scaling_list.sl_dc[1][i * 3]; + copy_scaling_list(&pps->scaling_list, vkpps_scaling); *vkpps = (StdVideoH265PictureParameterSet) { .flags = (StdVideoH265PpsFlags) { @@ -652,11 +634,9 @@ static void set_vps(const HEVCVPS *vps, static int vk_hevc_create_params(AVCodecContext *avctx, AVBufferRef **buf) { int err; - VkResult ret; const HEVCContext *h = avctx->priv_data; FFVulkanDecodeContext *dec = avctx->internal->hwaccel_priv_data; FFVulkanDecodeShared *ctx = (FFVulkanDecodeShared *)dec->shared_ref->data; - FFVulkanFunctions *vk = &ctx->s.vkfn; VkVideoDecodeH265SessionParametersAddInfoKHR h265_params_info = { .sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_KHR, @@ -676,22 +656,16 @@ static int vk_hevc_create_params(AVCodecContext *avctx, AVBufferRef **buf) }; int nb_vps = 0; - AVBufferRef *data_set; HEVCHeaderSet *hdr; - AVBufferRef *tmp; - VkVideoSessionParametersKHR *par = av_malloc(sizeof(*par)); - if (!par) - return AVERROR(ENOMEM); - for (int i = 0; h->ps.vps_list[i]; i++) nb_vps++; - err = get_data_set_buf(dec, &data_set, nb_vps, h->ps.vps_list); + err = alloc_hevc_header_structs(dec, nb_vps, h->ps.vps_list); if (err < 0) return err; - hdr = (HEVCHeaderSet *)data_set->data; + hdr = dec->hevc_headers; h265_params_info.pStdSPSs = hdr->sps; h265_params_info.pStdPPSs = hdr->pps; @@ -727,29 +701,14 @@ static int vk_hevc_create_params(AVCodecContext *avctx, AVBufferRef **buf) h265_params.maxStdPPSCount = h265_params_info.stdPPSCount; h265_params.maxStdVPSCount = h265_params_info.stdVPSCount; - /* Create session parameters */ - ret = vk->CreateVideoSessionParametersKHR(ctx->s.hwctx->act_dev, &session_params_create, - ctx->s.hwctx->alloc, par); - av_buffer_unref(&data_set); - if (ret != VK_SUCCESS) { - av_log(avctx, AV_LOG_ERROR, "Unable to create Vulkan video session parameters: %s!\n", - ff_vk_ret2str(ret)); - return AVERROR_EXTERNAL; - } - - tmp = av_buffer_create((uint8_t *)par, sizeof(*par), ff_vk_decode_free_params, - ctx, 0); - if (!tmp) { - ff_vk_decode_free_params(ctx, (uint8_t *)par); - return AVERROR(ENOMEM); - } + err = ff_vk_decode_create_params(buf, avctx, ctx, &session_params_create); + if (err < 0) + return err; av_log(avctx, AV_LOG_DEBUG, "Created frame parameters: %i SPS %i PPS %i VPS\n", h265_params_info.stdSPSCount, h265_params_info.stdPPSCount, h265_params_info.stdVPSCount); - *buf = tmp; - return 0; } @@ -954,11 +913,11 @@ static void vk_hevc_free_frame_priv(void *_hwctx, uint8_t *data) av_free(hp); } -const AVHWAccel ff_hevc_vulkan_hwaccel = { - .name = "hevc_vulkan", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, - .pix_fmt = AV_PIX_FMT_VULKAN, +const FFHWAccel ff_hevc_vulkan_hwaccel = { + .p.name = "hevc_vulkan", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, + .p.pix_fmt = AV_PIX_FMT_VULKAN, .start_frame = &vk_hevc_start_frame, .decode_slice = &vk_hevc_decode_slice, .end_frame = &vk_hevc_end_frame, diff --git a/arm/android/third_party/ffmpeg/libavcodec/vulkan_video.c b/arm/android/third_party/ffmpeg/libavcodec/vulkan_video.c index 9a363aab..236aa124 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vulkan_video.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vulkan_video.c @@ -154,6 +154,51 @@ VkVideoComponentBitDepthFlagBitsKHR ff_vk_depth_from_av_depth(int depth) return VK_VIDEO_COMPONENT_BIT_DEPTH_INVALID_KHR; } +int ff_vk_h264_level_to_av(StdVideoH264LevelIdc level) +{ + switch (level) { + case STD_VIDEO_H264_LEVEL_IDC_1_0: return 10; + case STD_VIDEO_H264_LEVEL_IDC_1_1: return 11; + case STD_VIDEO_H264_LEVEL_IDC_1_2: return 12; + case STD_VIDEO_H264_LEVEL_IDC_1_3: return 13; + case STD_VIDEO_H264_LEVEL_IDC_2_0: return 20; + case STD_VIDEO_H264_LEVEL_IDC_2_1: return 21; + case STD_VIDEO_H264_LEVEL_IDC_2_2: return 22; + case STD_VIDEO_H264_LEVEL_IDC_3_0: return 30; + case STD_VIDEO_H264_LEVEL_IDC_3_1: return 31; + case STD_VIDEO_H264_LEVEL_IDC_3_2: return 32; + case STD_VIDEO_H264_LEVEL_IDC_4_0: return 40; + case STD_VIDEO_H264_LEVEL_IDC_4_1: return 41; + case STD_VIDEO_H264_LEVEL_IDC_4_2: return 42; + case STD_VIDEO_H264_LEVEL_IDC_5_0: return 50; + case STD_VIDEO_H264_LEVEL_IDC_5_1: return 51; + case STD_VIDEO_H264_LEVEL_IDC_5_2: return 52; + case STD_VIDEO_H264_LEVEL_IDC_6_0: return 60; + case STD_VIDEO_H264_LEVEL_IDC_6_1: return 61; + default: + case STD_VIDEO_H264_LEVEL_IDC_6_2: return 62; + } +} + +int ff_vk_h265_level_to_av(StdVideoH265LevelIdc level) +{ + switch (level) { + case STD_VIDEO_H265_LEVEL_IDC_1_0: return 10; + case STD_VIDEO_H265_LEVEL_IDC_2_0: return 20; + case STD_VIDEO_H265_LEVEL_IDC_2_1: return 21; + case STD_VIDEO_H265_LEVEL_IDC_3_0: return 30; + case STD_VIDEO_H265_LEVEL_IDC_3_1: return 31; + case STD_VIDEO_H265_LEVEL_IDC_4_0: return 40; + case STD_VIDEO_H265_LEVEL_IDC_4_1: return 41; + case STD_VIDEO_H265_LEVEL_IDC_5_0: return 50; + case STD_VIDEO_H265_LEVEL_IDC_5_1: return 51; + case STD_VIDEO_H265_LEVEL_IDC_6_0: return 60; + case STD_VIDEO_H265_LEVEL_IDC_6_1: return 61; + default: + case STD_VIDEO_H265_LEVEL_IDC_6_2: return 62; + } +} + static void free_data_buf(void *opaque, uint8_t *data) { FFVulkanContext *ctx = opaque; diff --git a/arm/android/third_party/ffmpeg/libavcodec/vulkan_video.h b/arm/android/third_party/ffmpeg/libavcodec/vulkan_video.h index 183ce89b..b28e3fe0 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vulkan_video.h +++ b/arm/android/third_party/ffmpeg/libavcodec/vulkan_video.h @@ -71,6 +71,13 @@ VkVideoChromaSubsamplingFlagBitsKHR ff_vk_subsampling_from_av_desc(const AVPixFm */ VkVideoComponentBitDepthFlagBitsKHR ff_vk_depth_from_av_depth(int depth); + +/** + * Convert level from Vulkan to AV. + */ +int ff_vk_h264_level_to_av(StdVideoH264LevelIdc level); +int ff_vk_h265_level_to_av(StdVideoH265LevelIdc level); + typedef struct FFVkVideoBuffer { FFVkBuffer buf; uint8_t *mem; diff --git a/arm/android/third_party/ffmpeg/libavcodec/vvc_mp4toannexb_bsf.c b/arm/android/third_party/ffmpeg/libavcodec/vvc_mp4toannexb_bsf.c index 9e606cdc..25c37269 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vvc_mp4toannexb_bsf.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vvc_mp4toannexb_bsf.c @@ -24,14 +24,12 @@ #include "libavutil/intreadwrite.h" #include "libavutil/mem.h" -#include "avcodec.h" #include "bsf.h" #include "bsf_internal.h" #include "bytestream.h" +#include "defs.h" #include "vvc.h" -#include "libavcodec/get_bits.h" - #define MIN_VVCC_LENGTH 23 typedef struct VVCBSFContext { diff --git a/arm/android/third_party/ffmpeg/libavcodec/vvc_parser.c b/arm/android/third_party/ffmpeg/libavcodec/vvc_parser.c index 3951ebe5..c661595e 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/vvc_parser.c +++ b/arm/android/third_party/ffmpeg/libavcodec/vvc_parser.c @@ -225,10 +225,10 @@ static void get_slice_poc(VVCParserContext *s, int *poc, } else { if ((poc_lsb < prev_poc_lsb) && ((prev_poc_lsb - poc_lsb) >= (max_poc_lsb / 2))) - poc_msb = prev_poc_msb + max_poc_lsb; + poc_msb = prev_poc_msb + (unsigned)max_poc_lsb; else if ((poc_lsb > prev_poc_lsb) && ((poc_lsb - prev_poc_lsb) > (max_poc_lsb / 2))) - poc_msb = prev_poc_msb - max_poc_lsb; + poc_msb = prev_poc_msb - (unsigned)max_poc_lsb; else poc_msb = prev_poc_msb; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/wavarc.c b/arm/android/third_party/ffmpeg/libavcodec/wavarc.c index 6daad6a5..09ed4d47 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/wavarc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/wavarc.c @@ -111,7 +111,7 @@ static av_cold int wavarc_init(AVCodecContext *avctx) } s->max_framesize = s->nb_samples * 16; - s->bitstream = av_calloc(s->max_framesize, sizeof(*s->bitstream)); + s->bitstream = av_calloc(s->max_framesize + AV_INPUT_BUFFER_PADDING_SIZE, sizeof(*s->bitstream)); if (!s->bitstream) return AVERROR(ENOMEM); @@ -154,11 +154,11 @@ static void do_stereo(WavArcContext *s, int ch, int correlated, int len) } else { if (correlated) { for (int n = 0; n < nb_samples; n++) - s->samples[1][n + len] += s->samples[0][n + len]; + s->samples[1][n + len] += (unsigned)s->samples[0][n + len]; } for (int n = 0; n < len; n++) { s->pred[0][n] = s->samples[1][nb_samples + n]; - s->pred[1][n] = s->pred[0][n] - s->samples[0][nb_samples + n]; + s->pred[1][n] = s->pred[0][n] - (unsigned)s->samples[0][nb_samples + n]; } } } @@ -205,7 +205,7 @@ static int decode_1dif(AVCodecContext *avctx, if (block_type < 4 && block_type >= 0) { k = 1 + (avctx->sample_fmt == AV_SAMPLE_FMT_S16P); k = get_urice(gb, k) + 1; - if (k > 32) + if (k >= 32) return AVERROR_INVALIDDATA; } @@ -218,6 +218,10 @@ static int decode_1dif(AVCodecContext *avctx, continue; case 6: s->shift = get_urice(gb, 2); + if ((unsigned)s->shift > 31) { + s->shift = 0; + return AVERROR_INVALIDDATA; + } continue; case 5: if (avctx->sample_fmt == AV_SAMPLE_FMT_U8P) { @@ -239,18 +243,18 @@ static int decode_1dif(AVCodecContext *avctx, break; case 3: for (int n = 0; n < s->nb_samples; n++) - samples[n + 4] = get_srice(gb, k) + (samples[n + 3] - samples[n + 2]) * 3 + + samples[n + 4] = get_srice(gb, k) + (samples[n + 3] - (unsigned)samples[n + 2]) * 3 + samples[n + 1]; finished = 1; break; case 2: for (int n = 0; n < s->nb_samples; n++) - samples[n + 4] = get_srice(gb, k) + (samples[n + 3] * 2 - samples[n + 2]); + samples[n + 4] = get_srice(gb, k) + (samples[n + 3] * 2U - samples[n + 2]); finished = 1; break; case 1: for (int n = 0; n < s->nb_samples; n++) - samples[n + 4] = get_srice(gb, k) + samples[n + 3]; + samples[n + 4] = get_srice(gb, k) + (unsigned)samples[n + 3]; finished = 1; break; case 0: @@ -297,7 +301,7 @@ static int decode_2slp(AVCodecContext *avctx, if (block_type < 5 && block_type >= 0) { k = 1 + (avctx->sample_fmt == AV_SAMPLE_FMT_S16P); k = get_urice(gb, k) + 1; - if (k > 32) + if (k >= 32) return AVERROR_INVALIDDATA; } @@ -307,13 +311,17 @@ static int decode_2slp(AVCodecContext *avctx, return AVERROR_EOF; case 8: s->nb_samples = get_urice(gb, 8); - if (s->nb_samples > 570) { + if (s->nb_samples > 570U) { s->nb_samples = 570; return AVERROR_INVALIDDATA; } continue; case 7: s->shift = get_urice(gb, 2); + if ((unsigned)s->shift > 31) { + s->shift = 0; + return AVERROR_INVALIDDATA; + } continue; case 6: if (avctx->sample_fmt == AV_SAMPLE_FMT_U8P) { @@ -335,13 +343,13 @@ static int decode_2slp(AVCodecContext *avctx, break; case 4: for (int n = 0; n < s->nb_samples; n++) - samples[n + 70] = get_srice(gb, k) + (samples[n + 69] - samples[n + 68]) * 3 + + samples[n + 70] = get_srice(gb, k) + (samples[n + 69] - (unsigned)samples[n + 68]) * 3 + samples[n + 67]; finished = 1; break; case 3: for (int n = 0; n < s->nb_samples; n++) - samples[n + 70] = get_srice(gb, k) + (samples[n + 69] * 2 - samples[n + 68]); + samples[n + 70] = get_srice(gb, k) + (samples[n + 69] * 2U - samples[n + 68]); finished = 1; break; case 2: @@ -351,7 +359,7 @@ static int decode_2slp(AVCodecContext *avctx, break; case 1: for (int n = 0; n < s->nb_samples; n++) - samples[n + 70] = get_srice(gb, k) + samples[n + 69]; + samples[n + 70] = get_srice(gb, k) + (unsigned)samples[n + 69]; finished = 1; break; case 0: @@ -404,13 +412,13 @@ static int ac_init(AVCodecContext *avctx, return 0; } -static unsigned ac_get_prob(WavArcContext *s) +static uint16_t ac_get_prob(WavArcContext *s) { - return ((s->freq_range - 1) + ((unsigned)s->ac_value - (unsigned)s->ac_low) * - (unsigned)s->freq_range) / (((unsigned)s->ac_high - (unsigned)s->ac_low) + 1) & 0xffffu; + return ((s->freq_range - 1) + (s->ac_value - s->ac_low) * s->freq_range) / + ((s->ac_high - s->ac_low) + 1U); } -static unsigned ac_map_symbol(WavArcContext *s, unsigned prob) +static uint8_t ac_map_symbol(WavArcContext *s, uint16_t prob) { int idx = 255; @@ -427,33 +435,43 @@ static int ac_normalize(AVCodecContext *avctx, WavArcContext *s, GetBitContext * { int range; - range = (unsigned)s->ac_high - (unsigned)s->ac_low + 1; - s->ac_high = (int16_t)((range * (unsigned)s->range_high) / (unsigned)s->freq_range) + -1 + s->ac_low; - s->ac_low += (int16_t)((range * (unsigned)s->range_low) / (unsigned)s->freq_range); + if (s->ac_high < s->ac_low) + goto fail; + + range = (s->ac_high - s->ac_low) + 1; + s->ac_high = (range * s->range_high) / s->freq_range + s->ac_low - 1; + s->ac_low += (range * s->range_low) / s->freq_range; + + if (s->ac_high < s->ac_low) + goto fail; for (;;) { if ((s->ac_high & 0x8000) != (s->ac_low & 0x8000)) { - if ((s->ac_low & 0x4000) == 0 || (s->ac_high & 0x4000) != 0) + if (((s->ac_low & 0x4000) == 0) || ((s->ac_high & 0x4000) != 0)) return 0; s->ac_value ^= 0x4000; s->ac_low &= 0x3fff; s->ac_high |= 0x4000; } - s->ac_low = s->ac_low << 1; - s->ac_high = s->ac_high * 2 + 1; - if (s->ac_high < s->ac_low) { - av_log(avctx, AV_LOG_ERROR, "invalid state\n"); - return AVERROR_INVALIDDATA; - } + s->ac_low = s->ac_low * 2; + s->ac_high = s->ac_high * 2 | 1; + if (s->ac_high < s->ac_low) + goto fail; if (get_bits_left(gb) <= 0) { av_log(avctx, AV_LOG_ERROR, "overread in arithmetic coder\n"); - return AVERROR_INVALIDDATA; + goto fail; } s->ac_value = s->ac_value * 2 + get_bits1(gb); + if (s->ac_low > s->ac_value || s->ac_high < s->ac_value) + goto fail; } + +fail: + av_log(avctx, AV_LOG_ERROR, "invalid state\n"); + return AVERROR_INVALIDDATA; } static void ac_init_model(WavArcContext *s) @@ -476,11 +494,11 @@ static int ac_read_model(AVCodecContext *avctx, end = get_bits(gb, 8); for (;;) { - while (start <= end) + while (start <= end) { + if (get_bits_left(gb) < 8) + return AVERROR_INVALIDDATA; s->model[start++] = get_bits(gb, 8); - - if (get_bits_left(gb) < 8) - return AVERROR_INVALIDDATA; + } if (get_bits_left(gb) < 8) return AVERROR_INVALIDDATA; @@ -521,6 +539,8 @@ static int decode_5elp(AVCodecContext *avctx, if (block_type >= 0 && block_type <= 7) { k = 1 + (avctx->sample_fmt == AV_SAMPLE_FMT_S16P); k = get_urice(gb, k) + 1; + if (k >= 32) + return AVERROR_INVALIDDATA; } if (block_type <= 2 || block_type == 6 || block_type == 13 || @@ -560,9 +580,9 @@ static int decode_5elp(AVCodecContext *avctx, } for (int n = 0; n < s->nb_samples; n++) { - unsigned prob = ac_get_prob(s); - prob = ac_map_symbol(s, prob); - ac_out[n] = prob - 0x80; + uint16_t prob = ac_get_prob(s); + int ac = ac_map_symbol(s, prob); + ac_out[n] = ac - 0x80; if ((ret = ac_normalize(avctx, s, &ac_gb)) < 0) return ret; } @@ -579,13 +599,17 @@ static int decode_5elp(AVCodecContext *avctx, return AVERROR_EOF; case 11: s->nb_samples = get_urice(gb, 8); - if (s->nb_samples > 570) { + if (s->nb_samples > 570U) { s->nb_samples = 570; return AVERROR_INVALIDDATA; } continue; case 10: s->shift = get_urice(gb, 2); + if ((unsigned)s->shift > 31) { + s->shift = 0; + return AVERROR_INVALIDDATA; + } continue; case 9: if (avctx->sample_fmt == AV_SAMPLE_FMT_U8P) { @@ -608,11 +632,16 @@ static int decode_5elp(AVCodecContext *avctx, case 20: case 7: for (int n = 0; n < s->nb_samples; n++) - samples[n + 70] = ac_out[n] + samples[n + 69] * 3 - samples[n + 68] * 3 + samples[n + 67]; + samples[n + 70] += ac_out[n] + samples[n + 69] * 3U - samples[n + 68] * 3U + samples[n + 67]; finished = 1; break; case 19: case 6: + for (int n = 0; n < 70; n++) { + ac_pred[n] = samples[n]; + samples[n] = 0; + } + for (int n = 0; n < s->nb_samples; n++) { int sum = 15; @@ -621,24 +650,31 @@ static int decode_5elp(AVCodecContext *avctx, samples[n + 70] += ac_out[n] + (sum >> 4); } + + for (int n = 0; n < 70; n++) + samples[n] = ac_pred[n]; + + for (int n = 0; n < s->nb_samples; n++) + samples[n + 70] += ac_out[n] + samples[n + 69] * 3U - samples[n + 68] * 3U + samples[n + 67]; + finished = 1; break; case 18: case 5: for (int n = 0; n < s->nb_samples; n++) - samples[n + 70] = ac_out[n] + samples[n + 69] * 2 - samples[n + 68]; + samples[n + 70] += ac_out[n] + samples[n + 69] * 2U - samples[n + 68]; finished = 1; break; case 17: case 4: for (int n = 0; n < s->nb_samples; n++) - samples[n + 70] = ac_out[n]; + samples[n + 70] += ac_out[n]; finished = 1; break; case 16: case 3: for (int n = 0; n < s->nb_samples; n++) - samples[n + 70] = ac_out[n] + samples[n + 69]; + samples[n + 70] += ac_out[n] + (unsigned)samples[n + 69]; finished = 1; break; case 15: @@ -661,7 +697,7 @@ static int decode_5elp(AVCodecContext *avctx, samples[n] = ac_pred[n]; for (int n = 0; n < s->nb_samples; n++) - samples[n + 70] += samples[n + 69] * 2 - samples[n + 68]; + samples[n + 70] += samples[n + 69] * 2U - samples[n + 68]; finished = 1; break; @@ -678,14 +714,14 @@ static int decode_5elp(AVCodecContext *avctx, for (int o = 0; o < order; o++) sum += s->filter[ch][o] * (unsigned)samples[n + 70 - o - 1]; - samples[n + 70] += ac_out[n] + (sum >> 4); + samples[n + 70] += (unsigned)ac_out[n] + (sum >> 4); } for (int n = 0; n < 70; n++) samples[n] = ac_pred[n]; for (int n = 0; n < s->nb_samples; n++) - samples[n + 70] += samples[n + 69]; + samples[n + 70] += (unsigned)samples[n + 69]; finished = 1; break; @@ -697,7 +733,7 @@ static int decode_5elp(AVCodecContext *avctx, for (int o = 0; o < order; o++) sum += s->filter[ch][o] * (unsigned)samples[n + 70 - o - 1]; - samples[n + 70] += ac_out[n] + (sum >> 4); + samples[n + 70] += (unsigned)ac_out[n] + (sum >> 4); } finished = 1; break; diff --git a/arm/android/third_party/ffmpeg/libavcodec/wavpack.c b/arm/android/third_party/ffmpeg/libavcodec/wavpack.c index 4346304f..966f4b83 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/wavpack.c +++ b/arm/android/third_party/ffmpeg/libavcodec/wavpack.c @@ -96,12 +96,10 @@ typedef struct WavpackFrameContext { uint8_t *value_lookup[MAX_HISTORY_BINS]; } WavpackFrameContext; -#define WV_MAX_FRAME_DECODERS 14 - typedef struct WavpackContext { AVCodecContext *avctx; - WavpackFrameContext *fdec[WV_MAX_FRAME_DECODERS]; + WavpackFrameContext **fdec; int fdec_num; int block; @@ -796,71 +794,73 @@ static inline int wv_unpack_stereo(WavpackFrameContext *s, GetBitContext *gb, if (last) break; for (i = 0; i < s->terms; i++) { - t = s->decorr[i].value; + Decorr *decorr = &s->decorr[i]; + + t = decorr->value; if (t > 0) { if (t > 8) { if (t & 1) { - A = 2U * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1]; - B = 2U * s->decorr[i].samplesB[0] - s->decorr[i].samplesB[1]; + A = 2U * decorr->samplesA[0] - decorr->samplesA[1]; + B = 2U * decorr->samplesB[0] - decorr->samplesB[1]; } else { - A = (int)(3U * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1]) >> 1; - B = (int)(3U * s->decorr[i].samplesB[0] - s->decorr[i].samplesB[1]) >> 1; + A = (int)(3U * decorr->samplesA[0] - decorr->samplesA[1]) >> 1; + B = (int)(3U * decorr->samplesB[0] - decorr->samplesB[1]) >> 1; } - s->decorr[i].samplesA[1] = s->decorr[i].samplesA[0]; - s->decorr[i].samplesB[1] = s->decorr[i].samplesB[0]; - j = 0; + decorr->samplesA[1] = decorr->samplesA[0]; + decorr->samplesB[1] = decorr->samplesB[0]; + j = 0; } else { - A = s->decorr[i].samplesA[pos]; - B = s->decorr[i].samplesB[pos]; + A = decorr->samplesA[pos]; + B = decorr->samplesB[pos]; j = (pos + t) & 7; } if (type != AV_SAMPLE_FMT_S16P) { - L2 = L + ((s->decorr[i].weightA * (int64_t)A + 512) >> 10); - R2 = R + ((s->decorr[i].weightB * (int64_t)B + 512) >> 10); + L2 = L + ((decorr->weightA * (int64_t)A + 512) >> 10); + R2 = R + ((decorr->weightB * (int64_t)B + 512) >> 10); } else { - L2 = L + (unsigned)((int)(s->decorr[i].weightA * (unsigned)A + 512) >> 10); - R2 = R + (unsigned)((int)(s->decorr[i].weightB * (unsigned)B + 512) >> 10); + L2 = L + (unsigned)((int)(decorr->weightA * (unsigned)A + 512) >> 10); + R2 = R + (unsigned)((int)(decorr->weightB * (unsigned)B + 512) >> 10); } if (A && L) - s->decorr[i].weightA -= ((((L ^ A) >> 30) & 2) - 1) * s->decorr[i].delta; + decorr->weightA -= ((((L ^ A) >> 30) & 2) - 1) * decorr->delta; if (B && R) - s->decorr[i].weightB -= ((((R ^ B) >> 30) & 2) - 1) * s->decorr[i].delta; - s->decorr[i].samplesA[j] = L = L2; - s->decorr[i].samplesB[j] = R = R2; + decorr->weightB -= ((((R ^ B) >> 30) & 2) - 1) * decorr->delta; + decorr->samplesA[j] = L = L2; + decorr->samplesB[j] = R = R2; } else if (t == -1) { if (type != AV_SAMPLE_FMT_S16P) - L2 = L + ((s->decorr[i].weightA * (int64_t)s->decorr[i].samplesA[0] + 512) >> 10); + L2 = L + ((decorr->weightA * (int64_t)decorr->samplesA[0] + 512) >> 10); else - L2 = L + (unsigned)((int)(s->decorr[i].weightA * (unsigned)s->decorr[i].samplesA[0] + 512) >> 10); - UPDATE_WEIGHT_CLIP(s->decorr[i].weightA, s->decorr[i].delta, s->decorr[i].samplesA[0], L); + L2 = L + (unsigned)((int)(decorr->weightA * (unsigned)decorr->samplesA[0] + 512) >> 10); + UPDATE_WEIGHT_CLIP(decorr->weightA, decorr->delta, decorr->samplesA[0], L); L = L2; if (type != AV_SAMPLE_FMT_S16P) - R2 = R + ((s->decorr[i].weightB * (int64_t)L2 + 512) >> 10); + R2 = R + ((decorr->weightB * (int64_t)L2 + 512) >> 10); else - R2 = R + (unsigned)((int)(s->decorr[i].weightB * (unsigned)L2 + 512) >> 10); - UPDATE_WEIGHT_CLIP(s->decorr[i].weightB, s->decorr[i].delta, L2, R); - R = R2; - s->decorr[i].samplesA[0] = R; + R2 = R + (unsigned)((int)(decorr->weightB * (unsigned)L2 + 512) >> 10); + UPDATE_WEIGHT_CLIP(decorr->weightB, decorr->delta, L2, R); + R = R2; + decorr->samplesA[0] = R; } else { if (type != AV_SAMPLE_FMT_S16P) - R2 = R + ((s->decorr[i].weightB * (int64_t)s->decorr[i].samplesB[0] + 512) >> 10); + R2 = R + ((decorr->weightB * (int64_t)decorr->samplesB[0] + 512) >> 10); else - R2 = R + (unsigned)((int)(s->decorr[i].weightB * (unsigned)s->decorr[i].samplesB[0] + 512) >> 10); - UPDATE_WEIGHT_CLIP(s->decorr[i].weightB, s->decorr[i].delta, s->decorr[i].samplesB[0], R); + R2 = R + (unsigned)((int)(decorr->weightB * (unsigned)decorr->samplesB[0] + 512) >> 10); + UPDATE_WEIGHT_CLIP(decorr->weightB, decorr->delta, decorr->samplesB[0], R); R = R2; if (t == -3) { - R2 = s->decorr[i].samplesA[0]; - s->decorr[i].samplesA[0] = R; + R2 = decorr->samplesA[0]; + decorr->samplesA[0] = R; } if (type != AV_SAMPLE_FMT_S16P) - L2 = L + ((s->decorr[i].weightA * (int64_t)R2 + 512) >> 10); + L2 = L + ((decorr->weightA * (int64_t)R2 + 512) >> 10); else - L2 = L + (unsigned)((int)(s->decorr[i].weightA * (unsigned)R2 + 512) >> 10); - UPDATE_WEIGHT_CLIP(s->decorr[i].weightA, s->decorr[i].delta, R2, L); - L = L2; - s->decorr[i].samplesB[0] = L; + L2 = L + (unsigned)((int)(decorr->weightA * (unsigned)R2 + 512) >> 10); + UPDATE_WEIGHT_CLIP(decorr->weightA, decorr->delta, R2, L); + L = L2; + decorr->samplesB[0] = L; } } @@ -922,25 +922,27 @@ static inline int wv_unpack_mono(WavpackFrameContext *s, GetBitContext *gb, if (last) break; for (i = 0; i < s->terms; i++) { - t = s->decorr[i].value; + Decorr *decorr = &s->decorr[i]; + + t = decorr->value; if (t > 8) { if (t & 1) - A = 2U * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1]; + A = 2U * decorr->samplesA[0] - decorr->samplesA[1]; else - A = (int)(3U * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1]) >> 1; - s->decorr[i].samplesA[1] = s->decorr[i].samplesA[0]; - j = 0; + A = (int)(3U * decorr->samplesA[0] - decorr->samplesA[1]) >> 1; + decorr->samplesA[1] = decorr->samplesA[0]; + j = 0; } else { - A = s->decorr[i].samplesA[pos]; + A = decorr->samplesA[pos]; j = (pos + t) & 7; } if (type != AV_SAMPLE_FMT_S16P) - S = T + ((s->decorr[i].weightA * (int64_t)A + 512) >> 10); + S = T + ((decorr->weightA * (int64_t)A + 512) >> 10); else - S = T + (unsigned)((int)(s->decorr[i].weightA * (unsigned)A + 512) >> 10); + S = T + (unsigned)((int)(decorr->weightA * (unsigned)A + 512) >> 10); if (A && T) - s->decorr[i].weightA -= ((((T ^ A) >> 30) & 2) - 1) * s->decorr[i].delta; - s->decorr[i].samplesA[j] = T = S; + decorr->weightA -= ((((T ^ A) >> 30) & 2) - 1) * decorr->delta; + decorr->samplesA[j] = T = S; } pos = (pos + 1) & 7; crc = crc * 3 + S; @@ -971,7 +973,8 @@ static inline int wv_unpack_mono(WavpackFrameContext *s, GetBitContext *gb, static av_cold int wv_alloc_frame_context(WavpackContext *c) { - if (c->fdec_num == WV_MAX_FRAME_DECODERS) + c->fdec = av_realloc_f(c->fdec, c->fdec_num + 1, sizeof(*c->fdec)); + if (!c->fdec) return -1; c->fdec[c->fdec_num] = av_mallocz(sizeof(**c->fdec)); @@ -1064,6 +1067,7 @@ static av_cold int wavpack_decode_end(AVCodecContext *avctx) for (int i = 0; i < s->fdec_num; i++) av_freep(&s->fdec[i]); + av_freep(&s->fdec); s->fdec_num = 0; ff_thread_release_ext_buffer(avctx, &s->curr_frame); @@ -1127,7 +1131,7 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no, else if ((s->frame_flags & 0x03) <= 1) sample_fmt = AV_SAMPLE_FMT_S16P; else - sample_fmt = AV_SAMPLE_FMT_S32P; + sample_fmt = AV_SAMPLE_FMT_S32P; if (wc->ch_offset && avctx->sample_fmt != sample_fmt) return AVERROR_INVALIDDATA; @@ -1219,36 +1223,38 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no, } t = 0; for (i = s->terms - 1; (i >= 0) && (t < size); i--) { - if (s->decorr[i].value > 8) { - s->decorr[i].samplesA[0] = + Decorr *decorr = &s->decorr[i]; + + if (decorr->value > 8) { + decorr->samplesA[0] = wp_exp2(bytestream2_get_le16(&gb)); - s->decorr[i].samplesA[1] = + decorr->samplesA[1] = wp_exp2(bytestream2_get_le16(&gb)); if (s->stereo_in) { - s->decorr[i].samplesB[0] = + decorr->samplesB[0] = wp_exp2(bytestream2_get_le16(&gb)); - s->decorr[i].samplesB[1] = + decorr->samplesB[1] = wp_exp2(bytestream2_get_le16(&gb)); - t += 4; + t += 4; } t += 4; - } else if (s->decorr[i].value < 0) { - s->decorr[i].samplesA[0] = + } else if (decorr->value < 0) { + decorr->samplesA[0] = wp_exp2(bytestream2_get_le16(&gb)); - s->decorr[i].samplesB[0] = + decorr->samplesB[0] = wp_exp2(bytestream2_get_le16(&gb)); - t += 4; + t += 4; } else { - for (j = 0; j < s->decorr[i].value; j++) { - s->decorr[i].samplesA[j] = + for (j = 0; j < decorr->value; j++) { + decorr->samplesA[j] = wp_exp2(bytestream2_get_le16(&gb)); if (s->stereo_in) { - s->decorr[i].samplesB[j] = + decorr->samplesB[j] = wp_exp2(bytestream2_get_le16(&gb)); } } - t += s->decorr[i].value * 2 * (s->stereo_in + 1); + t += decorr->value * 2 * (s->stereo_in + 1); } } got_samples = 1; @@ -1415,18 +1421,12 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no, size = bytestream2_get_byte(&gb); chan |= (bytestream2_get_byte(&gb) & 0xF) << 8; chan += 1; - if (avctx->ch_layout.nb_channels != chan) - av_log(avctx, AV_LOG_WARNING, "%i channels signalled" - " instead of %i.\n", chan, avctx->ch_layout.nb_channels); chmask = bytestream2_get_le24(&gb); break; case 5: size = bytestream2_get_byte(&gb); chan |= (bytestream2_get_byte(&gb) & 0xF) << 8; chan += 1; - if (avctx->ch_layout.nb_channels != chan) - av_log(avctx, AV_LOG_WARNING, "%i channels signalled" - " instead of %i.\n", chan, avctx->ch_layout.nb_channels); chmask = bytestream2_get_le32(&gb); break; default: @@ -1519,11 +1519,7 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no, return AVERROR_INVALIDDATA; } } else { - ret = av_channel_layout_copy(&new_ch_layout, &avctx->ch_layout); - if (ret < 0) { - av_log(avctx, AV_LOG_ERROR, "Error copying channel layout\n"); - return ret; - } + av_channel_layout_default(&new_ch_layout, chan); } } else { av_channel_layout_default(&new_ch_layout, s->stereo + 1); diff --git a/arm/android/third_party/ffmpeg/libavcodec/wavpackenc.c b/arm/android/third_party/ffmpeg/libavcodec/wavpackenc.c index 9271e879..33a5dfcc 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/wavpackenc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/wavpackenc.c @@ -2592,7 +2592,16 @@ static int wavpack_encode_block(WavPackEncodeContext *s, s->avctx->ch_layout.u.mask != AV_CH_LAYOUT_STEREO) { put_metadata_block(&pb, WP_ID_CHANINFO, 5); bytestream2_put_byte(&pb, s->avctx->ch_layout.nb_channels); - bytestream2_put_le32(&pb, s->avctx->ch_layout.u.mask); + if (s->avctx->ch_layout.u.mask >> 32) + bytestream2_put_le32(&pb, 0); + else + bytestream2_put_le32(&pb, s->avctx->ch_layout.u.mask); + bytestream2_put_byte(&pb, 0); + } else if (s->flags & WV_INITIAL_BLOCK && + s->avctx->ch_layout.order == AV_CHANNEL_ORDER_UNSPEC) { + put_metadata_block(&pb, WP_ID_CHANINFO, 5); + bytestream2_put_byte(&pb, s->avctx->ch_layout.nb_channels); + bytestream2_put_le32(&pb, 0); bytestream2_put_byte(&pb, 0); } diff --git a/arm/android/third_party/ffmpeg/libavcodec/webp.c b/arm/android/third_party/ffmpeg/libavcodec/webp.c index d35cb66f..54b3fde6 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/webp.c +++ b/arm/android/third_party/ffmpeg/libavcodec/webp.c @@ -233,7 +233,7 @@ static void image_ctx_free(ImageContext *img) if (img->huffman_groups) { for (i = 0; i < img->nb_huffman_groups; i++) { for (j = 0; j < HUFFMAN_CODES_PER_META_CODE; j++) - ff_free_vlc(&img->huffman_groups[i * HUFFMAN_CODES_PER_META_CODE + j].vlc); + ff_vlc_free(&img->huffman_groups[i * HUFFMAN_CODES_PER_META_CODE + j].vlc); } av_free(img->huffman_groups); } @@ -300,9 +300,9 @@ static int huff_reader_build_canonical(HuffReader *r, const uint8_t *code_length return AVERROR_INVALIDDATA; } - ret = init_vlc(&r->vlc, 8, alphabet_size, + ret = vlc_init(&r->vlc, 8, alphabet_size, code_lengths, sizeof(*code_lengths), sizeof(*code_lengths), - codes, sizeof(*codes), sizeof(*codes), INIT_VLC_OUTPUT_LE); + codes, sizeof(*codes), sizeof(*codes), VLC_INIT_OUTPUT_LE); if (ret < 0) { av_free(codes); return ret; @@ -415,7 +415,7 @@ static int read_huffman_code_normal(WebPContext *s, HuffReader *hc, ret = huff_reader_build_canonical(hc, code_lengths, alphabet_size); finish: - ff_free_vlc(&code_len_hc.vlc); + ff_vlc_free(&code_len_hc.vlc); av_free(code_lengths); return ret; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/wma.c b/arm/android/third_party/ffmpeg/libavcodec/wma.c index 41d16e52..3b4d049a 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/wma.c +++ b/arm/android/third_party/ffmpeg/libavcodec/wma.c @@ -42,7 +42,7 @@ static av_cold int init_coef_vlc(VLC *vlc, uint16_t **prun_table, float *flevel_table; int i, l, j, k, level, ret; - ret = init_vlc(vlc, VLCBITS, n, table_bits, 1, 1, table_codes, 4, 4, 0); + ret = vlc_init(vlc, VLCBITS, n, table_bits, 1, 1, table_codes, 4, 4, 0); if (ret < 0) return ret; @@ -372,11 +372,11 @@ int ff_wma_end(AVCodecContext *avctx) av_tx_uninit(&s->mdct_ctx[i]); if (s->use_exp_vlc) - ff_free_vlc(&s->exp_vlc); + ff_vlc_free(&s->exp_vlc); if (s->use_noise_coding) - ff_free_vlc(&s->hgain_vlc); + ff_vlc_free(&s->hgain_vlc); for (i = 0; i < 2; i++) { - ff_free_vlc(&s->coef_vlc[i]); + ff_vlc_free(&s->coef_vlc[i]); av_freep(&s->run_table[i]); av_freep(&s->level_table[i]); av_freep(&s->int_table[i]); diff --git a/arm/android/third_party/ffmpeg/libavcodec/wmadec.c b/arm/android/third_party/ffmpeg/libavcodec/wmadec.c index bc18d182..ab48e28e 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/wmadec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/wmadec.c @@ -119,7 +119,7 @@ static av_cold int wma_decode_init(AVCodecContext *avctx) } if (s->use_noise_coding) { - ret = ff_init_vlc_from_lengths(&s->hgain_vlc, HGAINVLCBITS, + ret = ff_vlc_init_from_lengths(&s->hgain_vlc, HGAINVLCBITS, FF_ARRAY_ELEMS(ff_wma_hgain_hufftab), &ff_wma_hgain_hufftab[0][1], 2, &ff_wma_hgain_hufftab[0][0], 2, 1, @@ -130,7 +130,7 @@ static av_cold int wma_decode_init(AVCodecContext *avctx) if (s->use_exp_vlc) { // FIXME move out of context - ret = init_vlc(&s->exp_vlc, EXPVLCBITS, sizeof(ff_aac_scalefactor_bits), + ret = vlc_init(&s->exp_vlc, EXPVLCBITS, sizeof(ff_aac_scalefactor_bits), ff_aac_scalefactor_bits, 1, 1, ff_aac_scalefactor_code, 4, 4, 0); if (ret < 0) diff --git a/arm/android/third_party/ffmpeg/libavcodec/wmaprodec.c b/arm/android/third_party/ffmpeg/libavcodec/wmaprodec.c index f523f363..61b86ad6 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/wmaprodec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/wmaprodec.c @@ -320,25 +320,25 @@ static av_cold int get_rate(AVCodecContext *avctx) static av_cold void decode_init_static(void) { - INIT_VLC_STATIC_FROM_LENGTHS(&sf_vlc, SCALEVLCBITS, HUFF_SCALE_SIZE, + VLC_INIT_STATIC_FROM_LENGTHS(&sf_vlc, SCALEVLCBITS, HUFF_SCALE_SIZE, &scale_table[0][1], 2, &scale_table[0][0], 2, 1, -60, 0, 616); - INIT_VLC_STATIC_FROM_LENGTHS(&sf_rl_vlc, VLCBITS, HUFF_SCALE_RL_SIZE, + VLC_INIT_STATIC_FROM_LENGTHS(&sf_rl_vlc, VLCBITS, HUFF_SCALE_RL_SIZE, &scale_rl_table[0][1], 2, &scale_rl_table[0][0], 2, 1, 0, 0, 1406); - INIT_VLC_STATIC_FROM_LENGTHS(&coef_vlc[0], VLCBITS, HUFF_COEF0_SIZE, + VLC_INIT_STATIC_FROM_LENGTHS(&coef_vlc[0], VLCBITS, HUFF_COEF0_SIZE, coef0_lens, 1, coef0_syms, 2, 2, 0, 0, 2108); - INIT_VLC_STATIC_FROM_LENGTHS(&coef_vlc[1], VLCBITS, HUFF_COEF1_SIZE, + VLC_INIT_STATIC_FROM_LENGTHS(&coef_vlc[1], VLCBITS, HUFF_COEF1_SIZE, &coef1_table[0][1], 2, &coef1_table[0][0], 2, 1, 0, 0, 3912); - INIT_VLC_STATIC_FROM_LENGTHS(&vec4_vlc, VLCBITS, HUFF_VEC4_SIZE, + VLC_INIT_STATIC_FROM_LENGTHS(&vec4_vlc, VLCBITS, HUFF_VEC4_SIZE, vec4_lens, 1, vec4_syms, 2, 2, -1, 0, 604); - INIT_VLC_STATIC_FROM_LENGTHS(&vec2_vlc, VLCBITS, HUFF_VEC2_SIZE, + VLC_INIT_STATIC_FROM_LENGTHS(&vec2_vlc, VLCBITS, HUFF_VEC2_SIZE, &vec2_table[0][1], 2, &vec2_table[0][0], 2, 1, -1, 0, 562); - INIT_VLC_STATIC_FROM_LENGTHS(&vec1_vlc, VLCBITS, HUFF_VEC1_SIZE, + VLC_INIT_STATIC_FROM_LENGTHS(&vec1_vlc, VLCBITS, HUFF_VEC1_SIZE, &vec1_table[0][1], 2, &vec1_table[0][0], 2, 1, 0, 0, 562); diff --git a/arm/android/third_party/ffmpeg/libavcodec/wmavoice.c b/arm/android/third_party/ffmpeg/libavcodec/wmavoice.c index 44fda0e2..dd7cc64d 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/wmavoice.c +++ b/arm/android/third_party/ffmpeg/libavcodec/wmavoice.c @@ -31,6 +31,7 @@ #include "libavutil/float_dsp.h" #include "libavutil/mem_internal.h" #include "libavutil/thread.h" +#include "libavutil/tx.h" #include "avcodec.h" #include "codec_internal.h" #include "decode.h" @@ -41,8 +42,6 @@ #include "acelp_vectors.h" #include "acelp_filters.h" #include "lsp.h" -#include "dct.h" -#include "rdft.h" #include "sinewin.h" #define MAX_BLOCKS 8 ///< maximum number of blocks per frame @@ -263,10 +262,10 @@ typedef struct WMAVoiceContext { * smoothing and so on, and context variables for FFT/iFFT. * @{ */ - RDFTContext rdft, irdft; ///< contexts for FFT-calculation in the - ///< postfilter (for denoise filter) - DCTContext dct, dst; ///< contexts for phase shift (in Hilbert - ///< transform, part of postfilter) + AVTXContext *rdft, *irdft; ///< contexts for FFT-calculation in the + av_tx_fn rdft_fn, irdft_fn; ///< postfilter (for denoise filter) + AVTXContext *dct, *dst; ///< contexts for phase shift (in Hilbert + av_tx_fn dct_fn, dst_fn; ///< transform, part of postfilter) float sin[511], cos[511]; ///< 8-bit cosine/sine windows over [-pi,pi] ///< range float postfilter_agc; ///< gain control memory, used in @@ -277,9 +276,9 @@ typedef struct WMAVoiceContext { ///< by postfilter float denoise_filter_cache[MAX_FRAMESIZE]; int denoise_filter_cache_size; ///< samples in #denoise_filter_cache - DECLARE_ALIGNED(32, float, tilted_lpcs_pf)[0x80]; + DECLARE_ALIGNED(32, float, tilted_lpcs_pf)[0x82]; ///< aligned buffer for LPC tilting - DECLARE_ALIGNED(32, float, denoise_coeffs_pf)[0x80]; + DECLARE_ALIGNED(32, float, denoise_coeffs_pf)[0x82]; ///< aligned buffer for denoise coefficients DECLARE_ALIGNED(32, float, synth_filter_out_buf)[0x80 + MAX_LSPS_ALIGN16]; ///< aligned buffer for postfilter speech @@ -321,7 +320,7 @@ static av_cold void wmavoice_init_static_data(void) 14, 14, 14, 14 }; - INIT_VLC_STATIC_FROM_LENGTHS(&frame_type_vlc, VLC_NBITS, + VLC_INIT_STATIC_FROM_LENGTHS(&frame_type_vlc, VLC_NBITS, FF_ARRAY_ELEMS(bits), bits, 1, NULL, 0, 0, 0, 0, 132); } @@ -388,10 +387,24 @@ static av_cold int wmavoice_decode_init(AVCodecContext *ctx) s->spillover_bitsize = 3 + av_ceil_log2(ctx->block_align); s->do_apf = flags & 0x1; if (s->do_apf) { - if ((ret = ff_rdft_init(&s->rdft, 7, DFT_R2C)) < 0 || - (ret = ff_rdft_init(&s->irdft, 7, IDFT_C2R)) < 0 || - (ret = ff_dct_init (&s->dct, 6, DCT_I)) < 0 || - (ret = ff_dct_init (&s->dst, 6, DST_I)) < 0) + float scale = 1.0f; + + ret = av_tx_init(&s->rdft, &s->rdft_fn, AV_TX_FLOAT_RDFT, 0, 1 << 7, &scale, 0); + if (ret < 0) + return ret; + + ret = av_tx_init(&s->irdft, &s->irdft_fn, AV_TX_FLOAT_RDFT, 1, 1 << 7, &scale, 0); + if (ret < 0) + return ret; + + scale = 1.0 / (1 << 6); + ret = av_tx_init(&s->dct, &s->dct_fn, AV_TX_FLOAT_DCT_I, 0, 1 << 6, &scale, 0); + if (ret < 0) + return ret; + + scale = 1.0 / (1 << 6); + ret = av_tx_init(&s->dst, &s->dst_fn, AV_TX_FLOAT_DST_I, 0, 1 << 6, &scale, 0); + if (ret < 0) return ret; ff_sine_window_init(s->cos, 256); @@ -596,20 +609,25 @@ static float tilt_factor(const float *lpcs, int n_lpcs) /** * Derive denoise filter coefficients (in real domain) from the LPCs. */ -static void calc_input_response(WMAVoiceContext *s, float *lpcs, - int fcb_type, float *coeffs, int remainder) +static void calc_input_response(WMAVoiceContext *s, float *lpcs_src, + int fcb_type, float *coeffs_dst, int remainder) { float last_coeff, min = 15.0, max = -15.0; float irange, angle_mul, gain_mul, range, sq; + LOCAL_ALIGNED_32(float, coeffs, [0x82]); + LOCAL_ALIGNED_32(float, lpcs, [0x82]); + LOCAL_ALIGNED_32(float, lpcs_dct, [0x82]); int n, idx; + memcpy(coeffs, coeffs_dst, 0x82*sizeof(float)); + /* Create frequency power spectrum of speech input (i.e. RDFT of LPCs) */ - s->rdft.rdft_calc(&s->rdft, lpcs); + s->rdft_fn(s->rdft, lpcs, lpcs_src, sizeof(float)); #define log_range(var, assign) do { \ float tmp = log10f(assign); var = tmp; \ max = FFMAX(max, tmp); min = FFMIN(min, tmp); \ } while (0) - log_range(last_coeff, lpcs[1] * lpcs[1]); + log_range(last_coeff, lpcs[64] * lpcs[64]); for (n = 1; n < 64; n++) log_range(lpcs[n], lpcs[n * 2] * lpcs[n * 2] + lpcs[n * 2 + 1] * lpcs[n * 2 + 1]); @@ -649,8 +667,8 @@ static void calc_input_response(WMAVoiceContext *s, float *lpcs, * is a sine input) by doing a phase shift (in theory, H(sin())=cos()). * Hilbert_Transform(RDFT(x)) = Laplace_Transform(x), which calculates the * "moment" of the LPCs in this filter. */ - s->dct.dct_calc(&s->dct, lpcs); - s->dst.dct_calc(&s->dst, lpcs); + s->dct_fn(s->dct, lpcs_dct, lpcs, sizeof(float)); + s->dst_fn(s->dst, lpcs, lpcs_dct, sizeof(float)); /* Split out the coefficient indexes into phase/magnitude pairs */ idx = 255 + av_clip(lpcs[64], -255, 255); @@ -668,25 +686,25 @@ static void calc_input_response(WMAVoiceContext *s, float *lpcs, coeffs[n * 2 + 1] = coeffs[n] * s->sin[idx]; coeffs[n * 2] = coeffs[n] * s->cos[idx]; } - coeffs[1] = last_coeff; + coeffs[64] = last_coeff; /* move into real domain */ - s->irdft.rdft_calc(&s->irdft, coeffs); + s->irdft_fn(s->irdft, coeffs_dst, coeffs, sizeof(AVComplexFloat)); /* tilt correction and normalize scale */ - memset(&coeffs[remainder], 0, sizeof(coeffs[0]) * (128 - remainder)); + memset(&coeffs_dst[remainder], 0, sizeof(coeffs_dst[0]) * (128 - remainder)); if (s->denoise_tilt_corr) { float tilt_mem = 0; - coeffs[remainder - 1] = 0; + coeffs_dst[remainder - 1] = 0; ff_tilt_compensation(&tilt_mem, - -1.8 * tilt_factor(coeffs, remainder - 1), - coeffs, remainder); + -1.8 * tilt_factor(coeffs_dst, remainder - 1), + coeffs_dst, remainder); } - sq = (1.0 / 64.0) * sqrtf(1 / avpriv_scalarproduct_float_c(coeffs, coeffs, + sq = (1.0 / 64.0) * sqrtf(1 / avpriv_scalarproduct_float_c(coeffs_dst, coeffs_dst, remainder)); for (n = 0; n < remainder; n++) - coeffs[n] *= sq; + coeffs_dst[n] *= sq; } /** @@ -722,6 +740,8 @@ static void wiener_denoise(WMAVoiceContext *s, int fcb_type, int remainder, lim, n; if (fcb_type != FCB_TYPE_SILENCE) { + LOCAL_ALIGNED_32(float, coeffs_f, [0x82]); + LOCAL_ALIGNED_32(float, synth_f, [0x82]); float *tilted_lpcs = s->tilted_lpcs_pf, *coeffs = s->denoise_coeffs_pf, tilt_mem = 0; @@ -742,16 +762,16 @@ static void wiener_denoise(WMAVoiceContext *s, int fcb_type, /* apply coefficients (in frequency spectrum domain), i.e. complex * number multiplication */ memset(&synth_pf[size], 0, sizeof(synth_pf[0]) * (128 - size)); - s->rdft.rdft_calc(&s->rdft, synth_pf); - s->rdft.rdft_calc(&s->rdft, coeffs); - synth_pf[0] *= coeffs[0]; - synth_pf[1] *= coeffs[1]; - for (n = 1; n < 64; n++) { - float v1 = synth_pf[n * 2], v2 = synth_pf[n * 2 + 1]; - synth_pf[n * 2] = v1 * coeffs[n * 2] - v2 * coeffs[n * 2 + 1]; - synth_pf[n * 2 + 1] = v2 * coeffs[n * 2] + v1 * coeffs[n * 2 + 1]; + s->rdft_fn(s->rdft, synth_f, synth_pf, sizeof(float)); + s->rdft_fn(s->rdft, coeffs_f, coeffs, sizeof(float)); + synth_f[0] *= coeffs_f[0]; + synth_f[1] *= coeffs_f[1]; + for (n = 1; n <= 64; n++) { + float v1 = synth_f[n * 2], v2 = synth_f[n * 2 + 1]; + synth_f[n * 2] = v1 * coeffs_f[n * 2] - v2 * coeffs_f[n * 2 + 1]; + synth_f[n * 2 + 1] = v2 * coeffs_f[n * 2] + v1 * coeffs_f[n * 2 + 1]; } - s->irdft.rdft_calc(&s->irdft, synth_pf); + s->irdft_fn(s->irdft, synth_pf, synth_f, sizeof(AVComplexFloat)); } /* merge filter output with the history of previous runs */ @@ -1986,10 +2006,10 @@ static av_cold int wmavoice_decode_end(AVCodecContext *ctx) WMAVoiceContext *s = ctx->priv_data; if (s->do_apf) { - ff_rdft_end(&s->rdft); - ff_rdft_end(&s->irdft); - ff_dct_end(&s->dct); - ff_dct_end(&s->dst); + av_tx_uninit(&s->rdft); + av_tx_uninit(&s->irdft); + av_tx_uninit(&s->dct); + av_tx_uninit(&s->dst); } return 0; diff --git a/arm/android/third_party/ffmpeg/libavcodec/wnv1.c b/arm/android/third_party/ffmpeg/libavcodec/wnv1.c index 5c57db00..ffc9174a 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/wnv1.c +++ b/arm/android/third_party/ffmpeg/libavcodec/wnv1.c @@ -115,10 +115,10 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *p, static av_cold void wnv1_init_static(void) { - INIT_VLC_STATIC_FROM_LENGTHS(&code_vlc, CODE_VLC_BITS, 16, + VLC_INIT_STATIC_FROM_LENGTHS(&code_vlc, CODE_VLC_BITS, 16, &code_tab[0][1], 2, &code_tab[0][0], 2, 1, - -7, INIT_VLC_OUTPUT_LE, 1 << CODE_VLC_BITS); + -7, VLC_INIT_OUTPUT_LE, 1 << CODE_VLC_BITS); } static av_cold int decode_init(AVCodecContext *avctx) diff --git a/arm/android/third_party/ffmpeg/libavcodec/x86/Makefile b/arm/android/third_party/ffmpeg/libavcodec/x86/Makefile index 118daca3..d5fb3064 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/x86/Makefile +++ b/arm/android/third_party/ffmpeg/libavcodec/x86/Makefile @@ -5,11 +5,9 @@ OBJS-$(CONFIG_AC3DSP) += x86/ac3dsp_init.o OBJS-$(CONFIG_AUDIODSP) += x86/audiodsp_init.o OBJS-$(CONFIG_BLOCKDSP) += x86/blockdsp_init.o OBJS-$(CONFIG_BSWAPDSP) += x86/bswapdsp_init.o -OBJS-$(CONFIG_DCT) += x86/dct_init.o OBJS-$(CONFIG_DIRAC_DECODER) += x86/diracdsp_init.o \ x86/dirac_dwt_init.o OBJS-$(CONFIG_FDCTDSP) += x86/fdctdsp_init.o -OBJS-$(CONFIG_FFT) += x86/fft_init.o OBJS-$(CONFIG_FMTCONVERT) += x86/fmtconvert_init.o OBJS-$(CONFIG_H263DSP) += x86/h263dsp_init.o OBJS-$(CONFIG_H264CHROMA) += x86/h264chroma_init.o @@ -75,7 +73,6 @@ OBJS-$(CONFIG_UTVIDEO_DECODER) += x86/utvideodsp_init.o OBJS-$(CONFIG_V210_DECODER) += x86/v210-init.o OBJS-$(CONFIG_V210_ENCODER) += x86/v210enc_init.o OBJS-$(CONFIG_VORBIS_DECODER) += x86/vorbisdsp_init.o -OBJS-$(CONFIG_VP3_DECODER) += x86/hpeldsp_vp3_init.o OBJS-$(CONFIG_VP6_DECODER) += x86/vp6dsp_init.o OBJS-$(CONFIG_VP9_DECODER) += x86/vp9dsp_init.o \ x86/vp9dsp_init_10bpp.o \ @@ -99,8 +96,6 @@ X86ASM-OBJS-$(CONFIG_AC3DSP) += x86/ac3dsp.o \ X86ASM-OBJS-$(CONFIG_AUDIODSP) += x86/audiodsp.o X86ASM-OBJS-$(CONFIG_BLOCKDSP) += x86/blockdsp.o X86ASM-OBJS-$(CONFIG_BSWAPDSP) += x86/bswapdsp.o -X86ASM-OBJS-$(CONFIG_DCT) += x86/dct32.o -X86ASM-OBJS-$(CONFIG_FFT) += x86/fft.o X86ASM-OBJS-$(CONFIG_FMTCONVERT) += x86/fmtconvert.o X86ASM-OBJS-$(CONFIG_H263DSP) += x86/h263_loopfilter.o X86ASM-OBJS-$(CONFIG_H264CHROMA) += x86/h264_chromamc.o \ @@ -127,7 +122,7 @@ X86ASM-OBJS-$(CONFIG_LLVIDDSP) += x86/lossless_videodsp.o X86ASM-OBJS-$(CONFIG_LLVIDENCDSP) += x86/lossless_videoencdsp.o X86ASM-OBJS-$(CONFIG_LPC) += x86/lpc.o X86ASM-OBJS-$(CONFIG_ME_CMP) += x86/me_cmp.o -X86ASM-OBJS-$(CONFIG_MPEGAUDIODSP) += x86/imdct36.o +X86ASM-OBJS-$(CONFIG_MPEGAUDIODSP) += x86/dct32.o x86/imdct36.o X86ASM-OBJS-$(CONFIG_MPEGVIDEOENC) += x86/mpegvideoencdsp.o X86ASM-OBJS-$(CONFIG_OPUS_DECODER) += x86/opusdsp.o X86ASM-OBJS-$(CONFIG_OPUS_ENCODER) += x86/celt_pvq_search.o @@ -192,7 +187,6 @@ X86ASM-OBJS-$(CONFIG_UTVIDEO_DECODER) += x86/utvideodsp.o X86ASM-OBJS-$(CONFIG_V210_ENCODER) += x86/v210enc.o X86ASM-OBJS-$(CONFIG_V210_DECODER) += x86/v210.o X86ASM-OBJS-$(CONFIG_VORBIS_DECODER) += x86/vorbisdsp.o -X86ASM-OBJS-$(CONFIG_VP3_DECODER) += x86/hpeldsp_vp3.o X86ASM-OBJS-$(CONFIG_VP6_DECODER) += x86/vp6dsp.o X86ASM-OBJS-$(CONFIG_VP9_DECODER) += x86/vp9intrapred.o \ x86/vp9intrapred_16bpp.o \ diff --git a/arm/android/third_party/ffmpeg/libavcodec/x86/hpeldsp.asm b/arm/android/third_party/ffmpeg/libavcodec/x86/hpeldsp.asm index 7a2b7135..3bc27861 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/x86/hpeldsp.asm +++ b/arm/android/third_party/ffmpeg/libavcodec/x86/hpeldsp.asm @@ -165,6 +165,47 @@ cglobal put_no_rnd_pixels8_x2, 4,5 RET +; void ff_put_no_rnd_pixels8_x2_exact(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) +INIT_MMX mmxext +cglobal put_no_rnd_pixels8_x2_exact, 4,5 + lea r4, [r2*3] + pcmpeqb m6, m6 +.loop: + mova m0, [r1] + mova m2, [r1+r2] + mova m1, [r1+1] + mova m3, [r1+r2+1] + pxor m0, m6 + pxor m2, m6 + pxor m1, m6 + pxor m3, m6 + PAVGB m0, m1 + PAVGB m2, m3 + pxor m0, m6 + pxor m2, m6 + mova [r0], m0 + mova [r0+r2], m2 + mova m0, [r1+r2*2] + mova m1, [r1+r2*2+1] + mova m2, [r1+r4] + mova m3, [r1+r4+1] + pxor m0, m6 + pxor m1, m6 + pxor m2, m6 + pxor m3, m6 + PAVGB m0, m1 + PAVGB m2, m3 + pxor m0, m6 + pxor m2, m6 + mova [r0+r2*2], m0 + mova [r0+r4], m2 + lea r1, [r1+r2*4] + lea r0, [r0+r2*4] + sub r3d, 4 + jg .loop + RET + + ; void ff_put_pixels8_y2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) %macro PUT_PIXELS8_Y2 0 %if cpuflag(sse2) @@ -235,6 +276,42 @@ cglobal put_no_rnd_pixels8_y2, 4,5 RET +; void ff_put_no_rnd_pixels8_y2_exact(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) +INIT_MMX mmxext +cglobal put_no_rnd_pixels8_y2_exact, 4,5 + lea r4, [r2*3] + mova m0, [r1] + pcmpeqb m6, m6 + add r1, r2 + pxor m0, m6 +.loop: + mova m1, [r1] + mova m2, [r1+r2] + pxor m1, m6 + pxor m2, m6 + PAVGB m0, m1 + PAVGB m1, m2 + pxor m0, m6 + pxor m1, m6 + mova [r0], m0 + mova [r0+r2], m1 + mova m1, [r1+r2*2] + mova m0, [r1+r4] + pxor m1, m6 + pxor m0, m6 + PAVGB m2, m1 + PAVGB m1, m0 + pxor m2, m6 + pxor m1, m6 + mova [r0+r2*2], m2 + mova [r0+r4], m1 + lea r1, [r1+r2*4] + lea r0, [r0+r2*4] + sub r3d, 4 + jg .loop + RET + + ; void ff_avg_pixels8_x2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) %macro AVG_PIXELS8_X2 0 %if cpuflag(sse2) diff --git a/arm/android/third_party/ffmpeg/libavcodec/x86/hpeldsp.h b/arm/android/third_party/ffmpeg/libavcodec/x86/hpeldsp.h index fd740da7..ac7e625f 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/x86/hpeldsp.h +++ b/arm/android/third_party/ffmpeg/libavcodec/x86/hpeldsp.h @@ -22,8 +22,6 @@ #include #include -#include "libavcodec/hpeldsp.h" - void ff_avg_pixels8_x2_mmx(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); @@ -50,6 +48,4 @@ void ff_put_pixels16_xy2_sse2(uint8_t *block, const uint8_t *pixels, void ff_put_pixels16_xy2_ssse3(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); -void ff_hpeldsp_vp3_init_x86(HpelDSPContext *c, int cpu_flags, int flags); - #endif /* AVCODEC_X86_HPELDSP_H */ diff --git a/arm/android/third_party/ffmpeg/libavcodec/x86/hpeldsp_init.c b/arm/android/third_party/ffmpeg/libavcodec/x86/hpeldsp_init.c index 09c48c34..f08c66f5 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/x86/hpeldsp_init.c +++ b/arm/android/third_party/ffmpeg/libavcodec/x86/hpeldsp_init.c @@ -22,8 +22,6 @@ * MMX optimization by Nick Kurshev */ -#include "config_components.h" - #include "libavutil/attributes.h" #include "libavutil/cpu.h" #include "libavutil/x86/cpu.h" @@ -47,10 +45,16 @@ void ff_avg_pixels16_y2_sse2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); void ff_put_no_rnd_pixels8_x2_mmxext(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); +void ff_put_no_rnd_pixels8_x2_exact_mmxext(uint8_t *block, + const uint8_t *pixels, + ptrdiff_t line_size, int h); void ff_put_pixels8_y2_mmxext(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); void ff_put_no_rnd_pixels8_y2_mmxext(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); +void ff_put_no_rnd_pixels8_y2_exact_mmxext(uint8_t *block, + const uint8_t *pixels, + ptrdiff_t line_size, int h); void ff_avg_pixels8_x2_mmxext(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); void ff_avg_pixels8_y2_mmxext(uint8_t *block, const uint8_t *pixels, @@ -183,6 +187,9 @@ static void hpeldsp_init_mmxext(HpelDSPContext *c, int flags) c->avg_pixels_tab[1][2] = ff_avg_pixels8_y2_mmxext; c->avg_pixels_tab[1][3] = ff_avg_pixels8_xy2_mmxext; + 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; + 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; @@ -235,7 +242,4 @@ av_cold void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags) if (EXTERNAL_SSSE3(cpu_flags)) hpeldsp_init_ssse3(c, flags); - - if (CONFIG_VP3_DECODER) - ff_hpeldsp_vp3_init_x86(c, cpu_flags, flags); } diff --git a/arm/android/third_party/ffmpeg/libavcodec/x86/idctdsp_init.c b/arm/android/third_party/ffmpeg/libavcodec/x86/idctdsp_init.c index f28a1ad7..2d165b97 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/x86/idctdsp_init.c +++ b/arm/android/third_party/ffmpeg/libavcodec/x86/idctdsp_init.c @@ -45,10 +45,12 @@ av_cold int ff_init_scantable_permutation_x86(uint8_t *idct_permutation, int i; switch (perm_type) { +#if ARCH_X86_32 case FF_IDCT_PERM_SIMPLE: for (i = 0; i < 64; i++) idct_permutation[i] = simple_mmx_permutation[i]; return 1; +#endif case FF_IDCT_PERM_SSE2: for (i = 0; i < 64; i++) idct_permutation[i] = (i & 0x38) | idct_sse2_row_perm[i & 7]; diff --git a/arm/android/third_party/ffmpeg/libavcodec/x86/mpegaudiodsp.c b/arm/android/third_party/ffmpeg/libavcodec/x86/mpegaudiodsp.c index 6586fe07..43662cd2 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/x86/mpegaudiodsp.c +++ b/arm/android/third_party/ffmpeg/libavcodec/x86/mpegaudiodsp.c @@ -45,6 +45,9 @@ void ff_four_imdct36_float_sse(float *out, float *buf, float *in, float *win, void ff_four_imdct36_float_avx(float *out, float *buf, float *in, float *win, float *tmpbuf); +void ff_dct32_float_sse2(float *out, const float *in); +void ff_dct32_float_avx (float *out, const float *in); + DECLARE_ALIGNED(16, static float, mdct_win_sse)[2][4][4*40]; #if HAVE_6REGS && HAVE_SSE_INLINE @@ -267,6 +270,7 @@ av_cold void ff_mpadsp_init_x86(MPADSPContext *s) #if HAVE_SSE if (EXTERNAL_SSE2(cpu_flags)) { s->imdct36_blocks_float = imdct36_blocks_sse2; + s->dct32_float = ff_dct32_float_sse2; } if (EXTERNAL_SSE3(cpu_flags)) { s->imdct36_blocks_float = imdct36_blocks_sse3; @@ -279,6 +283,8 @@ av_cold void ff_mpadsp_init_x86(MPADSPContext *s) if (EXTERNAL_AVX(cpu_flags)) { s->imdct36_blocks_float = imdct36_blocks_avx; } + if (EXTERNAL_AVX_FAST(cpu_flags)) + s->dct32_float = ff_dct32_float_avx; #endif #endif /* HAVE_X86ASM */ } diff --git a/arm/android/third_party/ffmpeg/libavcodec/x86/mpegvideoenc_template.c b/arm/android/third_party/ffmpeg/libavcodec/x86/mpegvideoenc_template.c index b5b0a5ff..5f013be7 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/x86/mpegvideoenc_template.c +++ b/arm/android/third_party/ffmpeg/libavcodec/x86/mpegvideoenc_template.c @@ -225,7 +225,8 @@ static int RENAME(dct_quantize)(MpegEncContext *s, if(s->mb_intra) block[0]= level; else block[0]= temp_block[0]; - if (s->idsp.perm_type == FF_IDCT_PERM_SIMPLE) { + av_assert2(ARCH_X86_32 || s->idsp.perm_type != FF_IDCT_PERM_SIMPLE); + if (ARCH_X86_32 && s->idsp.perm_type == FF_IDCT_PERM_SIMPLE) { if(last_non_zero_p1 <= 1) goto end; block[0x08] = temp_block[0x01]; block[0x10] = temp_block[0x08]; block[0x20] = temp_block[0x10]; diff --git a/arm/android/third_party/ffmpeg/libavcodec/x86/proresdsp_init.c b/arm/android/third_party/ffmpeg/libavcodec/x86/proresdsp_init.c index bde79ab8..f7abbfa6 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/x86/proresdsp_init.c +++ b/arm/android/third_party/ffmpeg/libavcodec/x86/proresdsp_init.c @@ -30,12 +30,12 @@ void ff_prores_idct_put_10_sse2(uint16_t *dst, ptrdiff_t linesize, void ff_prores_idct_put_10_avx (uint16_t *dst, ptrdiff_t linesize, int16_t *block, const int16_t *qmat); -av_cold void ff_proresdsp_init_x86(ProresDSPContext *dsp, AVCodecContext *avctx) +av_cold void ff_proresdsp_init_x86(ProresDSPContext *dsp, int bits_per_raw_sample) { #if ARCH_X86_64 int cpu_flags = av_get_cpu_flags(); - if (avctx->bits_per_raw_sample == 10){ + if (bits_per_raw_sample == 10) { if (EXTERNAL_SSE2(cpu_flags)) { dsp->idct_permutation_type = FF_IDCT_PERM_TRANSPOSE; dsp->idct_put = ff_prores_idct_put_10_sse2; diff --git a/arm/android/third_party/ffmpeg/libavcodec/x86/snowdsp.c b/arm/android/third_party/ffmpeg/libavcodec/x86/snowdsp.c index bca1f9bd..bd0aa766 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/x86/snowdsp.c +++ b/arm/android/third_party/ffmpeg/libavcodec/x86/snowdsp.c @@ -24,7 +24,6 @@ #include "libavutil/attributes.h" #include "libavutil/cpu.h" #include "libavutil/x86/asm.h" -#include "libavcodec/snow.h" #include "libavcodec/snow_dwt.h" #if HAVE_INLINE_ASM diff --git a/arm/android/third_party/ffmpeg/libavcodec/xan.c b/arm/android/third_party/ffmpeg/libavcodec/xan.c index 14fc2443..cc0ecea5 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/xan.c +++ b/arm/android/third_party/ffmpeg/libavcodec/xan.c @@ -622,8 +622,7 @@ static int xan_decode_frame(AVCodecContext *avctx, AVFrame *frame, if (xan_wc3_decode_frame(s, frame) < 0) return AVERROR_INVALIDDATA; - av_frame_unref(s->last_frame); - if ((ret = av_frame_ref(s->last_frame, frame)) < 0) + if ((ret = av_frame_replace(s->last_frame, frame)) < 0) return ret; *got_frame = 1; diff --git a/arm/android/third_party/ffmpeg/libavcodec/xvididct.c b/arm/android/third_party/ffmpeg/libavcodec/xvididct.c index f338901a..dcea3221 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/xvididct.c +++ b/arm/android/third_party/ffmpeg/libavcodec/xvididct.c @@ -69,24 +69,24 @@ static int idct_row(short *in, const int *const tab, int rnd) if (!(right | in[4])) { const int k = c4 * in[0] + rnd; if (left) { - const int a0 = k + c2 * in[2]; - const int a1 = k + c6 * in[2]; - const int a2 = k - c6 * in[2]; - const int a3 = k - c2 * in[2]; + const unsigned a0 = k + c2 * in[2]; + const unsigned a1 = k + c6 * in[2]; + const unsigned a2 = k - c6 * in[2]; + const unsigned a3 = k - c2 * in[2]; const int b0 = c1 * in[1] + c3 * in[3]; const int b1 = c3 * in[1] - c7 * in[3]; const int b2 = c5 * in[1] - c1 * in[3]; const int b3 = c7 * in[1] - c5 * in[3]; - in[0] = (a0 + b0) >> ROW_SHIFT; - in[1] = (a1 + b1) >> ROW_SHIFT; - in[2] = (a2 + b2) >> ROW_SHIFT; - in[3] = (a3 + b3) >> ROW_SHIFT; - in[4] = (a3 - b3) >> ROW_SHIFT; - in[5] = (a2 - b2) >> ROW_SHIFT; - in[6] = (a1 - b1) >> ROW_SHIFT; - in[7] = (a0 - b0) >> ROW_SHIFT; + in[0] = (int)(a0 + b0) >> ROW_SHIFT; + in[1] = (int)(a1 + b1) >> ROW_SHIFT; + in[2] = (int)(a2 + b2) >> ROW_SHIFT; + in[3] = (int)(a3 + b3) >> ROW_SHIFT; + in[4] = (int)(a3 - b3) >> ROW_SHIFT; + in[5] = (int)(a2 - b2) >> ROW_SHIFT; + in[6] = (int)(a1 - b1) >> ROW_SHIFT; + in[7] = (int)(a0 - b0) >> ROW_SHIFT; } else { const int a0 = k >> ROW_SHIFT; if (a0) { @@ -114,7 +114,7 @@ static int idct_row(short *in, const int *const tab, int rnd) in[5] = a1; in[6] = a1; } else { - const int k = c4 * in[0] + rnd; + const unsigned int k = c4 * in[0] + rnd; const unsigned int a0 = k + c2 * in[2] + c4 * in[4] + c6 * in[6]; const unsigned int a1 = k + c6 * in[2] - c4 * in[4] - c2 * in[6]; const unsigned int a2 = k - c6 * in[2] - c4 * in[4] + c2 * in[6]; diff --git a/arm/android/third_party/ffmpeg/libavcodec/ylc.c b/arm/android/third_party/ffmpeg/libavcodec/ylc.c index c0c4d27c..b03df315 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/ylc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/ylc.c @@ -87,7 +87,7 @@ static int build_vlc(AVCodecContext *avctx, VLC *vlc, const uint32_t *table) uint8_t xlat[256]; int cur_node, i, j, pos = 0; - ff_free_vlc(vlc); + ff_vlc_free(vlc); for (i = 0; i < 256; i++) { nodes[i].count = table[i]; @@ -142,7 +142,7 @@ static int build_vlc(AVCodecContext *avctx, VLC *vlc, const uint32_t *table) get_tree_codes(bits, lens, xlat, nodes, cur_node - 1, 0, 0, &pos); - return ff_init_vlc_sparse(vlc, YLC_VLC_BITS, pos, lens, 2, 2, + return ff_vlc_init_sparse(vlc, YLC_VLC_BITS, pos, lens, 2, 2, bits, 4, 4, xlat, 1, 1, 0); } @@ -438,7 +438,7 @@ static av_cold int decode_end(AVCodecContext *avctx) YLCContext *s = avctx->priv_data; for (int i = 0; i < FF_ARRAY_ELEMS(s->vlc); i++) - ff_free_vlc(&s->vlc[i]); + ff_vlc_free(&s->vlc[i]); av_freep(&s->buffer); s->buffer_size = 0; diff --git a/arm/android/third_party/ffmpeg/libavcodec/yuv4enc.c b/arm/android/third_party/ffmpeg/libavcodec/yuv4enc.c index 8123260d..2a9d3442 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/yuv4enc.c +++ b/arm/android/third_party/ffmpeg/libavcodec/yuv4enc.c @@ -29,10 +29,10 @@ static int yuv4_encode_frame(AVCodecContext *avctx, AVPacket *pkt, { uint8_t *dst; const uint8_t *y, *u, *v; - int i, j, ret; + int ret; - ret = ff_get_encode_buffer(avctx, pkt, 6 * (avctx->width + 1 >> 1) - * (avctx->height + 1 >> 1), 0); + ret = ff_get_encode_buffer(avctx, pkt, 6 * ((avctx->width + 1) / 2) + * ((avctx->height + 1) / 2), 0); if (ret < 0) return ret; dst = pkt->data; @@ -41,8 +41,8 @@ static int yuv4_encode_frame(AVCodecContext *avctx, AVPacket *pkt, u = pic->data[1]; v = pic->data[2]; - for (i = 0; i < avctx->height + 1 >> 1; i++) { - for (j = 0; j < avctx->width + 1 >> 1; j++) { + for (int i = 0; i < avctx->height / 2; i++) { + for (int j = 0; j < (avctx->width + 1) / 2; j++) { *dst++ = u[j] ^ 0x80; *dst++ = v[j] ^ 0x80; *dst++ = y[ 2 * j ]; @@ -55,6 +55,17 @@ static int yuv4_encode_frame(AVCodecContext *avctx, AVPacket *pkt, v += pic->linesize[2]; } + if (avctx->height & 1) { + for (int j = 0; j < (avctx->width + 1) / 2; j++) { + *dst++ = u[j] ^ 0x80; + *dst++ = v[j] ^ 0x80; + *dst++ = y[2 * j ]; + *dst++ = y[2 * j + 1]; + *dst++ = y[2 * j ]; + *dst++ = y[2 * j + 1]; + } + } + *got_packet = 1; return 0; } diff --git a/arm/android/third_party/ffmpeg/libavcodec/zerocodec.c b/arm/android/third_party/ffmpeg/libavcodec/zerocodec.c index 6c3bcebc..48f78d1d 100644 --- a/arm/android/third_party/ffmpeg/libavcodec/zerocodec.c +++ b/arm/android/third_party/ffmpeg/libavcodec/zerocodec.c @@ -93,8 +93,7 @@ static int zerocodec_decode_frame(AVCodecContext *avctx, AVFrame *pic, dst -= pic->linesize[0]; } - av_frame_unref(zc->previous_frame); - if ((ret = av_frame_ref(zc->previous_frame, pic)) < 0) + if ((ret = av_frame_replace(zc->previous_frame, pic)) < 0) return ret; *got_frame = 1; diff --git a/arm/android/third_party/ffmpeg/libavutil/Makefile b/arm/android/third_party/ffmpeg/libavutil/Makefile index bd9c6f9e..4711f8cd 100644 --- a/arm/android/third_party/ffmpeg/libavutil/Makefile +++ b/arm/android/third_party/ffmpeg/libavutil/Makefile @@ -31,6 +31,7 @@ HEADERS = adler32.h \ encryption_info.h \ error.h \ eval.h \ + executor.h \ fifo.h \ file.h \ frame.h \ @@ -91,6 +92,7 @@ HEADERS = adler32.h \ tea.h \ tx.h \ film_grain_params.h \ + video_hint.h ARCH_HEADERS = bswap.h \ intmath.h \ @@ -126,6 +128,7 @@ OBJS = adler32.o \ encryption_info.o \ error.o \ eval.o \ + executor.o \ fifo.o \ file.o \ file_open.o \ @@ -181,6 +184,7 @@ OBJS = adler32.o \ uuid.o \ version.o \ video_enc_params.o \ + video_hint.o \ film_grain_params.o \ diff --git a/arm/android/third_party/ffmpeg/libavutil/aarch64/autorename_libavutil_aarch64_cpu.c b/arm/android/third_party/ffmpeg/libavutil/aarch64/autorename_libavutil_aarch64_cpu.c new file mode 100644 index 00000000..3adbdc6f --- /dev/null +++ b/arm/android/third_party/ffmpeg/libavutil/aarch64/autorename_libavutil_aarch64_cpu.c @@ -0,0 +1,2 @@ +// File automatically generated. See crbug.com/495833. +#include "cpu.c" diff --git a/arm/android/third_party/ffmpeg/libavutil/audio_fifo.c b/arm/android/third_party/ffmpeg/libavutil/audio_fifo.c index f4103178..dc2dea9b 100644 --- a/arm/android/third_party/ffmpeg/libavutil/audio_fifo.c +++ b/arm/android/third_party/ffmpeg/libavutil/audio_fifo.c @@ -116,7 +116,7 @@ int av_audio_fifo_realloc(AVAudioFifo *af, int nb_samples) return 0; } -int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples) +int av_audio_fifo_write(AVAudioFifo *af, void * const *data, int nb_samples) { int i, ret, size; @@ -142,12 +142,13 @@ 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 av_audio_fifo_peek(const AVAudioFifo *af, void * const *data, int nb_samples) { return av_audio_fifo_peek_at(af, data, nb_samples, 0); } -int av_audio_fifo_peek_at(AVAudioFifo *af, void **data, int nb_samples, int offset) +int av_audio_fifo_peek_at(const AVAudioFifo *af, void * const *data, + int nb_samples, int offset) { int i, ret, size; @@ -171,7 +172,7 @@ int av_audio_fifo_peek_at(AVAudioFifo *af, void **data, int nb_samples, int offs return nb_samples; } -int av_audio_fifo_read(AVAudioFifo *af, void **data, int nb_samples) +int av_audio_fifo_read(AVAudioFifo *af, void * const *data, int nb_samples) { int i, size; diff --git a/arm/android/third_party/ffmpeg/libavutil/audio_fifo.h b/arm/android/third_party/ffmpeg/libavutil/audio_fifo.h index d1e4c856..fa5f59a2 100644 --- a/arm/android/third_party/ffmpeg/libavutil/audio_fifo.h +++ b/arm/android/third_party/ffmpeg/libavutil/audio_fifo.h @@ -91,7 +91,7 @@ int av_audio_fifo_realloc(AVAudioFifo *af, int nb_samples); * code on failure. If successful, the number of samples * actually written will always be nb_samples. */ -int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples); +int av_audio_fifo_write(AVAudioFifo *af, void * const *data, int nb_samples); /** * Peek data from an AVAudioFifo. @@ -107,7 +107,7 @@ int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples); * 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); +int av_audio_fifo_peek(const AVAudioFifo *af, void * const *data, int nb_samples); /** * Peek data from an AVAudioFifo. @@ -124,7 +124,8 @@ int av_audio_fifo_peek(AVAudioFifo *af, void **data, int nb_samples); * 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_at(AVAudioFifo *af, void **data, int nb_samples, int offset); +int av_audio_fifo_peek_at(const AVAudioFifo *af, void * const *data, + int nb_samples, int offset); /** * Read data from an AVAudioFifo. @@ -140,7 +141,7 @@ int av_audio_fifo_peek_at(AVAudioFifo *af, void **data, int nb_samples, int offs * 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_read(AVAudioFifo *af, void **data, int nb_samples); +int av_audio_fifo_read(AVAudioFifo *af, void * const *data, int nb_samples); /** * Drain data from an AVAudioFifo. diff --git a/arm/android/third_party/ffmpeg/libavutil/avstring.c b/arm/android/third_party/ffmpeg/libavutil/avstring.c index e460b5be..8751ce55 100644 --- a/arm/android/third_party/ffmpeg/libavutil/avstring.c +++ b/arm/android/third_party/ffmpeg/libavutil/avstring.c @@ -32,7 +32,6 @@ #include "bprint.h" #include "error.h" #include "macros.h" -#include "version.h" int av_strstart(const char *str, const char *pfx, const char **ptr) { diff --git a/arm/android/third_party/ffmpeg/libavutil/avstring.h b/arm/android/third_party/ffmpeg/libavutil/avstring.h index ac113d8c..12f8fec9 100644 --- a/arm/android/third_party/ffmpeg/libavutil/avstring.h +++ b/arm/android/third_party/ffmpeg/libavutil/avstring.h @@ -24,7 +24,6 @@ #include #include #include "attributes.h" -#include "version.h" /** * @addtogroup lavu_string @@ -265,7 +264,7 @@ int av_strncasecmp(const char *a, const char *b, size_t n); /** * Locale-independent strings replace. - * @note This means only ASCII-range characters are replace + * @note This means only ASCII-range characters are replaced. */ char *av_strireplace(const char *str, const char *from, const char *to); diff --git a/arm/android/third_party/ffmpeg/libavutil/avutil.h b/arm/android/third_party/ffmpeg/libavutil/avutil.h index 64b68bdb..a362c8ba 100644 --- a/arm/android/third_party/ffmpeg/libavutil/avutil.h +++ b/arm/android/third_party/ffmpeg/libavutil/avutil.h @@ -257,7 +257,12 @@ const char *av_get_media_type_string(enum AVMediaType media_type); * Internal time base represented as fractional value */ +#ifdef __cplusplus +/* ISO C++ forbids compound-literals. */ +#define AV_TIME_BASE_Q av_make_q(1, AV_TIME_BASE) +#else #define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE} +#endif /** * @} @@ -294,7 +299,6 @@ char av_get_picture_type_char(enum AVPictureType pict_type); */ #include "common.h" -#include "error.h" #include "rational.h" #include "version.h" #include "macros.h" diff --git a/arm/android/third_party/ffmpeg/libavutil/bprint.c b/arm/android/third_party/ffmpeg/libavutil/bprint.c index 5b540ebc..4e957171 100644 --- a/arm/android/third_party/ffmpeg/libavutil/bprint.c +++ b/arm/android/third_party/ffmpeg/libavutil/bprint.c @@ -71,7 +71,7 @@ void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max) unsigned size_auto = (char *)buf + sizeof(*buf) - buf->reserved_internal_buffer; - if (size_max == 1) + if (size_max == AV_BPRINT_SIZE_AUTOMATIC) size_max = size_auto; buf->str = buf->reserved_internal_buffer; buf->len = 0; @@ -84,6 +84,11 @@ void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max) void av_bprint_init_for_buffer(AVBPrint *buf, char *buffer, unsigned size) { + if (size == 0) { + av_bprint_init(buf, 0, AV_BPRINT_SIZE_COUNT_ONLY); + return; + } + buf->str = buffer; buf->len = 0; buf->size = size; diff --git a/arm/android/third_party/ffmpeg/libavutil/bprint.h b/arm/android/third_party/ffmpeg/libavutil/bprint.h index f27d30f7..85597454 100644 --- a/arm/android/third_party/ffmpeg/libavutil/bprint.h +++ b/arm/android/third_party/ffmpeg/libavutil/bprint.h @@ -144,6 +144,9 @@ void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max); * Init a print buffer using a pre-existing buffer. * * The buffer will not be reallocated. + * In case size equals zero, the AVBPrint will be initialized to use + * the internal buffer as if using AV_BPRINT_SIZE_COUNT_ONLY with + * av_bprint_init(). * * @param buf buffer structure to init * @param buffer byte buffer to use for the string data diff --git a/arm/android/third_party/ffmpeg/libavutil/channel_layout.c b/arm/android/third_party/ffmpeg/libavutil/channel_layout.c index e2f75122..9b581ae6 100644 --- a/arm/android/third_party/ffmpeg/libavutil/channel_layout.c +++ b/arm/android/third_party/ffmpeg/libavutil/channel_layout.c @@ -108,7 +108,9 @@ int av_channel_name(char *buf, size_t buf_size, enum AVChannel channel_id) av_bprint_init_for_buffer(&bp, buf, buf_size); av_channel_name_bprint(&bp, channel_id); - return bp.len; + if (bp.len >= INT_MAX) + return AVERROR(ERANGE); + return bp.len + 1; } void av_channel_description_bprint(AVBPrint *bp, enum AVChannel channel_id) @@ -135,7 +137,9 @@ int av_channel_description(char *buf, size_t buf_size, enum AVChannel channel_id av_bprint_init_for_buffer(&bp, buf, buf_size); av_channel_description_bprint(&bp, channel_id); - return bp.len; + if (bp.len >= INT_MAX) + return AVERROR(ERANGE); + return bp.len + 1; } enum AVChannel av_channel_from_string(const char *str) @@ -789,7 +793,9 @@ int av_channel_layout_describe(const AVChannelLayout *channel_layout, if (ret < 0) return ret; - return bp.len; + if (bp.len >= INT_MAX) + return AVERROR(ERANGE); + return bp.len + 1; } enum AVChannel diff --git a/arm/android/third_party/ffmpeg/libavutil/channel_layout.h b/arm/android/third_party/ffmpeg/libavutil/channel_layout.h index f345415c..ac2ddfa0 100644 --- a/arm/android/third_party/ffmpeg/libavutil/channel_layout.h +++ b/arm/android/third_party/ffmpeg/libavutil/channel_layout.h @@ -358,8 +358,16 @@ typedef struct AVChannelLayout { void *opaque; } AVChannelLayout; +/** + * Macro to define native channel layouts + * + * @note This doesn't use designated initializers for compatibility with C++ 17 and older. + */ #define AV_CHANNEL_LAYOUT_MASK(nb, m) \ - { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = (nb), .u = { .mask = (m) }} + { /* .order */ AV_CHANNEL_ORDER_NATIVE, \ + /* .nb_channels */ (nb), \ + /* .u.mask */ { m }, \ + /* .opaque */ NULL } /** * @name Common pre-defined channel layouts @@ -396,8 +404,12 @@ typedef struct AVChannelLayout { #define AV_CHANNEL_LAYOUT_HEXADECAGONAL AV_CHANNEL_LAYOUT_MASK(16, AV_CH_LAYOUT_HEXADECAGONAL) #define AV_CHANNEL_LAYOUT_STEREO_DOWNMIX AV_CHANNEL_LAYOUT_MASK(2, AV_CH_LAYOUT_STEREO_DOWNMIX) #define AV_CHANNEL_LAYOUT_22POINT2 AV_CHANNEL_LAYOUT_MASK(24, AV_CH_LAYOUT_22POINT2) + #define AV_CHANNEL_LAYOUT_AMBISONIC_FIRST_ORDER \ - { .order = AV_CHANNEL_ORDER_AMBISONIC, .nb_channels = 4, .u = { .mask = 0 }} + { /* .order */ AV_CHANNEL_ORDER_AMBISONIC, \ + /* .nb_channels */ 4, \ + /* .u.mask */ { 0 }, \ + /* .opaque */ NULL } /** @} */ struct AVBPrint; diff --git a/arm/android/third_party/ffmpeg/libavutil/common.h b/arm/android/third_party/ffmpeg/libavutil/common.h index fd1404be..de2140a6 100644 --- a/arm/android/third_party/ffmpeg/libavutil/common.h +++ b/arm/android/third_party/ffmpeg/libavutil/common.h @@ -40,6 +40,7 @@ #include #include "attributes.h" +#include "error.h" #include "macros.h" //rounded division & shift diff --git a/arm/android/third_party/ffmpeg/libavutil/dict.c b/arm/android/third_party/ffmpeg/libavutil/dict.c index f673977a..7f23d533 100644 --- a/arm/android/third_party/ffmpeg/libavutil/dict.c +++ b/arm/android/third_party/ffmpeg/libavutil/dict.c @@ -18,13 +18,15 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include +#include #include #include "avassert.h" #include "avstring.h" #include "dict.h" #include "dict_internal.h" -#include "internal.h" +#include "error.h" #include "mem.h" #include "time_internal.h" #include "bprint.h" diff --git a/arm/android/third_party/ffmpeg/libavutil/emms.h b/arm/android/third_party/ffmpeg/libavutil/emms.h new file mode 100644 index 00000000..4ec01274 --- /dev/null +++ b/arm/android/third_party/ffmpeg/libavutil/emms.h @@ -0,0 +1,66 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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_EMMS_H +#define AVUTIL_EMMS_H + +#include "config.h" +#include "libavutil/attributes.h" + +#if ARCH_X86 + +void avpriv_emms_asm(void); + +#if HAVE_MMX_INLINE +#ifndef __MMX__ +#include "libavutil/cpu.h" +#endif + +# define emms_c emms_c +/** + * Empty mmx state. + * this must be called between any dsp function and float/double code. + * for example sin(); dsp->idct_put(); emms_c(); cos() + * Note, *alloc() and *free() also use float code in some libc implementations + * thus this also applies to them or any function using them. + */ +static av_always_inline void emms_c(void) +{ +/* Some inlined functions may also use mmx instructions regardless of + * runtime cpuflags. With that in mind, we unconditionally empty the + * mmx state if the target cpu chosen at configure time supports it. + */ +#if !defined(__MMX__) + if(av_get_cpu_flags() & AV_CPU_FLAG_MMX) +#endif + __asm__ volatile ("emms" ::: "memory"); +} +#elif HAVE_MMX && HAVE_MM_EMPTY +# include +# define emms_c _mm_empty +#elif HAVE_MMX_EXTERNAL +# define emms_c avpriv_emms_asm +#endif /* HAVE_MMX_INLINE */ + +#endif /* ARCH_X86 */ + +#ifndef emms_c +# define emms_c() do {} while(0) +#endif + +#endif /* AVUTIL_EMMS_H */ diff --git a/arm/android/third_party/ffmpeg/libavutil/encryption_info.c b/arm/android/third_party/ffmpeg/libavutil/encryption_info.c index be7ce38e..8cf51566 100644 --- a/arm/android/third_party/ffmpeg/libavutil/encryption_info.c +++ b/arm/android/third_party/ffmpeg/libavutil/encryption_info.c @@ -16,6 +16,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + #include "encryption_info.h" #include "mem.h" #include "intreadwrite.h" diff --git a/arm/android/third_party/ffmpeg/libavutil/executor.c b/arm/android/third_party/ffmpeg/libavutil/executor.c new file mode 100644 index 00000000..0da919f4 --- /dev/null +++ b/arm/android/third_party/ffmpeg/libavutil/executor.c @@ -0,0 +1,201 @@ +/* + * Copyright (C) 2023 Nuo Mi + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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 "internal.h" +#include "mem.h" +#include "thread.h" + +#include "executor.h" + +#if !HAVE_THREADS + +#define ExecutorThread char + +#define executor_thread_create(t, a, s, ar) 0 +#define executor_thread_join(t, r) do {} while(0) + +#else + +#define ExecutorThread pthread_t + +#define executor_thread_create(t, a, s, ar) pthread_create(t, a, s, ar) +#define executor_thread_join(t, r) pthread_join(t, r) + +#endif //!HAVE_THREADS + +typedef struct ThreadInfo { + AVExecutor *e; + ExecutorThread thread; +} ThreadInfo; + +struct AVExecutor { + AVTaskCallbacks cb; + int thread_count; + + ThreadInfo *threads; + uint8_t *local_contexts; + + AVMutex lock; + AVCond cond; + int die; + + AVTask *tasks; +}; + +static AVTask* remove_task(AVTask **prev, AVTask *t) +{ + *prev = t->next; + t->next = NULL; + return t; +} + +static void add_task(AVTask **prev, AVTask *t) +{ + t->next = *prev; + *prev = t; +} + +static int run_one_task(AVExecutor *e, void *lc) +{ + AVTaskCallbacks *cb = &e->cb; + AVTask **prev; + + for (prev = &e->tasks; *prev && !cb->ready(*prev, cb->user_data); prev = &(*prev)->next) + /* nothing */; + if (*prev) { + AVTask *t = remove_task(prev, *prev); + ff_mutex_unlock(&e->lock); + cb->run(t, lc, cb->user_data); + ff_mutex_lock(&e->lock); + return 1; + } + return 0; +} + +#if HAVE_THREADS +static void *executor_worker_task(void *data) +{ + ThreadInfo *ti = (ThreadInfo*)data; + AVExecutor *e = ti->e; + void *lc = e->local_contexts + (ti - e->threads) * e->cb.local_context_size; + + ff_mutex_lock(&e->lock); + while (1) { + if (e->die) break; + + if (!run_one_task(e, lc)) { + //no task in one loop + ff_cond_wait(&e->cond, &e->lock); + } + } + ff_mutex_unlock(&e->lock); + return NULL; +} +#endif + +static void executor_free(AVExecutor *e, const int has_lock, const int has_cond) +{ + if (e->thread_count) { + //signal die + ff_mutex_lock(&e->lock); + e->die = 1; + ff_cond_broadcast(&e->cond); + ff_mutex_unlock(&e->lock); + + for (int i = 0; i < e->thread_count; i++) + executor_thread_join(e->threads[i].thread, NULL); + } + if (has_cond) + ff_cond_destroy(&e->cond); + if (has_lock) + ff_mutex_destroy(&e->lock); + + av_free(e->threads); + av_free(e->local_contexts); + + av_free(e); +} + +AVExecutor* av_executor_alloc(const AVTaskCallbacks *cb, int thread_count) +{ + AVExecutor *e; + int has_lock = 0, has_cond = 0; + if (!cb || !cb->user_data || !cb->ready || !cb->run || !cb->priority_higher) + return NULL; + + e = av_mallocz(sizeof(*e)); + if (!e) + return NULL; + e->cb = *cb; + + e->local_contexts = av_calloc(thread_count, e->cb.local_context_size); + if (!e->local_contexts) + goto free_executor; + + e->threads = av_calloc(thread_count, sizeof(*e->threads)); + if (!e->threads) + goto free_executor; + + has_lock = !ff_mutex_init(&e->lock, NULL); + has_cond = !ff_cond_init(&e->cond, NULL); + + if (!has_lock || !has_cond) + goto free_executor; + + for (/* nothing */; e->thread_count < thread_count; e->thread_count++) { + ThreadInfo *ti = e->threads + e->thread_count; + ti->e = e; + if (executor_thread_create(&ti->thread, NULL, executor_worker_task, ti)) + goto free_executor; + } + return e; + +free_executor: + executor_free(e, has_lock, has_cond); + return NULL; +} + +void av_executor_free(AVExecutor **executor) +{ + if (!executor || !*executor) + return; + executor_free(*executor, 1, 1); + *executor = NULL; +} + +void av_executor_execute(AVExecutor *e, AVTask *t) +{ + AVTaskCallbacks *cb = &e->cb; + AVTask **prev; + + ff_mutex_lock(&e->lock); + if (t) { + for (prev = &e->tasks; *prev && cb->priority_higher(*prev, t); prev = &(*prev)->next) + /* nothing */; + add_task(prev, t); + } + ff_cond_signal(&e->cond); + ff_mutex_unlock(&e->lock); + +#if !HAVE_THREADS + // We are running in a single-threaded environment, so we must handle all tasks ourselves + while (run_one_task(e, e->local_contexts)) + /* nothing */; +#endif +} diff --git a/arm/android/third_party/ffmpeg/libavutil/executor.h b/arm/android/third_party/ffmpeg/libavutil/executor.h new file mode 100644 index 00000000..c602bcb6 --- /dev/null +++ b/arm/android/third_party/ffmpeg/libavutil/executor.h @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2023 Nuo Mi + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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_EXECUTOR_H +#define AVUTIL_EXECUTOR_H + +typedef struct AVExecutor AVExecutor; +typedef struct AVTask AVTask; + +struct AVTask { + AVTask *next; +}; + +typedef struct AVTaskCallbacks { + void *user_data; + + int local_context_size; + + // return 1 if a's priority > b's priority + int (*priority_higher)(const AVTask *a, const AVTask *b); + + // task is ready for run + int (*ready)(const AVTask *t, void *user_data); + + // run the task + int (*run)(AVTask *t, void *local_context, void *user_data); +} AVTaskCallbacks; + +/** + * Alloc executor + * @param callbacks callback structure for executor + * @param thread_count worker thread number + * @return return the executor + */ +AVExecutor* av_executor_alloc(const AVTaskCallbacks *callbacks, int thread_count); + +/** + * Free executor + * @param e pointer to executor + */ +void av_executor_free(AVExecutor **e); + +/** + * Add task to executor + * @param e pointer to executor + * @param t pointer to task. If NULL, it will wakeup one work thread + */ +void av_executor_execute(AVExecutor *e, AVTask *t); + +#endif //AVUTIL_EXECUTOR_H diff --git a/arm/android/third_party/ffmpeg/libavutil/fifo.c b/arm/android/third_party/ffmpeg/libavutil/fifo.c index 51a5af6f..b0807abb 100644 --- a/arm/android/third_party/ffmpeg/libavutil/fifo.c +++ b/arm/android/third_party/ffmpeg/libavutil/fifo.c @@ -252,12 +252,12 @@ int av_fifo_read_to_cb(AVFifo *f, AVFifoCB write_cb, return ret; } -int av_fifo_peek(AVFifo *f, void *buf, size_t nb_elems, size_t offset) +int av_fifo_peek(const AVFifo *f, void *buf, size_t nb_elems, size_t offset) { return fifo_peek_common(f, buf, &nb_elems, offset, NULL, NULL); } -int av_fifo_peek_to_cb(AVFifo *f, AVFifoCB write_cb, void *opaque, +int av_fifo_peek_to_cb(const AVFifo *f, AVFifoCB write_cb, void *opaque, size_t *nb_elems, size_t offset) { return fifo_peek_common(f, NULL, nb_elems, offset, write_cb, opaque); @@ -293,6 +293,7 @@ void av_fifo_freep2(AVFifo **f) #if FF_API_FIFO_OLD_API +#include "internal.h" FF_DISABLE_DEPRECATION_WARNINGS #define OLD_FIFO_SIZE_MAX (size_t)FFMIN3(INT_MAX, UINT32_MAX, SIZE_MAX) diff --git a/arm/android/third_party/ffmpeg/libavutil/fifo.h b/arm/android/third_party/ffmpeg/libavutil/fifo.h index 70f9376d..ce3a2aed 100644 --- a/arm/android/third_party/ffmpeg/libavutil/fifo.h +++ b/arm/android/third_party/ffmpeg/libavutil/fifo.h @@ -200,7 +200,7 @@ int av_fifo_read_to_cb(AVFifo *f, AVFifoCB write_cb, * * @return a non-negative number on success, a negative error code on failure */ -int av_fifo_peek(AVFifo *f, void *buf, size_t nb_elems, size_t offset); +int av_fifo_peek(const AVFifo *f, void *buf, size_t nb_elems, size_t offset); /** * Feed data from a FIFO into a user-provided callback. @@ -217,7 +217,7 @@ int av_fifo_peek(AVFifo *f, void *buf, size_t nb_elems, size_t offset); * * @return a non-negative number on success, a negative error code on failure */ -int av_fifo_peek_to_cb(AVFifo *f, AVFifoCB write_cb, void *opaque, +int av_fifo_peek_to_cb(const AVFifo *f, AVFifoCB write_cb, void *opaque, size_t *nb_elems, size_t offset); /** diff --git a/arm/android/third_party/ffmpeg/libavutil/file.c b/arm/android/third_party/ffmpeg/libavutil/file.c index 6a2f3aa9..cc17885b 100644 --- a/arm/android/third_party/ffmpeg/libavutil/file.c +++ b/arm/android/third_party/ffmpeg/libavutil/file.c @@ -17,6 +17,7 @@ */ #include "config.h" +#include "error.h" #include "file.h" #include "file_open.h" #include "internal.h" diff --git a/arm/android/third_party/ffmpeg/libavutil/frame.c b/arm/android/third_party/ffmpeg/libavutil/frame.c index b6cee2d8..a3f07ca0 100644 --- a/arm/android/third_party/ffmpeg/libavutil/frame.c +++ b/arm/android/third_party/ffmpeg/libavutil/frame.c @@ -833,7 +833,6 @@ AVFrameSideData *av_frame_get_side_data(const AVFrame *frame, static int frame_copy_video(AVFrame *dst, const AVFrame *src) { - const uint8_t *src_data[4]; int planes; if (dst->width < src->width || @@ -848,10 +847,9 @@ static int frame_copy_video(AVFrame *dst, const AVFrame *src) if (!dst->data[i] || !src->data[i]) return AVERROR(EINVAL); - memcpy(src_data, src->data, sizeof(src_data)); - av_image_copy(dst->data, dst->linesize, - src_data, src->linesize, - dst->format, src->width, src->height); + av_image_copy2(dst->data, dst->linesize, + src->data, src->linesize, + dst->format, src->width, src->height); return 0; } diff --git a/arm/android/third_party/ffmpeg/libavutil/frame.h b/arm/android/third_party/ffmpeg/libavutil/frame.h index 575ded3c..516e84d7 100644 --- a/arm/android/third_party/ffmpeg/libavutil/frame.h +++ b/arm/android/third_party/ffmpeg/libavutil/frame.h @@ -214,6 +214,16 @@ enum AVFrameSideDataType { * Ambient viewing environment metadata, as defined by H.274. */ AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT, + + /** + * Provide encoder-specific hinting information about changed/unchanged + * portions of a frame. It can be used to pass information about which + * macroblocks can be skipped because they didn't change from the + * corresponding ones in the previous frame. This could be useful for + * applications which know this information in advance to speed up + * encoding. + */ + AV_FRAME_DATA_VIDEO_HINT, }; enum AVActiveFormatDescription { diff --git a/arm/android/third_party/ffmpeg/libavutil/hash.c b/arm/android/third_party/ffmpeg/libavutil/hash.c index 9a497481..12333982 100644 --- a/arm/android/third_party/ffmpeg/libavutil/hash.c +++ b/arm/android/third_party/ffmpeg/libavutil/hash.c @@ -20,6 +20,8 @@ #include #include +#include +#include #include "hash.h" #include "adler32.h" diff --git a/arm/android/third_party/ffmpeg/libavutil/hmac.c b/arm/android/third_party/ffmpeg/libavutil/hmac.c index 7d241fc7..302d7b04 100644 --- a/arm/android/third_party/ffmpeg/libavutil/hmac.c +++ b/arm/android/third_party/ffmpeg/libavutil/hmac.c @@ -23,6 +23,7 @@ #include #include "attributes.h" +#include "error.h" #include "hmac.h" #include "md5.h" #include "sha.h" diff --git a/arm/android/third_party/ffmpeg/libavutil/hwcontext.c b/arm/android/third_party/ffmpeg/libavutil/hwcontext.c index 33965982..3650d465 100644 --- a/arm/android/third_party/ffmpeg/libavutil/hwcontext.c +++ b/arm/android/third_party/ffmpeg/libavutil/hwcontext.c @@ -819,8 +819,7 @@ int av_hwframe_map(AVFrame *dst, const AVFrame *src, int flags) return AVERROR(EINVAL); } hwmap = (HWMapDescriptor*)src->buf[0]->data; - av_frame_unref(dst); - return av_frame_ref(dst, hwmap->source); + return av_frame_replace(dst, hwmap->source); } } @@ -950,6 +949,5 @@ fail: int ff_hwframe_map_replace(AVFrame *dst, const AVFrame *src) { HWMapDescriptor *hwmap = (HWMapDescriptor*)dst->buf[0]->data; - av_frame_unref(hwmap->source); - return av_frame_ref(hwmap->source, src); + return av_frame_replace(hwmap->source, src); } diff --git a/arm/android/third_party/ffmpeg/libavutil/hwcontext_cuda.c b/arm/android/third_party/ffmpeg/libavutil/hwcontext_cuda.c index 4b298fa9..0312d3b9 100644 --- a/arm/android/third_party/ffmpeg/libavutil/hwcontext_cuda.c +++ b/arm/android/third_party/ffmpeg/libavutil/hwcontext_cuda.c @@ -290,7 +290,7 @@ static void cuda_device_uninit(AVHWDeviceContext *device_ctx) if (hwctx->internal->is_allocated && hwctx->cuda_ctx) { if (hwctx->internal->flags & AV_CUDA_USE_PRIMARY_CONTEXT) CHECK_CU(cu->cuDevicePrimaryCtxRelease(hwctx->internal->cuda_device)); - else + else if (!(hwctx->internal->flags & AV_CUDA_USE_CURRENT_CONTEXT)) CHECK_CU(cu->cuCtxDestroy(hwctx->cuda_ctx)); hwctx->cuda_ctx = NULL; @@ -361,6 +361,11 @@ static int cuda_context_init(AVHWDeviceContext *device_ctx, int flags) { hwctx->internal->cuda_device)); if (ret < 0) return ret; + } else if (flags & AV_CUDA_USE_CURRENT_CONTEXT) { + ret = CHECK_CU(cu->cuCtxGetCurrent(&hwctx->cuda_ctx)); + if (ret < 0) + return ret; + av_log(device_ctx, AV_LOG_INFO, "Using current CUDA context.\n"); } else { ret = CHECK_CU(cu->cuCtxCreate(&hwctx->cuda_ctx, desired_flags, hwctx->internal->cuda_device)); @@ -382,8 +387,21 @@ static int cuda_flags_from_opts(AVHWDeviceContext *device_ctx, AVDictionary *opts, int *flags) { AVDictionaryEntry *primary_ctx_opt = av_dict_get(opts, "primary_ctx", NULL, 0); + AVDictionaryEntry *current_ctx_opt = av_dict_get(opts, "current_ctx", NULL, 0); - if (primary_ctx_opt && strtol(primary_ctx_opt->value, NULL, 10)) { + int use_primary_ctx = 0, use_current_ctx = 0; + if (primary_ctx_opt) + use_primary_ctx = strtol(primary_ctx_opt->value, NULL, 10); + + if (current_ctx_opt) + use_current_ctx = strtol(current_ctx_opt->value, NULL, 10); + + if (use_primary_ctx && use_current_ctx) { + av_log(device_ctx, AV_LOG_ERROR, "Requested both primary and current CUDA context simultaneously.\n"); + return AVERROR(EINVAL); + } + + if (primary_ctx_opt && use_primary_ctx) { av_log(device_ctx, AV_LOG_VERBOSE, "Using CUDA primary device context\n"); *flags |= AV_CUDA_USE_PRIMARY_CONTEXT; } else if (primary_ctx_opt) { @@ -391,6 +409,14 @@ static int cuda_flags_from_opts(AVHWDeviceContext *device_ctx, *flags &= ~AV_CUDA_USE_PRIMARY_CONTEXT; } + if (current_ctx_opt && use_current_ctx) { + av_log(device_ctx, AV_LOG_VERBOSE, "Using CUDA current device context\n"); + *flags |= AV_CUDA_USE_CURRENT_CONTEXT; + } else if (current_ctx_opt) { + av_log(device_ctx, AV_LOG_VERBOSE, "Disabling use of CUDA current device context\n"); + *flags &= ~AV_CUDA_USE_CURRENT_CONTEXT; + } + return 0; } diff --git a/arm/android/third_party/ffmpeg/libavutil/hwcontext_cuda.h b/arm/android/third_party/ffmpeg/libavutil/hwcontext_cuda.h index cefbe0ce..cbad434f 100644 --- a/arm/android/third_party/ffmpeg/libavutil/hwcontext_cuda.h +++ b/arm/android/third_party/ffmpeg/libavutil/hwcontext_cuda.h @@ -62,6 +62,11 @@ typedef struct AVCUDADeviceContext { */ #define AV_CUDA_USE_PRIMARY_CONTEXT (1 << 0) +/** + * Use current device context instead of creating a new one. + */ +#define AV_CUDA_USE_CURRENT_CONTEXT (1 << 1) + /** * @} */ diff --git a/arm/android/third_party/ffmpeg/libavutil/hwcontext_d3d11va.c b/arm/android/third_party/ffmpeg/libavutil/hwcontext_d3d11va.c index aa50538d..cc8c97d2 100644 --- a/arm/android/third_party/ffmpeg/libavutil/hwcontext_d3d11va.c +++ b/arm/android/third_party/ffmpeg/libavutil/hwcontext_d3d11va.c @@ -452,8 +452,8 @@ static int d3d11va_transfer_data(AVHWFramesContext *ctx, AVFrame *dst, fill_texture_ptrs(map_data, map_linesize, ctx, &desc, &map); - av_image_copy(dst->data, dst->linesize, (const uint8_t **)map_data, map_linesize, - ctx->sw_format, w, h); + av_image_copy2(dst->data, dst->linesize, map_data, map_linesize, + ctx->sw_format, w, h); ID3D11DeviceContext_Unmap(device_hwctx->device_context, staging, 0); } else { @@ -464,8 +464,8 @@ static int d3d11va_transfer_data(AVHWFramesContext *ctx, AVFrame *dst, fill_texture_ptrs(map_data, map_linesize, ctx, &desc, &map); - av_image_copy(map_data, map_linesize, (const uint8_t **)src->data, src->linesize, - ctx->sw_format, w, h); + av_image_copy2(map_data, map_linesize, src->data, src->linesize, + ctx->sw_format, w, h); ID3D11DeviceContext_Unmap(device_hwctx->device_context, staging, 0); diff --git a/arm/android/third_party/ffmpeg/libavutil/hwcontext_dxva2.c b/arm/android/third_party/ffmpeg/libavutil/hwcontext_dxva2.c index ea378df7..2c11f151 100644 --- a/arm/android/third_party/ffmpeg/libavutil/hwcontext_dxva2.c +++ b/arm/android/third_party/ffmpeg/libavutil/hwcontext_dxva2.c @@ -356,8 +356,8 @@ static int dxva2_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst, if (ret < 0) goto fail; - av_image_copy(map->data, map->linesize, (const uint8_t **)src->data, src->linesize, - ctx->sw_format, src->width, src->height); + av_image_copy2(map->data, map->linesize, src->data, src->linesize, + ctx->sw_format, src->width, src->height); fail: av_frame_free(&map); diff --git a/arm/android/third_party/ffmpeg/libavutil/hwcontext_qsv.c b/arm/android/third_party/ffmpeg/libavutil/hwcontext_qsv.c index d4b564ba..1bfda9e6 100644 --- a/arm/android/third_party/ffmpeg/libavutil/hwcontext_qsv.c +++ b/arm/android/third_party/ffmpeg/libavutil/hwcontext_qsv.c @@ -1902,7 +1902,7 @@ static int qsv_map_to(AVHWFramesContext *dst_ctx, case AV_PIX_FMT_VAAPI: { mfxHDLPair *pair = (mfxHDLPair*)hwctx->surfaces[i].Data.MemId; - if (*(VASurfaceID*)pair->first == (VASurfaceID)src->data[3]) { + if (*(VASurfaceID*)pair->first == (VASurfaceID)(uintptr_t)src->data[3]) { index = i; break; } diff --git a/arm/android/third_party/ffmpeg/libavutil/hwcontext_vaapi.c b/arm/android/third_party/ffmpeg/libavutil/hwcontext_vaapi.c index 6c3a227d..558fed94 100644 --- a/arm/android/third_party/ffmpeg/libavutil/hwcontext_vaapi.c +++ b/arm/android/third_party/ffmpeg/libavutil/hwcontext_vaapi.c @@ -1048,6 +1048,9 @@ static const struct { #if defined(VA_FOURCC_Y412) && defined(DRM_FORMAT_XVYU12_16161616) DRM_MAP(Y412, 1, DRM_FORMAT_XVYU12_16161616), #endif +#if defined(VA_FOURCC_X2R10G10B10) && defined(DRM_FORMAT_XRGB2101010) + DRM_MAP(X2R10G10B10, 1, DRM_FORMAT_XRGB2101010), +#endif }; #undef DRM_MAP diff --git a/arm/android/third_party/ffmpeg/libavutil/hwcontext_vulkan.c b/arm/android/third_party/ffmpeg/libavutil/hwcontext_vulkan.c index 75314f14..c676f4fc 100644 --- a/arm/android/third_party/ffmpeg/libavutil/hwcontext_vulkan.c +++ b/arm/android/third_party/ffmpeg/libavutil/hwcontext_vulkan.c @@ -99,6 +99,7 @@ typedef struct VulkanDevicePriv { VkPhysicalDeviceVulkan13Features device_features_1_3; VkPhysicalDeviceDescriptorBufferFeaturesEXT desc_buf_features; VkPhysicalDeviceShaderAtomicFloatFeaturesEXT atomic_float_features; + VkPhysicalDeviceCooperativeMatrixFeaturesKHR coop_matrix_features; /* Queues */ pthread_mutex_t **qf_mutex; @@ -405,6 +406,7 @@ static const VulkanOptExtension optional_device_exts[] = { { VK_EXT_DESCRIPTOR_BUFFER_EXTENSION_NAME, FF_VK_EXT_DESCRIPTOR_BUFFER, }, { VK_EXT_PHYSICAL_DEVICE_DRM_EXTENSION_NAME, FF_VK_EXT_DEVICE_DRM }, { VK_EXT_SHADER_ATOMIC_FLOAT_EXTENSION_NAME, FF_VK_EXT_ATOMIC_FLOAT }, + { VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME, FF_VK_EXT_COOP_MATRIX }, /* Imports/exports */ { VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME, FF_VK_EXT_EXTERNAL_FD_MEMORY }, @@ -1202,9 +1204,13 @@ static int vulkan_device_create_internal(AVHWDeviceContext *ctx, VkPhysicalDeviceTimelineSemaphoreFeatures timeline_features = { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES, }; + VkPhysicalDeviceCooperativeMatrixFeaturesKHR coop_matrix_features = { + .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR, + .pNext = &timeline_features, + }; VkPhysicalDeviceShaderAtomicFloatFeaturesEXT atomic_float_features = { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT, - .pNext = &timeline_features, + .pNext = &coop_matrix_features, }; VkPhysicalDeviceDescriptorBufferFeaturesEXT desc_buf_features = { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT, @@ -1242,7 +1248,9 @@ static int vulkan_device_create_internal(AVHWDeviceContext *ctx, p->desc_buf_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT; p->desc_buf_features.pNext = &p->atomic_float_features; p->atomic_float_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT; - p->atomic_float_features.pNext = NULL; + p->atomic_float_features.pNext = &p->coop_matrix_features; + p->coop_matrix_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR; + p->coop_matrix_features.pNext = NULL; ctx->free = vulkan_device_free; @@ -1304,6 +1312,8 @@ static int vulkan_device_create_internal(AVHWDeviceContext *ctx, p->atomic_float_features.shaderBufferFloat32Atomics = atomic_float_features.shaderBufferFloat32Atomics; p->atomic_float_features.shaderBufferFloat32AtomicAdd = atomic_float_features.shaderBufferFloat32AtomicAdd; + p->coop_matrix_features.cooperativeMatrix = coop_matrix_features.cooperativeMatrix; + dev_info.pNext = &hwctx->device_features; /* Setup queue family */ @@ -1768,19 +1778,18 @@ static void vulkan_free_internal(AVVkFrame *f) av_freep(&f->internal); } -static void vulkan_frame_free(void *opaque, uint8_t *data) +static void vulkan_frame_free(AVHWFramesContext *hwfc, AVVkFrame *f) { - AVVkFrame *f = (AVVkFrame *)data; - AVHWFramesContext *hwfc = opaque; AVVulkanDeviceContext *hwctx = hwfc->device_ctx->hwctx; VulkanDevicePriv *p = hwfc->device_ctx->internal->priv; FFVulkanFunctions *vk = &p->vkctx.vkfn; int nb_images = ff_vk_count_images(f); VkSemaphoreWaitInfo sem_wait = { - .sType = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO, - .pSemaphores = f->sem, - .pValues = f->sem_value, + .sType = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO, + .flags = 0x0, + .pSemaphores = f->sem, + .pValues = f->sem_value, .semaphoreCount = nb_images, }; @@ -1797,6 +1806,11 @@ static void vulkan_frame_free(void *opaque, uint8_t *data) av_free(f); } +static void vulkan_frame_free_cb(void *opaque, uint8_t *data) +{ + vulkan_frame_free(opaque, (AVVkFrame*)data); +} + static int alloc_bind_mem(AVHWFramesContext *hwfc, AVVkFrame *f, void *alloc_pnext, size_t alloc_pnext_stride) { @@ -2077,7 +2091,7 @@ static int create_frame(AVHWFramesContext *hwfc, AVVkFrame **frame, return 0; fail: - vulkan_frame_free(hwfc, (uint8_t *)f); + vulkan_frame_free(hwfc, f); return err; } @@ -2179,7 +2193,8 @@ static AVBufferRef *vulkan_pool_alloc(void *opaque, size_t size) } err = create_frame(hwfc, &f, hwctx->tiling, hwctx->usage, hwctx->img_flags, - hwctx->nb_layers, eiinfo.handleTypes ? &eiinfo : NULL); + hwctx->nb_layers, + eiinfo.handleTypes ? &eiinfo : hwctx->create_pnext); if (err) return NULL; @@ -2198,14 +2213,14 @@ static AVBufferRef *vulkan_pool_alloc(void *opaque, size_t size) goto fail; avbuf = av_buffer_create((uint8_t *)f, sizeof(AVVkFrame), - vulkan_frame_free, hwfc, 0); + vulkan_frame_free_cb, hwfc, 0); if (!avbuf) goto fail; return avbuf; fail: - vulkan_frame_free(hwfc, (uint8_t *)f); + vulkan_frame_free(hwfc, f); return NULL; } @@ -2346,7 +2361,7 @@ static int vulkan_frames_init(AVHWFramesContext *hwfc) if (err) return err; - vulkan_frame_free(hwfc, (uint8_t *)f); + vulkan_frame_free(hwfc, f); /* If user did not specify a pool, hwfc->pool will be set to the internal one * in hwcontext.c just after this gets called */ @@ -2393,31 +2408,7 @@ static int vulkan_transfer_get_formats(AVHWFramesContext *hwfc, #if CONFIG_LIBDRM static void vulkan_unmap_from_drm(AVHWFramesContext *hwfc, HWMapDescriptor *hwmap) { - AVVkFrame *f = hwmap->priv; - AVVulkanDeviceContext *hwctx = hwfc->device_ctx->hwctx; - VulkanDevicePriv *p = hwfc->device_ctx->internal->priv; - FFVulkanFunctions *vk = &p->vkctx.vkfn; - const int nb_images = ff_vk_count_images(f); - - VkSemaphoreWaitInfo wait_info = { - .sType = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO, - .flags = 0x0, - .pSemaphores = f->sem, - .pValues = f->sem_value, - .semaphoreCount = nb_images, - }; - - vk->WaitSemaphores(hwctx->act_dev, &wait_info, UINT64_MAX); - - vulkan_free_internal(f); - - for (int i = 0; i < nb_images; i++) { - vk->DestroyImage(hwctx->act_dev, f->img[i], hwctx->alloc); - vk->FreeMemory(hwctx->act_dev, f->mem[i], hwctx->alloc); - vk->DestroySemaphore(hwctx->act_dev, f->sem[i], hwctx->alloc); - } - - av_free(f); + vulkan_frame_free(hwfc, hwmap->priv); } static const struct { @@ -2755,7 +2746,7 @@ static int vulkan_map_from_drm(AVHWFramesContext *hwfc, AVFrame *dst, return 0; fail: - vulkan_frame_free(hwfc->device_ctx->hwctx, (uint8_t *)f); + vulkan_frame_free(hwfc->device_ctx->hwctx, f); dst->data[0] = NULL; return err; } @@ -3054,7 +3045,6 @@ static int vulkan_transfer_data_from_cuda(AVHWFramesContext *hwfc, fail: CHECK_CU(cu->cuCtxPopCurrent(&dummy)); vulkan_free_internal(dst_f); - dst_f->internal = NULL; av_buffer_unref(&dst->buf[0]); return err; } @@ -3631,7 +3621,6 @@ static int vulkan_transfer_data_to_cuda(AVHWFramesContext *hwfc, AVFrame *dst, fail: CHECK_CU(cu->cuCtxPopCurrent(&dummy)); vulkan_free_internal(dst_f); - dst_f->internal = NULL; av_buffer_unref(&dst->buf[0]); return err; } diff --git a/arm/android/third_party/ffmpeg/libavutil/imgutils.c b/arm/android/third_party/ffmpeg/libavutil/imgutils.c index 9ab5757c..da381269 100644 --- a/arm/android/third_party/ffmpeg/libavutil/imgutils.c +++ b/arm/android/third_party/ffmpeg/libavutil/imgutils.c @@ -378,8 +378,8 @@ void av_image_copy_plane(uint8_t *dst, int dst_linesize, image_copy_plane(dst, dst_linesize, src, src_linesize, bytewidth, height); } -static void image_copy(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4], - const uint8_t *src_data[4], const ptrdiff_t src_linesizes[4], +static void image_copy(uint8_t *const dst_data[4], const ptrdiff_t dst_linesizes[4], + const uint8_t *const src_data[4], const ptrdiff_t src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height, void (*copy_plane)(uint8_t *, ptrdiff_t, const uint8_t *, ptrdiff_t, ptrdiff_t, int)) @@ -419,8 +419,8 @@ static void image_copy(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4], } } -void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], - const uint8_t *src_data[4], const int src_linesizes[4], +void av_image_copy(uint8_t *const dst_data[4], const int dst_linesizes[4], + const uint8_t * const src_data[4], const int src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height) { ptrdiff_t dst_linesizes1[4], src_linesizes1[4]; @@ -435,8 +435,8 @@ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], width, height, image_copy_plane); } -void av_image_copy_uc_from(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4], - const uint8_t *src_data[4], const ptrdiff_t src_linesizes[4], +void av_image_copy_uc_from(uint8_t * const dst_data[4], const ptrdiff_t dst_linesizes[4], + const uint8_t * const src_data[4], const ptrdiff_t src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height) { image_copy(dst_data, dst_linesizes, src_data, src_linesizes, pix_fmt, @@ -579,7 +579,7 @@ static void memset_bytes(uint8_t *dst, size_t dst_size, uint8_t *clear, // if it's a subsampled packed format). #define MAX_BLOCK_SIZE 32 -int av_image_fill_black(uint8_t *dst_data[4], const ptrdiff_t dst_linesize[4], +int av_image_fill_black(uint8_t * const dst_data[4], const ptrdiff_t dst_linesize[4], enum AVPixelFormat pix_fmt, enum AVColorRange range, int width, int height) { diff --git a/arm/android/third_party/ffmpeg/libavutil/imgutils.h b/arm/android/third_party/ffmpeg/libavutil/imgutils.h index e10ac149..fa3bb101 100644 --- a/arm/android/third_party/ffmpeg/libavutil/imgutils.h +++ b/arm/android/third_party/ffmpeg/libavutil/imgutils.h @@ -170,10 +170,26 @@ void av_image_copy_plane_uc_from(uint8_t *dst, ptrdiff_t dst_linesize, * @param width width of the image in pixels * @param height height of the image in pixels */ -void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], - const uint8_t *src_data[4], const int src_linesizes[4], +void av_image_copy(uint8_t * const dst_data[4], const int dst_linesizes[4], + const uint8_t * const src_data[4], const int src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height); +/** + * Wrapper around av_image_copy() to workaround the limitation + * that the conversion from uint8_t * const * to const uint8_t * const * + * is not performed automatically in C. + * @see av_image_copy() + */ +static inline +void av_image_copy2(uint8_t * const dst_data[4], const int dst_linesizes[4], + uint8_t * const src_data[4], const int src_linesizes[4], + enum AVPixelFormat pix_fmt, int width, int height) +{ + av_image_copy(dst_data, dst_linesizes, + (const uint8_t * const *)src_data, src_linesizes, + pix_fmt, width, height); +} + /** * Copy image data located in uncacheable (e.g. GPU mapped) memory. Where * available, this function will use special functionality for reading from such @@ -188,8 +204,8 @@ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], * @note On x86, the linesizes currently need to be aligned to the cacheline * size (i.e. 64) to get improved performance. */ -void av_image_copy_uc_from(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4], - const uint8_t *src_data[4], const ptrdiff_t src_linesizes[4], +void av_image_copy_uc_from(uint8_t * const dst_data[4], const ptrdiff_t dst_linesizes[4], + const uint8_t * const src_data[4], const ptrdiff_t src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height); /** @@ -319,7 +335,7 @@ int av_image_check_sar(unsigned int w, unsigned int h, AVRational sar); * @param height the height of the image in pixels * @return 0 if the image data was cleared, a negative AVERROR code otherwise */ -int av_image_fill_black(uint8_t *dst_data[4], const ptrdiff_t dst_linesize[4], +int av_image_fill_black(uint8_t * const dst_data[4], const ptrdiff_t dst_linesize[4], enum AVPixelFormat pix_fmt, enum AVColorRange range, int width, int height); diff --git a/arm/android/third_party/ffmpeg/libavutil/internal.h b/arm/android/third_party/ffmpeg/libavutil/internal.h index a71c39e0..d612acd2 100644 --- a/arm/android/third_party/ffmpeg/libavutil/internal.h +++ b/arm/android/third_party/ffmpeg/libavutil/internal.h @@ -43,14 +43,6 @@ #include "macros.h" #include "pixfmt.h" -#if ARCH_X86 -# include "x86/emms.h" -#endif - -#ifndef emms_c -# define emms_c() do {} while(0) -#endif - #ifndef attribute_align_arg #if ARCH_X86_32 && AV_GCC_VERSION_AT_LEAST(4,2) # define attribute_align_arg __attribute__((force_align_arg_pointer)) diff --git a/arm/android/third_party/ffmpeg/libavutil/intreadwrite.h b/arm/android/third_party/ffmpeg/libavutil/intreadwrite.h index 4c8413a5..21df7887 100644 --- a/arm/android/third_party/ffmpeg/libavutil/intreadwrite.h +++ b/arm/android/third_party/ffmpeg/libavutil/intreadwrite.h @@ -72,8 +72,6 @@ typedef union { # include "mips/intreadwrite.h" #elif ARCH_PPC # include "ppc/intreadwrite.h" -#elif ARCH_TOMI -# include "tomi/intreadwrite.h" #elif ARCH_X86 # include "x86/intreadwrite.h" #endif @@ -215,7 +213,7 @@ typedef union { * by per-arch headers. */ -#if defined(__GNUC__) +#if defined(__GNUC__) || defined(__clang__) union unaligned_64 { uint64_t l; } __attribute__((packed)) av_alias; union unaligned_32 { uint32_t l; } __attribute__((packed)) av_alias; diff --git a/arm/android/third_party/ffmpeg/libavutil/md5.c b/arm/android/third_party/ffmpeg/libavutil/md5.c index 0170d8dd..c01820da 100644 --- a/arm/android/third_party/ffmpeg/libavutil/md5.c +++ b/arm/android/third_party/ffmpeg/libavutil/md5.c @@ -31,9 +31,11 @@ */ #include +#include #include "bswap.h" #include "intreadwrite.h" +#include "macros.h" #include "mem.h" #include "md5.h" diff --git a/arm/android/third_party/ffmpeg/libavutil/mem.h b/arm/android/third_party/ffmpeg/libavutil/mem.h index 62b4ca6e..ab7648ac 100644 --- a/arm/android/third_party/ffmpeg/libavutil/mem.h +++ b/arm/android/third_party/ffmpeg/libavutil/mem.h @@ -27,12 +27,10 @@ #ifndef AVUTIL_MEM_H #define AVUTIL_MEM_H -#include +#include #include #include "attributes.h" -#include "avutil.h" -#include "version.h" /** * @addtogroup lavu_mem diff --git a/arm/android/third_party/ffmpeg/libavutil/murmur3.c b/arm/android/third_party/ffmpeg/libavutil/murmur3.c index f2e2a9ea..c88a236a 100644 --- a/arm/android/third_party/ffmpeg/libavutil/murmur3.c +++ b/arm/android/third_party/ffmpeg/libavutil/murmur3.c @@ -20,6 +20,7 @@ #include #include +#include #include "mem.h" #include "intreadwrite.h" #include "murmur3.h" diff --git a/arm/android/third_party/ffmpeg/libavutil/pixdesc.c b/arm/android/third_party/ffmpeg/libavutil/pixdesc.c index e1e0dd2a..6ded9467 100644 --- a/arm/android/third_party/ffmpeg/libavutil/pixdesc.c +++ b/arm/android/third_party/ffmpeg/libavutil/pixdesc.c @@ -2223,6 +2223,34 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { }, .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE, }, + [AV_PIX_FMT_GBRAP14LE] = { + .name = "gbrap14le", + .nb_components = 4, + .log2_chroma_w = 0, + .log2_chroma_h = 0, + .comp = { + { 2, 2, 0, 0, 14 }, /* R */ + { 0, 2, 0, 0, 14 }, /* G */ + { 1, 2, 0, 0, 14 }, /* B */ + { 3, 2, 0, 0, 14 }, /* A */ + }, + .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB | + AV_PIX_FMT_FLAG_ALPHA, + }, + [AV_PIX_FMT_GBRAP14BE] = { + .name = "gbrap14be", + .nb_components = 4, + .log2_chroma_w = 0, + .log2_chroma_h = 0, + .comp = { + { 2, 2, 0, 0, 14 }, /* R */ + { 0, 2, 0, 0, 14 }, /* G */ + { 1, 2, 0, 0, 14 }, /* B */ + { 3, 2, 0, 0, 14 }, /* A */ + }, + .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | + AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA, + }, [AV_PIX_FMT_GBRAP12LE] = { .name = "gbrap12le", .nb_components = 4, diff --git a/arm/android/third_party/ffmpeg/libavutil/pixfmt.h b/arm/android/third_party/ffmpeg/libavutil/pixfmt.h index 63e07ba6..a26c72d5 100644 --- a/arm/android/third_party/ffmpeg/libavutil/pixfmt.h +++ b/arm/android/third_party/ffmpeg/libavutil/pixfmt.h @@ -426,6 +426,9 @@ enum AVPixelFormat { AV_PIX_FMT_P412BE, ///< interleaved chroma YUV 4:4:4, 36bpp, data in the high bits, big-endian AV_PIX_FMT_P412LE, ///< interleaved chroma YUV 4:4:4, 36bpp, data in the high bits, little-endian + AV_PIX_FMT_GBRAP14BE, ///< planar GBR 4:4:4:4 56bpp, big-endian + AV_PIX_FMT_GBRAP14LE, ///< planar GBR 4:4:4:4 56bpp, little-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 }; @@ -484,6 +487,7 @@ enum AVPixelFormat { #define AV_PIX_FMT_GBRP16 AV_PIX_FMT_NE(GBRP16BE, GBRP16LE) #define AV_PIX_FMT_GBRAP10 AV_PIX_FMT_NE(GBRAP10BE, GBRAP10LE) #define AV_PIX_FMT_GBRAP12 AV_PIX_FMT_NE(GBRAP12BE, GBRAP12LE) +#define AV_PIX_FMT_GBRAP14 AV_PIX_FMT_NE(GBRAP14BE, GBRAP14LE) #define AV_PIX_FMT_GBRAP16 AV_PIX_FMT_NE(GBRAP16BE, GBRAP16LE) #define AV_PIX_FMT_BAYER_BGGR16 AV_PIX_FMT_NE(BAYER_BGGR16BE, BAYER_BGGR16LE) diff --git a/arm/android/third_party/ffmpeg/libavutil/riscv/bswap_rvb.S b/arm/android/third_party/ffmpeg/libavutil/riscv/bswap_rvb.S new file mode 100644 index 00000000..3ff53ccb --- /dev/null +++ b/arm/android/third_party/ffmpeg/libavutil/riscv/bswap_rvb.S @@ -0,0 +1,65 @@ +/* + * Copyright © 2022 Rémi Denis-Courmont. + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#if (__riscv_xlen >= 64) + .macro bswap32_rvb out, in, count + andi t0, \count, 4 + beqz t0, 1f + /* Align input to 64-bit */ + lwu t0, (\in) + addi \out, \out, 4 + rev8 t0, t0 + addi \count, \count, -1 + srli t0, t0, __riscv_xlen - 32 + addi \in, \in, 4 + sw t0, -4(\out) +1: + andi t3, \count, -2 + sh2add \count, \count, \out + beqz t3, 3f + sh2add t3, t3, \out +2: /* 2 elements (64 bits) at a time on a 64-bit boundary */ + ld t0, (\in) + addi \out, \out, 8 + rev8 t0, t0 +#if (__riscv_xlen == 64) + srli t2, t0, 32 + sw t0, -4(\out) +#else + srli t1, t0, __riscv_xlen - 64 + srli t2, t0, __riscv_xlen - 32 + sw t1, -4(\out) +#endif + addi \in, \in, 8 + sw t2, -8(\out) + bne \out, t3, 2b +3: + beq \out, \count, 5f +4: /* Process last element */ + lwu t0, (\in) + addi \out, \out, 4 + rev8 t0, t0 + addi \in, \in, 4 + srli t0, t0, __riscv_xlen - 32 + sw t0, -4(\out) +5: + ret + .endm +#endif diff --git a/arm/android/third_party/ffmpeg/libavutil/riscv/float_dsp_rvv.S b/arm/android/third_party/ffmpeg/libavutil/riscv/float_dsp_rvv.S index 7cfc890b..91b70bf1 100644 --- a/arm/android/third_party/ffmpeg/libavutil/riscv/float_dsp_rvv.S +++ b/arm/android/third_party/ffmpeg/libavutil/riscv/float_dsp_rvv.S @@ -75,32 +75,37 @@ endfunc func ff_vector_fmul_window_rvv, zve32f // a0: dst, a1: src0, a2: src1, a3: window, a4: length - addi t0, a4, -1 - add t1, t0, a4 - sh2add a2, t0, a2 - sh2add t0, t1, a0 - sh2add t3, t1, a3 - li t1, -4 // byte stride + vsetvli t0, zero, e16, m4, ta, ma + sh2add a2, a4, a2 + vid.v v0 + sh3add t3, a4, a3 + vadd.vi v0, v0, 1 + sh3add t0, a4, a0 1: - vsetvli t2, a4, e32, m4, ta, ma - vle32.v v16, (a1) + vsetvli t2, a4, e16, m2, ta, ma slli t4, t2, 2 - vlse32.v v20, (a2), t1 - sub a4, a4, t2 - vle32.v v24, (a3) - add a1, a1, t4 - vlse32.v v28, (t3), t1 - sub a2, a2, t4 - vfmul.vv v0, v16, v28 - add a3, a3, t4 - vfmul.vv v8, v16, v24 + vrsub.vx v2, v0, t2 sub t3, t3, t4 - vfnmsac.vv v0, v20, v24 - vfmacc.vv v8, v20, v28 - vse32.v v0, (a0) - add a0, a0, t4 - vsse32.v v8, (t0), t1 + vsetvli zero, zero, e32, m4, ta, ma + sub a2, a2, t4 + vle32.v v8, (t3) sub t0, t0, t4 + vle32.v v4, (a2) + sub a4, a4, t2 + vrgatherei16.vv v28, v8, v2 + vle32.v v16, (a1) + add a1, a1, t4 + vrgatherei16.vv v20, v4, v2 + vle32.v v24, (a3) + add a3, a3, t4 + vfmul.vv v12, v16, v28 + vfmul.vv v16, v16, v24 + vfnmsac.vv v12, v20, v24 + vfmacc.vv v16, v20, v28 + vrgatherei16.vv v8, v16, v2 + vse32.v v12, (a0) + add a0, a0, t4 + vse32.v v8, (t0) bnez a4, 1b ret @@ -125,20 +130,25 @@ func ff_vector_fmul_add_rvv, zve32f ret endfunc +// TODO factor vrsub, separate last iteration? // (a0) = (a1) * reverse(a2) [0..a3-1] func ff_vector_fmul_reverse_rvv, zve32f + vsetvli t0, zero, e16, m4, ta, ma sh2add a2, a3, a2 - li t2, -4 // byte stride - addi a2, a2, -4 + vid.v v0 + vadd.vi v0, v0, 1 1: - vsetvli t0, a3, e32, m8, ta, ma + vsetvli t0, a3, e16, m4, ta, ma slli t1, t0, 2 - vle32.v v16, (a1) - sub a3, a3, t0 - vlse32.v v24, (a2), t2 - add a1, a1, t1 - vfmul.vv v16, v16, v24 + vrsub.vx v4, v0, t0 // v4[i] = [VL-1, VL-2... 1, 0] sub a2, a2, t1 + vsetvli zero, zero, e32, m8, ta, ma + vle32.v v8, (a2) + sub a3, a3, t0 + vle32.v v16, (a1) + add a1, a1, t1 + vrgatherei16.vv v24, v8, v4 // v24 = reverse(v8) + vfmul.vv v16, v16, v24 vse32.v v16, (a0) add a0, a0, t1 bnez a3, 1b diff --git a/arm/android/third_party/ffmpeg/libavutil/riscv/timer.h b/arm/android/third_party/ffmpeg/libavutil/riscv/timer.h index a34157a5..174b469c 100644 --- a/arm/android/third_party/ffmpeg/libavutil/riscv/timer.h +++ b/arm/android/third_party/ffmpeg/libavutil/riscv/timer.h @@ -24,21 +24,21 @@ #if HAVE_INLINE_ASM #include -static inline uint64_t rdcycle64(void) +static inline uint64_t ff_read_time(void) { #if (__riscv_xlen >= 64) uintptr_t cycles; - __asm__ volatile ("rdcycle %0" : "=r"(cycles)); + __asm__ volatile ("rdtime %0" : "=r" (cycles)); #else uint64_t cycles; uint32_t hi, lo, check; __asm__ volatile ( - "1: rdcycleh %0\n" - " rdcycle %1\n" - " rdcycleh %2\n" + "1: rdtimeh %0\n" + " rdtime %1\n" + " rdtimeh %2\n" " bne %0, %2, 1b\n" : "=r" (hi), "=r" (lo), "=r" (check)); cycles = (((uint64_t)hi) << 32) | lo; @@ -47,7 +47,8 @@ static inline uint64_t rdcycle64(void) return cycles; } -#define AV_READ_TIME rdcycle64 +#define AV_READ_TIME ff_read_time +#define FF_TIMER_UNITS "ticks" #endif #endif /* AVUTIL_RISCV_TIMER_H */ diff --git a/arm/android/third_party/ffmpeg/libavutil/samplefmt.c b/arm/android/third_party/ffmpeg/libavutil/samplefmt.c index 6d3ec34d..e1be5f05 100644 --- a/arm/android/third_party/ffmpeg/libavutil/samplefmt.c +++ b/arm/android/third_party/ffmpeg/libavutil/samplefmt.c @@ -219,7 +219,7 @@ int av_samples_alloc_array_and_samples(uint8_t ***audio_data, int *linesize, int return ret; } -int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset, +int av_samples_copy(uint8_t * const *dst, uint8_t * const *src, int dst_offset, int src_offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt) { @@ -243,7 +243,7 @@ int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset, return 0; } -int av_samples_set_silence(uint8_t **audio_data, int offset, int nb_samples, +int av_samples_set_silence(uint8_t * const *audio_data, int offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt) { int planar = av_sample_fmt_is_planar(sample_fmt); diff --git a/arm/android/third_party/ffmpeg/libavutil/samplefmt.h b/arm/android/third_party/ffmpeg/libavutil/samplefmt.h index 6bad0e25..43a57a42 100644 --- a/arm/android/third_party/ffmpeg/libavutil/samplefmt.h +++ b/arm/android/third_party/ffmpeg/libavutil/samplefmt.h @@ -246,7 +246,7 @@ int av_samples_alloc_array_and_samples(uint8_t ***audio_data, int *linesize, int * @param nb_channels number of audio channels * @param sample_fmt audio sample format */ -int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset, +int av_samples_copy(uint8_t * const *dst, uint8_t * const *src, int dst_offset, int src_offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt); @@ -259,7 +259,7 @@ int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset, * @param nb_channels number of audio channels * @param sample_fmt audio sample format */ -int av_samples_set_silence(uint8_t **audio_data, int offset, int nb_samples, +int av_samples_set_silence(uint8_t * const *audio_data, int offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt); /** diff --git a/arm/android/third_party/ffmpeg/libavutil/spherical.c b/arm/android/third_party/ffmpeg/libavutil/spherical.c index ed66344a..800d3459 100644 --- a/arm/android/third_party/ffmpeg/libavutil/spherical.c +++ b/arm/android/third_party/ffmpeg/libavutil/spherical.c @@ -19,6 +19,7 @@ */ #include "avstring.h" +#include "macros.h" #include "mem.h" #include "spherical.h" diff --git a/arm/android/third_party/ffmpeg/libavutil/tests/channel_layout.c b/arm/android/third_party/ffmpeg/libavutil/tests/channel_layout.c index 5516db09..c537e7e7 100644 --- a/arm/android/third_party/ffmpeg/libavutil/tests/channel_layout.c +++ b/arm/android/third_party/ffmpeg/libavutil/tests/channel_layout.c @@ -18,33 +18,111 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "libavutil/channel_layout.c" +#include +#include +#include + +#include "libavutil/bprint.h" +#include "libavutil/channel_layout.h" +#include "libavutil/internal.h" +#include "libavutil/mem.h" + +#define BPRINT_ARGS1(bp, ...) (bp), __VA_ARGS__ +#define BPRINT_ARGS0(bp, ...) __VA_ARGS__, (bp) +#define ORD_ARGS1(str, size, ...) (str), (size), __VA_ARGS__ +#define ORD_ARGS0(str, size, ...) __VA_ARGS__, (str), (size) + +// This macro presumes the AVBPrint to have been cleared before usage. +#define CMP_BPRINT_AND_NONBPRINT(bp, func_name, ARG_ORDER, ...) do { \ + char *str; \ + int size; \ + func_name ## _bprint(BPRINT_ARGS ## ARG_ORDER((bp), __VA_ARGS__)); \ + if (strlen((bp)->str) != (bp)->len) { \ + printf("strlen of AVBPrint-string returned by "#func_name"_bprint" \ + " differs from AVBPrint.len: %"SIZE_SPECIFIER" vs. %u\n", \ + strlen((bp)->str), (bp)->len); \ + break; \ + } \ + size = func_name(ORD_ARGS ## ARG_ORDER(NULL, 0, __VA_ARGS__)); \ + if (size <= 0) { \ + printf(#func_name " returned %d\n", size); \ + break; \ + } \ + if ((bp)->len != size - 1) { \ + printf("Return value %d of " #func_name " inconsistent with length"\ + " %u obtained from corresponding bprint version\n", \ + size, (bp)->len); \ + break; \ + } \ + str = av_malloc(size); \ + if (!str) { \ + printf("string of size %d could not be allocated.\n", size); \ + break; \ + } \ + size = func_name(ORD_ARGS ## ARG_ORDER(str, size, __VA_ARGS__)); \ + if (size <= 0 || (bp)->len != size - 1) { \ + printf("Return value %d of " #func_name " inconsistent with length"\ + " %d obtained in first pass.\n", size, (bp)->len); \ + av_free(str); \ + break; \ + } \ + if (strcmp(str, (bp)->str)) { \ + printf("Ordinary and _bprint versions of "#func_name" disagree: " \ + "'%s' vs. '%s'\n", str, (bp)->str); \ + av_free(str); \ + break; \ + } \ + av_free(str); \ + } while (0) + + +static void channel_name(AVBPrint *bp, enum AVChannel channel) +{ + av_bprint_clear(bp); + CMP_BPRINT_AND_NONBPRINT(bp, av_channel_name, 1, channel); +} + +static void channel_description(AVBPrint *bp, enum AVChannel channel) +{ + av_bprint_clear(bp); + CMP_BPRINT_AND_NONBPRINT(bp, av_channel_description, 1, channel); +} + +static void channel_layout_from_mask(AVChannelLayout *layout, + AVBPrint *bp, uint64_t channel_layout) +{ + av_channel_layout_uninit(layout); + av_bprint_clear(bp); + if (!av_channel_layout_from_mask(layout, channel_layout) && + av_channel_layout_check(layout)) + CMP_BPRINT_AND_NONBPRINT(bp, av_channel_layout_describe, 0, layout); + else + av_bprintf(bp, "fail"); +} + +static void channel_layout_from_string(AVChannelLayout *layout, + AVBPrint *bp, const char *channel_layout) +{ + av_channel_layout_uninit(layout); + av_bprint_clear(bp); + if (!av_channel_layout_from_string(layout, channel_layout) && + av_channel_layout_check(layout)) + CMP_BPRINT_AND_NONBPRINT(bp, av_channel_layout_describe, 0, layout); + else + av_bprintf(bp, "fail"); +} #define CHANNEL_NAME(x) \ - av_bprint_clear(&bp); \ - av_channel_name_bprint(&bp, x); + channel_name(&bp, (x)); #define CHANNEL_DESCRIPTION(x) \ - av_bprint_clear(&bp); \ - av_channel_description_bprint(&bp, x); + channel_description(&bp, (x)); #define CHANNEL_LAYOUT_FROM_MASK(x) \ - av_channel_layout_uninit(&layout); \ - av_bprint_clear(&bp); \ - if (!av_channel_layout_from_mask(&layout, x) && \ - av_channel_layout_check(&layout)) \ - av_channel_layout_describe_bprint(&layout, &bp); \ - else \ - av_bprintf(&bp, "fail"); + channel_layout_from_mask(&layout, &bp, (x)); #define CHANNEL_LAYOUT_FROM_STRING(x) \ - av_channel_layout_uninit(&layout); \ - av_bprint_clear(&bp); \ - if (!av_channel_layout_from_string(&layout, x) && \ - av_channel_layout_check(&layout)) \ - av_channel_layout_describe_bprint(&layout, &bp); \ - else \ - av_bprintf(&bp, "fail"); + channel_layout_from_string(&layout, &bp, (x)); #define CHANNEL_LAYOUT_CHANNEL_FROM_INDEX(x) \ ret = av_channel_layout_channel_from_index(&layout, x); \ @@ -72,7 +150,7 @@ int main(void) { const AVChannelLayout *playout; - AVChannelLayout layout = { 0 }; + AVChannelLayout layout = { 0 }, layout2 = { 0 }; AVBPrint bp; void *iter = NULL; uint64_t mask; @@ -246,6 +324,15 @@ int main(void) CHANNEL_LAYOUT_FROM_STRING("FR+FL@Foo+USR63@Foo"); printf("With \"FR+FL@Foo+USR63@Foo\": %33s\n", bp.str); + ret = av_channel_layout_copy(&layout2, &layout); + if (ret < 0) { + printf("Copying channel layout \"FR+FL@Foo+USR63@Foo\" failed; " + "ret %d\n", ret); + } + ret = av_channel_layout_compare(&layout, &layout2); + if (ret) + printf("Channel layout and its copy compare unequal; ret: %d\n", ret); + printf("\nTesting av_channel_layout_index_from_string\n"); CHANNEL_LAYOUT_INDEX_FROM_STRING("FR"); printf("On \"FR+FL@Foo+USR63@Foo\" layout with \"FR\": %18d\n", ret); @@ -347,6 +434,7 @@ int main(void) printf("On \"ambisonic 2+stereo\" layout with AV_CH_LAYOUT_QUAD: 0x%"PRIx64"\n", mask); av_channel_layout_uninit(&layout); + av_channel_layout_uninit(&layout2); av_bprint_finalize(&bp, NULL); return 0; diff --git a/arm/android/third_party/ffmpeg/libavutil/tests/lzo.c b/arm/android/third_party/ffmpeg/libavutil/tests/lzo.c index a5655dbf..d7a78a16 100644 --- a/arm/android/third_party/ffmpeg/libavutil/tests/lzo.c +++ b/arm/android/third_party/ffmpeg/libavutil/tests/lzo.c @@ -19,6 +19,8 @@ */ #include +#include +#include #include #include "libavutil/log.h" diff --git a/arm/android/third_party/ffmpeg/libavutil/tests/murmur3.c b/arm/android/third_party/ffmpeg/libavutil/tests/murmur3.c index b8d6b1fe..7a793dac 100644 --- a/arm/android/third_party/ffmpeg/libavutil/tests/murmur3.c +++ b/arm/android/third_party/ffmpeg/libavutil/tests/murmur3.c @@ -18,6 +18,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include +#include + #include "libavutil/intreadwrite.h" #include "libavutil/mem.h" #include "libavutil/murmur3.h" diff --git a/arm/android/third_party/ffmpeg/libavutil/tests/pixdesc.c b/arm/android/third_party/ffmpeg/libavutil/tests/pixdesc.c index 34e2bea9..b13aba59 100644 --- a/arm/android/third_party/ffmpeg/libavutil/tests/pixdesc.c +++ b/arm/android/third_party/ffmpeg/libavutil/tests/pixdesc.c @@ -19,6 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/log.h" #include "libavutil/pixdesc.c" int main(void){ diff --git a/arm/android/third_party/ffmpeg/libavutil/thread.h b/arm/android/third_party/ffmpeg/libavutil/thread.h index 2f5e7e1c..2ded498c 100644 --- a/arm/android/third_party/ffmpeg/libavutil/thread.h +++ b/arm/android/third_party/ffmpeg/libavutil/thread.h @@ -163,6 +163,15 @@ static inline int strict_pthread_once(pthread_once_t *once_control, void (*init_ #define ff_mutex_unlock pthread_mutex_unlock #define ff_mutex_destroy pthread_mutex_destroy +#define AVCond pthread_cond_t + +#define ff_cond_init pthread_cond_init +#define ff_cond_destroy pthread_cond_destroy +#define ff_cond_signal pthread_cond_signal +#define ff_cond_broadcast pthread_cond_broadcast +#define ff_cond_wait pthread_cond_wait +#define ff_cond_timedwait pthread_cond_timedwait + #define AVOnce pthread_once_t #define AV_ONCE_INIT PTHREAD_ONCE_INIT @@ -178,6 +187,16 @@ static inline int ff_mutex_lock(AVMutex *mutex){ return 0; } static inline int ff_mutex_unlock(AVMutex *mutex){ return 0; } static inline int ff_mutex_destroy(AVMutex *mutex){ return 0; } +#define AVCond char + +static inline int ff_cond_init(AVCond *cond, const void *attr){ return 0; } +static inline int ff_cond_destroy(AVCond *cond){ return 0; } +static inline int ff_cond_signal(AVCond *cond){ return 0; } +static inline int ff_cond_broadcast(AVCond *cond){ return 0; } +static inline int ff_cond_wait(AVCond *cond, AVMutex *mutex){ return 0; } +static inline int ff_cond_timedwait(AVCond *cond, AVMutex *mutex, + const void *abstime){ return 0; } + #define AVOnce char #define AV_ONCE_INIT 0 diff --git a/arm/android/third_party/ffmpeg/libavutil/threadmessage.c b/arm/android/third_party/ffmpeg/libavutil/threadmessage.c index f0e23f28..20b38820 100644 --- a/arm/android/third_party/ffmpeg/libavutil/threadmessage.c +++ b/arm/android/third_party/ffmpeg/libavutil/threadmessage.c @@ -19,6 +19,9 @@ */ #include +#include + +#include "error.h" #include "fifo.h" #include "mem.h" #include "threadmessage.h" diff --git a/arm/android/third_party/ffmpeg/libavutil/timer.h b/arm/android/third_party/ffmpeg/libavutil/timer.h index 861ba7e9..2cd299ec 100644 --- a/arm/android/third_party/ffmpeg/libavutil/timer.h +++ b/arm/android/third_party/ffmpeg/libavutil/timer.h @@ -105,9 +105,9 @@ #if CONFIG_LINUX_PERF #define START_TIMER \ - static int linux_perf_fd; \ + static int linux_perf_fd = -1; \ uint64_t tperf; \ - if (!linux_perf_fd) { \ + if (linux_perf_fd == -1) { \ struct perf_event_attr attr = { \ .type = PERF_TYPE_HARDWARE, \ .size = sizeof(struct perf_event_attr), \ diff --git a/arm/android/third_party/ffmpeg/libavutil/timestamp.h b/arm/android/third_party/ffmpeg/libavutil/timestamp.h index e082f01b..9ae64da8 100644 --- a/arm/android/third_party/ffmpeg/libavutil/timestamp.h +++ b/arm/android/third_party/ffmpeg/libavutil/timestamp.h @@ -24,7 +24,7 @@ #ifndef AVUTIL_TIMESTAMP_H #define AVUTIL_TIMESTAMP_H -#include "common.h" +#include "avutil.h" #if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS) && !defined(PRId64) #error missing -D__STDC_FORMAT_MACROS / #define __STDC_FORMAT_MACROS diff --git a/arm/android/third_party/ffmpeg/libavutil/tx.c b/arm/android/third_party/ffmpeg/libavutil/tx.c index 52e8685b..0abfbe0e 100644 --- a/arm/android/third_party/ffmpeg/libavutil/tx.c +++ b/arm/android/third_party/ffmpeg/libavutil/tx.c @@ -439,7 +439,9 @@ int ff_tx_decompose_length(int dst[TX_MAX_DECOMPOSITIONS], enum AVTXType type, /* Check direction for non-orthogonal codelets */ if (((cd->flags & FF_TX_FORWARD_ONLY) && inv) || - ((cd->flags & (FF_TX_INVERSE_ONLY | AV_TX_FULL_IMDCT)) && !inv)) + ((cd->flags & (FF_TX_INVERSE_ONLY | AV_TX_FULL_IMDCT)) && !inv) || + ((cd->flags & (FF_TX_FORWARD_ONLY | AV_TX_REAL_TO_REAL)) && inv) || + ((cd->flags & (FF_TX_FORWARD_ONLY | AV_TX_REAL_TO_IMAGINARY)) && inv)) continue; /* Check if the CPU supports the required ISA */ @@ -562,6 +564,10 @@ static void print_flags(AVBPrint *bp, uint64_t f) av_bprintf(bp, "%spreshuf", prev > 1 ? sep : ""); if ((f & AV_TX_FULL_IMDCT) && ++prev) av_bprintf(bp, "%simdct_full", prev > 1 ? sep : ""); + if ((f & AV_TX_REAL_TO_REAL) && ++prev) + av_bprintf(bp, "%sreal_to_real", prev > 1 ? sep : ""); + if ((f & AV_TX_REAL_TO_IMAGINARY) && ++prev) + av_bprintf(bp, "%sreal_to_imaginary", prev > 1 ? sep : ""); if ((f & FF_TX_ASM_CALL) && ++prev) av_bprintf(bp, "%sasm_call", prev > 1 ? sep : ""); av_bprintf(bp, "]"); @@ -574,18 +580,24 @@ static void print_type(AVBPrint *bp, enum AVTXType type) type == AV_TX_FLOAT_FFT ? "fft_float" : type == AV_TX_FLOAT_MDCT ? "mdct_float" : type == AV_TX_FLOAT_RDFT ? "rdft_float" : + type == AV_TX_FLOAT_DCT_I ? "dctI_float" : + type == AV_TX_FLOAT_DST_I ? "dstI_float" : type == AV_TX_DOUBLE_FFT ? "fft_double" : type == AV_TX_DOUBLE_MDCT ? "mdct_double" : type == AV_TX_DOUBLE_RDFT ? "rdft_double" : + type == AV_TX_DOUBLE_DCT_I ? "dctI_double" : + type == AV_TX_DOUBLE_DST_I ? "dstI_double" : type == AV_TX_INT32_FFT ? "fft_int32" : type == AV_TX_INT32_MDCT ? "mdct_int32" : type == AV_TX_INT32_RDFT ? "rdft_int32" : + type == AV_TX_INT32_DCT_I ? "dctI_int32" : + type == AV_TX_INT32_DST_I ? "dstI_int32" : "unknown"); } static void print_cd_info(const FFTXCodelet *cd, int prio, int len, int print_prio) { - AVBPrint bp = { 0 }; + AVBPrint bp; av_bprint_init(&bp, 0, AV_BPRINT_SIZE_AUTOMATIC); av_bprintf(&bp, "%s - type: ", cd->name); @@ -708,7 +720,7 @@ av_cold int ff_tx_init_subtx(AVTXContext *s, enum AVTXType type, int codelet_list_idx = codelet_list_num; int nb_cd_matches = 0; #if !CONFIG_SMALL - AVBPrint bp = { 0 }; + AVBPrint bp; #endif /* We still accept functions marked with SLOW, even if the CPU is @@ -719,7 +731,11 @@ av_cold int ff_tx_init_subtx(AVTXContext *s, enum AVTXType type, uint64_t req_flags = flags; /* Flags the codelet may require to be present */ - uint64_t inv_req_mask = AV_TX_FULL_IMDCT | FF_TX_PRESHUFFLE | FF_TX_ASM_CALL; + uint64_t inv_req_mask = AV_TX_FULL_IMDCT | + AV_TX_REAL_TO_REAL | + AV_TX_REAL_TO_IMAGINARY | + FF_TX_PRESHUFFLE | + FF_TX_ASM_CALL; /* Unaligned codelets are compatible with the aligned flag */ if (req_flags & FF_TX_ALIGNED) @@ -744,7 +760,9 @@ av_cold int ff_tx_init_subtx(AVTXContext *s, enum AVTXType type, /* Check direction for non-orthogonal codelets */ if (((cd->flags & FF_TX_FORWARD_ONLY) && inv) || - ((cd->flags & (FF_TX_INVERSE_ONLY | AV_TX_FULL_IMDCT)) && !inv)) + ((cd->flags & (FF_TX_INVERSE_ONLY | AV_TX_FULL_IMDCT)) && !inv) || + ((cd->flags & (FF_TX_FORWARD_ONLY | AV_TX_REAL_TO_REAL)) && inv) || + ((cd->flags & (FF_TX_FORWARD_ONLY | AV_TX_REAL_TO_IMAGINARY)) && inv)) continue; /* Check if the requested flags match from both sides */ diff --git a/arm/android/third_party/ffmpeg/libavutil/tx.h b/arm/android/third_party/ffmpeg/libavutil/tx.h index 064edbc0..4696988c 100644 --- a/arm/android/third_party/ffmpeg/libavutil/tx.h +++ b/arm/android/third_party/ffmpeg/libavutil/tx.h @@ -105,6 +105,30 @@ enum AVTXType { AV_TX_DOUBLE_DCT = 10, AV_TX_INT32_DCT = 11, + /** + * Discrete Cosine Transform I + * + * The forward transform is a DCT-I. + * The inverse transform is a DCT-I multiplied by 2/(N + 1). + * + * The input array is always overwritten. + */ + AV_TX_FLOAT_DCT_I = 12, + AV_TX_DOUBLE_DCT_I = 13, + AV_TX_INT32_DCT_I = 14, + + /** + * Discrete Sine Transform I + * + * The forward transform is a DST-I. + * The inverse transform is a DST-I multiplied by 2/(N + 1). + * + * The input array is always overwritten. + */ + AV_TX_FLOAT_DST_I = 15, + AV_TX_DOUBLE_DST_I = 16, + AV_TX_INT32_DST_I = 17, + /* Not part of the API, do not use */ AV_TX_NB, }; @@ -149,6 +173,16 @@ enum AVTXFlags { * Ignored for all transforms but inverse MDCTs. */ AV_TX_FULL_IMDCT = 1ULL << 2, + + /** + * Perform a real to half-complex RDFT. + * Only the real, or imaginary coefficients will + * be output, depending on the flag used. Only available for forward RDFTs. + * Output array must have enough space to hold N complex values + * (regular size for a real to complex transform). + */ + AV_TX_REAL_TO_REAL = 1ULL << 3, + AV_TX_REAL_TO_IMAGINARY = 1ULL << 4, }; /** diff --git a/arm/android/third_party/ffmpeg/libavutil/tx_priv.h b/arm/android/third_party/ffmpeg/libavutil/tx_priv.h index d5ff8e14..d3fcdbf5 100644 --- a/arm/android/third_party/ffmpeg/libavutil/tx_priv.h +++ b/arm/android/third_party/ffmpeg/libavutil/tx_priv.h @@ -22,6 +22,7 @@ #include "tx.h" #include "thread.h" #include "mem_internal.h" +#include "common.h" #include "attributes.h" #ifdef TX_FLOAT diff --git a/arm/android/third_party/ffmpeg/libavutil/tx_template.c b/arm/android/third_party/ffmpeg/libavutil/tx_template.c index 983de75a..8dc3d251 100644 --- a/arm/android/third_party/ffmpeg/libavutil/tx_template.c +++ b/arm/android/third_party/ffmpeg/libavutil/tx_template.c @@ -43,6 +43,10 @@ SR_TABLE(32768) \ SR_TABLE(65536) \ SR_TABLE(131072) \ + SR_TABLE(262144) \ + SR_TABLE(524288) \ + SR_TABLE(1048576) \ + SR_TABLE(2097152) \ #define SR_TABLE(len) \ TABLE_DEF(len, len/4 + 1); @@ -218,8 +222,8 @@ static av_always_inline void NAME(TXComplex *out, TXComplex *in, \ BF(t[3].im, t[2].re, in[2].re, in[3].re); \ BF(t[3].re, t[2].im, in[2].im, in[3].im); \ \ - out[D0*stride].re = dc.re + t[0].re + t[2].re; \ - out[D0*stride].im = dc.im + t[0].im + t[2].im; \ + out[D0*stride].re = dc.re + (TXUSample)t[0].re + t[2].re; \ + out[D0*stride].im = dc.im + (TXUSample)t[0].im + t[2].im; \ \ SMUL(t[4].re, t[0].re, tab[0], tab[2], t[2].re, t[0].re); \ SMUL(t[4].im, t[0].im, tab[0], tab[2], t[2].im, t[0].im); \ @@ -231,14 +235,14 @@ static av_always_inline void NAME(TXComplex *out, TXComplex *in, \ BF(z0[2].re, z0[1].re, t[4].re, t[5].re); \ BF(z0[2].im, z0[1].im, t[4].im, t[5].im); \ \ - out[D1*stride].re = dc.re + z0[3].re; \ - out[D1*stride].im = dc.im + z0[0].im; \ - out[D2*stride].re = dc.re + z0[2].re; \ - out[D2*stride].im = dc.im + z0[1].im; \ - out[D3*stride].re = dc.re + z0[1].re; \ - out[D3*stride].im = dc.im + z0[2].im; \ - out[D4*stride].re = dc.re + z0[0].re; \ - out[D4*stride].im = dc.im + z0[3].im; \ + out[D1*stride].re = dc.re + (TXUSample)z0[3].re; \ + out[D1*stride].im = dc.im + (TXUSample)z0[0].im; \ + out[D2*stride].re = dc.re + (TXUSample)z0[2].re; \ + out[D2*stride].im = dc.im + (TXUSample)z0[1].im; \ + out[D3*stride].re = dc.re + (TXUSample)z0[1].re; \ + out[D3*stride].im = dc.im + (TXUSample)z0[2].im; \ + out[D4*stride].re = dc.re + (TXUSample)z0[0].re; \ + out[D4*stride].im = dc.im + (TXUSample)z0[3].im; \ } DECL_FFT5(fft5, 0, 1, 2, 3, 4) @@ -717,6 +721,10 @@ DECL_SR_CODELET(16384,8192,4096) DECL_SR_CODELET(32768,16384,8192) DECL_SR_CODELET(65536,32768,16384) DECL_SR_CODELET(131072,65536,32768) +DECL_SR_CODELET(262144,131072,65536) +DECL_SR_CODELET(524288,262144,131072) +DECL_SR_CODELET(1048576,524288,262144) +DECL_SR_CODELET(2097152,1048576,524288) static av_cold int TX_NAME(ff_tx_fft_init)(AVTXContext *s, const FFTXCodelet *cd, @@ -1605,14 +1613,18 @@ static av_cold int TX_NAME(ff_tx_rdft_init)(AVTXContext *s, int ret; double f, m; TXSample *tab; + uint64_t r2r = flags & AV_TX_REAL_TO_REAL; + int len4 = FFALIGN(len, 4) / 4; s->scale_d = *((SCALE_TYPE *)scale); s->scale_f = s->scale_d; + flags &= ~(AV_TX_REAL_TO_REAL | AV_TX_REAL_TO_IMAGINARY); + if ((ret = ff_tx_init_subtx(s, TX_TYPE(FFT), flags, NULL, len >> 1, inv, scale))) return ret; - if (!(s->exp = av_mallocz((8 + (len >> 2) - 1)*sizeof(*s->exp)))) + if (!(s->exp = av_mallocz((8 + 2*len4)*sizeof(*s->exp)))) return AVERROR(ENOMEM); tab = (TXSample *)s->exp; @@ -1627,21 +1639,27 @@ static av_cold int TX_NAME(ff_tx_rdft_init)(AVTXContext *s, *tab++ = RESCALE(-m); *tab++ = RESCALE( (0.5 - 0.0) * m); - *tab++ = RESCALE( (0.0 - 0.5) * m); + if (r2r) + *tab++ = 1 / s->scale_f; + else + *tab++ = RESCALE( (0.0 - 0.5) * m); *tab++ = RESCALE( (0.5 - inv) * m); *tab++ = RESCALE(-(0.5 - inv) * m); - for (int i = 0; i < len >> 2; i++) + for (int i = 0; i < len4; i++) *tab++ = RESCALE(cos(i*f)); - for (int i = len >> 2; i >= 0; i--) - *tab++ = RESCALE(cos(i*f) * (inv ? +1.0 : -1.0)); + + tab = ((TXSample *)s->exp) + len4 + 8; + + for (int i = 0; i < len4; i++) + *tab++ = RESCALE(cos(((len - i*4)/4.0)*f)) * (inv ? 1 : -1); return 0; } -#define DECL_RDFT(name, inv) \ -static void TX_NAME(ff_tx_rdft_ ##name)(AVTXContext *s, void *_dst, \ - void *_src, ptrdiff_t stride) \ +#define DECL_RDFT(n, inv) \ +static void TX_NAME(ff_tx_rdft_ ##n)(AVTXContext *s, void *_dst, \ + void *_src, ptrdiff_t stride) \ { \ const int len2 = s->len >> 1; \ const int len4 = s->len >> 2; \ @@ -1690,41 +1708,132 @@ static void TX_NAME(ff_tx_rdft_ ##name)(AVTXContext *s, void *_dst, \ data[len2].re = data[0].im; \ data[ 0].im = data[len2].im = 0; \ } \ -} - -DECL_RDFT(r2c, 0) -DECL_RDFT(c2r, 1) - -static const FFTXCodelet TX_NAME(ff_tx_rdft_r2c_def) = { - .name = TX_NAME_STR("rdft_r2c"), - .function = TX_NAME(ff_tx_rdft_r2c), - .type = TX_TYPE(RDFT), - .flags = AV_TX_UNALIGNED | AV_TX_INPLACE | - FF_TX_OUT_OF_PLACE | FF_TX_FORWARD_ONLY, - .factors = { 2, TX_FACTOR_ANY }, - .nb_factors = 2, - .min_len = 2, - .max_len = TX_LEN_UNLIMITED, - .init = TX_NAME(ff_tx_rdft_init), - .cpu_flags = FF_TX_CPU_FLAGS_ALL, - .prio = FF_TX_PRIO_BASE, +} \ + \ +static const FFTXCodelet TX_NAME(ff_tx_rdft_ ##n## _def) = { \ + .name = TX_NAME_STR("rdft_" #n), \ + .function = TX_NAME(ff_tx_rdft_ ##n), \ + .type = TX_TYPE(RDFT), \ + .flags = AV_TX_UNALIGNED | AV_TX_INPLACE | FF_TX_OUT_OF_PLACE | \ + (inv ? FF_TX_INVERSE_ONLY : FF_TX_FORWARD_ONLY), \ + .factors = { 4, TX_FACTOR_ANY }, \ + .nb_factors = 2, \ + .min_len = 4, \ + .max_len = TX_LEN_UNLIMITED, \ + .init = TX_NAME(ff_tx_rdft_init), \ + .cpu_flags = FF_TX_CPU_FLAGS_ALL, \ + .prio = FF_TX_PRIO_BASE, \ }; -static const FFTXCodelet TX_NAME(ff_tx_rdft_c2r_def) = { - .name = TX_NAME_STR("rdft_c2r"), - .function = TX_NAME(ff_tx_rdft_c2r), - .type = TX_TYPE(RDFT), - .flags = AV_TX_UNALIGNED | AV_TX_INPLACE | - FF_TX_OUT_OF_PLACE | FF_TX_INVERSE_ONLY, - .factors = { 2, TX_FACTOR_ANY }, - .nb_factors = 2, - .min_len = 2, - .max_len = TX_LEN_UNLIMITED, - .init = TX_NAME(ff_tx_rdft_init), - .cpu_flags = FF_TX_CPU_FLAGS_ALL, - .prio = FF_TX_PRIO_BASE, +DECL_RDFT(r2c, 0) +DECL_RDFT(c2r, 1) + +#define DECL_RDFT_HALF(n, mode, mod2) \ +static void TX_NAME(ff_tx_rdft_ ##n)(AVTXContext *s, void *_dst, \ + void *_src, ptrdiff_t stride) \ +{ \ + const int len = s->len; \ + const int len2 = len >> 1; \ + const int len4 = len >> 2; \ + const int aligned_len4 = FFALIGN(len, 4)/4; \ + const TXSample *fact = (void *)s->exp; \ + const TXSample *tcos = fact + 8; \ + const TXSample *tsin = tcos + aligned_len4; \ + TXComplex *data = _dst; \ + TXSample *out = _dst; /* Half-complex is forward-only */ \ + TXSample tmp_dc; \ + av_unused TXSample tmp_mid; \ + TXSample tmp[4]; \ + TXComplex sf, sl; \ + \ + s->fn[0](&s->sub[0], _dst, _src, sizeof(TXComplex)); \ + \ + tmp_dc = data[0].re; \ + data[ 0].re = tmp_dc + data[0].im; \ + tmp_dc = tmp_dc - data[0].im; \ + \ + data[ 0].re = MULT(fact[0], data[ 0].re); \ + tmp_dc = MULT(fact[1], tmp_dc); \ + data[len4].re = MULT(fact[2], data[len4].re); \ + \ + if (!mod2) { \ + data[len4].im = MULT(fact[3], data[len4].im); \ + } else { \ + sf = data[len4]; \ + sl = data[len4 + 1]; \ + if (mode == AV_TX_REAL_TO_REAL) \ + tmp[0] = MULT(fact[4], (sf.re + sl.re)); \ + else \ + tmp[0] = MULT(fact[5], (sf.im - sl.im)); \ + tmp[1] = MULT(fact[6], (sf.im + sl.im)); \ + tmp[2] = MULT(fact[7], (sf.re - sl.re)); \ + \ + if (mode == AV_TX_REAL_TO_REAL) { \ + tmp[3] = tmp[1]*tcos[len4] - tmp[2]*tsin[len4]; \ + tmp_mid = (tmp[0] - tmp[3]); \ + } else { \ + tmp[3] = tmp[1]*tsin[len4] + tmp[2]*tcos[len4]; \ + tmp_mid = (tmp[0] + tmp[3]); \ + } \ + } \ + \ + /* NOTE: unrolling this breaks non-mod8 lengths */ \ + for (int i = 1; i <= len4; i++) { \ + TXSample tmp[4]; \ + TXComplex sf = data[i]; \ + TXComplex sl = data[len2 - i]; \ + \ + if (mode == AV_TX_REAL_TO_REAL) \ + tmp[0] = MULT(fact[4], (sf.re + sl.re)); \ + else \ + tmp[0] = MULT(fact[5], (sf.im - sl.im)); \ + \ + tmp[1] = MULT(fact[6], (sf.im + sl.im)); \ + tmp[2] = MULT(fact[7], (sf.re - sl.re)); \ + \ + if (mode == AV_TX_REAL_TO_REAL) { \ + tmp[3] = tmp[1]*tcos[i] - tmp[2]*tsin[i]; \ + out[i] = (tmp[0] + tmp[3]); \ + out[len - i] = (tmp[0] - tmp[3]); \ + } else { \ + tmp[3] = tmp[1]*tsin[i] + tmp[2]*tcos[i]; \ + out[i - 1] = (tmp[3] - tmp[0]); \ + out[len - i - 1] = (tmp[0] + tmp[3]); \ + } \ + } \ + \ + for (int i = 1; i < (len4 + (mode == AV_TX_REAL_TO_IMAGINARY)); i++) \ + out[len2 - i] = out[len - i]; \ + \ + if (mode == AV_TX_REAL_TO_REAL) { \ + out[len2] = tmp_dc; \ + if (mod2) \ + out[len4 + 1] = tmp_mid * fact[5]; \ + } else if (mod2) { \ + out[len4] = tmp_mid; \ + } \ +} \ + \ +static const FFTXCodelet TX_NAME(ff_tx_rdft_ ##n## _def) = { \ + .name = TX_NAME_STR("rdft_" #n), \ + .function = TX_NAME(ff_tx_rdft_ ##n), \ + .type = TX_TYPE(RDFT), \ + .flags = AV_TX_UNALIGNED | AV_TX_INPLACE | mode | \ + FF_TX_OUT_OF_PLACE | FF_TX_FORWARD_ONLY, \ + .factors = { 2 + 2*(!mod2), TX_FACTOR_ANY }, \ + .nb_factors = 2, \ + .min_len = 2 + 2*(!mod2), \ + .max_len = TX_LEN_UNLIMITED, \ + .init = TX_NAME(ff_tx_rdft_init), \ + .cpu_flags = FF_TX_CPU_FLAGS_ALL, \ + .prio = FF_TX_PRIO_BASE, \ }; +DECL_RDFT_HALF(r2r, AV_TX_REAL_TO_REAL, 0) +DECL_RDFT_HALF(r2r_mod2, AV_TX_REAL_TO_REAL, 1) +DECL_RDFT_HALF(r2i, AV_TX_REAL_TO_IMAGINARY, 0) +DECL_RDFT_HALF(r2i_mod2, AV_TX_REAL_TO_IMAGINARY, 1) + static av_cold int TX_NAME(ff_tx_dct_init)(AVTXContext *s, const FFTXCodelet *cd, uint64_t flags, @@ -1899,6 +2008,107 @@ static const FFTXCodelet TX_NAME(ff_tx_dctIII_def) = { .prio = FF_TX_PRIO_BASE, }; +static av_cold int TX_NAME(ff_tx_dcstI_init)(AVTXContext *s, + const FFTXCodelet *cd, + uint64_t flags, + FFTXCodeletOptions *opts, + int len, int inv, + const void *scale) +{ + int ret; + SCALE_TYPE rsc = *((SCALE_TYPE *)scale); + + if (inv) { + len *= 2; + s->len *= 2; + rsc *= 0.5; + } + + /* We want a half-complex RDFT */ + flags |= cd->type == TX_TYPE(DCT_I) ? AV_TX_REAL_TO_REAL : + AV_TX_REAL_TO_IMAGINARY; + + if ((ret = ff_tx_init_subtx(s, TX_TYPE(RDFT), flags, NULL, + (len - 1 + 2*(cd->type == TX_TYPE(DST_I)))*2, + 0, &rsc))) + return ret; + + s->tmp = av_mallocz((len + 1)*2*sizeof(TXSample)); + if (!s->tmp) + return AVERROR(ENOMEM); + + return 0; +} + +static void TX_NAME(ff_tx_dctI)(AVTXContext *s, void *_dst, + void *_src, ptrdiff_t stride) +{ + TXSample *dst = _dst; + TXSample *src = _src; + const int len = s->len - 1; + TXSample *tmp = (TXSample *)s->tmp; + + stride /= sizeof(TXSample); + + for (int i = 0; i < len; i++) + tmp[i] = tmp[2*len - i] = src[i * stride]; + + tmp[len] = src[len * stride]; /* Middle */ + + s->fn[0](&s->sub[0], dst, tmp, sizeof(TXSample)); +} + +static void TX_NAME(ff_tx_dstI)(AVTXContext *s, void *_dst, + void *_src, ptrdiff_t stride) +{ + TXSample *dst = _dst; + TXSample *src = _src; + const int len = s->len + 1; + TXSample *tmp = (void *)s->tmp; + + stride /= sizeof(TXSample); + + tmp[0] = 0; + + for (int i = 1; i < len; i++) { + TXSample a = src[(i - 1) * stride]; + tmp[i] = -a; + tmp[2*len - i] = a; + } + + tmp[len] = 0; /* i == n, Nyquist */ + + s->fn[0](&s->sub[0], dst, tmp, sizeof(float)); +} + +static const FFTXCodelet TX_NAME(ff_tx_dctI_def) = { + .name = TX_NAME_STR("dctI"), + .function = TX_NAME(ff_tx_dctI), + .type = TX_TYPE(DCT_I), + .flags = AV_TX_UNALIGNED | AV_TX_INPLACE | FF_TX_OUT_OF_PLACE, + .factors = { 2, TX_FACTOR_ANY }, + .nb_factors = 2, + .min_len = 2, + .max_len = TX_LEN_UNLIMITED, + .init = TX_NAME(ff_tx_dcstI_init), + .cpu_flags = FF_TX_CPU_FLAGS_ALL, + .prio = FF_TX_PRIO_BASE, +}; + +static const FFTXCodelet TX_NAME(ff_tx_dstI_def) = { + .name = TX_NAME_STR("dstI"), + .function = TX_NAME(ff_tx_dstI), + .type = TX_TYPE(DST_I), + .flags = AV_TX_UNALIGNED | AV_TX_INPLACE | FF_TX_OUT_OF_PLACE, + .factors = { 2, TX_FACTOR_ANY }, + .nb_factors = 2, + .min_len = 2, + .max_len = TX_LEN_UNLIMITED, + .init = TX_NAME(ff_tx_dcstI_init), + .cpu_flags = FF_TX_CPU_FLAGS_ALL, + .prio = FF_TX_PRIO_BASE, +}; + int TX_TAB(ff_tx_mdct_gen_exp)(AVTXContext *s, int *pre_tab) { int off = 0; @@ -1947,6 +2157,10 @@ const FFTXCodelet * const TX_NAME(ff_tx_codelet_list)[] = { &TX_NAME(ff_tx_fft32768_ns_def), &TX_NAME(ff_tx_fft65536_ns_def), &TX_NAME(ff_tx_fft131072_ns_def), + &TX_NAME(ff_tx_fft262144_ns_def), + &TX_NAME(ff_tx_fft524288_ns_def), + &TX_NAME(ff_tx_fft1048576_ns_def), + &TX_NAME(ff_tx_fft2097152_ns_def), /* Prime factor codelets */ &TX_NAME(ff_tx_fft3_ns_def), @@ -1985,9 +2199,15 @@ const FFTXCodelet * const TX_NAME(ff_tx_codelet_list)[] = { &TX_NAME(ff_tx_mdct_naive_inv_def), &TX_NAME(ff_tx_mdct_inv_full_def), &TX_NAME(ff_tx_rdft_r2c_def), + &TX_NAME(ff_tx_rdft_r2r_def), + &TX_NAME(ff_tx_rdft_r2r_mod2_def), + &TX_NAME(ff_tx_rdft_r2i_def), + &TX_NAME(ff_tx_rdft_r2i_mod2_def), &TX_NAME(ff_tx_rdft_c2r_def), &TX_NAME(ff_tx_dctII_def), &TX_NAME(ff_tx_dctIII_def), + &TX_NAME(ff_tx_dctI_def), + &TX_NAME(ff_tx_dstI_def), NULL, }; diff --git a/arm/android/third_party/ffmpeg/libavutil/version.h b/arm/android/third_party/ffmpeg/libavutil/version.h index 24af520e..4c0c545d 100644 --- a/arm/android/third_party/ffmpeg/libavutil/version.h +++ b/arm/android/third_party/ffmpeg/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 58 -#define LIBAVUTIL_VERSION_MINOR 14 +#define LIBAVUTIL_VERSION_MINOR 27 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ diff --git a/arm/android/third_party/ffmpeg/libavutil/video_hint.c b/arm/android/third_party/ffmpeg/libavutil/video_hint.c new file mode 100644 index 00000000..431716ab --- /dev/null +++ b/arm/android/third_party/ffmpeg/libavutil/video_hint.c @@ -0,0 +1,81 @@ +/* + * Copyright 2023 Elias Carotti + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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 + +#include "avstring.h" +#include "frame.h" +#include "macros.h" +#include "mem.h" +#include "video_hint.h" + +AVVideoHint *av_video_hint_alloc(size_t nb_rects, + size_t *out_size) +{ + struct TestStruct { + AVVideoHint hint; + AVVideoRect rect; + }; + const size_t rect_offset = offsetof(struct TestStruct, rect); + size_t size = rect_offset; + AVVideoHint *hint; + + *out_size = 0; + if (nb_rects > (SIZE_MAX - size) / sizeof(AVVideoRect)) + return NULL; + size += sizeof(AVVideoRect) * nb_rects; + + hint = av_mallocz(size); + if (!hint) + return NULL; + + hint->nb_rects = nb_rects; + hint->rect_offset = rect_offset; + hint->rect_size = sizeof(AVVideoRect); + + *out_size = size; + + return hint; +} + +AVVideoHint *av_video_hint_create_side_data(AVFrame *frame, + size_t nb_rects) +{ + AVVideoHint *hint; + AVBufferRef *buf; + size_t size = 0; + + hint = av_video_hint_alloc(nb_rects, &size); + if (!hint) + return NULL; + + buf = av_buffer_create((uint8_t *)hint, size, NULL, NULL, 0); + if (!buf) { + av_freep(&hint); + return NULL; + } + + if (!av_frame_new_side_data_from_buf(frame, AV_FRAME_DATA_VIDEO_HINT, buf)) { + av_buffer_unref(&buf); + return NULL; + } + + return hint; +} diff --git a/arm/android/third_party/ffmpeg/libavutil/video_hint.h b/arm/android/third_party/ffmpeg/libavutil/video_hint.h new file mode 100644 index 00000000..1b219609 --- /dev/null +++ b/arm/android/third_party/ffmpeg/libavutil/video_hint.h @@ -0,0 +1,107 @@ +/** + * Copyright 2023 Elias Carotti + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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_VIDEO_HINT_H +#define AVUTIL_VIDEO_HINT_H + +#include +#include +#include "libavutil/avassert.h" +#include "libavutil/frame.h" + +typedef struct AVVideoRect { + uint32_t x, y; + uint32_t width, height; +} AVVideoRect; + +typedef enum AVVideoHintType { + /* rectangled delimit the constant areas (unchanged), default is changed */ + AV_VIDEO_HINT_TYPE_CONSTANT, + + /* rectangled delimit the constant areas (changed), default is not changed */ + AV_VIDEO_HINT_TYPE_CHANGED, +} AVVideoHintType; + +typedef struct AVVideoHint { + /** + * Number of AVVideoRect present. + * + * May be 0, in which case no per-rectangle information is present. In this + * case the values of rect_offset / rect_size are unspecified and should + * not be accessed. + */ + size_t nb_rects; + + /** + * Offset in bytes from the beginning of this structure at which the array + * of AVVideoRect starts. + */ + size_t rect_offset; + + /** + * Size in bytes of AVVideoRect. + */ + size_t rect_size; + + AVVideoHintType type; +} AVVideoHint; + +static av_always_inline AVVideoRect * +av_video_hint_rects(const AVVideoHint *hints) { + return (AVVideoRect *)((uint8_t *)hints + hints->rect_offset); +} + +static av_always_inline AVVideoRect * +av_video_hint_get_rect(const AVVideoHint *hints, size_t idx) { + return (AVVideoRect *)((uint8_t *)hints + hints->rect_offset + idx * hints->rect_size); +} + +/** + * Allocate memory for the AVVideoHint struct along with an nb_rects-sized + * arrays of AVVideoRect. + * + * The side data contains a list of rectangles for the portions of the frame + * which changed from the last encoded one (and the remainder are assumed to be + * changed), or, alternately (depending on the type parameter) the unchanged + * ones (and the remanining ones are those which changed). + * Macroblocks will thus be hinted either to be P_SKIP-ped or go through the + * regular encoding procedure. + * + * It's responsibility of the caller to fill the AVRects accordingly, and to set + * the proper AVVideoHintType field. + * + * @param out_size if non-NULL, the size in bytes of the resulting data array is + * written here + * + * @return newly allocated AVVideoHint struct (must be freed by the caller using + * av_free()) on success, NULL on memory allocation failure + */ +AVVideoHint *av_video_hint_alloc(size_t nb_rects, + size_t *out_size); + +/** + * Same as av_video_hint_alloc(), except newly-allocated AVVideoHint is attached + * as side data of type AV_FRAME_DATA_VIDEO_HINT_INFO to frame. + */ +AVVideoHint *av_video_hint_create_side_data(AVFrame *frame, + size_t nb_rects); + + +#endif /* AVUTIL_VIDEO_HINT_H */ diff --git a/arm/android/third_party/ffmpeg/libavutil/vulkan.c b/arm/android/third_party/ffmpeg/libavutil/vulkan.c index 48f5f4b5..dec8ccad 100644 --- a/arm/android/third_party/ffmpeg/libavutil/vulkan.c +++ b/arm/android/third_party/ffmpeg/libavutil/vulkan.c @@ -90,9 +90,13 @@ int ff_vk_load_props(FFVulkanContext *s) s->hprops = (VkPhysicalDeviceExternalMemoryHostPropertiesEXT) { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT, }; + s->coop_matrix_props = (VkPhysicalDeviceCooperativeMatrixPropertiesKHR) { + .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_KHR, + .pNext = &s->hprops, + }; s->subgroup_props = (VkPhysicalDeviceSubgroupSizeControlProperties) { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES, - .pNext = &s->hprops, + .pNext = &s->coop_matrix_props, }; s->desc_buf_props = (VkPhysicalDeviceDescriptorBufferPropertiesEXT) { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_PROPERTIES_EXT, @@ -161,6 +165,25 @@ int ff_vk_load_props(FFVulkanContext *s) vk->GetPhysicalDeviceQueueFamilyProperties2(s->hwctx->phys_dev, &s->tot_nb_qfs, s->qf_props); + if (s->extensions & FF_VK_EXT_COOP_MATRIX) { + vk->GetPhysicalDeviceCooperativeMatrixPropertiesKHR(s->hwctx->phys_dev, + &s->coop_mat_props_nb, NULL); + + if (s->coop_mat_props_nb) { + s->coop_mat_props = av_malloc_array(s->coop_mat_props_nb, + sizeof(VkCooperativeMatrixPropertiesKHR)); + for (int i = 0; i < s->coop_mat_props_nb; i++) { + s->coop_mat_props[i] = (VkCooperativeMatrixPropertiesKHR) { + .sType = VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_KHR, + }; + } + + vk->GetPhysicalDeviceCooperativeMatrixPropertiesKHR(s->hwctx->phys_dev, + &s->coop_mat_props_nb, + s->coop_mat_props); + } + } + return 0; } @@ -1861,6 +1884,7 @@ void ff_vk_pipeline_free(FFVulkanContext *s, FFVulkanPipeline *pl) av_freep(&pl->desc_set); av_freep(&pl->desc_bind); + av_freep(&pl->bound_buffer_indices); av_freep(&pl->push_consts); pl->push_consts_num = 0; } @@ -1870,6 +1894,7 @@ void ff_vk_uninit(FFVulkanContext *s) av_freep(&s->query_props); av_freep(&s->qf_props); av_freep(&s->video_props); + av_freep(&s->coop_mat_props); av_buffer_unref(&s->frames_ref); } diff --git a/arm/android/third_party/ffmpeg/libavutil/vulkan.h b/arm/android/third_party/ffmpeg/libavutil/vulkan.h index 20b81105..25c5ad4b 100644 --- a/arm/android/third_party/ffmpeg/libavutil/vulkan.h +++ b/arm/android/third_party/ffmpeg/libavutil/vulkan.h @@ -236,11 +236,15 @@ typedef struct FFVulkanContext { VkPhysicalDeviceExternalMemoryHostPropertiesEXT hprops; VkPhysicalDeviceDescriptorBufferPropertiesEXT desc_buf_props; VkPhysicalDeviceSubgroupSizeControlProperties subgroup_props; + VkPhysicalDeviceCooperativeMatrixPropertiesKHR coop_matrix_props; VkQueueFamilyQueryResultStatusPropertiesKHR *query_props; VkQueueFamilyVideoPropertiesKHR *video_props; VkQueueFamilyProperties2 *qf_props; int tot_nb_qfs; + VkCooperativeMatrixPropertiesKHR *coop_mat_props; + uint32_t coop_mat_props_nb; + VkPhysicalDeviceShaderAtomicFloatFeaturesEXT atomic_float_feats; VkPhysicalDeviceVulkan12Features feats_12; VkPhysicalDeviceFeatures2 feats; diff --git a/arm/android/third_party/ffmpeg/libavutil/vulkan_functions.h b/arm/android/third_party/ffmpeg/libavutil/vulkan_functions.h index 58a625dd..65021b04 100644 --- a/arm/android/third_party/ffmpeg/libavutil/vulkan_functions.h +++ b/arm/android/third_party/ffmpeg/libavutil/vulkan_functions.h @@ -45,6 +45,7 @@ typedef enum FFVulkanExtensions { FF_VK_EXT_VIDEO_DECODE_H265 = 1ULL << 13, /* VK_EXT_video_decode_h265 */ FF_VK_EXT_VIDEO_DECODE_AV1 = 1ULL << 14, /* VK_MESA_video_decode_av1 */ FF_VK_EXT_ATOMIC_FLOAT = 1ULL << 15, /* VK_EXT_shader_atomic_float */ + FF_VK_EXT_COOP_MATRIX = 1ULL << 16, /* VK_KHR_cooperative_matrix */ FF_VK_EXT_NO_FLAG = 1ULL << 31, } FFVulkanExtensions; @@ -80,6 +81,7 @@ typedef enum FFVulkanExtensions { MACRO(1, 0, FF_VK_EXT_NO_FLAG, GetPhysicalDeviceImageFormatProperties2) \ MACRO(1, 0, FF_VK_EXT_NO_FLAG, GetPhysicalDeviceQueueFamilyProperties) \ MACRO(1, 0, FF_VK_EXT_NO_FLAG, GetPhysicalDeviceQueueFamilyProperties2) \ + MACRO(1, 0, FF_VK_EXT_COOP_MATRIX, GetPhysicalDeviceCooperativeMatrixPropertiesKHR) \ \ /* Command pool */ \ MACRO(1, 1, FF_VK_EXT_NO_FLAG, CreateCommandPool) \ diff --git a/arm/android/third_party/ffmpeg/libavutil/vulkan_loader.h b/arm/android/third_party/ffmpeg/libavutil/vulkan_loader.h index c45c674e..f88722f2 100644 --- a/arm/android/third_party/ffmpeg/libavutil/vulkan_loader.h +++ b/arm/android/third_party/ffmpeg/libavutil/vulkan_loader.h @@ -46,6 +46,7 @@ static inline uint64_t ff_vk_extensions_to_mask(const char * const *extensions, { VK_EXT_DEBUG_UTILS_EXTENSION_NAME, FF_VK_EXT_DEBUG_UTILS }, { VK_EXT_PHYSICAL_DEVICE_DRM_EXTENSION_NAME, FF_VK_EXT_DEVICE_DRM }, { VK_EXT_SHADER_ATOMIC_FLOAT_EXTENSION_NAME, FF_VK_EXT_ATOMIC_FLOAT }, + { VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME, FF_VK_EXT_COOP_MATRIX }, #ifdef _WIN32 { VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME, FF_VK_EXT_EXTERNAL_WIN32_MEMORY }, { VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME, FF_VK_EXT_EXTERNAL_WIN32_SEM }, diff --git a/arm/android/third_party/ffmpeg/libavutil/wchar_filename.h b/arm/android/third_party/ffmpeg/libavutil/wchar_filename.h index fbc0a551..868a30b5 100644 --- a/arm/android/third_party/ffmpeg/libavutil/wchar_filename.h +++ b/arm/android/third_party/ffmpeg/libavutil/wchar_filename.h @@ -21,7 +21,8 @@ #ifdef _WIN32 -#define WIN32_LEAN_AND_MEAN +#include +#include #include #include "mem.h" diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/config.h index 73bca51c..d759f81d 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/arm-linux-androideabi --extra-cflags='--target=arm-linux-androideabi24' --extra-ldflags='--target=arm-linux-androideabi24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/arm-linux-androideabi --extra-ldflags='--gcc-toolchain=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-neon --extra-cflags='-mtune=generic-armv7-a' --extra-cflags='-mfloat-abi=softfp' --extra-cflags='-mfpu=neon' --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/arm-linux-androideabi --extra-cflags='--target=arm-linux-androideabi24' --extra-ldflags='--target=arm-linux-androideabi24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/arm-linux-androideabi --extra-ldflags='--gcc-toolchain=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-neon --extra-cflags='-mtune=generic-armv7-a' --extra-cflags='-mfloat-abi=softfp' --extra-cflags='-mfpu=neon' --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME android #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/config_components.h index 7e09d5f5..941ec3c9 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/arm64/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/arm64/config.h index eadd0284..c32cd7b0 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/arm64/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/aarch64-linux-android --extra-cflags='--target=aarch64-linux-android24' --extra-ldflags='--target=aarch64-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/aarch64-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/aarch64-linux-android --extra-cflags='--target=aarch64-linux-android24' --extra-ldflags='--target=aarch64-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/aarch64-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME android #define av_restrict restrict #define EXTERN_PREFIX "" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/arm64/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/arm64/config_components.h index 7e09d5f5..941ec3c9 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/arm64/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/arm64/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/arm64/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config.h index 12e20871..8f7c6ee4 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/i686-linux-android --extra-cflags='--target=i686-linux-android24' --extra-ldflags='--target=i686-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/i686-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --disable-x86asm --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/i686-linux-android --extra-cflags='--target=i686-linux-android24' --extra-ldflags='--target=i686-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/i686-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --disable-x86asm --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME android #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -199,7 +198,7 @@ #define HAVE_ALIGNED_STACK 1 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CLZ 1 -#define HAVE_FAST_CMOV 0 +#define HAVE_FAST_CMOV 1 #define HAVE_FAST_FLOAT16 0 #define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 1 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config_components.h index 7e09d5f5..941ec3c9 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/ia32/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/ia32/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/ia32/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/ia32/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.asm b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.asm index ed8bef71..7edacd19 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.asm +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.h index 3ba83b04..0989111b 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/x86_64-linux-android --extra-cflags='--target=x86_64-linux-android24' --extra-ldflags='--target=x86_64-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/x86_64-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=x86_64 --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/x86_64-linux-android --extra-cflags='--target=x86_64-linux-android24' --extra-ldflags='--target=x86_64-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/x86_64-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=x86_64 --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME android #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/x64/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/x64/config_components.h index 7e09d5f5..941ec3c9 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/x64/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/x64/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/x64/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/android/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/config.h index 7368ff7e..29ed1efa 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/17/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/18/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME darwin #define av_restrict restrict #define EXTERN_PREFIX "_" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/config_components.h index 5ad65d1e..74d256a0 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config.asm b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config.asm index d9bdaeec..152bc873 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config.asm +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config.h index bb6d3694..5b648b58 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=x86_64-apple-macosx' --extra-cflags=-F/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/17/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags='-arch x86_64' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=x86_64-apple-macosx' --extra-cflags=-F/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/18/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags='-arch x86_64' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME darwin #define av_restrict restrict #define EXTERN_PREFIX "_" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config_components.h index 1beef521..cc7e540c 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/ios/x64/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/ios/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/ios/x64/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/ios/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config.h index bc2366cd..9ca5c18b 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --disable-asm --disable-inline-asm --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --disable-asm --disable-inline-asm --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -199,7 +198,7 @@ #define HAVE_ALIGNED_STACK 0 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CLZ 0 -#define HAVE_FAST_CMOV 0 +#define HAVE_FAST_CMOV 1 #define HAVE_FAST_FLOAT16 0 #define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 0 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 0 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config_components.h index 1beef521..cc7e540c 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/config.h index 17369792..96c88e3e 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/config_components.h index 5ad65d1e..74d256a0 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm/config.h index a1db8f69..69704027 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm/config_components.h index 5ad65d1e..74d256a0 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/config.h index 7c3cc691..f6e4d95c 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --target-os=linux --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_arm64-sysroot --disable-dotprod --disable-i8mm --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --target-os=linux --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_arm64-sysroot --disable-dotprod --disable-i8mm --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/config_components.h index 5ad65d1e..74d256a0 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.asm b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.asm index abcd3716..baff8fea 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.asm +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.asm @@ -23,7 +23,6 @@ %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 @@ -183,7 +182,7 @@ %define HAVE_ALIGNED_STACK 1 %define HAVE_FAST_64BIT 0 %define HAVE_FAST_CLZ 1 -%define HAVE_FAST_CMOV 0 +%define HAVE_FAST_CMOV 1 %define HAVE_FAST_FLOAT16 0 %define HAVE_LOCAL_ALIGNED 1 %define HAVE_SIMD_ALIGN_16 1 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.h index 3240ff65..9c92dd31 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -199,7 +198,7 @@ #define HAVE_ALIGNED_STACK 1 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CLZ 1 -#define HAVE_FAST_CMOV 0 +#define HAVE_FAST_CMOV 1 #define HAVE_FAST_FLOAT16 0 #define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 1 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config_components.h index 5ad65d1e..74d256a0 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.asm b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.asm index 169bd144..f58c6865 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.asm +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.h index 8af77b02..12a4ce27 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config_components.h index 5ad65d1e..74d256a0 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/config.h index 7368ff7e..29ed1efa 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/17/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/18/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME darwin #define av_restrict restrict #define EXTERN_PREFIX "_" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/config_components.h index 5ad65d1e..74d256a0 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.asm b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.asm index 624a8e54..12ef0724 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.asm +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.h index cd4a0b7b..36e1e861 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=x86_64-apple-macosx' --extra-cflags=-F/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/17/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags='-arch x86_64' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=x86_64-apple-macosx' --extra-cflags=-F/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/18/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags='-arch x86_64' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME darwin #define av_restrict restrict #define EXTERN_PREFIX "_" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config_components.h index 5ad65d1e..74d256a0 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/arm64/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/arm64/config.h index 50cb0da0..94f43b62 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/arm64/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --arch=aarch64 --as=clang-cl --extra-cflags='--target=arm64-windows' --extra-cflags=/winsysroot/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --arch=aarch64 --as=clang-cl --extra-cflags='--target=arm64-windows' --extra-cflags=/winsysroot/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME win32 #define av_restrict restrict #define EXTERN_PREFIX "" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/arm64/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/arm64/config_components.h index 5ad65d1e..74d256a0 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/arm64/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/arm64/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/arm64/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.asm b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.asm index a035258d..d94bf572 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.asm +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.asm @@ -23,7 +23,6 @@ %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 @@ -183,7 +182,7 @@ %define HAVE_ALIGNED_STACK 0 %define HAVE_FAST_64BIT 0 %define HAVE_FAST_CLZ 1 -%define HAVE_FAST_CMOV 0 +%define HAVE_FAST_CMOV 1 %define HAVE_FAST_FLOAT16 0 %define HAVE_LOCAL_ALIGNED 1 %define HAVE_SIMD_ALIGN_16 1 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.h index 0269bee9..a5deb797 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=-m32 --extra-cflags=/winsysroot/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=-m32 --extra-cflags=/winsysroot/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME win32 #define av_restrict restrict #define EXTERN_PREFIX "_" @@ -39,7 +39,6 @@ #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 @@ -199,7 +198,7 @@ #define HAVE_ALIGNED_STACK 0 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CLZ 1 -#define HAVE_FAST_CMOV 0 +#define HAVE_FAST_CMOV 1 #define HAVE_FAST_FLOAT16 0 #define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 1 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config_components.h index 5ad65d1e..74d256a0 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/ia32/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/ia32/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/ia32/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/ia32/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.asm b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.asm index d3e747bb..2df49631 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.asm +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.h index 9987b87d..e524c62f 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/ffmpeg/chromium/include/win --target-os=win64 --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=/winsysroot/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/ffmpeg/chromium/include/win --target-os=win64 --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=/winsysroot/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME win64 #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/x64/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/x64/config_components.h index 5ad65d1e..74d256a0 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/x64/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/config.h index 5131d168..0146247a 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --disable-asm --disable-inline-asm --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --disable-asm --disable-inline-asm --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -199,7 +198,7 @@ #define HAVE_ALIGNED_STACK 0 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CLZ 0 -#define HAVE_FAST_CMOV 0 +#define HAVE_FAST_CMOV 1 #define HAVE_FAST_FLOAT16 0 #define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 0 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 1 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 0 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/config_components.h index de993a66..5942ac4d 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/config.h index fe3eed5b..cc54cf60 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 1 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/config_components.h index de993a66..5942ac4d 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/config.h index 8487aab5..bbbb6a03 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 1 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/config_components.h index de993a66..5942ac4d 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/config.h index 2685c43a..c8964972 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --target-os=linux --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_arm64-sysroot --disable-dotprod --disable-i8mm --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --target-os=linux --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_arm64-sysroot --disable-dotprod --disable-i8mm --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 1 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/config_components.h index de993a66..5942ac4d 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.asm b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.asm index 81e9a599..1cf35ddc 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.asm +++ b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.asm @@ -23,7 +23,6 @@ %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 @@ -183,7 +182,7 @@ %define HAVE_ALIGNED_STACK 1 %define HAVE_FAST_64BIT 0 %define HAVE_FAST_CLZ 1 -%define HAVE_FAST_CMOV 0 +%define HAVE_FAST_CMOV 1 %define HAVE_FAST_FLOAT16 0 %define HAVE_LOCAL_ALIGNED 1 %define HAVE_SIMD_ALIGN_16 1 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 1 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.h index c77ccd04..ede98138 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -199,7 +198,7 @@ #define HAVE_ALIGNED_STACK 1 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CLZ 1 -#define HAVE_FAST_CMOV 0 +#define HAVE_FAST_CMOV 1 #define HAVE_FAST_FLOAT16 0 #define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 1 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 1 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config_components.h index de993a66..5942ac4d 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.asm b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.asm index e9fe6fa8..3d71bee0 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.asm +++ b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 1 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.h index 0a614b1a..ca1ee8db 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 1 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config_components.h index de993a66..5942ac4d 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/config.h index d8d80900..fc761975 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/arm-linux-androideabi --extra-cflags='--target=arm-linux-androideabi24' --extra-ldflags='--target=arm-linux-androideabi24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/arm-linux-androideabi --extra-ldflags='--gcc-toolchain=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-neon --extra-cflags='-mtune=generic-armv7-a' --extra-cflags='-mfloat-abi=softfp' --extra-cflags='-mfpu=neon'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/arm-linux-androideabi --extra-cflags='--target=arm-linux-androideabi24' --extra-ldflags='--target=arm-linux-androideabi24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/arm-linux-androideabi --extra-ldflags='--gcc-toolchain=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-neon --extra-cflags='-mtune=generic-armv7-a' --extra-cflags='-mfloat-abi=softfp' --extra-cflags='-mfpu=neon'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME android #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/config_components.h index 01c9180a..0f131a30 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/arm64/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/arm64/config.h index 85ab27b0..0d51c602 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/arm64/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/aarch64-linux-android --extra-cflags='--target=aarch64-linux-android24' --extra-ldflags='--target=aarch64-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/aarch64-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/aarch64-linux-android --extra-cflags='--target=aarch64-linux-android24' --extra-ldflags='--target=aarch64-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/aarch64-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME android #define av_restrict restrict #define EXTERN_PREFIX "" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/arm64/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/arm64/config_components.h index 01c9180a..0f131a30 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/arm64/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/arm64/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/arm64/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config.h index dc245d96..2905f63e 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/i686-linux-android --extra-cflags='--target=i686-linux-android24' --extra-ldflags='--target=i686-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/i686-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --disable-x86asm" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/i686-linux-android --extra-cflags='--target=i686-linux-android24' --extra-ldflags='--target=i686-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/i686-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --disable-x86asm" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME android #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -199,7 +198,7 @@ #define HAVE_ALIGNED_STACK 1 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CLZ 1 -#define HAVE_FAST_CMOV 0 +#define HAVE_FAST_CMOV 1 #define HAVE_FAST_FLOAT16 0 #define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 1 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config_components.h index 01c9180a..0f131a30 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/ia32/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/ia32/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/ia32/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/ia32/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.asm b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.asm index d89a8d7d..af65909a 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.asm +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.h index af721ef9..9cabe944 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/x86_64-linux-android --extra-cflags='--target=x86_64-linux-android24' --extra-ldflags='--target=x86_64-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/x86_64-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=x86_64" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/x86_64-linux-android --extra-cflags='--target=x86_64-linux-android24' --extra-ldflags='--target=x86_64-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/x86_64-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=x86_64" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME android #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/x64/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/x64/config_components.h index 01c9180a..0f131a30 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/x64/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/x64/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/x64/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/android/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/config.h index 1ea6a410..81b7c892 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/17/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/18/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME darwin #define av_restrict restrict #define EXTERN_PREFIX "_" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/config_components.h index 4190b27f..a761e839 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config.asm b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config.asm index a853fb10..c34ea5ab 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config.asm +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config.h index c727314c..d7d2b758 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=x86_64-apple-macosx' --extra-cflags=-F/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/17/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags='-arch x86_64'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=x86_64-apple-macosx' --extra-cflags=-F/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/18/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags='-arch x86_64'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME darwin #define av_restrict restrict #define EXTERN_PREFIX "_" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config_components.h index 21fcd6e8..9989b924 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/ios/x64/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/ios/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/ios/x64/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/ios/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config.h index d71113bc..3ce5ca87 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --disable-asm --disable-inline-asm --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --disable-asm --disable-inline-asm --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -199,7 +198,7 @@ #define HAVE_ALIGNED_STACK 0 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CLZ 0 -#define HAVE_FAST_CMOV 0 +#define HAVE_FAST_CMOV 1 #define HAVE_FAST_FLOAT16 0 #define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 0 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 0 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config_components.h index 4190b27f..a761e839 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/config.h index fc4d6a73..83d9b656 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/config_components.h index 4190b27f..a761e839 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm/config.h index da119eca..7244b86d 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm/config_components.h index 4190b27f..a761e839 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/config.h index 7ef01779..b0cb35cd 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --target-os=linux --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_arm64-sysroot --disable-dotprod --disable-i8mm --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --target-os=linux --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_arm64-sysroot --disable-dotprod --disable-i8mm --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/config_components.h index 4190b27f..a761e839 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.asm b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.asm index 1721ad67..6247ebfb 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.asm +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.asm @@ -23,7 +23,6 @@ %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 @@ -183,7 +182,7 @@ %define HAVE_ALIGNED_STACK 1 %define HAVE_FAST_64BIT 0 %define HAVE_FAST_CLZ 1 -%define HAVE_FAST_CMOV 0 +%define HAVE_FAST_CMOV 1 %define HAVE_FAST_FLOAT16 0 %define HAVE_LOCAL_ALIGNED 1 %define HAVE_SIMD_ALIGN_16 1 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.h index 8aff558d..b4b36a0f 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -199,7 +198,7 @@ #define HAVE_ALIGNED_STACK 1 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CLZ 1 -#define HAVE_FAST_CMOV 0 +#define HAVE_FAST_CMOV 1 #define HAVE_FAST_FLOAT16 0 #define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 1 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config_components.h index 4190b27f..a761e839 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.asm b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.asm index 1c5a80d7..761a2ada 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.asm +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.h index e10b48dc..85423097 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config_components.h index 4190b27f..a761e839 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/x64/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/x64/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/linux/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/config.h index 1ea6a410..81b7c892 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/17/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/18/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME darwin #define av_restrict restrict #define EXTERN_PREFIX "_" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/config_components.h index 4190b27f..a761e839 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.asm b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.asm index 11813e74..492a5a81 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.asm +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.h index 1e2489a4..0d226f54 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=x86_64-apple-macosx' --extra-cflags=-F/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/17/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags='-arch x86_64'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=x86_64-apple-macosx' --extra-cflags=-F/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/18/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags='-arch x86_64'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME darwin #define av_restrict restrict #define EXTERN_PREFIX "_" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config_components.h index 4190b27f..a761e839 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/mac/x64/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/mac/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/mac/x64/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/mac/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/arm64/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/arm64/config.h index 75f13c43..0c388498 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/arm64/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --arch=aarch64 --as=clang-cl --extra-cflags='--target=arm64-windows' --extra-cflags=/winsysroot/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --arch=aarch64 --as=clang-cl --extra-cflags='--target=arm64-windows' --extra-cflags=/winsysroot/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME win32 #define av_restrict restrict #define EXTERN_PREFIX "" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/arm64/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/arm64/config_components.h index 4190b27f..a761e839 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/arm64/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/arm64/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/arm64/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.asm b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.asm index b3e84b2e..3d6b2793 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.asm +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.asm @@ -23,7 +23,6 @@ %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 @@ -183,7 +182,7 @@ %define HAVE_ALIGNED_STACK 0 %define HAVE_FAST_64BIT 0 %define HAVE_FAST_CLZ 1 -%define HAVE_FAST_CMOV 0 +%define HAVE_FAST_CMOV 1 %define HAVE_FAST_FLOAT16 0 %define HAVE_LOCAL_ALIGNED 1 %define HAVE_SIMD_ALIGN_16 1 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.h index 790f5c8e..59ae3062 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=-m32 --extra-cflags=/winsysroot/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=-m32 --extra-cflags=/winsysroot/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME win32 #define av_restrict restrict #define EXTERN_PREFIX "_" @@ -39,7 +39,6 @@ #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 @@ -199,7 +198,7 @@ #define HAVE_ALIGNED_STACK 0 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CLZ 1 -#define HAVE_FAST_CMOV 0 +#define HAVE_FAST_CMOV 1 #define HAVE_FAST_FLOAT16 0 #define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 1 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config_components.h index 4190b27f..a761e839 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/ia32/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/ia32/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/ia32/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/ia32/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.asm b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.asm index 36f8b667..37481669 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.asm +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.h index c8588609..8f316201 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/ffmpeg/chromium/include/win --target-os=win64 --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=/winsysroot/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/ffmpeg/chromium/include/win --target-os=win64 --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=/winsysroot/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME win64 #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/x64/config_components.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/x64/config_components.h index 4190b27f..a761e839 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/x64/config_components.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/x64/libavutil/ffversion.h b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/x64/libavutil/ffversion.h +++ b/arm/raspi/third_party/ffmpeg/chromium/config/Chromium/win/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/arm/raspi/third_party/ffmpeg/chromium/ffmpeg.sigs b/arm/raspi/third_party/ffmpeg/chromium/ffmpeg.sigs old mode 100755 new mode 100644 index 83c90539..4286e63a --- a/arm/raspi/third_party/ffmpeg/chromium/ffmpeg.sigs +++ b/arm/raspi/third_party/ffmpeg/chromium/ffmpeg.sigs @@ -66,6 +66,7 @@ void *av_buffer_get_opaque(const AVBufferRef *buf); int av_get_cpu_flags(void); void av_force_cpu_flags(int flags); void av_max_alloc(size_t max); +char *av_strdup(const char *s); int av_strerror(int errnum, char *errbuf, size_t errbuf_size); AVFrame *av_frame_clone(const AVFrame *src); void av_frame_unref(AVFrame *frame); diff --git a/arm/raspi/third_party/ffmpeg/chromium/patches/README b/arm/raspi/third_party/ffmpeg/chromium/patches/README index ebc9c346..85ad6f19 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/patches/README +++ b/arm/raspi/third_party/ffmpeg/chromium/patches/README @@ -3,112 +3,6 @@ --------------------------------------------------------------------- ------------------------------------------------------------------- -commit 35a9efdd9ee40dff4a5e45f0039328cd893c1264 -Author: Dale Curtis -Date: Fri Feb 3 16:12:21 2012 -0800 - - Remove old patches, apply existing patches. - - Deleted, since from upstream: - deleted: from_upstream/36_theora_flush.patch - deleted: from_upstream/38_webm_cues_before_first_cluster.patch - deleted: from_upstream/51_vp3_coefficient_overflow.patch - - Deleted, since non-working according to rbultje: - deleted: to_upstream/15_webp_ffmpeg.patch - - Deleted, since get_bits upstreamed: - deleted: ugly/07_get_bits_overrun.patch - deleted: ugly/08_enforce_theora_oob.patch - deleted: ugly/09_enforce_vorbis_oob_divzero.patch - deleted: ugly/10_aac_oob_read.patch - deleted: ugly/30_enforce_mp3_oob.patch - - Deleted, since upstreamed: - deleted: to_upstream/14_vp8_encode_options.patch - deleted: to_upstream/34_ogg_memcpy.patch - deleted: to_upstream/37_VP8_armv6_optimizations.patch - deleted: to_upstream/39_VP8_fix_oob_read_writes.patch - deleted: to_upstream/40_MKV_fix_oob_write.patch - deleted: to_upstream/42_vp8_fix_segmentation_maps.patch - deleted: to_upstream/43_mkv_seekahead_revalidate.patch - deleted: to_upstream/44_vorbis_oob_read.patch - deleted: to_upstream/45_mkv_fix_segmap_cache_overflow.patch - deleted: to_upstream/46_vp3_fix_double_free_invalid_read.patch - deleted: to_upstream/47_vp3_fix_infloop_and_memleak.patch - deleted: to_upstream/48_vorbis_residue_buffer.patch - deleted: to_upstream/49_vorbis_buffer_defense.patch - deleted: to_upstream/50_vp8_fix_frame_size_changes.patch - deleted: to_upstream/52_vorbis_fix_floor1_vector_int_overflow.patch - - Deleted, for now, but will be fixed w/ merge: - modified: ugly/31_remove_attribute_deprecated.patch - - Not applied, since no longer necessary (will be deleted after testing): - skipped: to_upstream/01_static_pthread_O2.patch - - Also disables unchecked bitstream reading per rbultje. - - BUG=none - TEST=ffmpeg_regression_tests - -Affects: - libavformat/matroskadec.c - ------------------------------------------------------------------- -commit 87b9d8e5781b28ae6f27b454605d8dbdf325d7e9 -Merge: 3a9bce0eec c39916bc2f -Author: Dale Curtis -Date: Mon Oct 1 10:30:25 2012 -0700 - - FFmpeg merge for M24. - - Merges FFmpeg from c39916bc2f43eed86f9822b7d6802b8a4f2a86c8 - - Conflicts: - libavcodec/vorbisdec.c - libavformat/matroskadec.c - libavformat/mov.c - libavformat/oggdec.c - -Affects: - libavformat/matroskadec.c - ------------------------------------------------------------------- -commit 67a3d8459c78a653192631c84611cf300c0c9b19 -Merge: 82ae69cc47 d91388367f -Author: Dale Curtis -Date: Mon Dec 3 14:22:52 2012 -0800 - - Merge FFmpeg from upstream for M25. - - Merged from d91388367fa64b98a09b45e2b7fb8435a62b7609. - - Conflicts: - configure - libavcodec/aacdec.c - libavcodec/ac3tab.h - libavcodec/dca.h - libavcodec/dnxhddata.h - libavcodec/mjpeg.h - libavcodec/mpeg4audio.h - libavcodec/mpegaudiodata.h - libavcodec/raw.h - libavformat/matroskadec.c - libavformat/mp3dec.c - libavutil/aes.h - libavutil/common.h - libavutil/intmath.h - libavutil/md5.h - libavutil/pixdesc.h - libavutil/sha.h - libavutil/tree.h - library.mak - -Affects: - libavformat/matroskadec.c - ------------------------------------------------------------------ commit 3a43b481b78e54009e293c6c6172fc6c68990d8c Author: Will Harris @@ -126,23 +20,6 @@ Date: Wed Jan 21 20:33:15 2015 -0800 Affects: libavutil/mem.c ------------------------------------------------------------------- -commit 967e4da013f8997d4cc34f1008f082a9c55e191f -Author: Dan Sanders -Date: Thu Jan 29 14:10:48 2015 -0800 - - Update patches and configs for M42. - - - Adds ffversion.h. - - Fixes to build with win8.1 SDK and for linux-noasm. - - Removed ugly patches and replaced with descriptions; - the patches were not being kept up to date. - - Change-Id: Ie0eab2bf3ab6c52cd088e54172792175ab7cb2de - -Affects: - libavformat/matroskadec.c - ------------------------------------------------------------------ commit f3299330654ac1b40c50b3cbcae619f42eb7d838 Author: Scott Graham @@ -246,27 +123,6 @@ Date: Fri Oct 21 15:49:44 2016 -0700 Affects: configure ------------------------------------------------------------------- -commit e4decbe7fd3f49d90f296e83bcbf2beb8edf202a -Merge: b4d337e668 134233972e -Author: Matt Wolenetz -Date: Tue Oct 25 14:31:38 2016 -0700 - - Merge FFmpeg for M56. - - Conflicts: - .gitignore - configure - libavcodec/h264.c - libavcodec/h264_parser.c - libavformat/matroskadec.c - libavformat/mov.c - libavformat/movenc.c - libavformat/utils.c - -Affects: - libavformat/matroskadec.c - ------------------------------------------------------------------ commit b281073a7b1ccff67b2cd8ec636facceeeb82327 Author: Matt Wolenetz @@ -433,19 +289,6 @@ Affects: libavutil/log.c libavutil/log.h ------------------------------------------------------------------- -commit 4a74bbe9c6a37e7cadd7fa3b4e9fb943b57e3f00 -Merge: bb424af97f 6a50a8f340 -Author: Dale Curtis -Date: Fri Nov 3 12:06:55 2017 -0700 - - Merge remote-tracking branch 'upstream/master' into merge-m64 - - Synced from upstream/6a50a8f340161a0b65feb3537591b0381a6a6b38 - -Affects: - configure - ------------------------------------------------------------------ commit 76b57e9f808de42f6f1bb7df97531aa4b5cb7bb0 Author: Dale Curtis @@ -608,21 +451,6 @@ Date: Thu Nov 8 10:55:58 2018 -0800 Affects: libavutil/x86/x86inc.asm ------------------------------------------------------------------- -commit d7ba23c23434eb938c6fcae4fe77ca1e2a2fbeff -Author: liberato@chromium.org -Date: Thu Aug 22 10:52:09 2019 -0700 - - Fail matroska parsing with an error rather than assert. - - Bug: 995706 - Change-Id: I6f9865e0fdf44def6cc40e369954e66a7e0ad1d1 - Reviewed-on: https://chromium-review.googlesource.com/c/chromium/third_party/ffmpeg/+/1765951 - Reviewed-by: Matthew Wolenetz - -Affects: - libavformat/matroskadec.c - ------------------------------------------------------------------ commit 6a44f89787a6103bf85825aac5b7bcfdba0dde5f Merge: c5003c8e13 acbd950ed2 @@ -849,7 +677,6 @@ Affects: libavcodec/mpeg4video_parser.c libavcodec/smacker.c libavcodec/utvideodec.c - libavformat/matroskadec.c ------------------------------------------------------------------ commit 1bc7749f096fc98032fc3206217b4fc47047258f @@ -954,17 +781,18 @@ Affects: libavutil/frame.h ------------------------------------------------------------------ -commit 881c5c3f6412020c37e97e178e0f5da9ddd2ae90 -Author: Frank Liberato -Date: Thu Jun 1 18:20:23 2023 +0000 +commit 125536d78f103ff44efeb26c4d7c98413a5a618f +Merge: 0d75f366d5 9240035c0e +Author: John Rummell +Date: Wed Oct 4 10:12:40 2023 -0700 - FFMpeg roll for M116 + Merge remote-tracking branch 'upstream/master' into sushi-2023-10-04-10-06-42 - Bug: 1449369 - Change-Id: Icb1bf9347dcf6ec71e61f552ab060cd8ba7504d2 - Reviewed-on: https://chromium-review.googlesource.com/c/chromium/third_party/ffmpeg/+/4581055 - Reviewed-by: Thomas Guilbert + Conflicts: + both modified: configure + both modified: libavformat/matroskadec.c + deleted by us: libavutil/macos_kperf.c Affects: - libavcodec/vp8data.c + configure diff --git a/arm/raspi/third_party/ffmpeg/chromium/patches/config_flag_changes.txt b/arm/raspi/third_party/ffmpeg/chromium/patches/config_flag_changes.txt index e69de29b..f3061930 100644 --- a/arm/raspi/third_party/ffmpeg/chromium/patches/config_flag_changes.txt +++ b/arm/raspi/third_party/ffmpeg/chromium/patches/config_flag_changes.txt @@ -0,0 +1,23 @@ ++ CONFIG_APSNR_FILTER 0 ++ CONFIG_ASISDR_FILTER 0 ++ CONFIG_AV1_VAAPI_ENCODER 0 ++ CONFIG_JPEGXL_PARSER 0 ++ CONFIG_LIBVMAF_CUDA_FILTER 0 ++ CONFIG_MPEG2_NVDEC_HWACCEL 0 ++ CONFIG_OSQ_DECODER 0 ++ CONFIG_OSQ_DEMUXER 0 ++ CONFIG_RV34_PARSER 0 ++ CONFIG_SCALE_VT_FILTER 0 ++ CONFIG_TRANSPOSE_VT_FILTER 0 ++ CONFIG_USM_DEMUXER 0 ++ HAVE_FAST_CMOV 1 ++ HAVE_OPENVINO2 0 +- ARCH_TOMI 0 +- CONFIG_DCT 1 +- CONFIG_FFT 1 +- CONFIG_MDCT 0 +- CONFIG_MPEG2_NVDEC_HWACCEL 0 +- CONFIG_RDFT 1 +- CONFIG_RV30_PARSER 0 +- CONFIG_RV40_PARSER 0 +- HAVE_FAST_CMOV 0 diff --git a/arm/raspi/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py b/arm/raspi/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py index 45f3476b..f57d1118 100755 --- a/arm/raspi/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py +++ b/arm/raspi/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py @@ -26,7 +26,7 @@ ROBO_CONFIGURATION = config.RoboConfiguration() FFMPEG_DIR = ROBO_CONFIGURATION.ffmpeg_home() CHROMIUM_ROOT_DIR = ROBO_CONFIGURATION.chrome_src() NDK_ROOT_DIR = os.path.abspath( - os.path.join(CHROMIUM_ROOT_DIR, 'third_party', 'android_toolchain')) + os.path.join(CHROMIUM_ROOT_DIR, 'third_party', 'android_toolchain', 'ndk')) # Token to indicate that a build has completed successfully, so that we can # skip it with `--fast`. SUCCESS_TOKEN = 'THIS_BUILD_WORKED' @@ -683,8 +683,6 @@ def ConfigureAndBuild(target_arch, target_os, host_os, host_arch, parallel_jobs, '--enable-avcodec', '--enable-avformat', '--enable-avutil', - '--enable-fft', - '--enable-rdft', '--enable-static', '--enable-libopus', diff --git a/arm/raspi/third_party/ffmpeg/ffmpeg_generated.gni b/arm/raspi/third_party/ffmpeg/ffmpeg_generated.gni index df7a1004..d933edfd 100644 --- a/arm/raspi/third_party/ffmpeg/ffmpeg_generated.gni +++ b/arm/raspi/third_party/ffmpeg/ffmpeg_generated.gni @@ -33,16 +33,12 @@ if ((is_android && current_cpu == "arm" && arm_use_neon) || (is_android && curre "libavcodec/codec_desc.c", "libavcodec/codec_par.c", "libavcodec/d3d11va.c", - "libavcodec/dct.c", "libavcodec/dct32_fixed.c", "libavcodec/dct32_float.c", "libavcodec/decode.c", "libavcodec/dirac.c", "libavcodec/dv_profile.c", "libavcodec/encode.c", - "libavcodec/fft_fixed_32.c", - "libavcodec/fft_float.c", - "libavcodec/fft_init_table.c", "libavcodec/flac.c", "libavcodec/flac_parser.c", "libavcodec/flacdata.c", @@ -80,7 +76,6 @@ if ((is_android && current_cpu == "arm" && arm_use_neon) || (is_android && curre "libavcodec/pthread_slice.c", "libavcodec/qsv_api.c", "libavcodec/raw.c", - "libavcodec/rdft.c", "libavcodec/to_upper4.c", "libavcodec/utils.c", "libavcodec/version.c", @@ -166,6 +161,7 @@ if ((is_android && current_cpu == "arm" && arm_use_neon) || (is_android && curre "libavutil/encryption_info.c", "libavutil/error.c", "libavutil/eval.c", + "libavutil/executor.c", "libavutil/fifo.c", "libavutil/file_open.c", "libavutil/film_grain_params.c", @@ -204,6 +200,7 @@ if ((is_android && current_cpu == "arm" && arm_use_neon) || (is_android && curre "libavutil/tx.c", "libavutil/uuid.c", "libavutil/video_enc_params.c", + "libavutil/video_hint.c", ] } @@ -312,28 +309,6 @@ if ((current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (current_cpu == " ] } -if ((is_apple && current_cpu == "x64") || (is_win && current_cpu == "x64") || (is_win && current_cpu == "x86") || (use_linux_config && current_cpu == "x64") || (use_linux_config && current_cpu == "x86")) { - ffmpeg_c_sources += [ - "libavcodec/x86/autorename_libavcodec_x86_videodsp_init.c", - "libavcodec/x86/h264_intrapred_init.c", - "libavcodec/x86/hpeldsp_init.c", - "libavcodec/x86/hpeldsp_vp3_init.c", - "libavcodec/x86/vp3dsp_init.c", - "libavcodec/x86/vp8dsp_init.c", - ] - ffmpeg_asm_sources += [ - "libavcodec/x86/autorename_libavcodec_x86_hpeldsp.asm", - "libavcodec/x86/autorename_libavcodec_x86_videodsp.asm", - "libavcodec/x86/autorename_libavcodec_x86_vp3dsp.asm", - "libavcodec/x86/autorename_libavcodec_x86_vp8dsp.asm", - "libavcodec/x86/fpel.asm", - "libavcodec/x86/h264_intrapred.asm", - "libavcodec/x86/h264_intrapred_10bit.asm", - "libavcodec/x86/hpeldsp_vp3.asm", - "libavcodec/x86/vp8dsp_loopfilter.asm", - ] -} - if ((use_linux_config && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "ChromeOS") || (use_linux_config && current_cpu == "arm" && ffmpeg_branding == "ChromeOS")) { ffmpeg_c_sources += [ "libavcodec/arm/blockdsp_init_arm.c", @@ -414,6 +389,26 @@ if ((use_linux_config && current_cpu == "x64" && ffmpeg_branding == "ChromeOS") ] } +if ((is_apple && current_cpu == "x64") || (is_win && current_cpu == "x64") || (is_win && current_cpu == "x86") || (use_linux_config && current_cpu == "x64") || (use_linux_config && current_cpu == "x86")) { + ffmpeg_c_sources += [ + "libavcodec/x86/autorename_libavcodec_x86_videodsp_init.c", + "libavcodec/x86/h264_intrapred_init.c", + "libavcodec/x86/hpeldsp_init.c", + "libavcodec/x86/vp3dsp_init.c", + "libavcodec/x86/vp8dsp_init.c", + ] + ffmpeg_asm_sources += [ + "libavcodec/x86/autorename_libavcodec_x86_hpeldsp.asm", + "libavcodec/x86/autorename_libavcodec_x86_videodsp.asm", + "libavcodec/x86/autorename_libavcodec_x86_vp3dsp.asm", + "libavcodec/x86/autorename_libavcodec_x86_vp8dsp.asm", + "libavcodec/x86/fpel.asm", + "libavcodec/x86/h264_intrapred.asm", + "libavcodec/x86/h264_intrapred_10bit.asm", + "libavcodec/x86/vp8dsp_loopfilter.asm", + ] +} + if ((use_linux_config && current_cpu == "arm" && arm_use_neon) || (use_linux_config && current_cpu == "arm")) { ffmpeg_c_sources += [ "libavcodec/arm/h264pred_init_arm.c", @@ -434,44 +429,6 @@ if ((use_linux_config && current_cpu == "arm" && arm_use_neon) || (use_linux_con ] } -if ((is_android && current_cpu == "x64") || (is_apple && current_cpu == "x64") || (is_win && current_cpu == "x64") || (is_win && current_cpu == "x86") || (use_linux_config && current_cpu == "x64") || (use_linux_config && current_cpu == "x86")) { - ffmpeg_c_sources += [ - "libavutil/x86/autorename_libavutil_x86_tx_float_init.c", - ] - ffmpeg_asm_sources += [ - "libavcodec/x86/dct32.asm", - "libavcodec/x86/fft.asm", - "libavcodec/x86/flacdsp.asm", - "libavcodec/x86/imdct36.asm", - "libavcodec/x86/vorbisdsp.asm", - "libavutil/x86/cpuid.asm", - "libavutil/x86/fixed_dsp.asm", - "libavutil/x86/float_dsp.asm", - "libavutil/x86/imgutils.asm", - "libavutil/x86/lls.asm", - "libavutil/x86/tx_float.asm", - ] -} - -if ((is_android && current_cpu == "arm" && arm_use_neon) || (use_linux_config && current_cpu == "arm" && arm_use_neon) || (use_linux_config && current_cpu == "arm")) { - ffmpeg_c_sources += [ - "libavcodec/arm/fft_init_arm.c", - "libavcodec/arm/flacdsp_init_arm.c", - "libavcodec/arm/mpegaudiodsp_init_arm.c", - "libavcodec/arm/rdft_init_arm.c", - "libavcodec/arm/vorbisdsp_init_arm.c", - "libavutil/arm/autorename_libavutil_arm_cpu.c", - "libavutil/arm/float_dsp_init_arm.c", - "libavutil/arm/float_dsp_init_vfp.c", - ] - ffmpeg_gas_sources += [ - "libavcodec/arm/fft_vfp.S", - "libavcodec/arm/flacdsp_arm.S", - "libavcodec/arm/mpegaudiodsp_fixed_armv6.S", - "libavutil/arm/float_dsp_vfp.S", - ] -} - if ((is_apple) || (is_win) || (use_linux_config)) { ffmpeg_c_sources += [ "libavcodec/autorename_libavcodec_videodsp.c", @@ -489,12 +446,28 @@ if ((is_apple) || (is_win) || (use_linux_config)) { ] } +if ((is_android && current_cpu == "x64") || (is_apple && current_cpu == "x64") || (is_win && current_cpu == "x64") || (is_win && current_cpu == "x86") || (use_linux_config && current_cpu == "x64") || (use_linux_config && current_cpu == "x86")) { + ffmpeg_c_sources += [ + "libavutil/x86/autorename_libavutil_x86_tx_float_init.c", + ] + ffmpeg_asm_sources += [ + "libavcodec/x86/dct32.asm", + "libavcodec/x86/flacdsp.asm", + "libavcodec/x86/imdct36.asm", + "libavcodec/x86/vorbisdsp.asm", + "libavutil/x86/cpuid.asm", + "libavutil/x86/fixed_dsp.asm", + "libavutil/x86/float_dsp.asm", + "libavutil/x86/imgutils.asm", + "libavutil/x86/lls.asm", + "libavutil/x86/tx_float.asm", + ] +} + if ((is_android && current_cpu == "x64") || (is_android && current_cpu == "x86") || (is_apple && current_cpu == "x64") || (is_win && current_cpu == "x64") || (is_win && current_cpu == "x86") || (use_linux_config && current_cpu == "x64") || (use_linux_config && current_cpu == "x86")) { ffmpeg_c_sources += [ "libavcodec/x86/autorename_libavcodec_x86_vorbisdsp_init.c", "libavcodec/x86/constants.c", - "libavcodec/x86/dct_init.c", - "libavcodec/x86/fft_init.c", "libavcodec/x86/flacdsp_init.c", "libavcodec/x86/mpegaudiodsp.c", "libavutil/x86/autorename_libavutil_x86_cpu.c", @@ -507,15 +480,13 @@ if ((is_android && current_cpu == "x64") || (is_android && current_cpu == "x86") if ((is_android && current_cpu == "arm64") || (is_apple && current_cpu == "arm64") || (is_win && current_cpu == "arm64") || (use_linux_config && current_cpu == "arm64")) { ffmpeg_c_sources += [ - "libavcodec/aarch64/fft_init_aarch64.c", "libavcodec/aarch64/mpegaudiodsp_init.c", "libavcodec/aarch64/vorbisdsp_init.c", - "libavutil/aarch64/cpu.c", + "libavutil/aarch64/autorename_libavutil_aarch64_cpu.c", "libavutil/aarch64/float_dsp_init.c", "libavutil/aarch64/tx_float_init.c", ] ffmpeg_gas_sources += [ - "libavcodec/aarch64/autorename_libavcodec_aarch64_fft_neon.S", "libavcodec/aarch64/autorename_libavcodec_aarch64_vorbisdsp_neon.S", "libavcodec/aarch64/mpegaudiodsp_neon.S", "libavutil/aarch64/autorename_libavutil_aarch64_float_dsp_neon.S", @@ -523,6 +494,22 @@ if ((is_android && current_cpu == "arm64") || (is_apple && current_cpu == "arm64 ] } +if ((is_android && current_cpu == "arm" && arm_use_neon) || (use_linux_config && current_cpu == "arm" && arm_use_neon) || (use_linux_config && current_cpu == "arm")) { + ffmpeg_c_sources += [ + "libavcodec/arm/flacdsp_init_arm.c", + "libavcodec/arm/mpegaudiodsp_init_arm.c", + "libavcodec/arm/vorbisdsp_init_arm.c", + "libavutil/arm/cpu.c", + "libavutil/arm/float_dsp_init_arm.c", + "libavutil/arm/float_dsp_init_vfp.c", + ] + ffmpeg_gas_sources += [ + "libavcodec/arm/flacdsp_arm.S", + "libavcodec/arm/mpegaudiodsp_fixed_armv6.S", + "libavutil/arm/float_dsp_vfp.S", + ] +} + if ((is_apple && current_cpu == "arm64") || (is_win && current_cpu == "arm64") || (use_linux_config && current_cpu == "arm64")) { ffmpeg_c_sources += [ "libavcodec/aarch64/h264pred_init.c", @@ -549,7 +536,7 @@ if ((is_apple && current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (is_w "libavcodec/aarch64/autorename_libavcodec_aarch64_hevcdsp_sao_neon.S", "libavcodec/aarch64/hevcdsp_deblock_neon.S", "libavcodec/aarch64/hevcdsp_epel_neon.S", - "libavcodec/aarch64/hevcdsp_qpel_neon.S", + "libavcodec/aarch64/hevcdsp_qpel_neon.S" ] ffmpeg_c_sources += [ @@ -591,18 +578,6 @@ if (use_linux_config && current_cpu == "arm" && arm_use_neon) { ] } -if ((is_android && current_cpu == "arm" && arm_use_neon) || (use_linux_config && current_cpu == "arm" && arm_use_neon)) { - ffmpeg_c_sources += [ - "libavutil/arm/float_dsp_init_neon.c", - ] - ffmpeg_gas_sources += [ - "libavcodec/arm/fft_neon.S", - "libavcodec/arm/rdft_neon.S", - "libavcodec/arm/vorbisdsp_neon.S", - "libavutil/arm/float_dsp_neon.S", - ] -} - if (use_linux_config && current_cpu == "arm64" && ffmpeg_branding == "ChromeOS") { ffmpeg_c_sources += [ "libavcodec/aarch64/idctdsp_init_aarch64.c", @@ -663,6 +638,16 @@ if ((current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (use_linux_config ] } +if ((is_android && current_cpu == "arm" && arm_use_neon) || (use_linux_config && current_cpu == "arm" && arm_use_neon)) { + ffmpeg_c_sources += [ + "libavutil/arm/float_dsp_init_neon.c", + ] + ffmpeg_gas_sources += [ + "libavcodec/arm/vorbisdsp_neon.S", + "libavutil/arm/float_dsp_neon.S", + ] +} + if ((current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (use_linux_config && current_cpu == "x64" && ffmpeg_branding == "ChromeOS") || (use_linux_config && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (use_linux_config && current_cpu == "x86" && ffmpeg_branding == "ChromeOS")) { ffmpeg_c_sources += [ "libavcodec/x86/aacpsdsp_init.c", diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/4xm.c b/arm/raspi/third_party/ffmpeg/libavcodec/4xm.c index 411e50da..c3e3a45d 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/4xm.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/4xm.c @@ -257,10 +257,10 @@ static av_cold void init_vlcs(void) for (j = 0; j < 4; j++) { block_type_vlc[i][j].table = table[i][j]; block_type_vlc[i][j].table_allocated = 32; - init_vlc(&block_type_vlc[i][j], BLOCK_TYPE_VLC_BITS, 7, + vlc_init(&block_type_vlc[i][j], BLOCK_TYPE_VLC_BITS, 7, &block_type_tab[i][j][0][1], 2, 1, &block_type_tab[i][j][0][0], 2, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); } } } @@ -706,8 +706,8 @@ static const uint8_t *read_huffman_tables(FourXContext *f, len_tab[j] = len; } - ff_free_vlc(&f->pre_vlc); - if (init_vlc(&f->pre_vlc, ACDC_VLC_BITS, 257, len_tab, 1, 1, + ff_vlc_free(&f->pre_vlc); + if (vlc_init(&f->pre_vlc, ACDC_VLC_BITS, 257, len_tab, 1, 1, bits_tab, 4, 4, 0)) return NULL; @@ -985,7 +985,7 @@ static av_cold int decode_end(AVCodecContext *avctx) av_freep(&f->cfrm[i].data); f->cfrm[i].allocated_size = 0; } - ff_free_vlc(&f->pre_vlc); + ff_vlc_free(&f->pre_vlc); return 0; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/8bps.c b/arm/raspi/third_party/ffmpeg/libavcodec/8bps.c index af98f62f..0becaa93 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/8bps.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/8bps.c @@ -26,27 +26,23 @@ * http://www.pcisys.net/~melanson/codecs/ * * Supports: PAL8 (RGB 8bpp, paletted) - * : BGR24 (RGB 24bpp) (can also output it as RGB32) - * : RGB32 (RGB 32bpp, 4th plane is alpha) + * : GBRP (RGB 24bpp) + * : GBRAP (RGB 32bpp, 4th plane is alpha) */ #include -#include "libavutil/bswap.h" +#include "libavutil/intreadwrite.h" #include "libavutil/internal.h" #include "avcodec.h" #include "codec_internal.h" #include "decode.h" - -static const enum AVPixelFormat pixfmt_rgb24[] = { - AV_PIX_FMT_BGR24, AV_PIX_FMT_0RGB32, AV_PIX_FMT_NONE }; - typedef struct EightBpsContext { AVCodecContext *avctx; - unsigned char planes; - unsigned char planemap[4]; + uint8_t planes; + uint8_t planemap[4]; } EightBpsContext; static int decode_frame(AVCodecContext *avctx, AVFrame *frame, @@ -55,15 +51,14 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; EightBpsContext * const c = avctx->priv_data; - const unsigned char *encoded = buf; - unsigned char *pixptr, *pixptr_end; + const uint8_t *encoded = buf; + uint8_t *pixptr, *pixptr_end; unsigned int height = avctx->height; // Real image height unsigned int dlen, p, row; - const unsigned char *lp, *dp, *ep; - unsigned char count; - unsigned int px_inc; - unsigned int planes = c->planes; - unsigned char *planemap = c->planemap; + const uint8_t *lp, *dp, *ep; + uint8_t count; + const uint8_t *planemap = c->planemap; + unsigned int planes = c->planes; int ret; if (buf_size < planes * height * 2) @@ -77,19 +72,18 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, /* Set data pointer after line lengths */ dp = encoded + planes * (height << 1); - px_inc = planes + (avctx->pix_fmt == AV_PIX_FMT_0RGB32); - for (p = 0; p < planes; p++) { + const int pi = planemap[p]; /* Lines length pointer for this plane */ lp = encoded + p * (height << 1); /* Decode a plane */ for (row = 0; row < height; row++) { - pixptr = frame->data[0] + row * frame->linesize[0] + planemap[p]; - pixptr_end = pixptr + frame->linesize[0]; + pixptr = frame->data[pi] + row * frame->linesize[pi]; + pixptr_end = pixptr + frame->linesize[pi]; if (ep - lp < row * 2 + 2) return AVERROR_INVALIDDATA; - dlen = av_be2ne16(*(const unsigned short *)(lp + row * 2)); + dlen = AV_RB16(lp + row * 2); /* Decode a row of this plane */ while (dlen > 0) { if (ep - dp <= 1) @@ -97,22 +91,19 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, if ((count = *dp++) <= 127) { count++; dlen -= count + 1; - if (pixptr_end - pixptr < count * px_inc) + if (pixptr_end - pixptr < count) break; if (ep - dp < count) return AVERROR_INVALIDDATA; - while (count--) { - *pixptr = *dp++; - pixptr += px_inc; - } + memcpy(pixptr, dp, count); + pixptr += count; + dp += count; } else { count = 257 - count; - if (pixptr_end - pixptr < count * px_inc) + if (pixptr_end - pixptr < count) break; - while (count--) { - *pixptr = *dp; - pixptr += px_inc; - } + memset(pixptr, dp[0], count); + pixptr += count; dp++; dlen -= 2; } @@ -150,16 +141,15 @@ static av_cold int decode_init(AVCodecContext *avctx) c->planemap[0] = 0; // 1st plane is palette indexes break; case 24: - avctx->pix_fmt = ff_get_format(avctx, pixfmt_rgb24); + avctx->pix_fmt = AV_PIX_FMT_GBRP; c->planes = 3; c->planemap[0] = 2; // 1st plane is red - c->planemap[1] = 1; // 2nd plane is green - c->planemap[2] = 0; // 3rd plane is blue + c->planemap[1] = 0; // 2nd plane is green + c->planemap[2] = 1; // 3rd plane is blue break; case 32: - avctx->pix_fmt = AV_PIX_FMT_RGB32; + avctx->pix_fmt = AV_PIX_FMT_GBRAP; c->planes = 4; - /* handle planemap setup later for decoding rgb24 data as rbg32 */ break; default: av_log(avctx, AV_LOG_ERROR, "Error: Unsupported color depth: %u.\n", @@ -167,11 +157,11 @@ static av_cold int decode_init(AVCodecContext *avctx) return AVERROR_INVALIDDATA; } - if (avctx->pix_fmt == AV_PIX_FMT_RGB32) { - c->planemap[0] = HAVE_BIGENDIAN ? 1 : 2; // 1st plane is red - c->planemap[1] = HAVE_BIGENDIAN ? 2 : 1; // 2nd plane is green - c->planemap[2] = HAVE_BIGENDIAN ? 3 : 0; // 3rd plane is blue - c->planemap[3] = HAVE_BIGENDIAN ? 0 : 3; // 4th plane is alpha + if (avctx->pix_fmt == AV_PIX_FMT_GBRAP) { + c->planemap[0] = 2; // 1st plane is red + c->planemap[1] = 0; // 2nd plane is green + c->planemap[2] = 1; // 3rd plane is blue + c->planemap[3] = 3; // 4th plane is alpha } return 0; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/Makefile b/arm/raspi/third_party/ffmpeg/libavcodec/Makefile index 1b0226c0..42af4e49 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/Makefile +++ b/arm/raspi/third_party/ffmpeg/libavcodec/Makefile @@ -32,6 +32,7 @@ OBJS = ac3_parser.o \ allcodecs.o \ avcodec.o \ avdct.o \ + avfft.o \ avpacket.o \ bitstream.o \ bitstream_filters.o \ @@ -81,7 +82,6 @@ OBJS-$(CONFIG_CBS_JPEG) += cbs_jpeg.o OBJS-$(CONFIG_CBS_MPEG2) += cbs_mpeg2.o OBJS-$(CONFIG_CBS_VP9) += cbs_vp9.o OBJS-$(CONFIG_CRYSTALHD) += crystalhd.o -OBJS-$(CONFIG_DCT) += dct.o dct32_fixed.o dct32_float.o OBJS-$(CONFIG_DEFLATE_WRAPPER) += zlib_wrapper.o OBJS-$(CONFIG_DOVI_RPU) += dovi_rpu.o OBJS-$(CONFIG_ERROR_RESILIENCE) += error_resilience.o @@ -90,9 +90,6 @@ OBJS-$(CONFIG_EXIF) += exif.o tiff_common.o OBJS-$(CONFIG_FAANDCT) += faandct.o OBJS-$(CONFIG_FAANIDCT) += faanidct.o OBJS-$(CONFIG_FDCTDSP) += fdctdsp.o jfdctfst.o jfdctint.o -FFT-OBJS-$(CONFIG_HARDCODED_TABLES) += cos_tables.o -OBJS-$(CONFIG_FFT) += avfft.o fft_float.o fft_fixed_32.o \ - fft_init_table.o $(FFT-OBJS-yes) OBJS-$(CONFIG_FMTCONVERT) += fmtconvert.o OBJS-$(CONFIG_GOLOMB) += golomb.o OBJS-$(CONFIG_H263DSP) += h263dsp.o @@ -125,7 +122,6 @@ OBJS-$(CONFIG_LLVIDENCDSP) += lossless_videoencdsp.o OBJS-$(CONFIG_LPC) += lpc.o OBJS-$(CONFIG_LSP) += lsp.o OBJS-$(CONFIG_LZF) += lzf.o -OBJS-$(CONFIG_MDCT) += mdct_float.o mdct_fixed_32.o OBJS-$(CONFIG_ME_CMP) += me_cmp.o OBJS-$(CONFIG_MEDIACODEC) += mediacodecdec_common.o mediacodec_surface.o mediacodec_wrapper.o mediacodec_sw_buffer.o OBJS-$(CONFIG_MPEG_ER) += mpeg_er.o @@ -134,7 +130,8 @@ OBJS-$(CONFIG_MPEGAUDIO) += mpegaudio.o mpegaudiodec_common.o \ OBJS-$(CONFIG_MPEGAUDIODSP) += mpegaudiodsp.o \ mpegaudiodsp_data.o \ mpegaudiodsp_fixed.o \ - mpegaudiodsp_float.o + mpegaudiodsp_float.o \ + dct32_fixed.o dct32_float.o OBJS-$(CONFIG_MPEGAUDIOHEADER) += mpegaudiodecheader.o mpegaudiotabs.o OBJS-$(CONFIG_MPEG4AUDIO) += mpeg4audio.o mpeg4audio_sample_rates.o OBJS-$(CONFIG_MPEGVIDEO) += mpegvideo.o rl.o \ @@ -156,7 +153,6 @@ OBJS-$(CONFIG_QSV) += qsv.o OBJS-$(CONFIG_QSVDEC) += qsvdec.o OBJS-$(CONFIG_QSVENC) += qsvenc.o OBJS-$(CONFIG_RANGECODER) += rangecoder.o -OBJS-$(CONFIG_RDFT) += rdft.o OBJS-$(CONFIG_RV34DSP) += rv34dsp.o OBJS-$(CONFIG_SINEWIN) += sinewin.o OBJS-$(CONFIG_SNAPPY) += snappy.o @@ -258,6 +254,7 @@ OBJS-$(CONFIG_AV1_MEDIACODEC_DECODER) += mediacodecdec.o OBJS-$(CONFIG_AV1_MEDIACODEC_ENCODER) += mediacodecenc.o OBJS-$(CONFIG_AV1_NVENC_ENCODER) += nvenc_av1.o nvenc.o OBJS-$(CONFIG_AV1_QSV_ENCODER) += qsvenc_av1.o +OBJS-$(CONFIG_AV1_VAAPI_ENCODER) += vaapi_encode_av1.o av1_levels.o OBJS-$(CONFIG_AVRN_DECODER) += avrndec.o OBJS-$(CONFIG_AVRP_DECODER) += r210dec.o OBJS-$(CONFIG_AVRP_ENCODER) += r210enc.o @@ -579,6 +576,7 @@ OBJS-$(CONFIG_OPUS_DECODER) += opusdec.o opusdec_celt.o opus_celt.o \ opusdsp.o opus_parse.o opus_rc.o OBJS-$(CONFIG_OPUS_ENCODER) += opusenc.o opusenc_psy.o opus_celt.o \ opus_pvq.o opus_rc.o opustab.o +OBJS-$(CONFIG_OSQ_DECODER) += osq.o OBJS-$(CONFIG_PAF_AUDIO_DECODER) += pafaudio.o OBJS-$(CONFIG_PAF_VIDEO_DECODER) += pafvideo.o OBJS-$(CONFIG_PAM_DECODER) += pnmdec.o pnm.o @@ -1056,6 +1054,8 @@ STLIBOBJS-$(CONFIG_AVFORMAT) += to_upper4.o STLIBOBJS-$(CONFIG_ISO_MEDIA) += mpegaudiotabs.o STLIBOBJS-$(CONFIG_FLV_MUXER) += mpeg4audio_sample_rates.o STLIBOBJS-$(CONFIG_HLS_DEMUXER) += ac3_channel_layout_tab.o +STLIBOBJS-$(CONFIG_IMAGE_JPEGXL_PIPE_DEMUXER) += jpegxl_parse.o +STLIBOBJS-$(CONFIG_JPEGXL_ANIM_DEMUXER) += jpegxl_parse.o STLIBOBJS-$(CONFIG_MATROSKA_DEMUXER) += mpeg4audio_sample_rates.o STLIBOBJS-$(CONFIG_MOV_DEMUXER) += ac3_channel_layout_tab.o STLIBOBJS-$(CONFIG_MXF_MUXER) += golomb.o @@ -1185,6 +1185,7 @@ OBJS-$(CONFIG_HEVC_PARSER) += hevc_parser.o hevc_data.o OBJS-$(CONFIG_HDR_PARSER) += hdr_parser.o OBJS-$(CONFIG_IPU_PARSER) += ipu_parser.o OBJS-$(CONFIG_JPEG2000_PARSER) += jpeg2000_parser.o +OBJS-$(CONFIG_JPEGXL_PARSER) += jpegxl_parser.o jpegxl_parse.o OBJS-$(CONFIG_MISC4_PARSER) += misc4_parser.o OBJS-$(CONFIG_MJPEG_PARSER) += mjpeg_parser.o OBJS-$(CONFIG_MLP_PARSER) += mlp_parse.o mlp_parser.o mlp.o @@ -1199,8 +1200,7 @@ OBJS-$(CONFIG_OPUS_PARSER) += opus_parser.o opus_parse.o \ OBJS-$(CONFIG_PNG_PARSER) += png_parser.o OBJS-$(CONFIG_PNM_PARSER) += pnm_parser.o pnm.o OBJS-$(CONFIG_QOI_PARSER) += qoi_parser.o -OBJS-$(CONFIG_RV30_PARSER) += rv34_parser.o -OBJS-$(CONFIG_RV40_PARSER) += rv34_parser.o +OBJS-$(CONFIG_RV34_PARSER) += rv34_parser.o OBJS-$(CONFIG_SBC_PARSER) += sbc_parser.o OBJS-$(CONFIG_SIPR_PARSER) += sipr_parser.o OBJS-$(CONFIG_TAK_PARSER) += tak_parser.o tak.o @@ -1283,6 +1283,7 @@ SKIPHEADERS += %_tablegen.h \ aacenc_quantization.h \ aacenc_quantization_misc.h \ bitstream_template.h \ + vulkan_video_codec_av1std.h \ $(ARCH)/vpx_arith.h \ SKIPHEADERS-$(CONFIG_AMF) += amfenc.h @@ -1304,7 +1305,7 @@ SKIPHEADERS-$(CONFIG_XVMC) += xvmc.h SKIPHEADERS-$(CONFIG_VAAPI) += vaapi_decode.h vaapi_hevc.h vaapi_encode.h SKIPHEADERS-$(CONFIG_VDPAU) += vdpau.h vdpau_internal.h SKIPHEADERS-$(CONFIG_VIDEOTOOLBOX) += videotoolbox.h vt_internal.h -SKIPHEADERS-$(CONFIG_VULKAN) += vulkan.h vulkan_video.h vulkan_decode.h vulkan_video_codec_av1std.h vulkan_video_codec_av1std_decode.h +SKIPHEADERS-$(CONFIG_VULKAN) += vulkan.h vulkan_video.h vulkan_decode.h vulkan_video_codec_av1std_decode.h SKIPHEADERS-$(CONFIG_V4L2_M2M) += v4l2_buffers.h v4l2_context.h v4l2_m2m.h SKIPHEADERS-$(CONFIG_ZLIB) += zlib_wrapper.h @@ -1318,9 +1319,8 @@ TESTPROGS = avcodec \ jpeg2000dwt \ mathops \ +TESTPROGS-$(CONFIG_AV1_VAAPI_ENCODER) += av1_levels TESTPROGS-$(CONFIG_CABAC) += cabac -TESTPROGS-$(CONFIG_DCT) += avfft -TESTPROGS-$(CONFIG_FFT) += fft fft-fixed32 TESTPROGS-$(CONFIG_GOLOMB) += golomb TESTPROGS-$(CONFIG_IDCTDSP) += dct TESTPROGS-$(CONFIG_IIRFILTER) += iirfilter @@ -1340,7 +1340,6 @@ HOSTPROGS = aacps_tablegen \ aacps_fixed_tablegen \ cbrt_tablegen \ cbrt_fixed_tablegen \ - cos_tablegen \ dv_tablegen \ motionpixels_tablegen \ mpegaudio_tablegen \ @@ -1355,12 +1354,6 @@ CLEANFILES = *_tables.c *_tables.h *_tablegen$(HOSTEXESUF) $(SUBDIR)tests/dct$(EXESUF): $(SUBDIR)dctref.o $(SUBDIR)aandcttab.o $(SUBDIR)dv_tablegen$(HOSTEXESUF): $(SUBDIR)dvdata_host.o -TRIG_TABLES = cos cos_fixed sin -TRIG_TABLES := $(TRIG_TABLES:%=$(SUBDIR)%_tables.c) - -$(TRIG_TABLES): $(SUBDIR)%_tables.c: $(SUBDIR)cos_tablegen$(HOSTEXESUF) - $(M)./$< $* > $@ - ifdef CONFIG_SMALL $(SUBDIR)%_tablegen$(HOSTEXESUF): HOSTCFLAGS += -DCONFIG_SMALL=1 else diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/aacdec_template.c b/arm/raspi/third_party/ffmpeg/libavcodec/aacdec_template.c index 444dc4fa..954399f8 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/aacdec_template.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/aacdec_template.c @@ -1133,14 +1133,14 @@ static av_cold void aac_static_table_init(void) for (unsigned i = 0, offset = 0; i < 11; i++) { vlc_spectral[i].table = &vlc_buf[offset]; vlc_spectral[i].table_allocated = FF_ARRAY_ELEMS(vlc_buf) - offset; - ff_init_vlc_sparse(&vlc_spectral[i], 8, ff_aac_spectral_sizes[i], + ff_vlc_init_sparse(&vlc_spectral[i], 8, ff_aac_spectral_sizes[i], ff_aac_spectral_bits[i], sizeof(ff_aac_spectral_bits[i][0]), sizeof(ff_aac_spectral_bits[i][0]), ff_aac_spectral_codes[i], sizeof(ff_aac_spectral_codes[i][0]), sizeof(ff_aac_spectral_codes[i][0]), ff_aac_codebook_vector_idx[i], sizeof(ff_aac_codebook_vector_idx[i][0]), sizeof(ff_aac_codebook_vector_idx[i][0]), - INIT_VLC_STATIC_OVERLONG); + VLC_INIT_STATIC_OVERLONG); offset += vlc_spectral[i].table_size; } @@ -1148,7 +1148,7 @@ static av_cold void aac_static_table_init(void) ff_aac_tableinit(); - INIT_VLC_STATIC(&vlc_scalefactors, 7, + VLC_INIT_STATIC(&vlc_scalefactors, 7, FF_ARRAY_ELEMS(ff_aac_scalefactor_code), ff_aac_scalefactor_bits, sizeof(ff_aac_scalefactor_bits[0]), @@ -1159,8 +1159,8 @@ static av_cold void aac_static_table_init(void) 352); // window initialization - AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(aac_kbd_long_960), 4.0, 960); - AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(aac_kbd_short_120), 6.0, 120); + AAC_RENAME(avpriv_kbd_window_init)(AAC_RENAME(aac_kbd_long_960), 4.0, 960); + AAC_RENAME(avpriv_kbd_window_init)(AAC_RENAME(aac_kbd_short_120), 6.0, 120); #if !USE_FIXED AAC_RENAME(ff_sine_window_init)(AAC_RENAME(sine_960), 960); @@ -1168,8 +1168,8 @@ static av_cold void aac_static_table_init(void) AAC_RENAME(ff_init_ff_sine_windows)(9); ff_aac_float_common_init(); #else - AAC_RENAME(ff_kbd_window_init)(AAC_RENAME2(aac_kbd_long_1024), 4.0, 1024); - AAC_RENAME(ff_kbd_window_init)(AAC_RENAME2(aac_kbd_short_128), 6.0, 128); + AAC_RENAME(avpriv_kbd_window_init)(AAC_RENAME2(aac_kbd_long_1024), 4.0, 1024); + AAC_RENAME(avpriv_kbd_window_init)(AAC_RENAME2(aac_kbd_short_128), 6.0, 128); init_sine_windows_fixed(); #endif @@ -2486,12 +2486,12 @@ static int decode_extension_payload(AACContext *ac, GetBitContext *gb, int cnt, ac->avctx->ch_layout.nb_channels == 1) { ac->oc[1].m4ac.sbr = 1; ac->oc[1].m4ac.ps = 1; - ac->avctx->profile = FF_PROFILE_AAC_HE_V2; + ac->avctx->profile = AV_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; + ac->avctx->profile = AV_PROFILE_AAC_HE; } res = AAC_RENAME(ff_decode_sbr_extension)(ac, &che->sbr, gb, crc_flag, cnt, elem_type); if (ac->oc[1].m4ac.ps == 1 && !ac->warned_he_aac_mono) { @@ -2856,8 +2856,8 @@ static void imdct_and_windowing_eld(AACContext *ac, SingleChannelElement *sce) ac->mdct512_fn(ac->mdct512, buf, in, sizeof(INTFLOAT)); for (i = 0; i < n; i+=2) { - buf[i + 0] = -(USE_FIXED + 1)*buf[i + 0]; - buf[i + 1] = (USE_FIXED + 1)*buf[i + 1]; + buf[i + 0] = -(UINTFLOAT)(USE_FIXED + 1)*buf[i + 0]; + buf[i + 1] = (UINTFLOAT)(USE_FIXED + 1)*buf[i + 1]; } // 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 @@ -3080,7 +3080,7 @@ static int aac_decode_er_frame(AVCodecContext *avctx, void *data, if ((err = frame_configure_elements(avctx)) < 0) return err; - // The FF_PROFILE_AAC_* defines are all object_type - 1 + // The AV_PROFILE_AAC_* defines are all object_type - 1 // This may lead to an undefined profile being signaled ac->avctx->profile = aot - 1; @@ -3163,7 +3163,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, AVFrame *frame, if ((err = frame_configure_elements(avctx)) < 0) goto fail; - // The FF_PROFILE_AAC_* defines are all object_type - 1 + // The AV_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; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/aacenc.c b/arm/raspi/third_party/ffmpeg/libavcodec/aacenc.c index f48f0570..2a34685a 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/aacenc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/aacenc.c @@ -1307,13 +1307,13 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) avctx->bit_rate); /* Profile and option setting */ - avctx->profile = avctx->profile == FF_PROFILE_UNKNOWN ? FF_PROFILE_AAC_LOW : + avctx->profile = avctx->profile == AV_PROFILE_UNKNOWN ? AV_PROFILE_AAC_LOW : avctx->profile; for (i = 0; i < FF_ARRAY_ELEMS(aacenc_profiles); i++) if (avctx->profile == aacenc_profiles[i]) break; - if (avctx->profile == FF_PROFILE_MPEG2_AAC_LOW) { - avctx->profile = FF_PROFILE_AAC_LOW; + if (avctx->profile == AV_PROFILE_MPEG2_AAC_LOW) { + avctx->profile = AV_PROFILE_AAC_LOW; ERROR_IF(s->options.pred, "Main prediction unavailable in the \"mpeg2_aac_low\" profile\n"); ERROR_IF(s->options.ltp, @@ -1321,22 +1321,22 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) WARN_IF(s->options.pns, "PNS unavailable in the \"mpeg2_aac_low\" profile, turning off\n"); s->options.pns = 0; - } else if (avctx->profile == FF_PROFILE_AAC_LTP) { + } else if (avctx->profile == AV_PROFILE_AAC_LTP) { s->options.ltp = 1; ERROR_IF(s->options.pred, "Main prediction unavailable in the \"aac_ltp\" profile\n"); - } else if (avctx->profile == FF_PROFILE_AAC_MAIN) { + } else if (avctx->profile == AV_PROFILE_AAC_MAIN) { s->options.pred = 1; ERROR_IF(s->options.ltp, "LTP prediction unavailable in the \"aac_main\" profile\n"); } else if (s->options.ltp) { - avctx->profile = FF_PROFILE_AAC_LTP; + avctx->profile = AV_PROFILE_AAC_LTP; WARN_IF(1, "Chainging profile to \"aac_ltp\"\n"); ERROR_IF(s->options.pred, "Main prediction unavailable in the \"aac_ltp\" profile\n"); } else if (s->options.pred) { - avctx->profile = FF_PROFILE_AAC_MAIN; + avctx->profile = AV_PROFILE_AAC_MAIN; WARN_IF(1, "Chainging profile to \"aac_main\"\n"); ERROR_IF(s->options.ltp, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/aacenc_ltp.c b/arm/raspi/third_party/ffmpeg/libavcodec/aacenc_ltp.c index f7fb85bb..f3075f0e 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/aacenc_ltp.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/aacenc_ltp.c @@ -37,7 +37,7 @@ void ff_aac_encode_ltp_info(AACEncContext *s, SingleChannelElement *sce, { int i; IndividualChannelStream *ics = &sce->ics; - if (s->profile != FF_PROFILE_AAC_LTP || !ics->predictor_present) + if (s->profile != AV_PROFILE_AAC_LTP || !ics->predictor_present) return; if (common_window) put_bits(&s->pb, 1, 0); @@ -119,7 +119,7 @@ void ff_aac_update_ltp(AACEncContext *s, SingleChannelElement *sce) float *pred_signal = &sce->ltp_state[0]; const float *samples = &s->planar_samples[s->cur_channel][1024]; - if (s->profile != FF_PROFILE_AAC_LTP) + if (s->profile != AV_PROFILE_AAC_LTP) return; /* Calculate lag */ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/aacenc_pred.c b/arm/raspi/third_party/ffmpeg/libavcodec/aacenc_pred.c index 447444cb..f87fcd5a 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/aacenc_pred.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/aacenc_pred.c @@ -335,7 +335,7 @@ void ff_aac_encode_main_pred(AACEncContext *s, SingleChannelElement *sce) IndividualChannelStream *ics = &sce->ics; const int pmax = FFMIN(ics->max_sfb, ff_aac_pred_sfb_max[s->samplerate_index]); - if (s->profile != FF_PROFILE_AAC_MAIN || + if (s->profile != AV_PROFILE_AAC_MAIN || !ics->predictor_present) return; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/aacenc_tns.c b/arm/raspi/third_party/ffmpeg/libavcodec/aacenc_tns.c index 195ff5e2..8dc6dfcf 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/aacenc_tns.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/aacenc_tns.c @@ -167,7 +167,7 @@ void ff_aac_search_for_tns(AACEncContext *s, SingleChannelElement *sce) const int c_bits = is8 ? TNS_Q_BITS_IS8 == 4 : TNS_Q_BITS == 4; const int sfb_start = av_clip(tns_min_sfb[is8][s->samplerate_index], 0, mmm); const int sfb_end = av_clip(sce->ics.num_swb, 0, mmm); - const int order = is8 ? 7 : s->profile == FF_PROFILE_AAC_LOW ? 12 : TNS_MAX_ORDER; + const int order = is8 ? 7 : s->profile == AV_PROFILE_AAC_LOW ? 12 : TNS_MAX_ORDER; const int slant = sce->ics.window_sequence[0] == LONG_STOP_SEQUENCE ? 1 : sce->ics.window_sequence[0] == LONG_START_SEQUENCE ? 0 : 2; const int sfb_len = sfb_end - sfb_start; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/aacenctab.h b/arm/raspi/third_party/ffmpeg/libavcodec/aacenctab.h index 2d966219..20e47ea9 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/aacenctab.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/aacenctab.h @@ -124,10 +124,10 @@ static const unsigned char aac_maxval_cb[] = { }; static const int aacenc_profiles[] = { - FF_PROFILE_AAC_MAIN, - FF_PROFILE_AAC_LOW, - FF_PROFILE_AAC_LTP, - FF_PROFILE_MPEG2_AAC_LOW, + AV_PROFILE_AAC_MAIN, + AV_PROFILE_AAC_LOW, + AV_PROFILE_AAC_LTP, + AV_PROFILE_MPEG2_AAC_LOW, }; #endif /* AVCODEC_AACENCTAB_H */ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/aacps_common.c b/arm/raspi/third_party/ffmpeg/libavcodec/aacps_common.c index c388d5b9..bee07b5f 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/aacps_common.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/aacps_common.c @@ -290,7 +290,7 @@ err: } #define PS_INIT_VLC_STATIC(num, nb_bits, size) \ - INIT_VLC_STATIC(&vlc_ps[num], nb_bits, ps_tmp[num].table_size / ps_tmp[num].elem_size, \ + VLC_INIT_STATIC(&vlc_ps[num], nb_bits, ps_tmp[num].table_size / ps_tmp[num].elem_size, \ ps_tmp[num].ps_bits, 1, 1, \ ps_tmp[num].ps_codes, ps_tmp[num].elem_size, ps_tmp[num].elem_size, \ size); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/aacsbr.h b/arm/raspi/third_party/ffmpeg/libavcodec/aacsbr.h index d70b19e1..09f9eb1d 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/aacsbr.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/aacsbr.h @@ -70,7 +70,7 @@ 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, \ + VLC_INIT_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) diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/aacsbr_template.c b/arm/raspi/third_party/ffmpeg/libavcodec/aacsbr_template.c index cdca402f..b33ffd42 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/aacsbr_template.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/aacsbr_template.c @@ -973,7 +973,7 @@ static void read_sbr_extension(AACContext *ac, SpectralBandReplication *sbr, *num_bits_left = 0; } else { *num_bits_left -= ff_ps_read_data(ac->avctx, gb, &sbr->ps.common, *num_bits_left); - ac->avctx->profile = FF_PROFILE_AAC_HE_V2; + ac->avctx->profile = AV_PROFILE_AAC_HE_V2; // ensure the warning is not printed if PS extension is present ac->warned_he_aac_mono = 1; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/aacsbrdata.h b/arm/raspi/third_party/ffmpeg/libavcodec/aacsbrdata.h index 7bb45b22..af86af01 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/aacsbrdata.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/aacsbrdata.h @@ -29,7 +29,6 @@ #define AVCODEC_AACSBRDATA_H #include -#include "libavutil/attributes_internal.h" #include "libavutil/mem_internal.h" #include "aac_defines.h" @@ -268,271 +267,6 @@ static const int8_t sbr_offset[6][16] = { {-2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20, 24}, // 64000 Hz < fs_sbr }; -/* First eight entries repeated at end to simplify SIMD implementations. */ -const attribute_visibility_hidden 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 -{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)}, -}; - ///< window coefficients for analysis/synthesis QMF banks static DECLARE_ALIGNED(32, INTFLOAT, sbr_qmf_window_ds)[320]; /* This table contains redundancy: It is symmetric about the entry #320 diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/aactab.c b/arm/raspi/third_party/ffmpeg/libavcodec/aactab.c index 0f4941d5..d0006eac 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/aactab.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/aactab.c @@ -48,8 +48,8 @@ DECLARE_ALIGNED(32, float, ff_aac_kbd_short_128)[128]; static av_cold void aac_float_common_init(void) { - ff_kbd_window_init(ff_aac_kbd_long_1024, 4.0, 1024); - ff_kbd_window_init(ff_aac_kbd_short_128, 6.0, 128); + avpriv_kbd_window_init(ff_aac_kbd_long_1024, 4.0, 1024); + avpriv_kbd_window_init(ff_aac_kbd_short_128, 6.0, 128); ff_init_ff_sine_windows(10); ff_init_ff_sine_windows(7); } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/aarch64/Makefile b/arm/raspi/third_party/ffmpeg/libavcodec/aarch64/Makefile index cb428b49..beb6a02f 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/aarch64/Makefile +++ b/arm/raspi/third_party/ffmpeg/libavcodec/aarch64/Makefile @@ -1,5 +1,4 @@ # subsystems -OBJS-$(CONFIG_FFT) += aarch64/fft_init_aarch64.o OBJS-$(CONFIG_FMTCONVERT) += aarch64/fmtconvert_init.o OBJS-$(CONFIG_H264CHROMA) += aarch64/h264chroma_init_aarch64.o OBJS-$(CONFIG_H264DSP) += aarch64/h264dsp_init_aarch64.o @@ -36,7 +35,6 @@ ARMV8-OBJS-$(CONFIG_VIDEODSP) += aarch64/videodsp.o # subsystems NEON-OBJS-$(CONFIG_AAC_DECODER) += aarch64/sbrdsp_neon.o -NEON-OBJS-$(CONFIG_FFT) += aarch64/fft_neon.o NEON-OBJS-$(CONFIG_FMTCONVERT) += aarch64/fmtconvert_neon.o NEON-OBJS-$(CONFIG_H264CHROMA) += aarch64/h264cmc_neon.o NEON-OBJS-$(CONFIG_H264DSP) += aarch64/h264dsp_neon.o \ @@ -47,7 +45,6 @@ NEON-OBJS-$(CONFIG_H264QPEL) += aarch64/h264qpel_neon.o \ NEON-OBJS-$(CONFIG_HPELDSP) += aarch64/hpeldsp_neon.o NEON-OBJS-$(CONFIG_IDCTDSP) += aarch64/idctdsp_neon.o \ aarch64/simple_idct_neon.o -NEON-OBJS-$(CONFIG_MDCT) += aarch64/mdct_neon.o NEON-OBJS-$(CONFIG_ME_CMP) += aarch64/me_cmp_neon.o NEON-OBJS-$(CONFIG_MPEGAUDIODSP) += aarch64/mpegaudiodsp_neon.o NEON-OBJS-$(CONFIG_PIXBLOCKDSP) += aarch64/pixblockdsp_neon.o diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_epel_neon.S b/arm/raspi/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_epel_neon.S index a8d69463..edaf39ed 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_epel_neon.S +++ b/arm/raspi/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_epel_neon.S @@ -32,6 +32,312 @@ const epel_filters, align=4 .byte -2, 10, 58, -2 endconst +const epel_filters_abs, align=4 + .byte 0, 0, 0, 0 + .byte 2, 58, 10, 2 + .byte 4, 54, 16, 2 + .byte 6, 46, 28, 4 + .byte 4, 36, 36, 4 + .byte 4, 28, 46, 6 + .byte 2, 16, 54, 4 + .byte 2, 10, 58, 2 +endconst + + +.macro load_epel_filterb freg, xreg + movrel \xreg, epel_filters_abs + add \xreg, \xreg, \freg, lsl #2 + ld4r {v0.16b, v1.16b, v2.16b, v3.16b}, [\xreg] // filter +.endm + +.macro calc_epelb dst, src0, src1, src2, src3 + umull \dst\().8h, \src1\().8b, v1.8b + umlsl \dst\().8h, \src0\().8b, v0.8b + umlal \dst\().8h, \src2\().8b, v2.8b + umlsl \dst\().8h, \src3\().8b, v3.8b +.endm + +.macro calc_epelb2 dst, src0, src1, src2, src3 + umull2 \dst\().8h, \src1\().16b, v1.16b + umlsl2 \dst\().8h, \src0\().16b, v0.16b + umlal2 \dst\().8h, \src2\().16b, v2.16b + umlsl2 \dst\().8h, \src3\().16b, v3.16b +.endm + +.macro load_epel_filterh freg, xreg + movrel \xreg, epel_filters + add \xreg, \xreg, \freg, lsl #2 + ld1 {v0.8b}, [\xreg] + sxtl v0.8h, v0.8b +.endm + +.macro calc_epelh dst, src0, src1, src2, src3 + smull \dst\().4s, \src0\().4h, v0.h[0] + smlal \dst\().4s, \src1\().4h, v0.h[1] + smlal \dst\().4s, \src2\().4h, v0.h[2] + smlal \dst\().4s, \src3\().4h, v0.h[3] + sqshrn \dst\().4h, \dst\().4s, #6 +.endm + +.macro calc_epelh2 dst, tmp, src0, src1, src2, src3 + smull2 \tmp\().4s, \src0\().8h, v0.h[0] + smlal2 \tmp\().4s, \src1\().8h, v0.h[1] + smlal2 \tmp\().4s, \src2\().8h, v0.h[2] + smlal2 \tmp\().4s, \src3\().8h, v0.h[3] + sqshrn2 \dst\().8h, \tmp\().4s, #6 +.endm + +.macro calc_all4 + calc v16, v17, v18, v19 + b.eq 2f + calc v17, v18, v19, v16 + b.eq 2f + calc v18, v19, v16, v17 + b.eq 2f + calc v19, v16, v17, v18 + b.ne 1b +.endm + +.macro calc_all8 + calc v16, v17, v18, v19, v20, v21, v22, v23 + b.eq 2f + calc v18, v19, v20, v21, v22, v23, v16, v17 + b.eq 2f + calc v20, v21, v22, v23, v16, v17, v18, v19 + b.eq 2f + calc v22, v23, v16, v17, v18, v19, v20, v21 + b.ne 1b +.endm + +.macro calc_all12 + calc v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27 + b.eq 2f + calc v19, v20, v21, v22, v23, v24, v25, v26, v27, v16, v17, v18 + b.eq 2f + calc v22, v23, v24, v25, v26, v27, v16, v17, v18, v19, v20, v21 + b.eq 2f + calc v25, v26, v27, v16, v17, v18, v19, v20, v21, v22, v23, v24 + b.ne 1b +.endm + +.macro calc_all16 + calc v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31 + b.eq 2f + calc v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v16, v17, v18, v19 + b.eq 2f + calc v24, v25, v26, v27, v28, v29, v30, v31, v16, v17, v18, v19, v20, v21, v22, v23 + b.eq 2f + calc v28, v29, v30, v31, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27 + b.ne 1b +.endm + +function ff_hevc_put_hevc_epel_uni_v4_8_neon, export=1 + load_epel_filterb x6, x5 + sub x2, x2, x3 + ld1 {v16.s}[0], [x2], x3 + ld1 {v17.s}[0], [x2], x3 + ld1 {v18.s}[0], [x2], x3 +.macro calc src0, src1, src2, src3 + ld1 {\src3\().s}[0], [x2], x3 + calc_epelb v4, \src0, \src1, \src2, \src3 + sqrshrun v4.8b, v4.8h, #6 + subs w4, w4, #1 + st1 {v4.s}[0], [x0], x1 +.endm +1: calc_all4 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_v6_8_neon, export=1 + load_epel_filterb x6, x5 + sub x2, x2, x3 + sub x1, x1, #4 + ld1 {v16.8b}, [x2], x3 + ld1 {v17.8b}, [x2], x3 + ld1 {v18.8b}, [x2], x3 +.macro calc src0, src1, src2, src3 + ld1 {\src3\().8b}, [x2], x3 + calc_epelb v4, \src0, \src1, \src2, \src3 + sqrshrun v4.8b, v4.8h, #6 + st1 {v4.s}[0], [x0], #4 + subs w4, w4, #1 + st1 {v4.h}[2], [x0], x1 +.endm +1: calc_all4 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_v8_8_neon, export=1 + load_epel_filterb x6, x5 + sub x2, x2, x3 + ld1 {v16.8b}, [x2], x3 + ld1 {v17.8b}, [x2], x3 + ld1 {v18.8b}, [x2], x3 +.macro calc src0, src1, src2, src3 + ld1 {\src3\().8b}, [x2], x3 + calc_epelb v4, \src0, \src1, \src2, \src3 + sqrshrun v4.8b, v4.8h, #6 + subs w4, w4, #1 + st1 {v4.8b}, [x0], x1 +.endm +1: calc_all4 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_v12_8_neon, export=1 + load_epel_filterb x6, x5 + sub x2, x2, x3 + sub x1, x1, #8 + ld1 {v16.16b}, [x2], x3 + ld1 {v17.16b}, [x2], x3 + ld1 {v18.16b}, [x2], x3 +.macro calc src0, src1, src2, src3 + ld1 {\src3\().16b}, [x2], x3 + calc_epelb v4, \src0, \src1, \src2, \src3 + calc_epelb2 v5, \src0, \src1, \src2, \src3 + sqrshrun v4.8b, v4.8h, #6 + sqrshrun2 v4.16b, v5.8h, #6 + subs w4, w4, #1 + st1 {v4.8b}, [x0], #8 + st1 {v4.s}[2], [x0], x1 +.endm +1: calc_all4 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_v16_8_neon, export=1 + load_epel_filterb x6, x5 + sub x2, x2, x3 + ld1 {v16.16b}, [x2], x3 + ld1 {v17.16b}, [x2], x3 + ld1 {v18.16b}, [x2], x3 +.macro calc src0, src1, src2, src3 + ld1 {\src3\().16b}, [x2], x3 + calc_epelb v4, \src0, \src1, \src2, \src3 + calc_epelb2 v5, \src0, \src1, \src2, \src3 + sqrshrun v4.8b, v4.8h, #6 + sqrshrun2 v4.16b, v5.8h, #6 + subs w4, w4, #1 + st1 {v4.16b}, [x0], x1 +.endm +1: calc_all4 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_v24_8_neon, export=1 + load_epel_filterb x6, x5 + sub x2, x2, x3 + ld1 {v16.8b, v17.8b, v18.8b}, [x2], x3 + ld1 {v19.8b, v20.8b, v21.8b}, [x2], x3 + ld1 {v22.8b, v23.8b, v24.8b}, [x2], x3 +.macro calc src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10, src11 + ld1 {\src9\().8b, \src10\().8b, \src11\().8b}, [x2], x3 + calc_epelb v4, \src0, \src3, \src6, \src9 + calc_epelb v5, \src1, \src4, \src7, \src10 + calc_epelb v6, \src2, \src5, \src8, \src11 + sqrshrun v4.8b, v4.8h, #6 + sqrshrun v5.8b, v5.8h, #6 + sqrshrun v6.8b, v6.8h, #6 + subs w4, w4, #1 + st1 {v4.8b-v6.8b}, [x0], x1 +.endm +1: calc_all12 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_v32_8_neon, export=1 + load_epel_filterb x6, x5 + sub x2, x2, x3 + ld1 {v16.16b, v17.16b}, [x2], x3 + ld1 {v18.16b, v19.16b}, [x2], x3 + ld1 {v20.16b, v21.16b}, [x2], x3 +.macro calc src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\src6\().16b, \src7\().16b}, [x2], x3 + calc_epelb v4, \src0, \src2, \src4, \src6 + calc_epelb2 v5, \src0, \src2, \src4, \src6 + calc_epelb v6, \src1, \src3, \src5, \src7 + calc_epelb2 v7, \src1, \src3, \src5, \src7 + sqrshrun v4.8b, v4.8h, #6 + sqrshrun2 v4.16b, v5.8h, #6 + sqrshrun v5.8b, v6.8h, #6 + sqrshrun2 v5.16b, v7.8h, #6 + subs w4, w4, #1 + st1 {v4.16b, v5.16b}, [x0], x1 +.endm +1: calc_all8 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_v48_8_neon, export=1 + load_epel_filterb x6, x5 + sub x2, x2, x3 + ld1 {v16.16b, v17.16b, v18.16b}, [x2], x3 + ld1 {v19.16b, v20.16b, v21.16b}, [x2], x3 + ld1 {v22.16b, v23.16b, v24.16b}, [x2], x3 +.macro calc src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10, src11 + ld1 {\src9\().16b, \src10\().16b, \src11\().16b}, [x2], x3 + calc_epelb v4, \src0, \src3, \src6, \src9 + calc_epelb2 v5, \src0, \src3, \src6, \src9 + calc_epelb v6, \src1, \src4, \src7, \src10 + calc_epelb2 v7, \src1, \src4, \src7, \src10 + calc_epelb v28, \src2, \src5, \src8, \src11 + calc_epelb2 v29, \src2, \src5, \src8, \src11 + sqrshrun v4.8b, v4.8h, #6 + sqrshrun2 v4.16b, v5.8h, #6 + sqrshrun v5.8b, v6.8h, #6 + sqrshrun2 v5.16b, v7.8h, #6 + sqrshrun v6.8b, v28.8h, #6 + sqrshrun2 v6.16b, v29.8h, #6 + subs w4, w4, #1 + st1 {v4.16b, v5.16b, v6.16b}, [x0], x1 +.endm +1: calc_all12 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_v64_8_neon, export=1 + load_epel_filterb x6, x5 + sub sp, sp, #32 + st1 {v8.8b-v11.8b}, [sp] + sub x2, x2, x3 + ld1 {v16.16b, v17.16b, v18.16b, v19.16b}, [x2], x3 + ld1 {v20.16b, v21.16b, v22.16b, v23.16b}, [x2], x3 + ld1 {v24.16b, v25.16b, v26.16b, v27.16b}, [x2], x3 +.macro calc src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10, src11, src12, src13, src14, src15 + ld1 {\src12\().16b, \src13\().16b, \src14\().16b, \src15\().16b}, [x2], x3 + calc_epelb v10, \src3, \src7, \src11, \src15 + calc_epelb2 v11, \src3, \src7, \src11, \src15 + calc_epelb v4, \src0, \src4, \src8, \src12 + calc_epelb2 v5, \src0, \src4, \src8, \src12 + calc_epelb v6, \src1, \src5, \src9, \src13 + calc_epelb2 v7, \src1, \src5, \src9, \src13 + calc_epelb v8, \src2, \src6, \src10, \src14 + calc_epelb2 v9, \src2, \src6, \src10, \src14 + sqrshrun v4.8b, v4.8h, #6 + sqrshrun2 v4.16b, v5.8h, #6 + sqrshrun v5.8b, v6.8h, #6 + sqrshrun2 v5.16b, v7.8h, #6 + sqrshrun v6.8b, v8.8h, #6 + sqrshrun2 v6.16b, v9.8h, #6 + sqrshrun v7.8b, v10.8h, #6 + sqrshrun2 v7.16b, v11.8h, #6 + subs w4, w4, #1 + st1 {v4.16b, v5.16b, v6.16b, v7.16b}, [x0], x1 +.endm +1: calc_all16 +.purgem calc +2: ld1 {v8.8b-v11.8b}, [sp], #32 + ret +endfunc + #if HAVE_I8MM .macro EPEL_H_HEADER @@ -376,6 +682,300 @@ function ff_hevc_put_hevc_epel_h64_8_neon_i8mm, export=1 ret endfunc +function ff_hevc_put_hevc_epel_uni_hv4_8_neon_i8mm, export=1 + add w10, w4, #3 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + str x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + add x0, sp, #48 + sub x1, x2, x3 + mov x2, x3 + add w3, w4, #3 + mov x4, x5 + bl X(ff_hevc_put_hevc_epel_h4_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldr x30, [sp], #48 + load_epel_filterh x6, x5 + mov x10, #(MAX_PB_SIZE * 2) + ld1 {v16.4h}, [sp], x10 + ld1 {v17.4h}, [sp], x10 + ld1 {v18.4h}, [sp], x10 +.macro calc src0, src1, src2, src3 + ld1 {\src3\().4h}, [sp], x10 + calc_epelh v4, \src0, \src1, \src2, \src3 + sqrshrun v4.8b, v4.8h, #6 + subs w4, w4, #1 + st1 {v4.s}[0], [x0], x1 +.endm +1: calc_all4 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_hv6_8_neon_i8mm, export=1 + add w10, w4, #3 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + str x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + add x0, sp, #48 + sub x1, x2, x3 + mov x2, x3 + add w3, w4, #3 + mov x4, x5 + bl X(ff_hevc_put_hevc_epel_h6_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldr x30, [sp], #48 + load_epel_filterh x6, x5 + sub x1, x1, #4 + mov x10, #(MAX_PB_SIZE * 2) + ld1 {v16.8h}, [sp], x10 + ld1 {v17.8h}, [sp], x10 + ld1 {v18.8h}, [sp], x10 +.macro calc src0, src1, src2, src3 + ld1 {\src3\().8h}, [sp], x10 + calc_epelh v4, \src0, \src1, \src2, \src3 + calc_epelh2 v4, v5, \src0, \src1, \src2, \src3 + sqrshrun v4.8b, v4.8h, #6 + st1 {v4.s}[0], [x0], #4 + subs w4, w4, #1 + st1 {v4.h}[2], [x0], x1 +.endm +1: calc_all4 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_hv8_8_neon_i8mm, export=1 + add w10, w4, #3 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + str x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + add x0, sp, #48 + sub x1, x2, x3 + mov x2, x3 + add w3, w4, #3 + mov x4, x5 + bl X(ff_hevc_put_hevc_epel_h8_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldr x30, [sp], #48 + load_epel_filterh x6, x5 + mov x10, #(MAX_PB_SIZE * 2) + ld1 {v16.8h}, [sp], x10 + ld1 {v17.8h}, [sp], x10 + ld1 {v18.8h}, [sp], x10 +.macro calc src0, src1, src2, src3 + ld1 {\src3\().8h}, [sp], x10 + calc_epelh v4, \src0, \src1, \src2, \src3 + calc_epelh2 v4, v5, \src0, \src1, \src2, \src3 + sqrshrun v4.8b, v4.8h, #6 + subs w4, w4, #1 + st1 {v4.8b}, [x0], x1 +.endm +1: calc_all4 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_hv12_8_neon_i8mm, export=1 + add w10, w4, #3 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + str x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + add x0, sp, #48 + sub x1, x2, x3 + mov x2, x3 + add w3, w4, #3 + mov x4, x5 + bl X(ff_hevc_put_hevc_epel_h12_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldr x30, [sp], #48 + load_epel_filterh x6, x5 + sub x1, x1, #8 + mov x10, #(MAX_PB_SIZE * 2) + ld1 {v16.8h, v17.8h}, [sp], x10 + ld1 {v18.8h, v19.8h}, [sp], x10 + ld1 {v20.8h, v21.8h}, [sp], x10 +.macro calc src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\src6\().8h, \src7\().8h}, [sp], x10 + calc_epelh v4, \src0, \src2, \src4, \src6 + calc_epelh2 v4, v5, \src0, \src2, \src4, \src6 + calc_epelh v5, \src1, \src3, \src5, \src7 + sqrshrun v4.8b, v4.8h, #6 + sqrshrun2 v4.16b, v5.8h, #6 + st1 {v4.8b}, [x0], #8 + st1 {v4.s}[2], [x0], x1 + subs w4, w4, #1 +.endm +1: calc_all8 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_hv16_8_neon_i8mm, export=1 + add w10, w4, #3 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + str x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + add x0, sp, #48 + sub x1, x2, x3 + mov x2, x3 + add w3, w4, #3 + mov x4, x5 + bl X(ff_hevc_put_hevc_epel_h16_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldr x30, [sp], #48 + load_epel_filterh x6, x5 + mov x10, #(MAX_PB_SIZE * 2) + ld1 {v16.8h, v17.8h}, [sp], x10 + ld1 {v18.8h, v19.8h}, [sp], x10 + ld1 {v20.8h, v21.8h}, [sp], x10 +.macro calc src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\src6\().8h, \src7\().8h}, [sp], x10 + calc_epelh v4, \src0, \src2, \src4, \src6 + calc_epelh2 v4, v5, \src0, \src2, \src4, \src6 + calc_epelh v5, \src1, \src3, \src5, \src7 + calc_epelh2 v5, v6, \src1, \src3, \src5, \src7 + sqrshrun v4.8b, v4.8h, #6 + sqrshrun2 v4.16b, v5.8h, #6 + subs w4, w4, #1 + st1 {v4.16b}, [x0], x1 +.endm +1: calc_all8 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_hv24_8_neon_i8mm, export=1 + add w10, w4, #3 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + str x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + add x0, sp, #48 + sub x1, x2, x3 + mov x2, x3 + add w3, w4, #3 + mov x4, x5 + bl X(ff_hevc_put_hevc_epel_h24_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldr x30, [sp], #48 + load_epel_filterh x6, x5 + mov x10, #(MAX_PB_SIZE * 2) + ld1 {v16.8h, v17.8h, v18.8h}, [sp], x10 + ld1 {v19.8h, v20.8h, v21.8h}, [sp], x10 + ld1 {v22.8h, v23.8h, v24.8h}, [sp], x10 +.macro calc src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10, src11 + ld1 {\src9\().8h, \src10\().8h, \src11\().8h}, [sp], x10 + calc_epelh v4, \src0, \src3, \src6, \src9 + calc_epelh2 v4, v5, \src0, \src3, \src6, \src9 + calc_epelh v5, \src1, \src4, \src7, \src10 + calc_epelh2 v5, v6, \src1, \src4, \src7, \src10 + calc_epelh v6, \src2, \src5, \src8, \src11 + calc_epelh2 v6, v7, \src2, \src5, \src8, \src11 + sqrshrun v4.8b, v4.8h, #6 + sqrshrun v5.8b, v5.8h, #6 + sqrshrun v6.8b, v6.8h, #6 + subs w4, w4, #1 + st1 {v4.8b, v5.8b, v6.8b}, [x0], x1 +.endm +1: calc_all12 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_hv32_8_neon_i8mm, export=1 + stp x5, x6, [sp, #-64]! + stp x3, x4, [sp, #16] + stp x1, x2, [sp, #32] + stp x0, x30, [sp, #48] + mov x7, #16 + bl X(ff_hevc_put_hevc_epel_uni_hv16_8_neon_i8mm) + ldp x5, x6, [sp] + ldp x3, x4, [sp, #16] + ldp x1, x2, [sp, #32] + ldr x0, [sp, #48] + add x0, x0, #16 + add x2, x2, #16 + mov x7, #16 + bl X(ff_hevc_put_hevc_epel_uni_hv16_8_neon_i8mm) + ldr x30, [sp, #56] + add sp, sp, #64 + ret +endfunc + +function ff_hevc_put_hevc_epel_uni_hv48_8_neon_i8mm, export=1 + stp x5, x6, [sp, #-64]! + stp x3, x4, [sp, #16] + stp x1, x2, [sp, #32] + stp x0, x30, [sp, #48] + mov x7, #24 + bl X(ff_hevc_put_hevc_epel_uni_hv24_8_neon_i8mm) + ldp x5, x6, [sp] + ldp x3, x4, [sp, #16] + ldp x1, x2, [sp, #32] + ldr x0, [sp, #48] + add x0, x0, #24 + add x2, x2, #24 + mov x7, #24 + bl X(ff_hevc_put_hevc_epel_uni_hv24_8_neon_i8mm) + ldr x30, [sp, #56] + add sp, sp, #64 + ret +endfunc + +function ff_hevc_put_hevc_epel_uni_hv64_8_neon_i8mm, export=1 + stp x5, x6, [sp, #-64]! + stp x3, x4, [sp, #16] + stp x1, x2, [sp, #32] + stp x0, x30, [sp, #48] + mov x7, #16 + bl X(ff_hevc_put_hevc_epel_uni_hv16_8_neon_i8mm) + ldp x5, x6, [sp] + ldp x3, x4, [sp, #16] + ldp x1, x2, [sp, #32] + ldr x0, [sp, #48] + add x0, x0, #16 + add x2, x2, #16 + mov x7, #16 + bl X(ff_hevc_put_hevc_epel_uni_hv16_8_neon_i8mm) + ldp x5, x6, [sp] + ldp x3, x4, [sp, #16] + ldp x1, x2, [sp, #32] + ldr x0, [sp, #48] + add x0, x0, #32 + add x2, x2, #32 + mov x7, #16 + bl X(ff_hevc_put_hevc_epel_uni_hv16_8_neon_i8mm) + ldp x5, x6, [sp] + ldp x3, x4, [sp, #16] + ldp x1, x2, [sp, #32] + ldr x0, [sp, #48] + add x0, x0, #48 + add x2, x2, #48 + mov x7, #16 + bl X(ff_hevc_put_hevc_epel_uni_hv16_8_neon_i8mm) + ldr x30, [sp, #56] + add sp, sp, #64 + ret +endfunc + .macro EPEL_UNI_W_H_HEADER ldr x12, [sp] sub x2, x2, #1 @@ -818,28 +1418,7 @@ endfunc sqxtn2 v6.8h, v31.4s .endm -.macro calc_epelh dst, src0, src1, src2, src3 - smull \dst\().4s, \src0\().4h, v0.h[0] - smlal \dst\().4s, \src1\().4h, v0.h[1] - smlal \dst\().4s, \src2\().4h, v0.h[2] - smlal \dst\().4s, \src3\().4h, v0.h[3] - sqshrn \dst\().4h, \dst\().4s, #6 -.endm -.macro calc_epelh2 dst, tmp, src0, src1, src2, src3 - smull2 \tmp\().4s, \src0\().8h, v0.h[0] - smlal2 \tmp\().4s, \src1\().8h, v0.h[1] - smlal2 \tmp\().4s, \src2\().8h, v0.h[2] - smlal2 \tmp\().4s, \src3\().8h, v0.h[3] - sqshrn2 \dst\().8h, \tmp\().4s, #6 -.endm - -.macro load_epel_filterh freg, xreg - movrel \xreg, epel_filters - add \xreg, \xreg, \freg, lsl #2 - ld1 {v0.8b}, [\xreg] - sxtl v0.8h, v0.8b -.endm function ff_hevc_put_hevc_epel_uni_w_hv4_8_neon_i8mm, export=1 epel_uni_w_hv_start diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_idct_neon.S b/arm/raspi/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_idct_neon.S index b7f23386..ba8a1eba 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_idct_neon.S +++ b/arm/raspi/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_idct_neon.S @@ -617,8 +617,7 @@ function ff_hevc_idct_16x16_\bitdepth\()_neon, export=1 add sp, sp, #640 - mov x30, x15 - ret + ret x15 endfunc .endm @@ -791,7 +790,7 @@ function func_tr_32x4_\name add x3, x11, #(32 + 3 * 64) scale_store \shift - br x10 + ret x10 endfunc .endm @@ -814,8 +813,7 @@ function ff_hevc_idct_32x32_\bitdepth\()_neon, export=1 .endr add sp, sp, #2432 - mov x30, x15 - ret + ret x15 endfunc .endm diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_init_aarch64.c b/arm/raspi/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_init_aarch64.c index e125b0cf..782cf802 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_init_aarch64.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_init_aarch64.c @@ -161,6 +161,14 @@ NEON8_FNPROTO(pel_uni_w_pixels, (uint8_t *_dst, ptrdiff_t _dststride, int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width),); +NEON8_FNPROTO(epel_uni_v, (uint8_t *dst, ptrdiff_t dststride, + const uint8_t *src, ptrdiff_t srcstride, + int height, intptr_t mx, intptr_t my, int width),); + +NEON8_FNPROTO(epel_uni_hv, (uint8_t *dst, ptrdiff_t _dststride, + const uint8_t *src, ptrdiff_t srcstride, + int height, intptr_t mx, intptr_t my, int width), _i8mm); + NEON8_FNPROTO(epel_uni_w_v, (uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, int height, int denom, int wx, int ox, @@ -184,6 +192,14 @@ NEON8_FNPROTO(qpel_h, (int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width), _i8mm); +NEON8_FNPROTO(qpel_uni_v, (uint8_t *dst, ptrdiff_t dststride, + const uint8_t *src, ptrdiff_t srcstride, + int height, intptr_t mx, intptr_t my, int width),); + +NEON8_FNPROTO(qpel_uni_hv, (uint8_t *dst, ptrdiff_t dststride, + const uint8_t *src, ptrdiff_t srcstride, + int height, intptr_t mx, intptr_t my, int width), _i8mm); + NEON8_FNPROTO(qpel_uni_w_h, (uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, int height, int denom, int wx, int ox, @@ -285,7 +301,9 @@ av_cold void ff_hevc_dsp_init_aarch64(HEVCDSPContext *c, const int bit_depth) c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_qpel_bi_h16_8_neon; NEON8_FNASSIGN(c->put_hevc_epel_uni, 0, 0, pel_uni_pixels,); + NEON8_FNASSIGN(c->put_hevc_epel_uni, 1, 0, epel_uni_v,); NEON8_FNASSIGN(c->put_hevc_qpel_uni, 0, 0, pel_uni_pixels,); + NEON8_FNASSIGN(c->put_hevc_qpel_uni, 1, 0, qpel_uni_v,); NEON8_FNASSIGN(c->put_hevc_epel_uni_w, 0, 0, pel_uni_w_pixels,); NEON8_FNASSIGN(c->put_hevc_qpel_uni_w, 0, 0, pel_uni_w_pixels,); NEON8_FNASSIGN(c->put_hevc_epel_uni_w, 1, 0, epel_uni_w_v,); @@ -293,8 +311,10 @@ av_cold void ff_hevc_dsp_init_aarch64(HEVCDSPContext *c, const int bit_depth) if (have_i8mm(cpu_flags)) { NEON8_FNASSIGN(c->put_hevc_epel, 0, 1, epel_h, _i8mm); + NEON8_FNASSIGN(c->put_hevc_epel_uni, 1, 1, epel_uni_hv, _i8mm); NEON8_FNASSIGN(c->put_hevc_epel_uni_w, 0, 1, epel_uni_w_h ,_i8mm); NEON8_FNASSIGN(c->put_hevc_qpel, 0, 1, qpel_h, _i8mm); + NEON8_FNASSIGN(c->put_hevc_qpel_uni, 1, 1, qpel_uni_hv, _i8mm); NEON8_FNASSIGN(c->put_hevc_qpel_uni_w, 0, 1, qpel_uni_w_h, _i8mm); NEON8_FNASSIGN(c->put_hevc_epel_uni_w, 1, 1, epel_uni_w_hv, _i8mm); NEON8_FNASSIGN_PARTIAL_5(c->put_hevc_qpel_uni_w, 1, 1, qpel_uni_w_hv, _i8mm); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_qpel_neon.S b/arm/raspi/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_qpel_neon.S index e38dff96..1212eae6 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_qpel_neon.S +++ b/arm/raspi/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_qpel_neon.S @@ -44,6 +44,74 @@ endconst sxtl v0.8h, v0.8b .endm +.macro load_qpel_filterb freg, xreg + movrel \xreg, qpel_filters_abs + add \xreg, \xreg, \freg, lsl #3 + ld4r {v0.16b, v1.16b, v2.16b, v3.16b}, [\xreg], #4 + ld4r {v4.16b, v5.16b, v6.16b, v7.16b}, [\xreg] +.endm + +.macro calc_qpelb dst, src0, src1, src2, src3, src4, src5, src6, src7 + umull \dst\().8h, \src1\().8b, v1.8b + umlsl \dst\().8h, \src0\().8b, v0.8b + umlsl \dst\().8h, \src2\().8b, v2.8b + umlal \dst\().8h, \src3\().8b, v3.8b + umlal \dst\().8h, \src4\().8b, v4.8b + umlsl \dst\().8h, \src5\().8b, v5.8b + umlal \dst\().8h, \src6\().8b, v6.8b + umlsl \dst\().8h, \src7\().8b, v7.8b +.endm + +.macro calc_qpelb2 dst, src0, src1, src2, src3, src4, src5, src6, src7 + umull2 \dst\().8h, \src1\().16b, v1.16b + umlsl2 \dst\().8h, \src0\().16b, v0.16b + umlsl2 \dst\().8h, \src2\().16b, v2.16b + umlal2 \dst\().8h, \src3\().16b, v3.16b + umlal2 \dst\().8h, \src4\().16b, v4.16b + umlsl2 \dst\().8h, \src5\().16b, v5.16b + umlal2 \dst\().8h, \src6\().16b, v6.16b + umlsl2 \dst\().8h, \src7\().16b, v7.16b +.endm + +.macro load_qpel_filterh freg, xreg + movrel \xreg, qpel_filters + add \xreg, \xreg, \freg, lsl #3 + ld1 {v0.8b}, [\xreg] + sxtl v0.8h, v0.8b +.endm + +.macro calc_qpelh dst, src0, src1, src2, src3, src4, src5, src6, src7, op, shift=6 + smull \dst\().4s, \src0\().4h, v0.h[0] + smlal \dst\().4s, \src1\().4h, v0.h[1] + smlal \dst\().4s, \src2\().4h, v0.h[2] + smlal \dst\().4s, \src3\().4h, v0.h[3] + smlal \dst\().4s, \src4\().4h, v0.h[4] + smlal \dst\().4s, \src5\().4h, v0.h[5] + smlal \dst\().4s, \src6\().4h, v0.h[6] + smlal \dst\().4s, \src7\().4h, v0.h[7] +.ifc \op, sshr + sshr \dst\().4s, \dst\().4s, \shift +.else + \op \dst\().4h, \dst\().4s, \shift +.endif +.endm + +.macro calc_qpelh2 dst, dstt, src0, src1, src2, src3, src4, src5, src6, src7, op, shift=6 + smull2 \dstt\().4s, \src0\().8h, v0.h[0] + smlal2 \dstt\().4s, \src1\().8h, v0.h[1] + smlal2 \dstt\().4s, \src2\().8h, v0.h[2] + smlal2 \dstt\().4s, \src3\().8h, v0.h[3] + smlal2 \dstt\().4s, \src4\().8h, v0.h[4] + smlal2 \dstt\().4s, \src5\().8h, v0.h[5] + smlal2 \dstt\().4s, \src6\().8h, v0.h[6] + smlal2 \dstt\().4s, \src7\().8h, v0.h[7] +.ifc \op, sshr + sshr \dst\().4s, \dstt\().4s, \shift +.else + \op \dst\().8h, \dstt\().4s, \shift +.endif +.endm + .macro put_hevc type .ifc \type, qpel // void put_hevc_qpel_h(int16_t *dst, @@ -595,6 +663,198 @@ function ff_hevc_put_hevc_pel_uni_pixels64_8_neon, export=1 ret endfunc +.macro calc_all + calc v23, v16, v17, v18, v19, v20, v21, v22, v23 + b.eq 2f + calc v16, v17, v18, v19, v20, v21, v22, v23, v16 + b.eq 2f + calc v17, v18, v19, v20, v21, v22, v23, v16, v17 + b.eq 2f + calc v18, v19, v20, v21, v22, v23, v16, v17, v18 + b.eq 2f + calc v19, v20, v21, v22, v23, v16, v17, v18, v19 + b.eq 2f + calc v20, v21, v22, v23, v16, v17, v18, v19, v20 + b.eq 2f + calc v21, v22, v23, v16, v17, v18, v19, v20, v21 + b.eq 2f + calc v22, v23, v16, v17, v18, v19, v20, v21, v22 + b.hi 1b +.endm + +function ff_hevc_put_hevc_qpel_uni_v4_8_neon, export=1 + load_qpel_filterb x6, x5 + sub x2, x2, x3, lsl #1 + sub x2, x2, x3 + ldr s16, [x2] + ldr s17, [x2, x3] + add x2, x2, x3, lsl #1 + ldr s18, [x2] + ldr s19, [x2, x3] + add x2, x2, x3, lsl #1 + ldr s20, [x2] + ldr s21, [x2, x3] + add x2, x2, x3, lsl #1 + ldr s22, [x2] + add x2, x2, x3 +.macro calc tmp, src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\tmp\().s}[0], [x2], x3 + calc_qpelb v24, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7 + sqrshrun v24.8b, v24.8h, #6 + subs w4, w4, #1 + st1 {v24.s}[0], [x0], x1 +.endm +1: calc_all +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_v6_8_neon, export=1 + load_qpel_filterb x6, x5 + sub x2, x2, x3, lsl #1 + sub x1, x1, #4 + sub x2, x2, x3 + ldr d16, [x2] + ldr d17, [x2, x3] + add x2, x2, x3, lsl #1 + ldr d18, [x2] + ldr d19, [x2, x3] + add x2, x2, x3, lsl #1 + ldr d20, [x2] + ldr d21, [x2, x3] + add x2, x2, x3, lsl #1 + ldr d22, [x2] + add x2, x2, x3 +.macro calc tmp, src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\tmp\().8b}, [x2], x3 + calc_qpelb v24, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7 + sqrshrun v24.8b, v24.8h, #6 + st1 {v24.s}[0], [x0], #4 + subs w4, w4, #1 + st1 {v24.h}[2], [x0], x1 +.endm +1: calc_all +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_v8_8_neon, export=1 + load_qpel_filterb x6, x5 + sub x2, x2, x3, lsl #1 + sub x2, x2, x3 + ldr d16, [x2] + ldr d17, [x2, x3] + add x2, x2, x3, lsl #1 + ldr d18, [x2] + ldr d19, [x2, x3] + add x2, x2, x3, lsl #1 + ldr d20, [x2] + ldr d21, [x2, x3] + add x2, x2, x3, lsl #1 + ldr d22, [x2] + add x2, x2, x3 +.macro calc tmp, src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\tmp\().8b}, [x2], x3 + calc_qpelb v24, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7 + sqrshrun v24.8b, v24.8h, #6 + subs w4, w4, #1 + st1 {v24.8b}, [x0], x1 +.endm +1: calc_all +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_v12_8_neon, export=1 + load_qpel_filterb x6, x5 + sub x2, x2, x3, lsl #1 + sub x1, x1, #8 + sub x2, x2, x3 +0: mov x8, x2 // src + mov w11, w4 // height + mov x10, x0 // dst + ldr q16, [x8] + ldr q17, [x8, x3] + add x8, x8, x3, lsl #1 + ldr q18, [x8] + ldr q19, [x8, x3] + add x8, x8, x3, lsl #1 + ldr q20, [x8] + ldr q21, [x8, x3] + add x8, x8, x3, lsl #1 + ldr q22, [x8] + add x8, x8, x3 +.macro calc tmp, src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\tmp\().16b}, [x8], x3 + calc_qpelb v24, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7 + calc_qpelb2 v25, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7 + sqrshrun v24.8b, v24.8h, #6 + sqrshrun2 v24.16b, v25.8h, #6 + st1 {v24.8b}, [x10], #8 + subs x11, x11, #1 + st1 {v24.s}[2], [x10], x1 +.endm +1: calc_all +.purgem calc +2: add x0, x0, #12 + add x2, x2, #12 + subs w7, w7, #12 + b.ne 0b + ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_v16_8_neon, export=1 + load_qpel_filterb x6, x5 + sub x2, x2, x3, lsl #1 + sub x2, x2, x3 +0: mov x8, x2 // src + mov w11, w4 // height + mov x10, x0 // dst + ldr q16, [x8] + ldr q17, [x8, x3] + add x8, x8, x3, lsl #1 + ldr q18, [x8] + ldr q19, [x8, x3] + add x8, x8, x3, lsl #1 + ldr q20, [x8] + ldr q21, [x8, x3] + add x8, x8, x3, lsl #1 + ldr q22, [x8] + add x8, x8, x3 +.macro calc tmp, src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\tmp\().16b}, [x8], x3 + calc_qpelb v24, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7 + calc_qpelb2 v25, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7 + sqrshrun v24.8b, v24.8h, #6 + sqrshrun2 v24.16b, v25.8h, #6 + subs x11, x11, #1 + st1 {v24.16b}, [x10], x1 +.endm +1: calc_all +.purgem calc +2: add x0, x0, #16 + add x2, x2, #16 + subs w7, w7, #16 + b.ne 0b + ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_v24_8_neon, export=1 + b X(ff_hevc_put_hevc_qpel_uni_v12_8_neon) +endfunc + +function ff_hevc_put_hevc_qpel_uni_v32_8_neon, export=1 + b X(ff_hevc_put_hevc_qpel_uni_v16_8_neon) +endfunc + +function ff_hevc_put_hevc_qpel_uni_v48_8_neon, export=1 + b X(ff_hevc_put_hevc_qpel_uni_v16_8_neon) +endfunc + +function ff_hevc_put_hevc_qpel_uni_v64_8_neon, export=1 + b X(ff_hevc_put_hevc_qpel_uni_v16_8_neon) +endfunc + function ff_hevc_put_hevc_pel_uni_w_pixels4_8_neon, export=1 mov w10, #-6 sub w10, w10, w5 @@ -1298,6 +1558,334 @@ function ff_hevc_put_hevc_qpel_uni_w_v64_8_neon, export=1 endfunc #if HAVE_I8MM + +.macro calc_all2 + calc v30, v31, v16, v18, v20, v22, v24, v26, v28, v30, v17, v19, v21, v23, v25, v27, v29, v31 + b.eq 2f + calc v16, v17, v18, v20, v22, v24, v26, v28, v30, v16, v19, v21, v23, v25, v27, v29, v31, v17 + b.eq 2f + calc v18, v19, v20, v22, v24, v26, v28, v30, v16, v18, v21, v23, v25, v27, v29, v31, v17, v19 + b.eq 2f + calc v20, v21, v22, v24, v26, v28, v30, v16, v18, v20, v23, v25, v27, v29, v31, v17, v19, v21 + b.eq 2f + calc v22, v23, v24, v26, v28, v30, v16, v18, v20, v22, v25, v27, v29, v31, v17, v19, v21, v23 + b.eq 2f + calc v24, v25, v26, v28, v30, v16, v18, v20, v22, v24, v27, v29, v31, v17, v19, v21, v23, v25 + b.eq 2f + calc v26, v27, v28, v30, v16, v18, v20, v22, v24, v26, v29, v31, v17, v19, v21, v23, v25, v27 + b.eq 2f + calc v28, v29, v30, v16, v18, v20, v22, v24, v26, v28, v31, v17, v19, v21, v23, v25, v27, v29 + b.hi 1b +.endm + +function ff_hevc_put_hevc_qpel_uni_hv4_8_neon_i8mm, export=1 + add w10, w4, #7 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + str x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + sub x1, x2, x3, lsl #1 + sub x1, x1, x3 + add x0, sp, #48 + mov x2, x3 + add x3, x4, #7 + mov x4, x5 + bl X(ff_hevc_put_hevc_qpel_h4_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldr x30, [sp], #48 + mov x9, #(MAX_PB_SIZE * 2) + load_qpel_filterh x6, x5 + ldr d16, [sp] + ldr d17, [sp, x9] + add sp, sp, x9, lsl #1 + ldr d18, [sp] + ldr d19, [sp, x9] + add sp, sp, x9, lsl #1 + ldr d20, [sp] + ldr d21, [sp, x9] + add sp, sp, x9, lsl #1 + ldr d22, [sp] + add sp, sp, x9 +.macro calc tmp, src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\tmp\().4h}, [sp], x9 + calc_qpelh v1, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sqrshrn, #12 + sqxtun v1.8b, v1.8h + subs w4, w4, #1 + st1 {v1.s}[0], [x0], x1 +.endm +1: calc_all +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_hv6_8_neon_i8mm, export=1 + add w10, w4, #7 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + str x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + sub x1, x2, x3, lsl #1 + sub x1, x1, x3 + add x0, sp, #48 + mov x2, x3 + add w3, w4, #7 + mov x4, x5 + bl X(ff_hevc_put_hevc_qpel_h6_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldr x30, [sp], #48 + mov x9, #(MAX_PB_SIZE * 2) + load_qpel_filterh x6, x5 + sub x1, x1, #4 + ldr q16, [sp] + ldr q17, [sp, x9] + add sp, sp, x9, lsl #1 + ldr q18, [sp] + ldr q19, [sp, x9] + add sp, sp, x9, lsl #1 + ldr q20, [sp] + ldr q21, [sp, x9] + add sp, sp, x9, lsl #1 + ldr q22, [sp] + add sp, sp, x9 +.macro calc tmp, src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\tmp\().8h}, [sp], x9 + calc_qpelh v1, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sqrshrn, #12 + calc_qpelh2 v1, v2, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sqrshrn2, #12 + sqxtun v1.8b, v1.8h + st1 {v1.s}[0], [x0], #4 + subs w4, w4, #1 + st1 {v1.h}[2], [x0], x1 +.endm +1: calc_all +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_hv8_8_neon_i8mm, export=1 + add w10, w4, #7 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + str x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + sub x1, x2, x3, lsl #1 + sub x1, x1, x3 + add x0, sp, #48 + mov x2, x3 + add w3, w4, #7 + mov x4, x5 + bl X(ff_hevc_put_hevc_qpel_h8_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldr x30, [sp], #48 + mov x9, #(MAX_PB_SIZE * 2) + load_qpel_filterh x6, x5 + ldr q16, [sp] + ldr q17, [sp, x9] + add sp, sp, x9, lsl #1 + ldr q18, [sp] + ldr q19, [sp, x9] + add sp, sp, x9, lsl #1 + ldr q20, [sp] + ldr q21, [sp, x9] + add sp, sp, x9, lsl #1 + ldr q22, [sp] + add sp, sp, x9 +.macro calc tmp, src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\tmp\().8h}, [sp], x9 + calc_qpelh v1, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sqrshrn, #12 + calc_qpelh2 v1, v2, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sqrshrn2, #12 + sqxtun v1.8b, v1.8h + subs w4, w4, #1 + st1 {v1.8b}, [x0], x1 +.endm +1: calc_all +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_hv12_8_neon_i8mm, export=1 + add w10, w4, #7 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + stp x7, x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + sub x1, x2, x3, lsl #1 + sub x1, x1, x3 + mov x2, x3 + add x0, sp, #48 + add w3, w4, #7 + mov x4, x5 + bl X(ff_hevc_put_hevc_qpel_h12_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldp x7, x30, [sp], #48 + mov x9, #(MAX_PB_SIZE * 2) + load_qpel_filterh x6, x5 + sub x1, x1, #8 + ld1 {v16.8h, v17.8h}, [sp], x9 + ld1 {v18.8h, v19.8h}, [sp], x9 + ld1 {v20.8h, v21.8h}, [sp], x9 + ld1 {v22.8h, v23.8h}, [sp], x9 + ld1 {v24.8h, v25.8h}, [sp], x9 + ld1 {v26.8h, v27.8h}, [sp], x9 + ld1 {v28.8h, v29.8h}, [sp], x9 +.macro calc tmp0, tmp1, src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10, src11, src12, src13, src14, src15 + ld1 {\tmp0\().8h, \tmp1\().8h}, [sp], x9 + calc_qpelh v1, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sqrshrn, #12 + calc_qpelh2 v1, v2, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sqrshrn2, #12 + calc_qpelh v2, \src8, \src9, \src10, \src11, \src12, \src13, \src14, \src15, sqrshrn, #12 + sqxtun v1.8b, v1.8h + sqxtun2 v1.16b, v2.8h + st1 {v1.8b}, [x0], #8 + subs w4, w4, #1 + st1 {v1.s}[2], [x0], x1 +.endm +1: calc_all2 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_hv16_8_neon_i8mm, export=1 + add w10, w4, #7 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + stp x7, x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + add x0, sp, #48 + sub x1, x2, x3, lsl #1 + sub x1, x1, x3 + mov x2, x3 + add w3, w4, #7 + mov x4, x5 + bl X(ff_hevc_put_hevc_qpel_h16_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldp x7, x30, [sp], #48 +.Lqpel_uni_hv16_loop: + mov x9, #(MAX_PB_SIZE * 2) + load_qpel_filterh x6, x5 + sub w12, w9, w7, lsl #1 +0: mov x8, sp // src + ld1 {v16.8h, v17.8h}, [x8], x9 + mov w11, w4 // height + ld1 {v18.8h, v19.8h}, [x8], x9 + mov x10, x0 // dst + ld1 {v20.8h, v21.8h}, [x8], x9 + ld1 {v22.8h, v23.8h}, [x8], x9 + ld1 {v24.8h, v25.8h}, [x8], x9 + ld1 {v26.8h, v27.8h}, [x8], x9 + ld1 {v28.8h, v29.8h}, [x8], x9 +.macro calc tmp0, tmp1, src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10, src11, src12, src13, src14, src15 + ld1 {\tmp0\().8h, \tmp1\().8h}, [x8], x9 + calc_qpelh v1, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sqrshrn, #12 + calc_qpelh2 v1, v2, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sqrshrn2, #12 + calc_qpelh v2, \src8, \src9, \src10, \src11, \src12, \src13, \src14, \src15, sqrshrn, #12 + calc_qpelh2 v2, v3, \src8, \src9, \src10, \src11, \src12, \src13, \src14, \src15, sqrshrn2, #12 + sqxtun v1.8b, v1.8h + subs x11, x11, #1 + sqxtun2 v1.16b, v2.8h + st1 {v1.16b}, [x10], x1 +.endm +1: calc_all2 +.purgem calc +2: add x0, x0, #16 + add sp, sp, #32 + subs w7, w7, #16 + b.ne 0b + add w10, w4, #6 + add sp, sp, x12 // discard rest of first line + lsl x10, x10, #7 + add sp, sp, x10 // tmp_array without first line + ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_hv24_8_neon_i8mm, export=1 + stp x4, x5, [sp, #-64]! + stp x2, x3, [sp, #16] + stp x0, x1, [sp, #32] + stp x6, x30, [sp, #48] + mov x7, #16 + bl X(ff_hevc_put_hevc_qpel_uni_hv16_8_neon_i8mm) + ldp x2, x3, [sp, #16] + add x2, x2, #16 + ldp x0, x1, [sp, #32] + ldp x4, x5, [sp], #48 + mov x7, #8 + add x0, x0, #16 + ldr x6, [sp] + bl X(ff_hevc_put_hevc_qpel_uni_hv8_8_neon_i8mm) + ldr x30, [sp, #8] + add sp, sp, #16 + ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_hv32_8_neon_i8mm, export=1 + add w10, w4, #7 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + stp x7, x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + sub x1, x2, x3, lsl #1 + add x0, sp, #48 + sub x1, x1, x3 + mov x2, x3 + add w3, w4, #7 + mov x4, x5 + bl X(ff_hevc_put_hevc_qpel_h32_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldp x7, x30, [sp], #48 + b .Lqpel_uni_hv16_loop +endfunc + +function ff_hevc_put_hevc_qpel_uni_hv48_8_neon_i8mm, export=1 + add w10, w4, #7 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + stp x7, x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + sub x1, x2, x3, lsl #1 + sub x1, x1, x3 + mov x2, x3 + add x0, sp, #48 + add w3, w4, #7 + mov x4, x5 + bl X(ff_hevc_put_hevc_qpel_h48_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldp x7, x30, [sp], #48 + b .Lqpel_uni_hv16_loop +endfunc + +function ff_hevc_put_hevc_qpel_uni_hv64_8_neon_i8mm, export=1 + add w10, w4, #7 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + stp x7, x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + add x0, sp, #48 + sub x1, x2, x3, lsl #1 + mov x2, x3 + sub x1, x1, x3 + add w3, w4, #7 + mov x4, x5 + bl X(ff_hevc_put_hevc_qpel_h64_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldp x7, x30, [sp], #48 + b .Lqpel_uni_hv16_loop +endfunc + .macro QPEL_UNI_W_H_HEADER ldr x12, [sp] sub x2, x2, #3 diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/aarch64/synth_filter_init.c b/arm/raspi/third_party/ffmpeg/libavcodec/aarch64/synth_filter_init.c index 6b6da35b..aea6aaf4 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/aarch64/synth_filter_init.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/aarch64/synth_filter_init.c @@ -23,15 +23,8 @@ #include "libavutil/aarch64/cpu.h" #include "libavutil/attributes.h" #include "libavutil/internal.h" -#include "libavcodec/fft.h" #include "libavcodec/synth_filter.h" -#include "asm-offsets.h" - -#if HAVE_NEON -AV_CHECK_OFFSET(FFTContext, imdct_half, IMDCT_HALF); -#endif - void ff_synth_filter_float_neon(AVTXContext *imdct, float *synth_buf_ptr, int *synth_buf_offset, float synth_buf2[32], const float window[512], diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/aarch64/synth_filter_neon.S b/arm/raspi/third_party/ffmpeg/libavcodec/aarch64/synth_filter_neon.S index 259fa6e6..63aefcb5 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/aarch64/synth_filter_neon.S +++ b/arm/raspi/third_party/ffmpeg/libavcodec/aarch64/synth_filter_neon.S @@ -19,8 +19,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "asm-offsets.h" - #include "libavutil/aarch64/asm.S" .macro inner_loop diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/ac3dec.c b/arm/raspi/third_party/ffmpeg/libavcodec/ac3dec.c index fc0cbeb4..ee501386 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/ac3dec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/ac3dec.c @@ -228,7 +228,7 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx) if ((ret = av_tx_init(&s->tx_256, &s->tx_fn_256, IMDCT_TYPE, 1, 256, &scale, 0))) return ret; - AC3_RENAME(ff_kbd_window_init)(s->window, 5.0, 256); + AC3_RENAME(avpriv_kbd_window_init)(s->window, 5.0, 256); ff_bswapdsp_init(&s->bdsp); #if (USE_FIXED) @@ -1714,7 +1714,7 @@ skip: if (!err) { avctx->sample_rate = s->sample_rate; avctx->bit_rate = s->bit_rate + s->prev_bit_rate; - avctx->profile = s->eac3_extension_type_a == 1 ? FF_PROFILE_EAC3_DDP_ATMOS : FF_PROFILE_UNKNOWN; + avctx->profile = s->eac3_extension_type_a == 1 ? AV_PROFILE_EAC3_DDP_ATMOS : AV_PROFILE_UNKNOWN; } if (!avctx->sample_rate) { diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/ac3enc.c b/arm/raspi/third_party/ffmpeg/libavcodec/ac3enc.c index 3cb4e5f0..56c8d239 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/ac3enc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/ac3enc.c @@ -33,6 +33,7 @@ #include "libavutil/avstring.h" #include "libavutil/channel_layout.h" #include "libavutil/crc.h" +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "libavutil/mem_internal.h" #include "libavutil/opt.h" diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/ac3enc_fixed.c b/arm/raspi/third_party/ffmpeg/libavcodec/ac3enc_fixed.c index 88dfd66b..079a43dc 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/ac3enc_fixed.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/ac3enc_fixed.c @@ -82,7 +82,7 @@ static av_cold int ac3_fixed_mdct_init(AC3EncodeContext *s) if (!iwin) return AVERROR(ENOMEM); - ff_kbd_window_init(fwin, 5.0, AC3_BLOCK_SIZE); + avpriv_kbd_window_init(fwin, 5.0, AC3_BLOCK_SIZE); for (int i = 0; i < AC3_BLOCK_SIZE; i++) iwin[i] = lrintf(fwin[i] * (1 << 22)); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/ac3enc_float.c b/arm/raspi/third_party/ffmpeg/libavcodec/ac3enc_float.c index ae351a53..9664adbf 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/ac3enc_float.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/ac3enc_float.c @@ -92,7 +92,7 @@ static av_cold int ac3_float_mdct_init(AC3EncodeContext *s) return AVERROR(ENOMEM); } - ff_kbd_window_init(window, 5.0, AC3_BLOCK_SIZE); + avpriv_kbd_window_init(window, 5.0, AC3_BLOCK_SIZE); s->mdct_window = window; return av_tx_init(&s->tx, &s->tx_fn, AV_TX_FLOAT_MDCT, 0, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/adx.h b/arm/raspi/third_party/ffmpeg/libavcodec/adx.h index 8d5e0869..60ce07ad 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/adx.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/adx.h @@ -35,9 +35,11 @@ typedef struct ADXChannelState { int s1,s2; } ADXChannelState; +#define MAX_CHANNELS 6 + typedef struct ADXContext { int channels; - ADXChannelState prev[2]; + ADXChannelState prev[MAX_CHANNELS]; int header_parsed; int eof; int cutoff; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/adx_parser.c b/arm/raspi/third_party/ffmpeg/libavcodec/adx_parser.c index 52aa14b7..62b4415b 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/adx_parser.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/adx_parser.c @@ -73,6 +73,16 @@ static int adx_parse(AVCodecParserContext *s1, s->remaining = 0; } else s->remaining -= buf_size; + } else if (avctx->ch_layout.nb_channels > 0) { + if (!s->block_size) + s->block_size = avctx->ch_layout.nb_channels * BLOCK_SIZE; + if (!s->remaining) + s->remaining = s->block_size; + if (s->remaining <= buf_size) { + next = s->remaining; + s->remaining = 0; + } else + s->remaining -= buf_size; } if (ff_combine_frame(pc, next, &buf, &buf_size) < 0 || !buf_size) { diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/adxdec.c b/arm/raspi/third_party/ffmpeg/libavcodec/adxdec.c index 97a7e596..4300dede 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/adxdec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/adxdec.c @@ -70,7 +70,7 @@ static int adx_decode_header(AVCodecContext *avctx, const uint8_t *buf, /* channels */ channels = buf[7]; - if (channels <= 0 || channels > 2) + if (channels <= 0 || channels > MAX_CHANNELS) return AVERROR_INVALIDDATA; if (avctx->ch_layout.nb_channels != channels) { diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/agm.c b/arm/raspi/third_party/ffmpeg/libavcodec/agm.c index 55cf0b47..88272cc3 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/agm.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/agm.c @@ -1015,12 +1015,12 @@ static int build_huff(const uint8_t *bitlen, VLC *vlc) } } - ff_free_vlc(vlc); - return ff_init_vlc_sparse(vlc, 13, nb_codes, + ff_vlc_free(vlc); + return ff_vlc_init_sparse(vlc, 13, nb_codes, bits, 1, 1, codes, 4, 4, symbols, 1, 1, - INIT_VLC_LE); + VLC_INIT_LE); } static int decode_huffman2(AVCodecContext *avctx, int header, int size) @@ -1203,8 +1203,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, if (ret < 0) return ret; - av_frame_unref(s->prev_frame); - if ((ret = av_frame_ref(s->prev_frame, frame)) < 0) + if ((ret = av_frame_replace(s->prev_frame, frame)) < 0) return ret; frame->crop_top = avctx->coded_height - avctx->height; @@ -1256,7 +1255,7 @@ static av_cold int decode_close(AVCodecContext *avctx) { AGMContext *s = avctx->priv_data; - ff_free_vlc(&s->vlc); + ff_vlc_free(&s->vlc); av_frame_free(&s->prev_frame); av_freep(&s->mvectors); s->mvectors_size = 0; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/alac.c b/arm/raspi/third_party/ffmpeg/libavcodec/alac.c index d10ecba7..538d1e59 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/alac.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/alac.c @@ -112,6 +112,7 @@ static inline unsigned int decode_scalar(GetBitContext *gb, int k, int bps) static int rice_decompress(ALACContext *alac, int32_t *output_buffer, int nb_samples, int bps, int rice_history_mult) { + GetBitContext *gb = &alac->gb; int i; unsigned int history = alac->rice_initial_history; int sign_modifier = 0; @@ -120,13 +121,13 @@ static int rice_decompress(ALACContext *alac, int32_t *output_buffer, int k; unsigned int x; - if(get_bits_left(&alac->gb) <= 0) + if (get_bits_left(gb) <= 0) return AVERROR_INVALIDDATA; /* calculate rice param and decode next value */ k = av_log2((history >> 9) + 3); k = FFMIN(k, alac->rice_limit); - x = decode_scalar(&alac->gb, k, bps); + x = decode_scalar(gb, k, bps); x += sign_modifier; sign_modifier = 0; output_buffer[i] = (x >> 1) ^ -(x & 1); @@ -145,7 +146,7 @@ static int rice_decompress(ALACContext *alac, int32_t *output_buffer, /* calculate rice param and decode block size */ k = 7 - av_log2(history) + ((history + 16) >> 6); k = FFMIN(k, alac->rice_limit); - block_size = decode_scalar(&alac->gb, k, 16); + block_size = decode_scalar(gb, k, 16); if (block_size > 0) { if (block_size >= nb_samples - i) { @@ -168,7 +169,7 @@ static int rice_decompress(ALACContext *alac, int32_t *output_buffer, static inline int sign_only(int v) { - return v ? FFSIGN(v) : 0; + return FFDIFFSIGN(v, 0); } static void lpc_prediction(int32_t *error_buffer, uint32_t *buffer_out, @@ -239,16 +240,17 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index, { ALACContext *alac = avctx->priv_data; int has_size, bps, is_compressed, decorr_shift, decorr_left_weight, ret; + GetBitContext *gb = &alac->gb; uint32_t output_samples; int i, ch; - skip_bits(&alac->gb, 4); /* element instance tag */ - skip_bits(&alac->gb, 12); /* unused header bits */ + skip_bits(gb, 4); /* element instance tag */ + skip_bits(gb, 12); /* unused header bits */ /* the number of output samples is stored in the frame */ - has_size = get_bits1(&alac->gb); + has_size = get_bits1(gb); - alac->extra_bits = get_bits(&alac->gb, 2) << 3; + alac->extra_bits = get_bits(gb, 2) << 3; bps = alac->sample_size - alac->extra_bits + channels - 1; if (bps > 32) { avpriv_report_missing_feature(avctx, "bps %d", bps); @@ -258,10 +260,10 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index, return AVERROR_INVALIDDATA; /* whether the frame is compressed */ - is_compressed = !get_bits1(&alac->gb); + is_compressed = !get_bits1(gb); if (has_size) - output_samples = get_bits_long(&alac->gb, 32); + output_samples = get_bits_long(gb, 32); else output_samples = alac->max_samples_per_frame; if (!output_samples || output_samples > alac->max_samples_per_frame) { @@ -298,39 +300,40 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index, return AVERROR(ENOSYS); } - decorr_shift = get_bits(&alac->gb, 8); - decorr_left_weight = get_bits(&alac->gb, 8); + decorr_shift = get_bits(gb, 8); + decorr_left_weight = get_bits(gb, 8); if (channels == 2 && decorr_left_weight && decorr_shift > 31) return AVERROR_INVALIDDATA; for (ch = 0; ch < channels; ch++) { - prediction_type[ch] = get_bits(&alac->gb, 4); - lpc_quant[ch] = get_bits(&alac->gb, 4); - rice_history_mult[ch] = get_bits(&alac->gb, 3); - lpc_order[ch] = get_bits(&alac->gb, 5); + prediction_type[ch] = get_bits(gb, 4); + lpc_quant[ch] = get_bits(gb, 4); + rice_history_mult[ch] = get_bits(gb, 3); + lpc_order[ch] = get_bits(gb, 5); if (lpc_order[ch] >= alac->max_samples_per_frame || !lpc_quant[ch]) return AVERROR_INVALIDDATA; /* read the predictor table */ for (i = lpc_order[ch] - 1; i >= 0; i--) - lpc_coefs[ch][i] = get_sbits(&alac->gb, 16); + lpc_coefs[ch][i] = get_sbits(gb, 16); } if (alac->extra_bits) { + const int extra_bits = alac->extra_bits; + if (get_bits_left(gb) < (int64_t)alac->nb_samples * channels * extra_bits) + return AVERROR_INVALIDDATA; for (i = 0; i < alac->nb_samples; i++) { - if(get_bits_left(&alac->gb) <= 0) - return AVERROR_INVALIDDATA; for (ch = 0; ch < channels; ch++) - alac->extra_bits_buffer[ch][i] = get_bits(&alac->gb, alac->extra_bits); + alac->extra_bits_buffer[ch][i] = get_bits(gb, extra_bits); } } for (ch = 0; ch < channels; ch++) { - int ret=rice_decompress(alac, alac->predict_error_buffer[ch], + int ret = rice_decompress(alac, alac->predict_error_buffer[ch], alac->nb_samples, bps, rice_history_mult[ch] * alac->rice_history_mult / 4); - if(ret<0) + if (ret < 0) return ret; /* adaptive FIR filter */ @@ -354,13 +357,14 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index, bps, lpc_coefs[ch], lpc_order[ch], lpc_quant[ch]); } } else { + const int sample_size = alac->sample_size; /* not compressed, easy case */ + if (get_bits_left(gb) < (int64_t)alac->nb_samples * channels * sample_size) + return AVERROR_INVALIDDATA; for (i = 0; i < alac->nb_samples; i++) { - if(get_bits_left(&alac->gb) <= 0) - return AVERROR_INVALIDDATA; for (ch = 0; ch < channels; ch++) { alac->output_samples_buffer[ch][i] = - get_sbits_long(&alac->gb, alac->sample_size); + get_sbits_long(gb, sample_size); } } alac->extra_bits = 0; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/allcodecs.c b/arm/raspi/third_party/ffmpeg/libavcodec/allcodecs.c index 8775d15a..5136a566 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/allcodecs.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/allcodecs.c @@ -516,6 +516,7 @@ extern const FFCodec ff_nellymoser_decoder; extern const FFCodec ff_on2avc_decoder; extern const FFCodec ff_opus_encoder; extern const FFCodec ff_opus_decoder; +extern const FFCodec ff_osq_decoder; extern const FFCodec ff_paf_audio_decoder; extern const FFCodec ff_qcelp_decoder; extern const FFCodec ff_qdm2_decoder; @@ -844,6 +845,7 @@ extern const FFCodec ff_av1_nvenc_encoder; extern const FFCodec ff_av1_qsv_decoder; extern const FFCodec ff_av1_qsv_encoder; extern const FFCodec ff_av1_amf_encoder; +extern const FFCodec ff_av1_vaapi_encoder; extern const FFCodec ff_libopenh264_encoder; extern const FFCodec ff_libopenh264_decoder; extern const FFCodec ff_h264_amf_encoder; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/alpha/idctdsp_alpha.c b/arm/raspi/third_party/ffmpeg/libavcodec/alpha/idctdsp_alpha.c index bd438425..ff770c15 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/alpha/idctdsp_alpha.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/alpha/idctdsp_alpha.c @@ -19,6 +19,7 @@ */ #include "libavutil/attributes.h" +#include "libavcodec/avcodec.h" #include "libavcodec/idctdsp.h" #include "idctdsp_alpha.h" #include "asm.h" diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/amfenc.c b/arm/raspi/third_party/ffmpeg/libavcodec/amfenc.c index cb48f8c2..061859f8 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/amfenc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/amfenc.c @@ -430,9 +430,9 @@ static int amf_copy_surface(AVCodecContext *avctx, const AVFrame *frame, dst_data[i] = plane->pVtbl->GetNative(plane); dst_linesize[i] = plane->pVtbl->GetHPitch(plane); } - av_image_copy(dst_data, dst_linesize, - (const uint8_t**)frame->data, frame->linesize, frame->format, - avctx->width, avctx->height); + av_image_copy2(dst_data, dst_linesize, + frame->data, frame->linesize, frame->format, + avctx->width, avctx->height); return 0; } @@ -720,10 +720,10 @@ int ff_amf_receive_packet(AVCodecContext *avctx, AVPacket *avpkt) if (!avpkt->data && !avpkt->buf) { res_query = ctx->encoder->pVtbl->QueryOutput(ctx->encoder, &data); if (data) { - query_output_data_flag = 1; // copy data to packet AMFBuffer *buffer; AMFGuid guid = IID_AMFBuffer(); + query_output_data_flag = 1; data->pVtbl->QueryInterface(data, &guid, (void**)&buffer); // query for buffer interface ret = amf_copy_buffer(avctx, avpkt, buffer); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/amfenc_av1.c b/arm/raspi/third_party/ffmpeg/libavcodec/amfenc_av1.c index 30c0a9fa..8f13aea2 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/amfenc_av1.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/amfenc_av1.c @@ -192,7 +192,7 @@ FF_ENABLE_DEPRECATION_WARNINGS AMF_ASSIGN_PROPERTY_RATE(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_FRAMERATE, framerate); switch (avctx->profile) { - case FF_PROFILE_AV1_MAIN: + case AV_PROFILE_AV1_MAIN: profile = AMF_VIDEO_ENCODER_AV1_PROFILE_MAIN; break; default: @@ -204,7 +204,7 @@ FF_ENABLE_DEPRECATION_WARNINGS AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_PROFILE, profile); profile_level = avctx->level; - if (profile_level == FF_LEVEL_UNKNOWN) { + if (profile_level == AV_LEVEL_UNKNOWN) { profile_level = ctx->level; } if (profile_level != 0) { diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/amfenc_h264.c b/arm/raspi/third_party/ffmpeg/libavcodec/amfenc_h264.c index 2380aa4e..bd544d12 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/amfenc_h264.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/amfenc_h264.c @@ -223,19 +223,19 @@ FF_ENABLE_DEPRECATION_WARNINGS AMF_ASSIGN_PROPERTY_RATE(res, ctx->encoder, AMF_VIDEO_ENCODER_FRAMERATE, framerate); switch (avctx->profile) { - case FF_PROFILE_H264_BASELINE: + case AV_PROFILE_H264_BASELINE: profile = AMF_VIDEO_ENCODER_PROFILE_BASELINE; break; - case FF_PROFILE_H264_MAIN: + case AV_PROFILE_H264_MAIN: profile = AMF_VIDEO_ENCODER_PROFILE_MAIN; break; - case FF_PROFILE_H264_HIGH: + case AV_PROFILE_H264_HIGH: profile = AMF_VIDEO_ENCODER_PROFILE_HIGH; break; - case FF_PROFILE_H264_CONSTRAINED_BASELINE: + case AV_PROFILE_H264_CONSTRAINED_BASELINE: profile = AMF_VIDEO_ENCODER_PROFILE_CONSTRAINED_BASELINE; break; - case (FF_PROFILE_H264_HIGH | FF_PROFILE_H264_CONSTRAINED): + case (AV_PROFILE_H264_HIGH | AV_PROFILE_H264_CONSTRAINED): profile = AMF_VIDEO_ENCODER_PROFILE_CONSTRAINED_HIGH; break; } @@ -246,7 +246,7 @@ FF_ENABLE_DEPRECATION_WARNINGS AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_PROFILE, profile); profile_level = avctx->level; - if (profile_level == FF_LEVEL_UNKNOWN) { + if (profile_level == AV_LEVEL_UNKNOWN) { profile_level = ctx->level; } if (profile_level != 0) { diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/amfenc_hevc.c b/arm/raspi/third_party/ffmpeg/libavcodec/amfenc_hevc.c index dd232cc8..352564a3 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/amfenc_hevc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/amfenc_hevc.c @@ -184,7 +184,7 @@ FF_ENABLE_DEPRECATION_WARNINGS AMF_ASSIGN_PROPERTY_RATE(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_FRAMERATE, framerate); switch (avctx->profile) { - case FF_PROFILE_HEVC_MAIN: + case AV_PROFILE_HEVC_MAIN: profile = AMF_VIDEO_ENCODER_HEVC_PROFILE_MAIN; break; default: @@ -198,7 +198,7 @@ FF_ENABLE_DEPRECATION_WARNINGS AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_TIER, ctx->tier); profile_level = avctx->level; - if (profile_level == FF_LEVEL_UNKNOWN) { + if (profile_level == AV_LEVEL_UNKNOWN) { profile_level = ctx->level; } if (profile_level != 0) { diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/apedec.c b/arm/raspi/third_party/ffmpeg/libavcodec/apedec.c index 613c76df..8bfbb75b 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/apedec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/apedec.c @@ -145,8 +145,6 @@ typedef struct APEPredictor64 { uint64_t coeffsA[2][4]; ///< adaption coefficients uint64_t coeffsB[2][5]; ///< adaption coefficients int64_t historybuffer[HISTORY_SIZE + PREDICTOR_SIZE]; - - unsigned int sample_pos; } APEPredictor64; /** Decoder context */ @@ -173,6 +171,9 @@ typedef struct APEContext { int32_t *decoded_buffer; int decoded_size; int32_t *decoded[MAX_CHANNELS]; ///< decoded data for each channel + int32_t *interim_buffer; + int interim_size; + int32_t *interim[MAX_CHANNELS]; ///< decoded data for each channel int blocks_per_loop; ///< maximum number of samples to decode for each call int16_t* filterbuf[APE_FILTER_LEVELS]; ///< filter memory @@ -189,6 +190,7 @@ typedef struct APEContext { const uint8_t *ptr; ///< current position in frame data int error; + int interim_mode; void (*entropy_decode_mono)(struct APEContext *ctx, int blockstodecode); void (*entropy_decode_stereo)(struct APEContext *ctx, int blockstodecode); @@ -225,6 +227,7 @@ static av_cold int ape_decode_close(AVCodecContext *avctx) av_freep(&s->filterbuf[i]); av_freep(&s->decoded_buffer); + av_freep(&s->interim_buffer); av_freep(&s->data); s->decoded_size = s->data_size = 0; @@ -250,12 +253,15 @@ static av_cold int ape_decode_init(AVCodecContext *avctx) switch (s->bps) { case 8: avctx->sample_fmt = AV_SAMPLE_FMT_U8P; + s->interim_mode = 0; break; case 16: avctx->sample_fmt = AV_SAMPLE_FMT_S16P; + s->interim_mode = 0; break; case 24: avctx->sample_fmt = AV_SAMPLE_FMT_S32P; + s->interim_mode = -1; break; default: avpriv_request_sample(avctx, @@ -860,8 +866,6 @@ static void init_predictor_decoder(APEContext *ctx) p64->lastA[0] = p64->lastA[1] = 0; p->sample_pos = 0; - - p64->sample_pos = 0; } /** Get inverse sign of integer (-1 for positive, 1 for negative and 0 for zero) */ @@ -1184,7 +1188,8 @@ static void predictor_decode_mono_3930(APEContext *ctx, int count) static av_always_inline int predictor_update_filter(APEPredictor64 *p, const int decoded, const int filter, const int delayA, const int delayB, - const int adaptA, const int adaptB) + const int adaptA, const int adaptB, + int interim_mode) { int64_t predictionA, predictionB; int32_t sign; @@ -1212,7 +1217,13 @@ static av_always_inline int predictor_update_filter(APEPredictor64 *p, p->buf[delayB - 3] * p->coeffsB[filter][3] + p->buf[delayB - 4] * p->coeffsB[filter][4]; - p->lastA[filter] = decoded + ((int64_t)((uint64_t)predictionA + (predictionB >> 1)) >> 10); + if (interim_mode < 1) { + predictionA = (int32_t)predictionA; + predictionB = (int32_t)predictionB; + p->lastA[filter] = (int32_t)(decoded + (unsigned)((int32_t)(predictionA + (predictionB >> 1)) >> 10)); + } else { + p->lastA[filter] = decoded + ((int64_t)((uint64_t)predictionA + (predictionB >> 1)) >> 10); + } p->filterA[filter] = p->lastA[filter] + ((int64_t)(p->filterA[filter] * 31ULL) >> 5); sign = APESIGN(decoded); @@ -1231,30 +1242,73 @@ static av_always_inline int predictor_update_filter(APEPredictor64 *p, static void predictor_decode_stereo_3950(APEContext *ctx, int count) { - APEPredictor64 *p = &ctx->predictor64; - int32_t *decoded0 = ctx->decoded[0]; - int32_t *decoded1 = ctx->decoded[1]; + APEPredictor64 *p_default = &ctx->predictor64; + APEPredictor64 p_interim; + int lcount = count; + int num_passes = 1; ape_apply_filters(ctx, ctx->decoded[0], ctx->decoded[1], count); + if (ctx->interim_mode == -1) { + p_interim = *p_default; + num_passes ++; + memcpy(ctx->interim[0], ctx->decoded[0], sizeof(*ctx->interim[0])*count); + memcpy(ctx->interim[1], ctx->decoded[1], sizeof(*ctx->interim[1])*count); + } - while (count--) { - /* Predictor Y */ - *decoded0 = predictor_update_filter(p, *decoded0, 0, YDELAYA, YDELAYB, - YADAPTCOEFFSA, YADAPTCOEFFSB); - decoded0++; - *decoded1 = predictor_update_filter(p, *decoded1, 1, XDELAYA, XDELAYB, - XADAPTCOEFFSA, XADAPTCOEFFSB); - decoded1++; + for (int pass = 0; pass < num_passes; pass++) { + int32_t *decoded0, *decoded1; + int interim_mode = ctx->interim_mode > 0 || pass; + APEPredictor64 *p; - /* Combined */ - p->buf++; - - /* Have we filled the history buffer? */ - if (p->buf == p->historybuffer + HISTORY_SIZE) { - memmove(p->historybuffer, p->buf, - PREDICTOR_SIZE * sizeof(*p->historybuffer)); - p->buf = p->historybuffer; + if (pass) { + p = &p_interim; + decoded0 = ctx->interim[0]; + decoded1 = ctx->interim[1]; + } else { + p = p_default; + decoded0 = ctx->decoded[0]; + decoded1 = ctx->decoded[1]; } + p->buf = p->historybuffer; + + count = lcount; + while (count--) { + /* Predictor Y */ + int32_t a0 = predictor_update_filter(p, *decoded0, 0, YDELAYA, YDELAYB, + YADAPTCOEFFSA, YADAPTCOEFFSB, + interim_mode); + int32_t a1 = predictor_update_filter(p, *decoded1, 1, XDELAYA, XDELAYB, + XADAPTCOEFFSA, XADAPTCOEFFSB, + interim_mode); + *decoded0++ = a0; + *decoded1++ = a1; + if (num_passes > 1) { + int32_t left = a1 - (unsigned)(a0 / 2); + int32_t right = left + a0; + + if (FFMAX(FFABS(left), FFABS(right)) > (1<<23)) { + ctx->interim_mode = !interim_mode; + av_log(ctx->avctx, AV_LOG_VERBOSE, "Interim mode: %d\n", ctx->interim_mode); + break; + } + } + + /* Combined */ + p->buf++; + + /* Have we filled the history buffer? */ + if (p->buf == p->historybuffer + HISTORY_SIZE) { + memmove(p->historybuffer, p->buf, + PREDICTOR_SIZE * sizeof(*p->historybuffer)); + p->buf = p->historybuffer; + } + } + } + if (num_passes > 1 && ctx->interim_mode > 0) { + memcpy(ctx->decoded[0], ctx->interim[0], sizeof(*ctx->interim[0])*lcount); + memcpy(ctx->decoded[1], ctx->interim[1], sizeof(*ctx->interim[1])*lcount); + *p_default = p_interim; + p_default->buf = p_default->historybuffer; } } @@ -1585,6 +1639,19 @@ static int ape_decode_frame(AVCodecContext *avctx, AVFrame *frame, s->decoded[0] = s->decoded_buffer; s->decoded[1] = s->decoded_buffer + FFALIGN(blockstodecode, 8); + if (s->interim_mode < 0) { + av_fast_malloc(&s->interim_buffer, &s->interim_size, decoded_buffer_size); + if (!s->interim_buffer) + return AVERROR(ENOMEM); + memset(s->interim_buffer, 0, decoded_buffer_size); + s->interim[0] = s->interim_buffer; + s->interim[1] = s->interim_buffer + FFALIGN(blockstodecode, 8); + } else { + av_freep(&s->interim_buffer); + s->interim_size = 0; + memset(s->interim, 0, sizeof(s->interim)); + } + s->error=0; if ((s->channels == 1) || (s->frameflags & APE_FRAMECODE_PSEUDO_STEREO)) @@ -1625,13 +1692,24 @@ static int ape_decode_frame(AVCodecContext *avctx, AVFrame *frame, s->samples -= blockstodecode; if (avctx->err_recognition & AV_EF_CRCCHECK && - s->fileversion >= 3900 && s->bps < 24) { + s->fileversion >= 3900) { uint32_t crc = s->CRC_state; const AVCRC *crc_tab = av_crc_get_table(AV_CRC_32_IEEE_LE); + int stride = s->bps == 24 ? 4 : (s->bps>>3); + int offset = s->bps == 24; + int bytes = s->bps >> 3; + for (i = 0; i < blockstodecode; i++) { for (ch = 0; ch < s->channels; ch++) { - uint8_t *smp = frame->data[ch] + (i*(s->bps >> 3)); - crc = av_crc(crc_tab, crc, smp, s->bps >> 3); +#if HAVE_BIGENDIAN + uint8_t *smp_native = frame->data[ch] + i*stride; + uint8_t smp[4]; + for(int j = 0; jdata[ch] + i*stride; +#endif + crc = av_crc(crc_tab, crc, smp+offset, bytes); } } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/arbc.c b/arm/raspi/third_party/ffmpeg/libavcodec/arbc.c index 1b349f4d..46b0275e 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/arbc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/arbc.c @@ -166,8 +166,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, prev_pixels -= fill_tile4(avctx, fill, frame); } - av_frame_unref(s->prev_frame); - if ((ret = av_frame_ref(s->prev_frame, frame)) < 0) + if ((ret = av_frame_replace(s->prev_frame, frame)) < 0) return ret; frame->pict_type = prev_pixels <= 0 ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/arm/Makefile b/arm/raspi/third_party/ffmpeg/libavcodec/arm/Makefile index 5d284bdc..becf316e 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/arm/Makefile +++ b/arm/raspi/third_party/ffmpeg/libavcodec/arm/Makefile @@ -5,7 +5,6 @@ OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_init_arm.o \ arm/ac3dsp_arm.o OBJS-$(CONFIG_AUDIODSP) += arm/audiodsp_init_arm.o OBJS-$(CONFIG_BLOCKDSP) += arm/blockdsp_init_arm.o -OBJS-$(CONFIG_FFT) += arm/fft_init_arm.o OBJS-$(CONFIG_FMTCONVERT) += arm/fmtconvert_init_arm.o OBJS-$(CONFIG_G722DSP) += arm/g722dsp_init_arm.o OBJS-$(CONFIG_H264CHROMA) += arm/h264chroma_init_arm.o @@ -25,7 +24,6 @@ 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_RDFT) += arm/rdft_init_arm.o OBJS-$(CONFIG_RV34DSP) += arm/rv34dsp_init_arm.o OBJS-$(CONFIG_VC1DSP) += arm/vc1dsp_init_arm.o OBJS-$(CONFIG_VIDEODSP) += arm/videodsp_init_arm.o @@ -90,9 +88,7 @@ ARMV6-OBJS-$(CONFIG_TRUEHD_DECODER) += arm/mlpdsp_armv6.o # VFP optimizations # subsystems -VFP-OBJS-$(CONFIG_FFT) += arm/fft_vfp.o VFP-OBJS-$(CONFIG_FMTCONVERT) += arm/fmtconvert_vfp.o -VFP-OBJS-$(CONFIG_MDCT) += arm/mdct_vfp.o # decoders/encoders VFP-OBJS-$(CONFIG_DCA_DECODER) += arm/synth_filter_vfp.o @@ -107,7 +103,6 @@ NEON-OBJS-$(CONFIG_AUDIODSP) += arm/audiodsp_init_neon.o \ arm/int_neon.o NEON-OBJS-$(CONFIG_BLOCKDSP) += arm/blockdsp_init_neon.o \ arm/blockdsp_neon.o -NEON-OBJS-$(CONFIG_FFT) += arm/fft_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 @@ -121,10 +116,8 @@ NEON-OBJS-$(CONFIG_HPELDSP) += arm/hpeldsp_init_neon.o \ NEON-OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_neon.o \ arm/idctdsp_neon.o \ arm/simple_idct_neon.o -NEON-OBJS-$(CONFIG_MDCT) += arm/mdct_neon.o NEON-OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_neon.o NEON-OBJS-$(CONFIG_PIXBLOCKDSP) += arm/pixblockdsp_neon.o -NEON-OBJS-$(CONFIG_RDFT) += arm/rdft_neon.o NEON-OBJS-$(CONFIG_VC1DSP) += arm/vc1dsp_init_neon.o \ arm/vc1dsp_neon.o NEON-OBJS-$(CONFIG_VP3DSP) += arm/vp3dsp_neon.o diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/arm/synth_filter_init_arm.c b/arm/raspi/third_party/ffmpeg/libavcodec/arm/synth_filter_init_arm.c index 858c117d..10689b62 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/arm/synth_filter_init_arm.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/arm/synth_filter_init_arm.c @@ -23,7 +23,6 @@ #include "libavutil/arm/cpu.h" #include "libavutil/attributes.h" #include "libavutil/internal.h" -#include "libavcodec/fft.h" #include "libavcodec/synth_filter.h" void ff_synth_filter_float_vfp(AVTXContext *imdct, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/asvdec.c b/arm/raspi/third_party/ffmpeg/libavcodec/asvdec.c index 62295b2d..7ad4faeb 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/asvdec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/asvdec.c @@ -67,19 +67,19 @@ typedef struct ASVDecContext { static av_cold void init_vlcs(void) { - INIT_VLC_STATIC(&ccp_vlc, CCP_VLC_BITS, 17, + VLC_INIT_STATIC(&ccp_vlc, CCP_VLC_BITS, 17, &ff_asv_ccp_tab[0][1], 2, 1, &ff_asv_ccp_tab[0][0], 2, 1, 32); - INIT_LE_VLC_STATIC(&dc_ccp_vlc, DC_CCP_VLC_BITS, 8, + VLC_INIT_LE_STATIC(&dc_ccp_vlc, DC_CCP_VLC_BITS, 8, &ff_asv_dc_ccp_tab[0][1], 2, 1, &ff_asv_dc_ccp_tab[0][0], 2, 1, 16); - INIT_LE_VLC_STATIC(&ac_ccp_vlc, AC_CCP_VLC_BITS, 16, + VLC_INIT_LE_STATIC(&ac_ccp_vlc, AC_CCP_VLC_BITS, 16, &ff_asv_ac_ccp_tab[0][1], 2, 1, &ff_asv_ac_ccp_tab[0][0], 2, 1, 64); - INIT_VLC_STATIC(&level_vlc, ASV1_LEVEL_VLC_BITS, 7, + VLC_INIT_STATIC(&level_vlc, ASV1_LEVEL_VLC_BITS, 7, &ff_asv_level_tab[0][1], 2, 1, &ff_asv_level_tab[0][0], 2, 1, 16); - INIT_LE_VLC_STATIC(&asv2_level_vlc, ASV2_LEVEL_VLC_BITS, 63, + VLC_INIT_LE_STATIC(&asv2_level_vlc, ASV2_LEVEL_VLC_BITS, 63, &ff_asv2_level_tab[0][1], 4, 2, &ff_asv2_level_tab[0][0], 4, 2, 1024); } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/asvenc.c b/arm/raspi/third_party/ffmpeg/libavcodec/asvenc.c index 4a14bcf8..50da4673 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/asvenc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/asvenc.c @@ -33,7 +33,6 @@ #include "asv.h" #include "avcodec.h" #include "codec_internal.h" -#include "dct.h" #include "encode.h" #include "fdctdsp.h" #include "mpeg12data.h" diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/atrac3.c b/arm/raspi/third_party/ffmpeg/libavcodec/atrac3.c index 5851ee02..fad2299a 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/atrac3.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/atrac3.c @@ -863,10 +863,10 @@ static av_cold void atrac3_init_static_data(void) for (i = 0; i < 7; i++) { spectral_coeff_tab[i].table = table; spectral_coeff_tab[i].table_allocated = 256; - ff_init_vlc_from_lengths(&spectral_coeff_tab[i], ATRAC3_VLC_BITS, huff_tab_sizes[i], + ff_vlc_init_from_lengths(&spectral_coeff_tab[i], ATRAC3_VLC_BITS, huff_tab_sizes[i], &hufftabs[0][1], 2, &hufftabs[0][0], 2, 1, - -31, INIT_VLC_USE_NEW_STATIC, NULL); + -31, VLC_INIT_USE_STATIC, NULL); hufftabs += huff_tab_sizes[i]; table += 256; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/atrac3plus.c b/arm/raspi/third_party/ffmpeg/libavcodec/atrac3plus.c index 5661654c..61753af7 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/atrac3plus.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/atrac3plus.c @@ -66,8 +66,8 @@ static av_cold void build_canonical_huff(const uint8_t *cb, const uint8_t **xlat out_vlc->table = &tables_data[*tab_offset]; out_vlc->table_allocated = 1 << max_len; - ff_init_vlc_from_lengths(out_vlc, max_len, index, bits, 1, - *xlat, 1, 1, 0, INIT_VLC_USE_NEW_STATIC, NULL); + ff_vlc_init_from_lengths(out_vlc, max_len, index, bits, 1, + *xlat, 1, 1, 0, VLC_INIT_USE_STATIC, NULL); *tab_offset += 1 << max_len; *xlat += index; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/atrac9dec.c b/arm/raspi/third_party/ffmpeg/libavcodec/atrac9dec.c index 8a694045..d24a8e3f 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/atrac9dec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/atrac9dec.c @@ -849,9 +849,9 @@ static av_cold void atrac9_init_vlc(VLC *vlc, int nb_bits, int nb_codes, vlc->table = &vlc_buf[*buf_offset]; vlc->table_allocated = FF_ARRAY_ELEMS(vlc_buf) - *buf_offset; - ff_init_vlc_from_lengths(vlc, nb_bits, nb_codes, + ff_vlc_init_from_lengths(vlc, nb_bits, nb_codes, &(*tab)[0][1], 2, &(*tab)[0][0], 2, 1, - offset, INIT_VLC_STATIC_OVERLONG, NULL); + offset, VLC_INIT_STATIC_OVERLONG, NULL); *buf_offset += vlc->table_size; *tab += nb_codes; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/audiotoolboxenc.c b/arm/raspi/third_party/ffmpeg/libavcodec/audiotoolboxenc.c index 46aca4c7..42ab7ae6 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/audiotoolboxenc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/audiotoolboxenc.c @@ -60,17 +60,17 @@ static UInt32 ffat_get_format_id(enum AVCodecID codec, int profile) switch (codec) { case AV_CODEC_ID_AAC: switch (profile) { - case FF_PROFILE_AAC_LOW: + case AV_PROFILE_AAC_LOW: default: return kAudioFormatMPEG4AAC; - case FF_PROFILE_AAC_HE: + case AV_PROFILE_AAC_HE: return kAudioFormatMPEG4AAC_HE; - case FF_PROFILE_AAC_HE_V2: + case AV_PROFILE_AAC_HE_V2: return kAudioFormatMPEG4AAC_HE_V2; - case FF_PROFILE_AAC_LD: + case AV_PROFILE_AAC_LD: return kAudioFormatMPEG4AAC_LD; #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 - case FF_PROFILE_AAC_ELD: + case AV_PROFILE_AAC_ELD: return kAudioFormatMPEG4AAC_ELD; #endif } @@ -483,8 +483,7 @@ static OSStatus ffat_encode_callback(AudioConverterRef converter, UInt32 *nb_pac if (*nb_packets > frame->nb_samples) *nb_packets = frame->nb_samples; - av_frame_unref(at->encoding_frame); - ret = av_frame_ref(at->encoding_frame, frame); + ret = av_frame_replace(at->encoding_frame, frame); if (ret < 0) { *nb_packets = 0; return ret; @@ -586,12 +585,12 @@ static av_cold int ffat_close_encoder(AVCodecContext *avctx) } static const AVProfile aac_profiles[] = { - { FF_PROFILE_AAC_LOW, "LC" }, - { 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 }, + { AV_PROFILE_AAC_LOW, "LC" }, + { AV_PROFILE_AAC_HE, "HE-AAC" }, + { AV_PROFILE_AAC_HE_V2, "HE-AACv2" }, + { AV_PROFILE_AAC_LD, "LD" }, + { AV_PROFILE_AAC_ELD, "ELD" }, + { AV_PROFILE_UNKNOWN }, }; #define AE AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/av1.h b/arm/raspi/third_party/ffmpeg/libavcodec/av1.h index 384f7cdd..8704bc41 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/av1.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/av1.h @@ -175,6 +175,13 @@ enum { AV1_RESTORE_SWITCHABLE = 3, }; +// TX mode (section 6.8.21) +enum { + AV1_ONLY_4X4 = 0, + AV1_TX_MODE_LARGEST = 1, + AV1_TX_MODE_SELECT = 2, +}; + // Sequence Headers are actually unbounded because one can use // an arbitrary number of leading zeroes when encoding via uvlc. // The following estimate is based around using the lowest number diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/av1_levels.c b/arm/raspi/third_party/ffmpeg/libavcodec/av1_levels.c new file mode 100644 index 00000000..19b6ee17 --- /dev/null +++ b/arm/raspi/third_party/ffmpeg/libavcodec/av1_levels.c @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2023 Intel Corporation + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include "libavutil/macros.h" +#include "av1_levels.h" + +/** ignore entries which named in spec but no details. Like level 2.2 and 7.0. */ +static const AV1LevelDescriptor av1_levels[] = { + // Name MaxVSize MainMbps MaxTiles + // | level_idx | MaxDisplayRate | HighMbps | MaxTileCols + // | | MaxPicSize | | MaxDecodeRate | | MainCR | | + // | | | MaxHSize | | | MaxHeaderRate | | | HighCR| | + // | | | | | | | | | | | | | | + { "2.0", 0, 147456, 2048, 1152, 4423680, 5529600, 150, 1.5, 0, 2, 0, 8, 4 }, + { "2.1", 1, 278784, 2816, 1584, 8363520, 10454400, 150, 3.0, 0, 2, 0, 8, 4 }, + { "3.0", 4, 665856, 4352, 2448, 19975680, 24969600, 150, 6.0, 0, 2, 0, 16, 6 }, + { "3.1", 5, 1065024, 5504, 3096, 31950720, 39938400, 150, 10.0, 0, 2, 0, 16, 6 }, + { "4.0", 8, 2359296, 6144, 3456, 70778880, 77856768, 300, 12.0, 30.0, 4, 4, 32, 8 }, + { "4.1", 9, 2359296, 6144, 3456, 141557760, 155713536, 300, 20.0, 50.0, 4, 4, 32, 8 }, + { "5.0", 12, 8912896, 8192, 4352, 267386880, 273715200, 300, 30.0, 100.0, 6, 4, 64, 8 }, + { "5.1", 13, 8912896, 8192, 4352, 534773760, 547430400, 300, 40.0, 160.0, 8, 4, 64, 8 }, + { "5.2", 14, 8912896, 8192, 4352, 1069547520, 1094860800, 300, 60.0, 240.0, 8, 4, 64, 8 }, + { "5.3", 15, 8912896, 8192, 4352, 1069547520, 1176502272, 300, 60.0, 240.0, 8, 4, 64, 8 }, + { "6.0", 16, 35651584, 16384, 8704, 1069547520, 1176502272, 300, 60.0, 240.0, 8, 4, 128, 16 }, + { "6.1", 17, 35651584, 16384, 8704, 2139095040, 2189721600, 300, 100.0, 480.0, 8, 4, 128, 16 }, + { "6.2", 18, 35651584, 16384, 8704, 4278190080, 4379443200, 300, 160.0, 800.0, 8, 4, 128, 16 }, + { "6.3", 19, 35651584, 16384, 8704, 4278190080, 4706009088, 300, 160.0, 800.0, 8, 4, 128, 16 }, +}; + +const AV1LevelDescriptor *ff_av1_guess_level(int64_t bitrate, + int tier, + int width, + int height, + int tiles, + int tile_cols, + float fps) +{ + int pic_size; + uint64_t display_rate; + float max_br; + + pic_size = width * height; + display_rate = (uint64_t)pic_size * fps; + + for (int i = 0; i < FF_ARRAY_ELEMS(av1_levels); i++) { + const AV1LevelDescriptor *level = &av1_levels[i]; + // Limitation: decode rate, header rate, compress rate, etc. are not considered. + if (pic_size > level->max_pic_size) + continue; + if (width > level->max_h_size) + continue; + if (height > level->max_v_size) + continue; + if (display_rate > level->max_display_rate) + continue; + + if (tier) + max_br = level->high_mbps; + else + max_br = level->main_mbps; + if (!max_br) + continue; + if (bitrate > (int64_t)(1000000.0 * max_br)) + continue; + + if (tiles > level->max_tiles) + continue; + if (tile_cols > level->max_tile_cols) + continue; + return level; + } + + return NULL; +} diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/av1_levels.h b/arm/raspi/third_party/ffmpeg/libavcodec/av1_levels.h new file mode 100644 index 00000000..164cb876 --- /dev/null +++ b/arm/raspi/third_party/ffmpeg/libavcodec/av1_levels.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2023 Intel Corporation + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_AV1_LEVELS_H +#define AVCODEC_AV1_LEVELS_H + +#include + +typedef struct AV1LevelDescriptor { + char name[4]; + uint8_t level_idx; + + uint32_t max_pic_size; + uint32_t max_h_size; + uint32_t max_v_size; + uint64_t max_display_rate; + uint64_t max_decode_rate; + + uint32_t max_header_rate; + float main_mbps; + float high_mbps; + uint32_t main_cr; + uint32_t high_cr; + uint32_t max_tiles; + uint32_t max_tile_cols; +} AV1LevelDescriptor; + +/** + * Guess the level of a stream from some parameters. + * + * Unknown parameters may be zero, in which case they will be ignored. + */ +const AV1LevelDescriptor *ff_av1_guess_level(int64_t bitrate, + int tier, + int width, + int height, + int tile_rows, + int tile_cols, + float fps); + +#endif /* AVCODEC_AV1_LEVELS_H */ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/av1dec.c b/arm/raspi/third_party/ffmpeg/libavcodec/av1dec.c index cc178464..39ccad5b 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/av1dec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/av1dec.c @@ -33,6 +33,7 @@ #include "bytestream.h" #include "codec_internal.h" #include "decode.h" +#include "hwaccel_internal.h" #include "internal.h" #include "hwconfig.h" #include "profiles.h" @@ -439,29 +440,20 @@ static int get_tiles_info(AVCodecContext *avctx, const AV1RawTileGroup *tile_gro } -static int get_pixel_format(AVCodecContext *avctx) +static enum AVPixelFormat get_sw_pixel_format(void *logctx, + const AV1RawSequenceHeader *seq) { - AV1DecContext *s = avctx->priv_data; - const AV1RawSequenceHeader *seq = s->raw_seq; uint8_t bit_depth; - int ret; enum AVPixelFormat pix_fmt = AV_PIX_FMT_NONE; -#define HWACCEL_MAX (CONFIG_AV1_DXVA2_HWACCEL + \ - CONFIG_AV1_D3D11VA_HWACCEL * 2 + \ - CONFIG_AV1_NVDEC_HWACCEL + \ - CONFIG_AV1_VAAPI_HWACCEL + \ - CONFIG_AV1_VDPAU_HWACCEL + \ - CONFIG_AV1_VULKAN_HWACCEL) - enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmtp = pix_fmts; if (seq->seq_profile == 2 && seq->color_config.high_bitdepth) bit_depth = seq->color_config.twelve_bit ? 12 : 10; else if (seq->seq_profile <= 2) bit_depth = seq->color_config.high_bitdepth ? 10 : 8; else { - av_log(avctx, AV_LOG_ERROR, + av_log(logctx, AV_LOG_ERROR, "Unknown AV1 profile %d.\n", seq->seq_profile); - return -1; + return AV_PIX_FMT_NONE; } if (!seq->color_config.mono_chrome) { @@ -475,7 +467,7 @@ static int get_pixel_format(AVCodecContext *avctx) else if (bit_depth == 12) pix_fmt = AV_PIX_FMT_YUV444P12; else - av_log(avctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n"); + av_log(logctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n"); } else if (seq->color_config.subsampling_x == 1 && seq->color_config.subsampling_y == 0) { if (bit_depth == 8) @@ -485,7 +477,7 @@ static int get_pixel_format(AVCodecContext *avctx) else if (bit_depth == 12) pix_fmt = AV_PIX_FMT_YUV422P12; else - av_log(avctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n"); + av_log(logctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n"); } else if (seq->color_config.subsampling_x == 1 && seq->color_config.subsampling_y == 1) { if (bit_depth == 8) @@ -495,7 +487,7 @@ static int get_pixel_format(AVCodecContext *avctx) else if (bit_depth == 12) pix_fmt = AV_PIX_FMT_YUV420P12; else - av_log(avctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n"); + av_log(logctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n"); } } else { if (bit_depth == 8) @@ -505,11 +497,25 @@ static int get_pixel_format(AVCodecContext *avctx) else if (bit_depth == 12) pix_fmt = AV_PIX_FMT_GRAY12; else - av_log(avctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n"); + av_log(logctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n"); } - av_log(avctx, AV_LOG_DEBUG, "AV1 decode get format: %s.\n", - av_get_pix_fmt_name(pix_fmt)); + return pix_fmt; +} + +static int get_pixel_format(AVCodecContext *avctx) +{ + AV1DecContext *s = avctx->priv_data; + const AV1RawSequenceHeader *seq = s->raw_seq; + int ret; + enum AVPixelFormat pix_fmt = get_sw_pixel_format(avctx, seq); +#define HWACCEL_MAX (CONFIG_AV1_DXVA2_HWACCEL + \ + CONFIG_AV1_D3D11VA_HWACCEL * 2 + \ + CONFIG_AV1_NVDEC_HWACCEL + \ + CONFIG_AV1_VAAPI_HWACCEL + \ + CONFIG_AV1_VDPAU_HWACCEL + \ + CONFIG_AV1_VULKAN_HWACCEL) + enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmtp = pix_fmts; if (pix_fmt == AV_PIX_FMT_NONE) return -1; @@ -607,9 +613,7 @@ static int get_pixel_format(AVCodecContext *avctx) *fmtp++ = pix_fmt; *fmtp = AV_PIX_FMT_NONE; - ret = ff_thread_get_format(avctx, pix_fmts); - if (ret < 0) - return ret; + ret = ff_get_format(avctx, pix_fmts); /** * check if the HW accel is inited correctly. If not, return un-implemented. @@ -619,12 +623,16 @@ static int get_pixel_format(AVCodecContext *avctx) if (!avctx->hwaccel) { av_log(avctx, AV_LOG_ERROR, "Your platform doesn't support" " hardware accelerated AV1 decoding.\n"); + avctx->pix_fmt = AV_PIX_FMT_NONE; return AVERROR(ENOSYS); } s->pix_fmt = pix_fmt; avctx->pix_fmt = ret; + av_log(avctx, AV_LOG_DEBUG, "AV1 decode get format: %s.\n", + av_get_pix_fmt_name(avctx->pix_fmt)); + return 0; } @@ -754,7 +762,6 @@ static int set_context_with_sequence(AVCodecContext *avctx, if (ret < 0) return ret; } - avctx->sample_aspect_ratio = (AVRational) { 1, 1 }; if (seq->timing_info_present_flag) avctx->framerate = ff_av1_framerate(1LL + seq->timing_info.num_ticks_per_picture_minus_1, @@ -865,6 +872,8 @@ static av_cold int av1_decode_init(AVCodecContext *avctx) goto end; } + avctx->pix_fmt = get_sw_pixel_format(avctx, seq); + end: ff_cbs_fragment_reset(&s->current_obu); } @@ -907,17 +916,11 @@ static int av1_frame_alloc(AVCodecContext *avctx, AV1Frame *f) break; } - if (avctx->hwaccel) { - const AVHWAccel *hwaccel = avctx->hwaccel; - if (hwaccel->frame_priv_data_size) { - f->hwaccel_priv_buf = ff_hwaccel_frame_priv_alloc(avctx, hwaccel); - if (!f->hwaccel_priv_buf) { - ret = AVERROR(ENOMEM); - goto fail; - } - f->hwaccel_picture_private = f->hwaccel_priv_buf->data; - } - } + ret = ff_hwaccel_frame_priv_alloc(avctx, &f->hwaccel_picture_private, + &f->hwaccel_priv_buf); + if (ret < 0) + goto fail; + return 0; fail: @@ -1239,9 +1242,9 @@ static int av1_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame) } } - if (avctx->hwaccel && avctx->hwaccel->decode_params) { - ret = avctx->hwaccel->decode_params(avctx, unit->type, unit->data, - unit->data_size); + if (FF_HW_HAS_CB(avctx, decode_params)) { + ret = FF_HW_CALL(avctx, decode_params, unit->type, + unit->data, unit->data_size); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "HW accel decode params fail.\n"); s->raw_seq = NULL; @@ -1311,8 +1314,7 @@ static int av1_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame) s->cur_frame.temporal_id = header->temporal_id; if (avctx->hwaccel && s->cur_frame.f->buf[0]) { - ret = avctx->hwaccel->start_frame(avctx, unit->data, - unit->data_size); + ret = FF_HW_CALL(avctx, start_frame, unit->data, unit->data_size); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "HW accel start frame fail.\n"); goto end; @@ -1338,9 +1340,8 @@ static int av1_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame) goto end; if (avctx->hwaccel && s->cur_frame.f->buf[0]) { - ret = avctx->hwaccel->decode_slice(avctx, - raw_tile_group->tile_data.data, - raw_tile_group->tile_data.data_size); + ret = FF_HW_CALL(avctx, decode_slice, raw_tile_group->tile_data.data, + raw_tile_group->tile_data.data_size); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "HW accel decode slice fail.\n"); @@ -1402,7 +1403,7 @@ static int av1_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame) if (raw_tile_group && (s->tile_num == raw_tile_group->tg_end + 1)) { int show_frame = s->raw_frame_header->show_frame; if (avctx->hwaccel && s->cur_frame.f->buf[0]) { - ret = avctx->hwaccel->end_frame(avctx); + ret = FF_HW_SIMPLE_CALL(avctx, end_frame); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "HW accel end frame fail.\n"); goto end; @@ -1498,8 +1499,8 @@ static void av1_decode_flush(AVCodecContext *avctx) ff_cbs_fragment_reset(&s->current_obu); ff_cbs_flush(s->cbc); - if (avctx->hwaccel && avctx->hwaccel->flush) - avctx->hwaccel->flush(avctx); + if (FF_HW_HAS_CB(avctx, flush)) + FF_HW_SIMPLE_CALL(avctx, flush); } #define OFFSET(x) offsetof(AV1DecContext, x) @@ -1526,7 +1527,7 @@ const FFCodec ff_av1_decoder = { .init = av1_decode_init, .close = av1_decode_free, FF_CODEC_RECEIVE_FRAME_CB(av1_receive_frame), - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_AVOID_PROBING, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .flush = av1_decode_flush, .p.profiles = NULL_IF_CONFIG_SMALL(ff_av1_profiles), diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/avcodec.c b/arm/raspi/third_party/ffmpeg/libavcodec/avcodec.c index 340abe83..f2dc7b0e 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/avcodec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/avcodec.c @@ -28,6 +28,7 @@ #include "libavutil/avstring.h" #include "libavutil/bprint.h" #include "libavutil/channel_layout.h" +#include "libavutil/emms.h" #include "libavutil/fifo.h" #include "libavutil/imgutils.h" #include "libavutil/mem.h" @@ -36,6 +37,7 @@ #include "avcodec.h" #include "avcodec_internal.h" #include "bsf.h" +#include "codec_desc.h" #include "codec_internal.h" #include "decode.h" #include "encode.h" @@ -44,6 +46,13 @@ #include "internal.h" #include "thread.h" +/** + * Maximum size in bytes of extradata. + * 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) - AV_INPUT_BUFFER_PADDING_SIZE) + int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2), void *arg, int *ret, int count, int size) { size_t i; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/avcodec.h b/arm/raspi/third_party/ffmpeg/libavcodec/avcodec.h index 5d910a69..1b42edbf 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/avcodec.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/avcodec.h @@ -31,6 +31,7 @@ #include "libavutil/attributes.h" #include "libavutil/avutil.h" #include "libavutil/buffer.h" +#include "libavutil/channel_layout.h" #include "libavutil/dict.h" #include "libavutil/frame.h" #include "libavutil/log.h" @@ -38,8 +39,6 @@ #include "libavutil/rational.h" #include "codec.h" -#include "codec_desc.h" -#include "codec_par.h" #include "codec_id.h" #include "defs.h" #include "packet.h" @@ -49,8 +48,13 @@ * to avoid unnecessary rebuilds. When included externally, keep including * the full version information. */ #include "version.h" + +#include "codec_desc.h" +#include "codec_par.h" #endif +struct AVCodecParameters; + /** * @defgroup libavc libavcodec * Encoding/Decoding Library @@ -421,8 +425,6 @@ typedef struct RcOverride{ */ #define AV_GET_ENCODE_BUFFER_FLAG_REF (1 << 0) -struct AVCodecInternal; - /** * main external API structure. * New fields can be added to the end with minor version bumps. @@ -1262,7 +1264,7 @@ typedef struct AVCodecContext { /** * decoder bitstream buffer size * - encoding: Set by user. - * - decoding: unused + * - decoding: May be set by libavcodec. */ int rc_buffer_size; @@ -1591,8 +1593,12 @@ typedef struct AVCodecContext { * profile * - encoding: Set by user. * - decoding: Set by libavcodec. + * See the AV_PROFILE_* defines in defs.h. */ int profile; +#if FF_API_FF_PROFILE_LEVEL + /** @deprecated The following defines are deprecated; use AV_PROFILE_* + * in defs.h instead. */ #define FF_PROFILE_UNKNOWN -99 #define FF_PROFILE_RESERVED -100 @@ -1723,14 +1729,20 @@ typedef struct AVCodecContext { #define FF_PROFILE_EVC_BASELINE 0 #define FF_PROFILE_EVC_MAIN 1 +#endif /** * level * - encoding: Set by user. * - decoding: Set by libavcodec. + * See AV_LEVEL_* in defs.h. */ int level; +#if FF_API_FF_PROFILE_LEVEL + /** @deprecated The following define is deprecated; use AV_LEVEL_UNKOWN + * in defs.h instead. */ #define FF_LEVEL_UNKNOWN -99 +#endif /** * Skip loop filtering for selected frames. @@ -1798,9 +1810,9 @@ typedef struct AVCodecContext { enum AVPixelFormat sw_pix_fmt; /** - * Timebase in which pkt_dts/pts and AVPacket.dts/pts are. - * - encoding unused. - * - decoding set by user. + * Timebase in which pkt_dts/pts and AVPacket.dts/pts are expressed. + * - encoding: unused. + * - decoding: set by user. */ AVRational pkt_timebase; @@ -1809,7 +1821,7 @@ typedef struct AVCodecContext { * - encoding: unused. * - decoding: set by libavcodec. */ - const AVCodecDescriptor *codec_descriptor; + const struct AVCodecDescriptor *codec_descriptor; /** * Current statistics for PTS correction. @@ -2148,139 +2160,6 @@ typedef struct AVHWAccel { * see AV_HWACCEL_CODEC_CAP_* */ int capabilities; - - /***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - */ - - /** - * Allocate a custom buffer - */ - int (*alloc_frame)(AVCodecContext *avctx, AVFrame *frame); - - /** - * Called at the beginning of each frame or field picture. - * - * Meaningful frame information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * Note that buf can be NULL along with buf_size set to 0. - * Otherwise, this means the whole frame is available at this point. - * - * @param avctx the codec context - * @param buf the frame data buffer base - * @param buf_size the size of the frame in bytes - * @return zero if successful, a negative value otherwise - */ - int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size); - - /** - * Callback for parameter data (SPS/PPS/VPS etc). - * - * Useful for hardware decoders which keep persistent state about the - * video parameters, and need to receive any changes to update that state. - * - * @param avctx the codec context - * @param type the nal unit type - * @param buf the nal unit data buffer - * @param buf_size the size of the nal unit in bytes - * @return zero if successful, a negative value otherwise - */ - int (*decode_params)(AVCodecContext *avctx, int type, const uint8_t *buf, uint32_t buf_size); - - /** - * Callback for each slice. - * - * Meaningful slice information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * @param avctx the codec context - * @param buf the slice data buffer base - * @param buf_size the size of the slice in bytes - * @return zero if successful, a negative value otherwise - */ - int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size); - - /** - * Called at the end of each frame or field picture. - * - * The whole picture is parsed at this point and can now be sent - * to the hardware accelerator. This function is mandatory. - * - * @param avctx the codec context - * @return zero if successful, a negative value otherwise - */ - int (*end_frame)(AVCodecContext *avctx); - - /** - * Size of per-frame hardware accelerator private data. - * - * Private data is allocated with av_mallocz() before - * AVCodecContext.get_buffer() and deallocated after - * AVCodecContext.release_buffer(). - */ - int frame_priv_data_size; - - /** - * Initialize the hwaccel private data. - * - * This will be called from ff_get_format(), after hwaccel and - * hwaccel_context are set and the hwaccel private data in AVCodecInternal - * is allocated. - */ - int (*init)(AVCodecContext *avctx); - - /** - * Uninitialize the hwaccel private data. - * - * This will be called from get_format() or avcodec_close(), after hwaccel - * and hwaccel_context are already uninitialized. - */ - int (*uninit)(AVCodecContext *avctx); - - /** - * Size of the private data to allocate in - * AVCodecInternal.hwaccel_priv_data. - */ - int priv_data_size; - - /** - * Internal hwaccel capabilities. - */ - int caps_internal; - - /** - * Fill the given hw_frames context with current codec parameters. Called - * from get_format. Refer to avcodec_get_hw_frames_parameters() for - * details. - * - * This CAN be called before AVHWAccel.init is called, and you must assume - * that avctx->hwaccel_priv_data is invalid. - */ - int (*frame_params)(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx); - - /** - * Copy necessary context variables from a previous thread context to the current one. - * For thread-safe hwaccels only. - */ - int (*update_thread_context)(AVCodecContext *dst, const AVCodecContext *src); - - /** - * Callback to free the hwaccel-specific frame data. - * - * @param hwctx a pointer to an AVHWDeviceContext. - * @param data the per-frame hardware accelerator private data to be freed. - */ - void (*free_frame_priv)(void *hwctx, uint8_t *data); - - /** - * Callback to flush the hwaccel state. - */ - void (*flush)(AVCodecContext *avctx); } AVHWAccel; /** @@ -2455,7 +2334,7 @@ const AVClass *avcodec_get_subtitle_rect_class(void); * * @return >= 0 on success, a negative AVERROR code on failure */ -int avcodec_parameters_from_context(AVCodecParameters *par, +int avcodec_parameters_from_context(struct AVCodecParameters *par, const AVCodecContext *codec); /** @@ -2467,7 +2346,7 @@ int avcodec_parameters_from_context(AVCodecParameters *par, * @return >= 0 on success, a negative AVERROR code on failure. */ int avcodec_parameters_to_context(AVCodecContext *codec, - const AVCodecParameters *par); + const struct AVCodecParameters *par); /** * Initialize the AVCodecContext to use the given AVCodec. Prior to using this diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/avfft.c b/arm/raspi/third_party/ffmpeg/libavcodec/avfft.c index 2200f377..fb635abf 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/avfft.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/avfft.c @@ -16,130 +16,233 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include +#include + #include "libavutil/attributes.h" +#include "libavutil/macros.h" #include "libavutil/mem.h" +#include "libavutil/tx.h" #include "avfft.h" -#include "fft.h" -#include "rdft.h" -#include "dct.h" + +typedef struct AVTXWrapper { + AVTXContext *ctx; + av_tx_fn fn; + + AVTXContext *ctx2; + av_tx_fn fn2; + + ptrdiff_t stride; + int len; + int inv; + + float *tmp; + int out_of_place; +} AVTXWrapper; /* FFT */ FFTContext *av_fft_init(int nbits, int inverse) { - FFTContext *s = av_mallocz(sizeof(*s)); + int ret; + float scale = 1.0f; + AVTXWrapper *s = av_malloc(sizeof(*s)); + if (!s) + return NULL; - if (s && ff_fft_init(s, nbits, inverse)) - av_freep(&s); + ret = av_tx_init(&s->ctx, &s->fn, AV_TX_FLOAT_FFT, inverse, 1 << nbits, + &scale, AV_TX_INPLACE); + if (ret < 0) { + av_free(s); + return NULL; + } - return s; + return (FFTContext *)s; } void av_fft_permute(FFTContext *s, FFTComplex *z) { - s->fft_permute(s, z); + /* Empty */ } void av_fft_calc(FFTContext *s, FFTComplex *z) { - s->fft_calc(s, z); + AVTXWrapper *w = (AVTXWrapper *)s; + w->fn(w->ctx, z, (void *)z, sizeof(AVComplexFloat)); } av_cold void av_fft_end(FFTContext *s) { if (s) { - ff_fft_end(s); - av_free(s); + AVTXWrapper *w = (AVTXWrapper *)s; + av_tx_uninit(&w->ctx); + av_tx_uninit(&w->ctx2); + av_free(w); } } -#if CONFIG_MDCT - FFTContext *av_mdct_init(int nbits, int inverse, double scale) { - FFTContext *s = av_malloc(sizeof(*s)); + int ret; + float scale_f = scale; + AVTXWrapper *s = av_malloc(sizeof(*s)); + if (!s) + return NULL; - if (s && ff_mdct_init(s, nbits, inverse, scale)) - av_freep(&s); + ret = av_tx_init(&s->ctx, &s->fn, AV_TX_FLOAT_MDCT, inverse, 1 << (nbits - 1), &scale_f, 0); + if (ret < 0) { + av_free(s); + return NULL; + } - return s; + if (inverse) { + ret = av_tx_init(&s->ctx2, &s->fn2, AV_TX_FLOAT_MDCT, inverse, 1 << (nbits - 1), + &scale_f, AV_TX_FULL_IMDCT); + if (ret < 0) { + av_tx_uninit(&s->ctx); + av_free(s); + return NULL; + } + } + + return (FFTContext *)s; } void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input) { - s->imdct_calc(s, output, input); + AVTXWrapper *w = (AVTXWrapper *)s; + w->fn2(w->ctx2, output, (void *)input, sizeof(float)); } void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input) { - s->imdct_half(s, output, input); + AVTXWrapper *w = (AVTXWrapper *)s; + w->fn(w->ctx, output, (void *)input, sizeof(float)); } void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input) { - s->mdct_calc(s, output, input); + AVTXWrapper *w = (AVTXWrapper *)s; + w->fn(w->ctx, output, (void *)input, sizeof(float)); } av_cold void av_mdct_end(FFTContext *s) { if (s) { - ff_mdct_end(s); - av_free(s); + AVTXWrapper *w = (AVTXWrapper *)s; + av_tx_uninit(&w->ctx); + av_free(w); } } -#endif /* CONFIG_MDCT */ - -#if CONFIG_RDFT - RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans) { - RDFTContext *s = av_malloc(sizeof(*s)); + int ret; + float scale = trans == IDFT_C2R ? 0.5f : 1.0f; + AVTXWrapper *s; - if (s && ff_rdft_init(s, nbits, trans)) - av_freep(&s); + /* The other 2 modes are unconventional, do not form an orthogonal + * transform, have never been useful, and so they're not implemented. */ + if (trans != IDFT_C2R && trans != DFT_R2C) + return NULL; - return s; + s = av_malloc(sizeof(*s)); + if (!s) + return NULL; + + ret = av_tx_init(&s->ctx, &s->fn, AV_TX_FLOAT_RDFT, trans == IDFT_C2R, + 1 << nbits, &scale, AV_TX_INPLACE); + if (ret < 0) { + av_free(s); + return NULL; + } + + s->stride = (trans == DFT_C2R) ? sizeof(float) : sizeof(AVComplexFloat); + s->len = 1 << nbits; + s->inv = trans == IDFT_C2R; + + return (RDFTContext *)s; } void av_rdft_calc(RDFTContext *s, FFTSample *data) { - s->rdft_calc(s, data); + AVTXWrapper *w = (AVTXWrapper *)s; + if (w->inv) + FFSWAP(float, data[1], data[w->len]); + w->fn(w->ctx, data, (void *)data, w->stride); + if (!w->inv) + FFSWAP(float, data[1], data[w->len]); } av_cold void av_rdft_end(RDFTContext *s) { if (s) { - ff_rdft_end(s); - av_free(s); + AVTXWrapper *w = (AVTXWrapper *)s; + av_tx_uninit(&w->ctx); + av_free(w); } } -#endif /* CONFIG_RDFT */ - -#if CONFIG_DCT - DCTContext *av_dct_init(int nbits, enum DCTTransformType inverse) { - DCTContext *s = av_malloc(sizeof(*s)); + int ret; + const float scale_map[] = { + [DCT_II] = 0.5f, + [DCT_III] = 1.0f / (1 << nbits), + [DCT_I] = 0.5f, + [DST_I] = 2.0f, + }; + static const enum AVTXType type_map[] = { + [DCT_II] = AV_TX_FLOAT_DCT, + [DCT_III] = AV_TX_FLOAT_DCT, + [DCT_I] = AV_TX_FLOAT_DCT_I, + [DST_I] = AV_TX_FLOAT_DST_I, + }; - if (s && ff_dct_init(s, nbits, inverse)) - av_freep(&s); + AVTXWrapper *s = av_malloc(sizeof(*s)); + if (!s) + return NULL; - return s; + s->len = (1 << nbits); + s->out_of_place = (inverse == DCT_I) || (inverse == DST_I); + + ret = av_tx_init(&s->ctx, &s->fn, type_map[inverse], + (inverse == DCT_III), 1 << (nbits - (inverse == DCT_III)), + &scale_map[inverse], s->out_of_place ? 0 : AV_TX_INPLACE); + if (ret < 0) { + av_free(s); + return NULL; + } + + if (s->out_of_place) { + s->tmp = av_malloc((1 << (nbits + 1))*sizeof(float)); + if (!s->tmp) { + av_tx_uninit(&s->ctx); + av_free(s); + return NULL; + } + } + + return (DCTContext *)s; } void av_dct_calc(DCTContext *s, FFTSample *data) { - s->dct_calc(s, data); + AVTXWrapper *w = (AVTXWrapper *)s; + if (w->out_of_place) { + memcpy(w->tmp, data, w->len*sizeof(float)); + w->fn(w->ctx, (void *)data, w->tmp, sizeof(float)); + } else { + w->fn(w->ctx, data, (void *)data, sizeof(float)); + } } av_cold void av_dct_end(DCTContext *s) { if (s) { - ff_dct_end(s); - av_free(s); + AVTXWrapper *w = (AVTXWrapper *)s; + av_tx_uninit(&w->ctx); + av_free(w->tmp); + av_free(w); } } - -#endif /* CONFIG_DCT */ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/avfft.h b/arm/raspi/third_party/ffmpeg/libavcodec/avfft.h index 0c0f9b8d..e3a0da1e 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/avfft.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/avfft.h @@ -19,6 +19,10 @@ #ifndef AVCODEC_AVFFT_H #define AVCODEC_AVFFT_H +#include "libavutil/attributes.h" +#include "version_major.h" +#if FF_API_AVFFT + /** * @file * @ingroup lavc_fft @@ -44,26 +48,42 @@ typedef struct FFTContext FFTContext; * Set up a complex FFT. * @param nbits log2 of the length of the input array * @param inverse if 0 perform the forward transform, if 1 perform the inverse + * @deprecated use av_tx_init from libavutil/tx.h with a type of AV_TX_FLOAT_FFT */ +attribute_deprecated FFTContext *av_fft_init(int nbits, int inverse); /** * Do the permutation needed BEFORE calling ff_fft_calc(). + * @deprecated without replacement */ +attribute_deprecated void av_fft_permute(FFTContext *s, FFTComplex *z); /** * Do a complex FFT with the parameters defined in av_fft_init(). The * input data must be permuted before. No 1.0/sqrt(n) normalization is done. + * @deprecated use the av_tx_fn value returned by av_tx_init, which also does permutation */ +attribute_deprecated void av_fft_calc(FFTContext *s, FFTComplex *z); +attribute_deprecated void av_fft_end(FFTContext *s); +/** + * @deprecated use av_tx_init from libavutil/tx.h with a type of AV_TX_FLOAT_MDCT, + * with a flag of AV_TX_FULL_IMDCT for a replacement to av_imdct_calc. + */ +attribute_deprecated FFTContext *av_mdct_init(int nbits, int inverse, double scale); +attribute_deprecated void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input); +attribute_deprecated void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input); +attribute_deprecated void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input); +attribute_deprecated void av_mdct_end(FFTContext *s); /* Real Discrete Fourier Transform */ @@ -81,9 +101,14 @@ typedef struct RDFTContext RDFTContext; * Set up a real FFT. * @param nbits log2 of the length of the input array * @param trans the type of transform + * + * @deprecated use av_tx_init from libavutil/tx.h with a type of AV_TX_FLOAT_RDFT */ +attribute_deprecated RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans); +attribute_deprecated void av_rdft_calc(RDFTContext *s, FFTSample *data); +attribute_deprecated void av_rdft_end(RDFTContext *s); /* Discrete Cosine Transform */ @@ -106,13 +131,19 @@ enum DCTTransformType { * @param type the type of transform * * @note the first element of the input of DST-I is ignored + * + * @deprecated use av_tx_init from libavutil/tx.h with an appropriate type of AV_TX_FLOAT_DCT */ +attribute_deprecated DCTContext *av_dct_init(int nbits, enum DCTTransformType type); +attribute_deprecated void av_dct_calc(DCTContext *s, FFTSample *data); +attribute_deprecated void av_dct_end (DCTContext *s); /** * @} */ +#endif /* FF_API_AVFFT */ #endif /* AVCODEC_AVFFT_H */ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/avpacket.c b/arm/raspi/third_party/ffmpeg/libavcodec/avpacket.c index 5fef65e9..9ec1feb0 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/avpacket.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/avpacket.c @@ -22,6 +22,7 @@ #include #include "libavutil/avassert.h" +#include "libavutil/avutil.h" #include "libavutil/intreadwrite.h" #include "libavutil/mathematics.h" #include "libavutil/mem.h" diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/bgmc.c b/arm/raspi/third_party/ffmpeg/libavcodec/bgmc.c index 361f7c52..0e41a39e 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/bgmc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/bgmc.c @@ -457,7 +457,7 @@ static uint8_t *bgmc_lut_getp(uint8_t *lut, int *lut_status, int delta) /** Initialize the lookup table arrays */ -av_cold int ff_bgmc_init(AVCodecContext *avctx, +av_cold int ff_bgmc_init(void *logctx, uint8_t **cf_lut, int **cf_lut_status) { *cf_lut = av_malloc(sizeof(**cf_lut) * LUT_BUFF * 16 * LUT_SIZE); @@ -465,7 +465,7 @@ av_cold int ff_bgmc_init(AVCodecContext *avctx, if (!*cf_lut || !*cf_lut_status) { ff_bgmc_end(cf_lut, cf_lut_status); - av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n"); + av_log(logctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n"); return AVERROR(ENOMEM); } else { // initialize lut_status buffer to a value never used to compare against diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/bgmc.h b/arm/raspi/third_party/ffmpeg/libavcodec/bgmc.h index 466df31a..81771d4a 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/bgmc.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/bgmc.h @@ -30,11 +30,10 @@ #define AVCODEC_BGMC_H -#include "avcodec.h" #include "get_bits.h" -int ff_bgmc_init(AVCodecContext *avctx, uint8_t **cf_lut, int **cf_lut_status); +int ff_bgmc_init(void *logctx, uint8_t **cf_lut, int **cf_lut_status); void ff_bgmc_end(uint8_t **cf_lut, int **cf_lut_status); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/bink.c b/arm/raspi/third_party/ffmpeg/libavcodec/bink.c index e3822d68..804c1419 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/bink.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/bink.c @@ -21,6 +21,7 @@ */ #include "libavutil/attributes.h" +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/internal.h" #include "libavutil/mem_internal.h" @@ -1299,8 +1300,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, emms_c(); if (c->version > 'b') { - av_frame_unref(c->last); - if ((ret = av_frame_ref(c->last, frame)) < 0) + if ((ret = av_frame_replace(c->last, frame)) < 0) return ret; } @@ -1318,9 +1318,9 @@ static av_cold void bink_init_vlcs(void) bink_trees[i].table = table + offset; bink_trees[i].table_allocated = 1 << maxbits; offset += bink_trees[i].table_allocated; - init_vlc(&bink_trees[i], maxbits, 16, + vlc_init(&bink_trees[i], maxbits, 16, bink_tree_lens[i], 1, 1, - bink_tree_bits[i], 1, 1, INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE); + bink_tree_bits[i], 1, 1, VLC_INIT_USE_STATIC | VLC_INIT_LE); } } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/bitstream.h b/arm/raspi/third_party/ffmpeg/libavcodec/bitstream.h index b60f0c29..35b7873b 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/bitstream.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/bitstream.h @@ -102,6 +102,7 @@ # define bits_decode210 bits_decode210_le # define bits_apply_sign bits_apply_sign_le # define bits_read_vlc bits_read_vlc_le +# define bits_read_vlc_multi bits_read_vlc_multi_le #elif defined(BITS_DEFAULT_BE) @@ -130,6 +131,7 @@ # define bits_decode210 bits_decode210_be # define bits_apply_sign bits_apply_sign_be # define bits_read_vlc bits_read_vlc_be +# define bits_read_vlc_multi bits_read_vlc_multi_be #endif diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/bitstream_template.h b/arm/raspi/third_party/ffmpeg/libavcodec/bitstream_template.h index 30bea84a..cf4aeff4 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/bitstream_template.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/bitstream_template.h @@ -491,7 +491,7 @@ static inline int BS_FUNC(priv_set_idx)(BSCTX *bc, int code, int *n, /** * Parse a vlc code. * @param bits is the number of bits which will be read at once, must be - * identical to nb_bits in init_vlc() + * identical to nb_bits in vlc_init() * @param max_depth is the number of times bits bits must be read to completely * read the longest vlc code * = (max_vlc_length + bits - 1) / bits @@ -520,6 +520,35 @@ static inline int BS_FUNC(read_vlc)(BSCTX *bc, const VLCElem *table, return code; } +static inline int BS_FUNC(read_vlc_multi)(BSCTX *bc, uint8_t *dst, + const VLC_MULTI_ELEM *const Jtable, + const VLCElem *const table, + const int bits, const int max_depth) +{ + unsigned idx = BS_FUNC(peek)(bc, bits); + int ret, nb_bits, code, n = Jtable[idx].len; + if (Jtable[idx].num) { + AV_COPY64U(dst, Jtable[idx].val); + ret = Jtable[idx].num; + } else { + code = table[idx].sym; + n = table[idx].len; + if (max_depth > 1 && n < 0) { + BS_FUNC(priv_skip_remaining)(bc, bits); + code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); + if (max_depth > 2 && n < 0) { + BS_FUNC(priv_skip_remaining)(bc, nb_bits); + code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); + } + } + AV_WN16(dst, code); + ret = n > 0; + } + BS_FUNC(priv_skip_remaining)(bc, n); + + return ret; +} + #undef BSCTX #undef BS_FUNC #undef BS_JOIN3 diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/bonk.c b/arm/raspi/third_party/ffmpeg/libavcodec/bonk.c index fbea91c7..6cd6a0af 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/bonk.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/bonk.c @@ -277,7 +277,7 @@ static int predictor_calc_error(int *k, int *state, int order, int error) for (i = order-2; i >= 0; i--, k_ptr--, state_ptr--) { unsigned k_value = *k_ptr, state_value = *state_ptr; - x -= shift_down(k_value * (unsigned)state_value, LATTICE_SHIFT); + x -= (unsigned) shift_down(k_value * (unsigned)state_value, LATTICE_SHIFT); state_ptr[1] = state_value + shift_down(k_value * x, LATTICE_SHIFT); } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/cavsdec.c b/arm/raspi/third_party/ffmpeg/libavcodec/cavsdec.c index 37071dfb..b356da0b 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/cavsdec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/cavsdec.c @@ -26,6 +26,7 @@ */ #include "libavutil/avassert.h" +#include "libavutil/emms.h" #include "avcodec.h" #include "get_bits.h" #include "golomb.h" diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/cbs.c b/arm/raspi/third_party/ffmpeg/libavcodec/cbs.c index 13a01bef..daf7f664 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/cbs.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/cbs.c @@ -117,8 +117,9 @@ av_cold int ff_cbs_init(CodedBitstreamContext **ctx_ptr, ctx->decompose_unit_types = NULL; - ctx->trace_enable = 0; - ctx->trace_level = AV_LOG_TRACE; + ctx->trace_enable = 0; + ctx->trace_level = AV_LOG_TRACE; + ctx->trace_context = ctx; *ctx_ptr = ctx; return 0; @@ -496,19 +497,27 @@ void ff_cbs_trace_header(CodedBitstreamContext *ctx, av_log(ctx->log_ctx, ctx->trace_level, "%s\n", name); } -void ff_cbs_trace_syntax_element(CodedBitstreamContext *ctx, int position, - const char *str, const int *subscripts, - const char *bits, int64_t value) +void ff_cbs_trace_read_log(void *trace_context, + GetBitContext *gbc, int length, + const char *str, const int *subscripts, + int64_t value) { + CodedBitstreamContext *ctx = trace_context; char name[256]; + char bits[256]; size_t name_len, bits_len; int pad, subs, i, j, k, n; - - if (!ctx->trace_enable) - return; + int position; av_assert0(value >= INT_MIN && value <= UINT32_MAX); + position = get_bits_count(gbc); + + av_assert0(length < 256); + for (i = 0; i < length; i++) + bits[i] = get_bits1(gbc) ? '1' : '0'; + bits[length] = 0; + subs = subscripts ? subscripts[0] : 0; n = 0; for (i = j = 0; str[i];) { @@ -535,7 +544,7 @@ void ff_cbs_trace_syntax_element(CodedBitstreamContext *ctx, int position, av_assert0(n == subs); name_len = strlen(name); - bits_len = strlen(bits); + bits_len = length; if (name_len + bits_len > 60) pad = bits_len + 2; @@ -546,13 +555,47 @@ void ff_cbs_trace_syntax_element(CodedBitstreamContext *ctx, int position, position, name, pad, bits, value); } -int ff_cbs_read_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, - int width, const char *name, - const int *subscripts, uint32_t *write_to, - uint32_t range_min, uint32_t range_max) +void ff_cbs_trace_write_log(void *trace_context, + PutBitContext *pbc, int length, + const char *str, const int *subscripts, + int64_t value) +{ + CodedBitstreamContext *ctx = trace_context; + + // Ensure that the syntax element is written to the output buffer, + // make a GetBitContext pointed at the start position, then call the + // read log function which can read the bits back to log them. + + GetBitContext gbc; + int position; + + if (length > 0) { + PutBitContext flush; + flush = *pbc; + flush_put_bits(&flush); + } + + position = put_bits_count(pbc); + av_assert0(position >= length); + + init_get_bits(&gbc, pbc->buf, position); + + skip_bits_long(&gbc, position - length); + + ff_cbs_trace_read_log(ctx, &gbc, length, str, subscripts, value); +} + +static av_always_inline int cbs_read_unsigned(CodedBitstreamContext *ctx, + GetBitContext *gbc, + int width, const char *name, + const int *subscripts, + uint32_t *write_to, + uint32_t range_min, + uint32_t range_max) { uint32_t value; - int position; + + CBS_TRACE_READ_START(); av_assert0(width > 0 && width <= 32); @@ -562,21 +605,9 @@ int ff_cbs_read_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, return AVERROR_INVALIDDATA; } - if (ctx->trace_enable) - position = get_bits_count(gbc); - value = get_bits_long(gbc, width); - if (ctx->trace_enable) { - char bits[33]; - int i; - for (i = 0; i < width; i++) - bits[i] = value >> (width - i - 1) & 1 ? '1' : '0'; - bits[i] = 0; - - ff_cbs_trace_syntax_element(ctx, position, name, subscripts, - bits, value); - } + CBS_TRACE_READ_END(); if (value < range_min || value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " @@ -589,11 +620,29 @@ int ff_cbs_read_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, return 0; } +int ff_cbs_read_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, + int width, const char *name, + const int *subscripts, uint32_t *write_to, + uint32_t range_min, uint32_t range_max) +{ + return cbs_read_unsigned(ctx, gbc, width, name, subscripts, + write_to, range_min, range_max); +} + +int ff_cbs_read_simple_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, + int width, const char *name, uint32_t *write_to) +{ + return cbs_read_unsigned(ctx, gbc, width, name, NULL, + write_to, 0, UINT32_MAX); +} + int ff_cbs_write_unsigned(CodedBitstreamContext *ctx, PutBitContext *pbc, int width, const char *name, const int *subscripts, uint32_t value, uint32_t range_min, uint32_t range_max) { + CBS_TRACE_WRITE_START(); + av_assert0(width > 0 && width <= 32); if (value < range_min || value > range_max) { @@ -606,32 +655,31 @@ int ff_cbs_write_unsigned(CodedBitstreamContext *ctx, PutBitContext *pbc, if (put_bits_left(pbc) < width) return AVERROR(ENOSPC); - if (ctx->trace_enable) { - char bits[33]; - int i; - for (i = 0; i < width; i++) - bits[i] = value >> (width - i - 1) & 1 ? '1' : '0'; - bits[i] = 0; - - ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), - name, subscripts, bits, value); - } - if (width < 32) put_bits(pbc, width, value); else put_bits32(pbc, value); + CBS_TRACE_WRITE_END(); + return 0; } +int ff_cbs_write_simple_unsigned(CodedBitstreamContext *ctx, PutBitContext *pbc, + int width, const char *name, uint32_t value) +{ + return ff_cbs_write_unsigned(ctx, pbc, width, name, NULL, + value, 0, MAX_UINT_BITS(width)); +} + int ff_cbs_read_signed(CodedBitstreamContext *ctx, GetBitContext *gbc, int width, const char *name, const int *subscripts, int32_t *write_to, int32_t range_min, int32_t range_max) { int32_t value; - int position; + + CBS_TRACE_READ_START(); av_assert0(width > 0 && width <= 32); @@ -641,21 +689,9 @@ int ff_cbs_read_signed(CodedBitstreamContext *ctx, GetBitContext *gbc, return AVERROR_INVALIDDATA; } - if (ctx->trace_enable) - position = get_bits_count(gbc); - value = get_sbits_long(gbc, width); - if (ctx->trace_enable) { - char bits[33]; - int i; - for (i = 0; i < width; i++) - bits[i] = value & (1U << (width - i - 1)) ? '1' : '0'; - bits[i] = 0; - - ff_cbs_trace_syntax_element(ctx, position, name, subscripts, - bits, value); - } + CBS_TRACE_READ_END(); if (value < range_min || value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " @@ -673,6 +709,8 @@ int ff_cbs_write_signed(CodedBitstreamContext *ctx, PutBitContext *pbc, const int *subscripts, int32_t value, int32_t range_min, int32_t range_max) { + CBS_TRACE_WRITE_START(); + av_assert0(width > 0 && width <= 32); if (value < range_min || value > range_max) { @@ -685,22 +723,13 @@ int ff_cbs_write_signed(CodedBitstreamContext *ctx, PutBitContext *pbc, if (put_bits_left(pbc) < width) return AVERROR(ENOSPC); - if (ctx->trace_enable) { - char bits[33]; - int i; - for (i = 0; i < width; i++) - bits[i] = value & (1U << (width - i - 1)) ? '1' : '0'; - bits[i] = 0; - - ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), - name, subscripts, bits, value); - } - if (width < 32) put_sbits(pbc, width, value); else put_bits32(pbc, value); + CBS_TRACE_WRITE_END(); + return 0; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/cbs.h b/arm/raspi/third_party/ffmpeg/libavcodec/cbs.h index b4131db5..ffb27977 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/cbs.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/cbs.h @@ -168,6 +168,51 @@ typedef struct CodedBitstreamFragment { CodedBitstreamUnit *units; } CodedBitstreamFragment; + +struct CodedBitstreamContext; +struct GetBitContext; +struct PutBitContext; + +/** + * Callback type for read tracing. + * + * @param ctx User-set trace context. + * @param gbc A GetBitContext set at the start of the syntax + * element. This is a copy, the callee does not + * need to preserve it. + * @param length Length in bits of the syntax element. + * @param name String name of the syntax elements. + * @param subscripts If the syntax element is an array, a pointer to + * an array of subscripts into the array. + * @param value Parsed value of the syntax element. + */ +typedef void (*CBSTraceReadCallback)(void *trace_context, + struct GetBitContext *gbc, + int start_position, + const char *name, + const int *subscripts, + int64_t value); + +/** + * Callback type for write tracing. + * + * @param ctx User-set trace context. + * @param pbc A PutBitContext set at the end of the syntax + * element. The user must not modify this, but may + * inspect it to determine state. + * @param length Length in bits of the syntax element. + * @param name String name of the syntax elements. + * @param subscripts If the syntax element is an array, a pointer to + * an array of subscripts into the array. + * @param value Written value of the syntax element. + */ +typedef void (*CBSTraceWriteCallback)(void *trace_context, + struct PutBitContext *pbc, + int start_position, + const char *name, + const int *subscripts, + int64_t value); + /** * Context structure for coded bitstream operations. */ @@ -211,11 +256,29 @@ typedef struct CodedBitstreamContext { */ int trace_enable; /** - * Log level to use for trace output. + * Log level to use for default trace output. * * From AV_LOG_*; defaults to AV_LOG_TRACE. */ int trace_level; + /** + * User context pointer to pass to trace callbacks. + */ + void *trace_context; + /** + * Callback for read tracing. + * + * If tracing is enabled then this is called once for each syntax + * element parsed. + */ + CBSTraceReadCallback trace_read_callback; + /** + * Callback for write tracing. + * + * If tracing is enabled then this is called once for each syntax + * element written. + */ + CBSTraceWriteCallback trace_write_callback; /** * Write buffer. Used as intermediate buffer when writing units. @@ -450,4 +513,27 @@ void ff_cbs_discard_units(CodedBitstreamContext *ctx, enum AVDiscard skip, int flags); + +/** + * Helper function for read tracing which formats the syntax element + * and logs the result. + * + * Trace context should be set to the CodedBitstreamContext. + */ +void ff_cbs_trace_read_log(void *trace_context, + struct GetBitContext *gbc, int length, + const char *str, const int *subscripts, + int64_t value); + +/** + * Helper function for write tracing which formats the syntax element + * and logs the result. + * + * Trace context should be set to the CodedBitstreamContext. + */ +void ff_cbs_trace_write_log(void *trace_context, + struct PutBitContext *pbc, int length, + const char *str, const int *subscripts, + int64_t value); + #endif /* AVCODEC_CBS_H */ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/cbs_av1.c b/arm/raspi/third_party/ffmpeg/libavcodec/cbs_av1.c index 8788fee0..ed9a7b80 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/cbs_av1.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/cbs_av1.c @@ -20,10 +20,10 @@ #include "libavutil/opt.h" #include "libavutil/pixfmt.h" -#include "avcodec.h" #include "cbs.h" #include "cbs_internal.h" #include "cbs_av1.h" +#include "defs.h" static int cbs_av1_read_uvlc(CodedBitstreamContext *ctx, GetBitContext *gbc, @@ -31,10 +31,8 @@ static int cbs_av1_read_uvlc(CodedBitstreamContext *ctx, GetBitContext *gbc, uint32_t range_min, uint32_t range_max) { uint32_t zeroes, bits_value, value; - int position; - if (ctx->trace_enable) - position = get_bits_count(gbc); + CBS_TRACE_READ_START(); zeroes = 0; while (1) { @@ -50,6 +48,9 @@ static int cbs_av1_read_uvlc(CodedBitstreamContext *ctx, GetBitContext *gbc, } if (zeroes >= 32) { + // Note that the spec allows an arbitrarily large number of + // zero bits followed by a one bit in this case, but the + // libaom implementation does not support it. value = MAX_UINT_BITS(32); } else { if (get_bits_left(gbc) < zeroes) { @@ -62,36 +63,7 @@ static int cbs_av1_read_uvlc(CodedBitstreamContext *ctx, GetBitContext *gbc, value = bits_value + (UINT32_C(1) << zeroes) - 1; } - if (ctx->trace_enable) { - char bits[65]; - int i, j, k; - - if (zeroes >= 32) { - while (zeroes > 32) { - k = FFMIN(zeroes - 32, 32); - for (i = 0; i < k; i++) - bits[i] = '0'; - bits[i] = 0; - ff_cbs_trace_syntax_element(ctx, position, name, - NULL, bits, 0); - zeroes -= k; - position += k; - } - } - - for (i = 0; i < zeroes; i++) - bits[i] = '0'; - bits[i++] = '1'; - - if (zeroes < 32) { - for (j = 0; j < zeroes; j++) - bits[i++] = (bits_value >> (zeroes - j - 1) & 1) ? '1' : '0'; - } - - bits[i] = 0; - ff_cbs_trace_syntax_element(ctx, position, name, - NULL, bits, value); - } + CBS_TRACE_READ_END_NO_SUBSCRIPTS(); if (value < range_min || value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " @@ -109,7 +81,9 @@ static int cbs_av1_write_uvlc(CodedBitstreamContext *ctx, PutBitContext *pbc, uint32_t range_min, uint32_t range_max) { uint32_t v; - int position, zeroes; + int zeroes; + + CBS_TRACE_WRITE_START(); if (value < range_min || value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " @@ -118,28 +92,17 @@ static int cbs_av1_write_uvlc(CodedBitstreamContext *ctx, PutBitContext *pbc, return AVERROR_INVALIDDATA; } - if (ctx->trace_enable) - position = put_bits_count(pbc); - zeroes = av_log2(value + 1); v = value - (1U << zeroes) + 1; + + if (put_bits_left(pbc) < 2 * zeroes + 1) + return AVERROR(ENOSPC); + put_bits(pbc, zeroes, 0); put_bits(pbc, 1, 1); put_bits(pbc, zeroes, v); - if (ctx->trace_enable) { - char bits[65]; - int i, j; - i = 0; - for (j = 0; j < zeroes; j++) - bits[i++] = '0'; - bits[i++] = '1'; - for (j = 0; j < zeroes; j++) - bits[i++] = (v >> (zeroes - j - 1) & 1) ? '1' : '0'; - bits[i++] = 0; - ff_cbs_trace_syntax_element(ctx, position, name, NULL, - bits, value); - } + CBS_TRACE_WRITE_END_NO_SUBSCRIPTS(); return 0; } @@ -148,20 +111,19 @@ static int cbs_av1_read_leb128(CodedBitstreamContext *ctx, GetBitContext *gbc, const char *name, uint64_t *write_to) { uint64_t value; - int position, err, i; + uint32_t byte; + int i; - if (ctx->trace_enable) - position = get_bits_count(gbc); + CBS_TRACE_READ_START(); value = 0; for (i = 0; i < 8; i++) { - int subscript[2] = { 1, i }; - uint32_t byte; - err = ff_cbs_read_unsigned(ctx, gbc, 8, "leb128_byte[i]", subscript, - &byte, 0x00, 0xff); - if (err < 0) - return err; - + if (get_bits_left(gbc) < 8) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid leb128 at " + "%s: bitstream ended.\n", name); + return AVERROR_INVALIDDATA; + } + byte = get_bits(gbc, 8); value |= (uint64_t)(byte & 0x7f) << (i * 7); if (!(byte & 0x80)) break; @@ -170,39 +132,44 @@ static int cbs_av1_read_leb128(CodedBitstreamContext *ctx, GetBitContext *gbc, if (value > UINT32_MAX) return AVERROR_INVALIDDATA; - if (ctx->trace_enable) - ff_cbs_trace_syntax_element(ctx, position, name, NULL, "", value); + CBS_TRACE_READ_END_NO_SUBSCRIPTS(); *write_to = value; return 0; } static int cbs_av1_write_leb128(CodedBitstreamContext *ctx, PutBitContext *pbc, - const char *name, uint64_t value) + const char *name, uint64_t value, int fixed_length) { - int position, err, len, i; + int len, i; uint8_t byte; + CBS_TRACE_WRITE_START(); + len = (av_log2(value) + 7) / 7; - if (ctx->trace_enable) - position = put_bits_count(pbc); + if (fixed_length) { + if (fixed_length < len) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "OBU is too large for " + "fixed length size field (%d > %d).\n", + len, fixed_length); + return AVERROR(EINVAL); + } + len = fixed_length; + } for (i = 0; i < len; i++) { - int subscript[2] = { 1, i }; + if (put_bits_left(pbc) < 8) + return AVERROR(ENOSPC); byte = value >> (7 * i) & 0x7f; if (i < len - 1) byte |= 0x80; - err = ff_cbs_write_unsigned(ctx, pbc, 8, "leb128_byte[i]", subscript, - byte, 0x00, 0xff); - if (err < 0) - return err; + put_bits(pbc, 8, byte); } - if (ctx->trace_enable) - ff_cbs_trace_syntax_element(ctx, position, name, NULL, "", value); + CBS_TRACE_WRITE_END_NO_SUBSCRIPTS(); return 0; } @@ -212,13 +179,12 @@ static int cbs_av1_read_ns(CodedBitstreamContext *ctx, GetBitContext *gbc, const int *subscripts, uint32_t *write_to) { uint32_t m, v, extra_bit, value; - int position, w; + int w; + + CBS_TRACE_READ_START(); av_assert0(n > 0); - if (ctx->trace_enable) - position = get_bits_count(gbc); - w = av_log2(n) + 1; m = (1 << w) - n; @@ -240,18 +206,7 @@ static int cbs_av1_read_ns(CodedBitstreamContext *ctx, GetBitContext *gbc, value = (v << 1) - m + extra_bit; } - if (ctx->trace_enable) { - char bits[33]; - int i; - for (i = 0; i < w - 1; i++) - bits[i] = (v >> i & 1) ? '1' : '0'; - if (v >= m) - bits[i++] = extra_bit ? '1' : '0'; - bits[i] = 0; - - ff_cbs_trace_syntax_element(ctx, position, - name, subscripts, bits, value); - } + CBS_TRACE_READ_END(); *write_to = value; return 0; @@ -262,7 +217,8 @@ static int cbs_av1_write_ns(CodedBitstreamContext *ctx, PutBitContext *pbc, const int *subscripts, uint32_t value) { uint32_t w, m, v, extra_bit; - int position; + + CBS_TRACE_WRITE_START(); if (value > n) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " @@ -271,9 +227,6 @@ static int cbs_av1_write_ns(CodedBitstreamContext *ctx, PutBitContext *pbc, return AVERROR_INVALIDDATA; } - if (ctx->trace_enable) - position = put_bits_count(pbc); - w = av_log2(n) + 1; m = (1 << w) - n; @@ -290,18 +243,7 @@ static int cbs_av1_write_ns(CodedBitstreamContext *ctx, PutBitContext *pbc, put_bits(pbc, 1, extra_bit); } - if (ctx->trace_enable) { - char bits[33]; - int i; - for (i = 0; i < w - 1; i++) - bits[i] = (v >> i & 1) ? '1' : '0'; - if (value >= m) - bits[i++] = extra_bit ? '1' : '0'; - bits[i] = 0; - - ff_cbs_trace_syntax_element(ctx, position, - name, subscripts, bits, value); - } + CBS_TRACE_WRITE_END(); return 0; } @@ -311,33 +253,24 @@ static int cbs_av1_read_increment(CodedBitstreamContext *ctx, GetBitContext *gbc const char *name, uint32_t *write_to) { uint32_t value; - int position, i; - char bits[33]; - av_assert0(range_min <= range_max && range_max - range_min < sizeof(bits) - 1); - if (ctx->trace_enable) - position = get_bits_count(gbc); + CBS_TRACE_READ_START(); - for (i = 0, value = range_min; value < range_max;) { + av_assert0(range_min <= range_max && range_max - range_min < 32); + + for (value = range_min; value < range_max;) { if (get_bits_left(gbc) < 1) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid increment value at " "%s: bitstream ended.\n", name); return AVERROR_INVALIDDATA; } - if (get_bits1(gbc)) { - bits[i++] = '1'; + if (get_bits1(gbc)) ++value; - } else { - bits[i++] = '0'; + else break; - } } - if (ctx->trace_enable) { - bits[i] = 0; - ff_cbs_trace_syntax_element(ctx, position, - name, NULL, bits, value); - } + CBS_TRACE_READ_END_NO_SUBSCRIPTS(); *write_to = value; return 0; @@ -349,6 +282,8 @@ static int cbs_av1_write_increment(CodedBitstreamContext *ctx, PutBitContext *pb { int len; + CBS_TRACE_WRITE_START(); + av_assert0(range_min <= range_max && range_max - range_min < 32); if (value < range_min || value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " @@ -364,23 +299,11 @@ static int cbs_av1_write_increment(CodedBitstreamContext *ctx, PutBitContext *pb if (put_bits_left(pbc) < len) return AVERROR(ENOSPC); - if (ctx->trace_enable) { - char bits[33]; - int i; - for (i = 0; i < len; i++) { - if (range_min + i == value) - bits[i] = '0'; - else - bits[i] = '1'; - } - bits[i] = 0; - ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), - name, NULL, bits, value); - } - if (len > 0) put_bits(pbc, len, (1 << len) - 1 - (value != range_max)); + CBS_TRACE_WRITE_END_NO_SUBSCRIPTS(); + return 0; } @@ -388,12 +311,10 @@ static int cbs_av1_read_subexp(CodedBitstreamContext *ctx, GetBitContext *gbc, uint32_t range_max, const char *name, const int *subscripts, uint32_t *write_to) { - uint32_t value; - int position, err; - uint32_t max_len, len, range_offset, range_bits; + uint32_t value, max_len, len, range_offset, range_bits; + int err; - if (ctx->trace_enable) - position = get_bits_count(gbc); + CBS_TRACE_READ_START(); av_assert0(range_max > 0); max_len = av_log2(range_max - 1) - 3; @@ -412,9 +333,8 @@ static int cbs_av1_read_subexp(CodedBitstreamContext *ctx, GetBitContext *gbc, } if (len < max_len) { - err = ff_cbs_read_unsigned(ctx, gbc, range_bits, - "subexp_bits", NULL, &value, - 0, MAX_UINT_BITS(range_bits)); + err = ff_cbs_read_simple_unsigned(ctx, gbc, range_bits, + "subexp_bits", &value); if (err < 0) return err; @@ -426,9 +346,7 @@ static int cbs_av1_read_subexp(CodedBitstreamContext *ctx, GetBitContext *gbc, } value += range_offset; - if (ctx->trace_enable) - ff_cbs_trace_syntax_element(ctx, position, - name, subscripts, "", value); + CBS_TRACE_READ_END_VALUE_ONLY(); *write_to = value; return err; @@ -438,9 +356,11 @@ static int cbs_av1_write_subexp(CodedBitstreamContext *ctx, PutBitContext *pbc, uint32_t range_max, const char *name, const int *subscripts, uint32_t value) { - int position, err; + int err; uint32_t max_len, len, range_offset, range_bits; + CBS_TRACE_WRITE_START(); + if (value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " "%"PRIu32", but must be in [0,%"PRIu32"].\n", @@ -448,9 +368,6 @@ static int cbs_av1_write_subexp(CodedBitstreamContext *ctx, PutBitContext *pbc, return AVERROR_INVALIDDATA; } - if (ctx->trace_enable) - position = put_bits_count(pbc); - av_assert0(range_max > 0); max_len = av_log2(range_max - 1) - 3; @@ -476,10 +393,9 @@ static int cbs_av1_write_subexp(CodedBitstreamContext *ctx, PutBitContext *pbc, return err; if (len < max_len) { - err = ff_cbs_write_unsigned(ctx, pbc, range_bits, - "subexp_bits", NULL, - value - range_offset, - 0, MAX_UINT_BITS(range_bits)); + err = ff_cbs_write_simple_unsigned(ctx, pbc, range_bits, + "subexp_bits", + value - range_offset); if (err < 0) return err; @@ -491,9 +407,7 @@ static int cbs_av1_write_subexp(CodedBitstreamContext *ctx, PutBitContext *pbc, return err; } - if (ctx->trace_enable) - ff_cbs_trace_syntax_element(ctx, position, - name, subscripts, "", value); + CBS_TRACE_WRITE_END_VALUE_ONLY(); return err; } @@ -546,8 +460,6 @@ static size_t cbs_av1_get_payload_bytes_left(GetBitContext *gbc) #define SUBSCRIPTS(subs, ...) (subs > 0 ? ((int[subs + 1]){ subs, __VA_ARGS__ }) : NULL) -#define fb(width, name) \ - xf(width, name, current->name, 0, MAX_UINT_BITS(width), 0, ) #define fc(width, name, range_min, range_max) \ xf(width, name, current->name, range_min, range_max, 0, ) #define flag(name) fb(1, name) @@ -573,6 +485,13 @@ static size_t cbs_av1_get_payload_bytes_left(GetBitContext *gbc) #define READWRITE read #define RWContext GetBitContext +#define fb(width, name) do { \ + uint32_t value; \ + CHECK(ff_cbs_read_simple_unsigned(ctx, rw, width, \ + #name, &value)); \ + current->name = value; \ + } while (0) + #define xf(width, name, var, range_min, range_max, subs, ...) do { \ uint32_t value; \ CHECK(ff_cbs_read_unsigned(ctx, rw, width, #name, \ @@ -645,6 +564,7 @@ static size_t cbs_av1_get_payload_bytes_left(GetBitContext *gbc) #undef READ #undef READWRITE #undef RWContext +#undef fb #undef xf #undef xsu #undef uvlc @@ -661,6 +581,11 @@ static size_t cbs_av1_get_payload_bytes_left(GetBitContext *gbc) #define READWRITE write #define RWContext PutBitContext +#define fb(width, name) do { \ + CHECK(ff_cbs_write_simple_unsigned(ctx, rw, width, #name, \ + current->name)); \ + } while (0) + #define xf(width, name, var, range_min, range_max, subs, ...) do { \ CHECK(ff_cbs_write_unsigned(ctx, rw, width, #name, \ SUBSCRIPTS(subs, __VA_ARGS__), \ @@ -703,7 +628,7 @@ static size_t cbs_av1_get_payload_bytes_left(GetBitContext *gbc) } while (0) #define leb128(name) do { \ - CHECK(cbs_av1_write_leb128(ctx, rw, #name, current->name)); \ + CHECK(cbs_av1_write_leb128(ctx, rw, #name, current->name, 0)); \ } while (0) #define infer(name, value) do { \ @@ -723,6 +648,7 @@ static size_t cbs_av1_get_payload_bytes_left(GetBitContext *gbc) #undef WRITE #undef READWRITE #undef RWContext +#undef fb #undef xf #undef xsu #undef uvlc @@ -1086,9 +1012,14 @@ static int cbs_av1_write_obu(CodedBitstreamContext *ctx, if (obu->header.obu_has_size_field) { pbc_tmp = *pbc; - // Add space for the size field to fill later. - put_bits32(pbc, 0); - put_bits32(pbc, 0); + if (priv->fixed_obu_size_length) { + for (int i = 0; i < priv->fixed_obu_size_length; i++) + put_bits(pbc, 8, 0); + } else { + // Add space for the size field to fill later. + put_bits32(pbc, 0); + put_bits32(pbc, 0); + } } td = NULL; @@ -1208,7 +1139,8 @@ static int cbs_av1_write_obu(CodedBitstreamContext *ctx, end_pos /= 8; *pbc = pbc_tmp; - err = cbs_av1_write_leb128(ctx, pbc, "obu_size", obu->obu_size); + err = cbs_av1_write_leb128(ctx, pbc, "obu_size", obu->obu_size, + priv->fixed_obu_size_length); if (err < 0) goto error; @@ -1225,8 +1157,13 @@ static int cbs_av1_write_obu(CodedBitstreamContext *ctx, } if (obu->obu_size > 0) { - memmove(pbc->buf + data_pos, - pbc->buf + start_pos, header_size); + if (!priv->fixed_obu_size_length) { + memmove(pbc->buf + data_pos, + pbc->buf + start_pos, header_size); + } else { + // The size was fixed so the following data was + // already written in the correct place. + } skip_put_bytes(pbc, header_size); if (td) { @@ -1345,6 +1282,8 @@ static const CodedBitstreamUnitTypeDescriptor cbs_av1_unit_types[] = { static const AVOption cbs_av1_options[] = { { "operating_point", "Set operating point to select layers to parse from a scalable bitstream", OFFSET(operating_point), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, AV1_MAX_OPERATING_POINTS - 1, 0 }, + { "fixed_obu_size_length", "Set fixed length of the obu_size field", + OFFSET(fixed_obu_size_length), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 8, 0 }, { NULL } }; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/cbs_av1.h b/arm/raspi/third_party/ffmpeg/libavcodec/cbs_av1.h index 64dfdce9..79242571 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/cbs_av1.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/cbs_av1.h @@ -467,6 +467,10 @@ typedef struct CodedBitstreamAV1Context { // AVOptions int operating_point; + // When writing, fix the length in bytes of the obu_size field. + // Writing will fail with an error if an OBU larger than can be + // represented by the fixed size is encountered. + int fixed_obu_size_length; } CodedBitstreamAV1Context; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/cbs_av1_syntax_template.c b/arm/raspi/third_party/ffmpeg/libavcodec/cbs_av1_syntax_template.c index a747e177..3be1f2d3 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/cbs_av1_syntax_template.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/cbs_av1_syntax_template.c @@ -82,7 +82,7 @@ static int FUNC(color_config)(CodedBitstreamContext *ctx, RWContext *rw, flag(high_bitdepth); - if (seq_profile == FF_PROFILE_AV1_PROFESSIONAL && + if (seq_profile == AV_PROFILE_AV1_PROFESSIONAL && current->high_bitdepth) { flag(twelve_bit); priv->bit_depth = current->twelve_bit ? 12 : 10; @@ -90,7 +90,7 @@ static int FUNC(color_config)(CodedBitstreamContext *ctx, RWContext *rw, priv->bit_depth = current->high_bitdepth ? 10 : 8; } - if (seq_profile == FF_PROFILE_AV1_HIGH) + if (seq_profile == AV_PROFILE_AV1_HIGH) infer(mono_chrome, 0); else flag(mono_chrome); @@ -126,10 +126,10 @@ static int FUNC(color_config)(CodedBitstreamContext *ctx, RWContext *rw, } else { flag(color_range); - if (seq_profile == FF_PROFILE_AV1_MAIN) { + if (seq_profile == AV_PROFILE_AV1_MAIN) { infer(subsampling_x, 1); infer(subsampling_y, 1); - } else if (seq_profile == FF_PROFILE_AV1_HIGH) { + } else if (seq_profile == AV_PROFILE_AV1_HIGH) { infer(subsampling_x, 0); infer(subsampling_y, 0); } else { @@ -190,8 +190,8 @@ static int FUNC(sequence_header_obu)(CodedBitstreamContext *ctx, RWContext *rw, HEADER("Sequence Header"); - fc(3, seq_profile, FF_PROFILE_AV1_MAIN, - FF_PROFILE_AV1_PROFESSIONAL); + fc(3, seq_profile, AV_PROFILE_AV1_MAIN, + AV_PROFILE_AV1_PROFESSIONAL); flag(still_picture); flag(reduced_still_picture_header); @@ -1028,9 +1028,9 @@ static int FUNC(read_tx_mode)(CodedBitstreamContext *ctx, RWContext *rw, int err; if (priv->coded_lossless) - infer(tx_mode, 0); + infer(tx_mode, AV1_ONLY_4X4); else - increment(tx_mode, 1, 2); + increment(tx_mode, AV1_TX_MODE_LARGEST, AV1_TX_MODE_SELECT); return 0; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/cbs_bsf.c b/arm/raspi/third_party/ffmpeg/libavcodec/cbs_bsf.c index 069f6e99..b2528548 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/cbs_bsf.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/cbs_bsf.c @@ -123,6 +123,11 @@ int ff_cbs_bsf_generic_init(AVBSFContext *bsf, const CBSBSFType *type) if (err < 0) return err; + ctx->output->trace_enable = 1; + ctx->output->trace_level = AV_LOG_TRACE; + ctx->output->trace_context = ctx->output; + ctx->output->trace_write_callback = ff_cbs_trace_write_log; + if (bsf->par_in->extradata) { err = ff_cbs_read_extradata(ctx->input, frag, bsf->par_in); if (err < 0) { diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/cbs_h2645.c b/arm/raspi/third_party/ffmpeg/libavcodec/cbs_h2645.c index 34c5d1d3..0a1c8ea4 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/cbs_h2645.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/cbs_h2645.c @@ -36,41 +36,38 @@ static int cbs_read_ue_golomb(CodedBitstreamContext *ctx, GetBitContext *gbc, uint32_t *write_to, uint32_t range_min, uint32_t range_max) { - uint32_t value; - int position, i, j; - unsigned int k; - char bits[65]; + uint32_t leading_bits, value; + int max_length, leading_zeroes; - position = get_bits_count(gbc); + CBS_TRACE_READ_START(); - for (i = 0; i < 32; i++) { - if (get_bits_left(gbc) < i + 1) { + max_length = FFMIN(get_bits_left(gbc), 32); + + leading_bits = show_bits_long(gbc, max_length); + if (leading_bits == 0) { + if (max_length >= 32) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid ue-golomb code at " + "%s: more than 31 zeroes.\n", name); + return AVERROR_INVALIDDATA; + } else { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid ue-golomb code at " "%s: bitstream ended.\n", name); return AVERROR_INVALIDDATA; } - k = get_bits1(gbc); - bits[i] = k ? '1' : '0'; - if (k) - break; } - if (i >= 32) { + + leading_zeroes = max_length - 1 - av_log2(leading_bits); + skip_bits_long(gbc, leading_zeroes); + + if (get_bits_left(gbc) < leading_zeroes + 1) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid ue-golomb code at " - "%s: more than 31 zeroes.\n", name); + "%s: bitstream ended.\n", name); return AVERROR_INVALIDDATA; } - value = 1; - for (j = 0; j < i; j++) { - k = get_bits1(gbc); - bits[i + j + 1] = k ? '1' : '0'; - value = value << 1 | k; - } - bits[i + j + 1] = 0; - --value; - if (ctx->trace_enable) - ff_cbs_trace_syntax_element(ctx, position, name, subscripts, - bits, value); + value = get_bits_long(gbc, leading_zeroes + 1) - 1; + + CBS_TRACE_READ_END(); if (value < range_min || value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " @@ -88,45 +85,44 @@ static int cbs_read_se_golomb(CodedBitstreamContext *ctx, GetBitContext *gbc, int32_t *write_to, int32_t range_min, int32_t range_max) { + uint32_t leading_bits, unsigned_value; + int max_length, leading_zeroes; int32_t value; - int position, i, j; - unsigned int k; - uint32_t v; - char bits[65]; - position = get_bits_count(gbc); + CBS_TRACE_READ_START(); - for (i = 0; i < 32; i++) { - if (get_bits_left(gbc) < i + 1) { + max_length = FFMIN(get_bits_left(gbc), 32); + + leading_bits = show_bits_long(gbc, max_length); + if (leading_bits == 0) { + if (max_length >= 32) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid se-golomb code at " + "%s: more than 31 zeroes.\n", name); + return AVERROR_INVALIDDATA; + } else { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid se-golomb code at " "%s: bitstream ended.\n", name); return AVERROR_INVALIDDATA; } - k = get_bits1(gbc); - bits[i] = k ? '1' : '0'; - if (k) - break; } - if (i >= 32) { + + leading_zeroes = max_length - 1 - av_log2(leading_bits); + skip_bits_long(gbc, leading_zeroes); + + if (get_bits_left(gbc) < leading_zeroes + 1) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid se-golomb code at " - "%s: more than 31 zeroes.\n", name); + "%s: bitstream ended.\n", name); return AVERROR_INVALIDDATA; } - v = 1; - for (j = 0; j < i; j++) { - k = get_bits1(gbc); - bits[i + j + 1] = k ? '1' : '0'; - v = v << 1 | k; - } - bits[i + j + 1] = 0; - if (v & 1) - value = -(int32_t)(v / 2); - else - value = v / 2; - if (ctx->trace_enable) - ff_cbs_trace_syntax_element(ctx, position, name, subscripts, - bits, value); + unsigned_value = get_bits_long(gbc, leading_zeroes + 1); + + if (unsigned_value & 1) + value = -(int32_t)(unsigned_value / 2); + else + value = unsigned_value / 2; + + CBS_TRACE_READ_END(); if (value < range_min || value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " @@ -146,6 +142,8 @@ static int cbs_write_ue_golomb(CodedBitstreamContext *ctx, PutBitContext *pbc, { int len; + CBS_TRACE_WRITE_START(); + if (value < range_min || value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " "%"PRIu32", but must be in [%"PRIu32",%"PRIu32"].\n", @@ -158,27 +156,14 @@ static int cbs_write_ue_golomb(CodedBitstreamContext *ctx, PutBitContext *pbc, if (put_bits_left(pbc) < 2 * len + 1) return AVERROR(ENOSPC); - if (ctx->trace_enable) { - char bits[65]; - int i; - - for (i = 0; i < len; i++) - bits[i] = '0'; - bits[len] = '1'; - for (i = 0; i < len; i++) - bits[len + i + 1] = (value + 1) >> (len - i - 1) & 1 ? '1' : '0'; - bits[len + len + 1] = 0; - - ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), - name, subscripts, bits, value); - } - put_bits(pbc, len, 0); if (len + 1 < 32) put_bits(pbc, len + 1, value + 1); else put_bits32(pbc, value + 1); + CBS_TRACE_WRITE_END(); + return 0; } @@ -190,6 +175,8 @@ static int cbs_write_se_golomb(CodedBitstreamContext *ctx, PutBitContext *pbc, int len; uint32_t uvalue; + CBS_TRACE_WRITE_START(); + if (value < range_min || value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " "%"PRId32", but must be in [%"PRId32",%"PRId32"].\n", @@ -209,27 +196,14 @@ static int cbs_write_se_golomb(CodedBitstreamContext *ctx, PutBitContext *pbc, if (put_bits_left(pbc) < 2 * len + 1) return AVERROR(ENOSPC); - if (ctx->trace_enable) { - char bits[65]; - int i; - - for (i = 0; i < len; i++) - bits[i] = '0'; - bits[len] = '1'; - for (i = 0; i < len; i++) - bits[len + i + 1] = (uvalue + 1) >> (len - i - 1) & 1 ? '1' : '0'; - bits[len + len + 1] = 0; - - ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), - name, subscripts, bits, value); - } - put_bits(pbc, len, 0); if (len + 1 < 32) put_bits(pbc, len + 1, uvalue + 1); else put_bits32(pbc, uvalue + 1); + CBS_TRACE_WRITE_END(); + return 0; } @@ -264,8 +238,6 @@ static int cbs_h265_payload_extension_present(GetBitContext *gbc, uint32_t paylo #define u(width, name, range_min, range_max) \ xu(width, name, current->name, range_min, range_max, 0, ) -#define ub(width, name) \ - xu(width, name, current->name, 0, MAX_UINT_BITS(width), 0, ) #define flag(name) ub(1, name) #define ue(name, range_min, range_max) \ xue(name, current->name, range_min, range_max, 0, ) @@ -301,6 +273,12 @@ static int cbs_h265_payload_extension_present(GetBitContext *gbc, uint32_t paylo #define READWRITE read #define RWContext GetBitContext +#define ub(width, name) do { \ + uint32_t value; \ + CHECK(ff_cbs_read_simple_unsigned(ctx, rw, width, #name, \ + &value)); \ + current->name = value; \ + } while (0) #define xu(width, name, var, range_min, range_max, subs, ...) do { \ uint32_t value; \ CHECK(ff_cbs_read_unsigned(ctx, rw, width, #name, \ @@ -379,6 +357,7 @@ static int cbs_h2645_read_more_rbsp_data(GetBitContext *gbc) #undef READ #undef READWRITE #undef RWContext +#undef ub #undef xu #undef xi #undef xue @@ -394,6 +373,11 @@ static int cbs_h2645_read_more_rbsp_data(GetBitContext *gbc) #define READWRITE write #define RWContext PutBitContext +#define ub(width, name) do { \ + uint32_t value = current->name; \ + CHECK(ff_cbs_write_simple_unsigned(ctx, rw, width, #name, \ + value)); \ + } while (0) #define xu(width, name, var, range_min, range_max, subs, ...) do { \ uint32_t value = var; \ CHECK(ff_cbs_write_unsigned(ctx, rw, width, #name, \ @@ -461,6 +445,7 @@ static int cbs_h2645_read_more_rbsp_data(GetBitContext *gbc) #undef WRITE #undef READWRITE #undef RWContext +#undef ub #undef xu #undef xi #undef xue @@ -695,7 +680,7 @@ static int cbs_h2645_split_fragment(CodedBitstreamContext *ctx, int nal_unit_type = bytestream2_get_byte(&gbc) & 0x1f; unsigned int num_nalus = 1; if(nal_unit_type != VVC_DCI_NUT && nal_unit_type != VVC_OPI_NUT) - num_nalus = bytestream2_get_be16u(&gbc); + num_nalus = bytestream2_get_be16(&gbc); start = bytestream2_tell(&gbc); for(i = 0; i < num_nalus; i++) { diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/cbs_h266.h b/arm/raspi/third_party/ffmpeg/libavcodec/cbs_h266.h index 0196f46b..3a6f6d96 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/cbs_h266.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/cbs_h266.h @@ -666,6 +666,9 @@ typedef struct H266RawPredWeightTable { int8_t luma_offset_l1[15]; int8_t delta_chroma_weight_l1[15][2]; int16_t delta_chroma_offset_l1[15][2]; + + uint8_t num_weights_l0; ///< NumWeightsL0 + uint8_t num_weights_l1; ///< NumWeightsL1 } H266RawPredWeightTable; typedef struct H266RawPictureHeader { @@ -828,6 +831,10 @@ typedef struct H266RawSliceHeader { uint8_t sh_entry_offset_len_minus1; uint32_t sh_entry_point_offset_minus1[VVC_MAX_ENTRY_POINTS]; + // derived values + uint32_t num_entry_points; ///< NumEntryPoints + uint8_t num_ref_idx_active[2]; ///< NumRefIdxActive[] + } H266RawSliceHeader; typedef struct H266RawSlice { diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/cbs_h266_syntax_template.c b/arm/raspi/third_party/ffmpeg/libavcodec/cbs_h266_syntax_template.c index dce0216f..aecc4d79 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/cbs_h266_syntax_template.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/cbs_h266_syntax_template.c @@ -891,6 +891,8 @@ static int FUNC(vps) (CodedBitstreamContext *ctx, RWContext *rw, } } } + if (!num_output_layers_in_ols[i]) + return AVERROR_INVALIDDATA; } for (i = 1; i < total_num_olss; i++) { int num_layers_in_ols = 0; @@ -1140,6 +1142,8 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw, if (current->sps_num_subpics_minus1 > 0) { int wlen = av_ceil_log2(tmp_width_val); int hlen = av_ceil_log2(tmp_height_val); + infer(sps_subpic_ctu_top_left_x[0], 0); + infer(sps_subpic_ctu_top_left_y[0], 0); if (current->sps_pic_width_max_in_luma_samples > ctb_size_y) ubs(wlen, sps_subpic_width_minus1[0], 1, 0); else @@ -1147,7 +1151,7 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw, if (current->sps_pic_height_max_in_luma_samples > ctb_size_y) ubs(hlen, sps_subpic_height_minus1[0], 1, 0); else - infer(sps_subpic_height_minus1[0], tmp_height_val); + infer(sps_subpic_height_minus1[0], tmp_height_val - 1); if (!current->sps_independent_subpics_flag) { flags(sps_subpic_treated_as_pic_flag[0], 1, 0); flags(sps_loop_filter_across_subpic_enabled_flag[0], 1, 0); @@ -1187,6 +1191,12 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw, } else { int num_subpic_cols = tmp_width_val / (current->sps_subpic_width_minus1[0] + 1); + if (tmp_width_val % (current->sps_subpic_width_minus1[0] + 1) || + tmp_height_val % (current->sps_subpic_width_minus1[0] + 1) || + current->sps_num_subpics_minus1 != + (num_subpic_cols * tmp_height_val / + (current->sps_subpic_height_minus1[0] + 1) - 1)) + return AVERROR_INVALIDDATA; infer(sps_subpic_ctu_top_left_x[i], (i % num_subpic_cols) * (current->sps_subpic_width_minus1[0] + 1)); @@ -1976,6 +1986,7 @@ static int FUNC(pps) (CodedBitstreamContext *ctx, RWContext *rw, 0, current->row_height_val[tile_y] - 1, 1, i); if (current->pps_num_exp_slices_in_tile[i] == 0) { num_slices_in_tile = 1; + current->slice_height_in_ctus[i] = current->row_height_val[tile_y]; slice_top_left_ctu_x[i] = ctu_x; slice_top_left_ctu_y[i] = ctu_y; } else { @@ -2498,7 +2509,6 @@ static int FUNC(pred_weight_table) (CodedBitstreamContext *ctx, RWContext *rw, H266RawPredWeightTable *current) { int err, i, j; - uint8_t num_weights_l0, num_weights_l1; ue(luma_log2_weight_denom, 0, 7); if (sps->sps_chroma_format_idc != 0) { se(delta_chroma_log2_weight_denom, @@ -2507,21 +2517,21 @@ static int FUNC(pred_weight_table) (CodedBitstreamContext *ctx, RWContext *rw, } else { infer(delta_chroma_log2_weight_denom, 0); } - if (pps->pps_wp_info_in_ph_flag) + if (pps->pps_wp_info_in_ph_flag) { ue(num_l0_weights, 0, FFMIN(15, ref_lists->rpl_ref_list[0].num_ref_entries)); - else - infer(num_l0_weights, 0); - num_weights_l0 = pps->pps_wp_info_in_ph_flag ? - current->num_l0_weights : num_ref_idx_active[0]; - for (i = 0; i < num_weights_l0; i++) { + infer(num_weights_l0, current->num_l0_weights); + } else { + infer(num_weights_l0, num_ref_idx_active[0]); + } + for (i = 0; i < current->num_weights_l0; i++) { flags(luma_weight_l0_flag[i], 1, i); } if (sps->sps_chroma_format_idc != 0) { - for (i = 0; i < num_weights_l0; i++) + for (i = 0; i < current->num_weights_l0; i++) flags(chroma_weight_l0_flag[i], 1, i); } - for (i = 0; i < num_weights_l0; i++) { + for (i = 0; i < current->num_weights_l0; i++) { if (current->luma_weight_l0_flag[i]) { ses(delta_luma_weight_l0[i], -128, 127, 1, i); ses(luma_offset_l0[i], -128, 127, 1, i); @@ -2537,28 +2547,26 @@ static int FUNC(pred_weight_table) (CodedBitstreamContext *ctx, RWContext *rw, } } - if (pps->pps_weighted_bipred_flag && pps->pps_wp_info_in_ph_flag && + if (pps->pps_weighted_bipred_flag && ref_lists->rpl_ref_list[1].num_ref_entries > 0) { - ue(num_l1_weights, 0, - FFMIN(15, ref_lists->rpl_ref_list[1].num_ref_entries)); - } - if (!pps->pps_weighted_bipred_flag || - (pps->pps_wp_info_in_ph_flag && - ref_lists->rpl_ref_list[1].num_ref_entries == 0)) { - num_weights_l1 = 0; - } else if (pps->pps_wp_info_in_ph_flag) { - num_weights_l1 = current->num_l1_weights; + if (pps->pps_wp_info_in_ph_flag) { + ue(num_l1_weights, 0, + FFMIN(15, ref_lists->rpl_ref_list[1].num_ref_entries)); + infer(num_weights_l1, current->num_l1_weights); + } else { + infer(num_weights_l1, num_ref_idx_active[1]); + } } else { - num_weights_l1 = num_ref_idx_active[1]; + infer(num_weights_l1, 0); } - for (i = 0; i < num_weights_l1; i++) + for (i = 0; i < current->num_weights_l1; i++) flags(luma_weight_l1_flag[i], 1, i); if (sps->sps_chroma_format_idc != 0) { - for (i = 0; i < num_weights_l1; i++) + for (i = 0; i < current->num_weights_l1; i++) flags(chroma_weight_l1_flag[i], 1, i); } - for (i = 0; i < num_weights_l1; i++) { + for (i = 0; i < current->num_weights_l1; i++) { if (current->luma_weight_l1_flag[i]) { ses(delta_luma_weight_l1[i], -128, 127, 1, i); ses(luma_offset_l1[i], -128, 127, 1, i); @@ -2930,20 +2938,14 @@ static int FUNC(picture_header) (CodedBitstreamContext *ctx, RWContext *rw, infer(ph_sao_chroma_enabled_flag, 0); } - if (pps->pps_dbf_info_in_ph_flag) { + if (pps->pps_dbf_info_in_ph_flag) flag(ph_deblocking_params_present_flag); - if (current->ph_deblocking_params_present_flag) { - if (!pps->pps_deblocking_filter_disabled_flag) { - flag(ph_deblocking_filter_disabled_flag); - } else { - if (pps->pps_deblocking_filter_disabled_flag && - current->ph_deblocking_params_present_flag) { - infer(ph_deblocking_filter_disabled_flag, 0); - } else { - infer(ph_deblocking_filter_disabled_flag, - pps->pps_deblocking_filter_disabled_flag); - } - } + else + infer(ph_deblocking_params_present_flag, 0); + + if (current->ph_deblocking_params_present_flag) { + if (!pps->pps_deblocking_filter_disabled_flag) { + flag(ph_deblocking_filter_disabled_flag); if (!current->ph_deblocking_filter_disabled_flag) { se(ph_luma_beta_offset_div2, -12, 12); se(ph_luma_tc_offset_div2, -12, 12); @@ -2962,25 +2964,19 @@ static int FUNC(picture_header) (CodedBitstreamContext *ctx, RWContext *rw, infer(ph_cr_tc_offset_div2, current->ph_luma_tc_offset_div2); } - } else { - infer(ph_luma_beta_offset_div2, pps->pps_luma_beta_offset_div2); - infer(ph_luma_tc_offset_div2, pps->pps_luma_tc_offset_div2); - if (pps->pps_chroma_tool_offsets_present_flag) { - infer(ph_cb_beta_offset_div2, pps->pps_cb_beta_offset_div2); - infer(ph_cb_tc_offset_div2, pps->pps_cb_tc_offset_div2); - infer(ph_cr_beta_offset_div2, pps->pps_cr_beta_offset_div2); - infer(ph_cr_tc_offset_div2, pps->pps_cr_tc_offset_div2); - } else { - infer(ph_cb_beta_offset_div2, - current->ph_luma_beta_offset_div2); - infer(ph_cb_tc_offset_div2, - current->ph_luma_tc_offset_div2); - infer(ph_cr_beta_offset_div2, - current->ph_luma_beta_offset_div2); - infer(ph_cr_tc_offset_div2, - current->ph_luma_tc_offset_div2); - } } + } else { + infer(ph_deblocking_filter_disabled_flag, 0); + } + } else { + infer(ph_deblocking_filter_disabled_flag, pps->pps_deblocking_filter_disabled_flag); + if (!current->ph_deblocking_filter_disabled_flag) { + infer(ph_luma_beta_offset_div2, pps->pps_luma_beta_offset_div2); + infer(ph_luma_tc_offset_div2, pps->pps_luma_tc_offset_div2); + infer(ph_cb_beta_offset_div2, pps->pps_cb_beta_offset_div2); + infer(ph_cb_tc_offset_div2, pps->pps_cb_tc_offset_div2); + infer(ph_cr_beta_offset_div2, pps->pps_cr_beta_offset_div2); + infer(ph_cr_tc_offset_div2, pps->pps_cr_tc_offset_div2); } } @@ -3103,57 +3099,74 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, if (nal_unit_type == VVC_IDR_W_RADL || nal_unit_type == VVC_IDR_N_LP || nal_unit_type == VVC_CRA_NUT || nal_unit_type == VVC_GDR_NUT) flag(sh_no_output_of_prior_pics_flag); - if (sps->sps_alf_enabled_flag && !pps->pps_alf_info_in_ph_flag) { - flag(sh_alf_enabled_flag); - if (current->sh_alf_enabled_flag) { - ub(3, sh_num_alf_aps_ids_luma); - for (i = 0; i < current->sh_num_alf_aps_ids_luma; i++) - ubs(3, sh_alf_aps_id_luma[i], 1, i); - if (sps->sps_chroma_format_idc != 0) { - flag(sh_alf_cb_enabled_flag); - flag(sh_alf_cr_enabled_flag); - } else { + + if (sps->sps_alf_enabled_flag) { + if (!pps->pps_alf_info_in_ph_flag) { + flag(sh_alf_enabled_flag); + if (current->sh_alf_enabled_flag) { + ub(3, sh_num_alf_aps_ids_luma); + for (i = 0; i < current->sh_num_alf_aps_ids_luma; i++) + ubs(3, sh_alf_aps_id_luma[i], 1, i); + + if (sps->sps_chroma_format_idc != 0) { + flag(sh_alf_cb_enabled_flag); + flag(sh_alf_cr_enabled_flag); + } + if (current->sh_alf_cb_enabled_flag || + current->sh_alf_cr_enabled_flag) { + ub(3, sh_alf_aps_id_chroma); + } + + if (sps->sps_ccalf_enabled_flag) { + flag(sh_alf_cc_cb_enabled_flag); + if (current->sh_alf_cc_cb_enabled_flag) + ub(3, sh_alf_cc_cb_aps_id); + + flag(sh_alf_cc_cr_enabled_flag); + if (current->sh_alf_cc_cr_enabled_flag) + ub(3, sh_alf_cc_cr_aps_id); + } + } + } else { + infer(sh_alf_enabled_flag, ph->ph_alf_enabled_flag); + if (current->sh_alf_enabled_flag) { + infer(sh_num_alf_aps_ids_luma, ph->ph_num_alf_aps_ids_luma); + for (i = 0; i < current->sh_num_alf_aps_ids_luma; i++) + infer(sh_alf_aps_id_luma[i], ph->ph_alf_aps_id_luma[i]); + infer(sh_alf_cb_enabled_flag, ph->ph_alf_cb_enabled_flag); infer(sh_alf_cr_enabled_flag, ph->ph_alf_cr_enabled_flag); - } - if (current->sh_alf_cb_enabled_flag || - current->sh_alf_cr_enabled_flag) - ub(3, sh_alf_aps_id_chroma); - else - infer(sh_alf_aps_id_chroma, ph->ph_alf_aps_id_chroma); - if (sps->sps_ccalf_enabled_flag) { - flag(sh_alf_cc_cb_enabled_flag); - if (current->sh_alf_cc_cb_enabled_flag) - ub(3, sh_alf_cc_cb_aps_id); - else - infer(sh_alf_cc_cb_aps_id, ph->ph_alf_cc_cb_aps_id); - flag(sh_alf_cc_cr_enabled_flag); - if (current->sh_alf_cc_cr_enabled_flag) - ub(3, sh_alf_cc_cr_aps_id); - else - infer(sh_alf_cc_cr_aps_id, ph->ph_alf_cc_cr_aps_id); - } else { - infer(sh_alf_cc_cb_enabled_flag, ph->ph_alf_cc_cb_enabled_flag); - infer(sh_alf_cc_cr_enabled_flag, ph->ph_alf_cc_cr_enabled_flag); - infer(sh_alf_cc_cb_aps_id, ph->ph_alf_cc_cb_aps_id); - infer(sh_alf_cc_cr_aps_id, ph->ph_alf_cc_cr_aps_id); + if (current->sh_alf_cb_enabled_flag ||current->sh_alf_cr_enabled_flag) + infer(sh_alf_aps_id_chroma, ph->ph_alf_aps_id_chroma); + + if (sps->sps_ccalf_enabled_flag) { + infer(sh_alf_cc_cb_enabled_flag, ph->ph_alf_cc_cb_enabled_flag); + if (current->sh_alf_cc_cb_enabled_flag) + infer(sh_alf_cc_cb_aps_id, ph->ph_alf_cc_cb_aps_id); + + infer(sh_alf_cc_cr_enabled_flag, ph->ph_alf_cc_cr_enabled_flag); + if (current->sh_alf_cc_cr_enabled_flag) + infer(sh_alf_cc_cr_aps_id, ph->ph_alf_cc_cr_aps_id); + } } } - } else { - infer(sh_alf_enabled_flag, 0); } - if (ph->ph_lmcs_enabled_flag && - !current->sh_picture_header_in_slice_header_flag) - flag(sh_lmcs_used_flag); - else - infer(sh_lmcs_used_flag, 0); + if (current->sh_picture_header_in_slice_header_flag) { + infer(sh_lmcs_used_flag, ph->ph_lmcs_enabled_flag); + infer(sh_explicit_scaling_list_used_flag, + ph->ph_explicit_scaling_list_enabled_flag); + } else { + if (ph->ph_lmcs_enabled_flag) + flag(sh_lmcs_used_flag); + else + infer(sh_lmcs_used_flag, 0); - if (ph->ph_explicit_scaling_list_enabled_flag && - !current->sh_picture_header_in_slice_header_flag) - flag(sh_explicit_scaling_list_used_flag); - else - infer(sh_explicit_scaling_list_used_flag, 0); + if (ph->ph_explicit_scaling_list_enabled_flag) + flag(sh_explicit_scaling_list_used_flag); + else + infer(sh_explicit_scaling_list_used_flag, 0); + } if (!pps->pps_rpl_info_in_ph_flag && ((nal_unit_type != VVC_IDR_W_RADL && @@ -3180,53 +3193,51 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, } else { infer(sh_num_ref_idx_active_override_flag, 1); } + + for (i = 0; i < 2; i++) { + if (current->sh_slice_type == VVC_SLICE_TYPE_B || + (current->sh_slice_type == VVC_SLICE_TYPE_P && i == 0)) { + if (current->sh_num_ref_idx_active_override_flag) { + current->num_ref_idx_active[i] = current->sh_num_ref_idx_active_minus1[i] + 1; + } else { + current->num_ref_idx_active[i] = + FFMIN(ref_pic_lists->rpl_ref_list[i].num_ref_entries, + pps->pps_num_ref_idx_default_active_minus1[i] + 1); + } + } else { + current->num_ref_idx_active[i] = 0; + } + } + if (current->sh_slice_type != VVC_SLICE_TYPE_I) { if (pps->pps_cabac_init_present_flag) flag(sh_cabac_init_flag); else infer(sh_cabac_init_flag, 0); if (ph->ph_temporal_mvp_enabled_flag && !pps->pps_rpl_info_in_ph_flag) { - uint8_t num_ref_idx_active[2]; - for (i = 0; i < 2; i++) { - if (current->sh_slice_type == VVC_SLICE_TYPE_B || - (current->sh_slice_type == VVC_SLICE_TYPE_P && i == 0)) { - if (current->sh_num_ref_idx_active_override_flag) { - num_ref_idx_active[i] = - current->sh_num_ref_idx_active_minus1[i] + 1; - } else { - num_ref_idx_active[i] = - FFMIN(ref_pic_lists->rpl_ref_list[i].num_ref_entries, - pps->pps_num_ref_idx_default_active_minus1[i] + 1); - } - } else { - num_ref_idx_active[i] = 0; - } - } - if (current->sh_slice_type == VVC_SLICE_TYPE_B) flag(sh_collocated_from_l0_flag); else infer(sh_collocated_from_l0_flag, 1); if ((current->sh_collocated_from_l0_flag && - num_ref_idx_active[0] > 1) || + current->num_ref_idx_active[0] > 1) || (!current->sh_collocated_from_l0_flag && - num_ref_idx_active[1] > 1)) { + current->num_ref_idx_active[1] > 1)) { unsigned int idx = current->sh_collocated_from_l0_flag ? 0 : 1; - ue(sh_collocated_ref_idx, 0, num_ref_idx_active[idx] - 1); + ue(sh_collocated_ref_idx, 0, current->num_ref_idx_active[idx] - 1); } else { infer(sh_collocated_ref_idx, 0); } - if (!pps->pps_wp_info_in_ph_flag && - ((pps->pps_weighted_pred_flag && - current->sh_slice_type == VVC_SLICE_TYPE_P) || - (pps->pps_weighted_bipred_flag && - current->sh_slice_type == VVC_SLICE_TYPE_B))) { - CHECK(FUNC(pred_weight_table) (ctx, rw, sps, pps, ref_pic_lists, - num_ref_idx_active, - ¤t->sh_pred_weight_table)); - } } - + if (!pps->pps_wp_info_in_ph_flag && + ((pps->pps_weighted_pred_flag && + current->sh_slice_type == VVC_SLICE_TYPE_P) || + (pps->pps_weighted_bipred_flag && + current->sh_slice_type == VVC_SLICE_TYPE_B))) { + CHECK(FUNC(pred_weight_table) (ctx, rw, sps, pps, ref_pic_lists, + current->num_ref_idx_active, + ¤t->sh_pred_weight_table)); + } } qp_bd_offset = 6 * sps->sps_bitdepth_minus8; if (!pps->pps_qp_delta_info_in_ph_flag) @@ -3296,9 +3307,7 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, if (!pps->pps_deblocking_filter_disabled_flag) flag(sh_deblocking_filter_disabled_flag); else - infer(sh_deblocking_filter_disabled_flag, - !(pps->pps_deblocking_filter_disabled_flag && - current->sh_deblocking_params_present_flag)); + infer(sh_deblocking_filter_disabled_flag, 0); if (!current->sh_deblocking_filter_disabled_flag) { se(sh_luma_beta_offset_div2, -12, 12); se(sh_luma_tc_offset_div2, -12, 12); @@ -3315,22 +3324,16 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, current->sh_luma_beta_offset_div2); infer(sh_cr_tc_offset_div2, current->sh_luma_tc_offset_div2); } - } else { + } + } else { + infer(sh_deblocking_filter_disabled_flag, ph->ph_deblocking_filter_disabled_flag); + if (!current->sh_deblocking_filter_disabled_flag) { infer(sh_luma_beta_offset_div2, ph->ph_luma_beta_offset_div2); infer(sh_luma_tc_offset_div2, ph->ph_luma_tc_offset_div2); - if (pps->pps_chroma_tool_offsets_present_flag) { - infer(sh_cb_beta_offset_div2, ph->ph_cb_beta_offset_div2); - infer(sh_cb_tc_offset_div2, ph->ph_cb_tc_offset_div2); - infer(sh_cr_beta_offset_div2, ph->ph_cr_beta_offset_div2); - infer(sh_cr_tc_offset_div2, ph->ph_cr_beta_offset_div2); - } else { - infer(sh_cb_beta_offset_div2, - current->sh_luma_beta_offset_div2); - infer(sh_cb_tc_offset_div2, current->sh_luma_tc_offset_div2); - infer(sh_cr_beta_offset_div2, - current->sh_luma_beta_offset_div2); - infer(sh_cr_tc_offset_div2, current->sh_luma_tc_offset_div2); - } + infer(sh_cb_beta_offset_div2, ph->ph_cb_beta_offset_div2); + infer(sh_cb_tc_offset_div2, ph->ph_cb_tc_offset_div2); + infer(sh_cr_beta_offset_div2, ph->ph_cr_beta_offset_div2); + infer(sh_cr_tc_offset_div2, ph->ph_cr_tc_offset_div2); } } @@ -3368,8 +3371,9 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, for (i = 0; i < current->sh_slice_header_extension_length; i++) us(8, sh_slice_header_extension_data_byte[i], 0x00, 0xff, 1, i); } + + current->num_entry_points = 0; if (sps->sps_entry_point_offsets_present_flag) { - int num_entry_points = 0; uint8_t entropy_sync = sps->sps_entropy_coding_sync_enabled_flag; int height; if (pps->pps_rect_slice_flag) { @@ -3386,7 +3390,7 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, else height = pps->pps_slice_height_in_tiles_minus1[slice_idx] + 1; - num_entry_points = width_in_tiles * height; + current->num_entry_points = width_in_tiles * height; } else { int tile_idx; int tile_y; @@ -3396,18 +3400,18 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, current->sh_num_tiles_in_slice_minus1; tile_idx++) { tile_y = tile_idx / pps->num_tile_rows; height = pps->row_height_val[tile_y]; - num_entry_points += (entropy_sync ? height : 1); + current->num_entry_points += (entropy_sync ? height : 1); } } - num_entry_points--; - if (num_entry_points > VVC_MAX_ENTRY_POINTS) { + current->num_entry_points--; + if (current->num_entry_points > VVC_MAX_ENTRY_POINTS) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Too many entry points: " - "%" PRIu16 ".\n", num_entry_points); + "%" PRIu16 ".\n", current->num_entry_points); return AVERROR_PATCHWELCOME; } - if (num_entry_points > 0) { + if (current->num_entry_points > 0) { ue(sh_entry_offset_len_minus1, 0, 31); - for (i = 0; i < num_entry_points; i++) { + for (i = 0; i < current->num_entry_points; i++) { ubs(current->sh_entry_offset_len_minus1 + 1, sh_entry_point_offset_minus1[i], 1, i); } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/cbs_internal.h b/arm/raspi/third_party/ffmpeg/libavcodec/cbs_internal.h index b752d646..285deb40 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/cbs_internal.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/cbs_internal.h @@ -157,24 +157,29 @@ typedef struct CodedBitstreamType { void ff_cbs_trace_header(CodedBitstreamContext *ctx, const char *name); -void ff_cbs_trace_syntax_element(CodedBitstreamContext *ctx, int position, - const char *name, const int *subscripts, - const char *bitstring, int64_t value); - // Helper functions for read/write of common bitstream elements, including -// generation of trace output. +// generation of trace output. The simple functions are equivalent to +// their non-simple counterparts except that their range is unrestricted +// (i.e. only limited by the amount of bits used) and they lack +// the ability to use subscripts. int ff_cbs_read_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, int width, const char *name, const int *subscripts, uint32_t *write_to, uint32_t range_min, uint32_t range_max); +int ff_cbs_read_simple_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, + int width, const char *name, uint32_t *write_to); + int ff_cbs_write_unsigned(CodedBitstreamContext *ctx, PutBitContext *pbc, int width, const char *name, const int *subscripts, uint32_t value, uint32_t range_min, uint32_t range_max); +int ff_cbs_write_simple_unsigned(CodedBitstreamContext *ctx, PutBitContext *pbc, + int width, const char *name, uint32_t value); + int ff_cbs_read_signed(CodedBitstreamContext *ctx, GetBitContext *gbc, int width, const char *name, const int *subscripts, int32_t *write_to, @@ -197,6 +202,87 @@ int ff_cbs_write_signed(CodedBitstreamContext *ctx, PutBitContext *pbc, // range_min in the above functions. #define MIN_INT_BITS(length) (-(INT64_C(1) << ((length) - 1))) + +// Start of a syntax element during read tracing. +#define CBS_TRACE_READ_START() \ + GetBitContext trace_start; \ + do { \ + if (ctx->trace_enable) \ + trace_start = *gbc; \ + } while (0) + +// End of a syntax element for tracing, make callback. +#define CBS_TRACE_READ_END() \ + do { \ + if (ctx->trace_enable) { \ + int start_position = get_bits_count(&trace_start); \ + int end_position = get_bits_count(gbc); \ + av_assert0(start_position <= end_position); \ + ctx->trace_read_callback(ctx->trace_context, &trace_start, \ + end_position - start_position, \ + name, subscripts, value); \ + } \ + } while (0) + +// End of a syntax element with no subscript entries. +#define CBS_TRACE_READ_END_NO_SUBSCRIPTS() \ + do { \ + const int *subscripts = NULL; \ + CBS_TRACE_READ_END(); \ + } while (0) + +// End of a syntax element which is made up of subelements which +// are aleady traced, so we are only showing the value. +#define CBS_TRACE_READ_END_VALUE_ONLY() \ + do { \ + if (ctx->trace_enable) { \ + ctx->trace_read_callback(ctx->trace_context, &trace_start, 0, \ + name, subscripts, value); \ + } \ + } while (0) + +// Start of a syntax element during write tracing. +#define CBS_TRACE_WRITE_START() \ + int start_position; \ + do { \ + if (ctx->trace_enable) \ + start_position = put_bits_count(pbc);; \ + } while (0) + +// End of a syntax element for tracing, make callback. +#define CBS_TRACE_WRITE_END() \ + do { \ + if (ctx->trace_enable) { \ + int end_position = put_bits_count(pbc); \ + av_assert0(start_position <= end_position); \ + ctx->trace_write_callback(ctx->trace_context, pbc, \ + end_position - start_position, \ + name, subscripts, value); \ + } \ + } while (0) + +// End of a syntax element with no subscript entries. +#define CBS_TRACE_WRITE_END_NO_SUBSCRIPTS() \ + do { \ + const int *subscripts = NULL; \ + CBS_TRACE_WRITE_END(); \ + } while (0) + +// End of a syntax element which is made up of subelements which are +// aleady traced, so we are only showing the value. This forges a +// PutBitContext to point to the position of the start of the syntax +// element, but the other state doesn't matter because length is zero. +#define CBS_TRACE_WRITE_END_VALUE_ONLY() \ + do { \ + if (ctx->trace_enable) { \ + PutBitContext tmp; \ + init_put_bits(&tmp, pbc->buf, start_position); \ + skip_put_bits(&tmp, start_position); \ + ctx->trace_write_callback(ctx->trace_context, &tmp, 0, \ + name, subscripts, value); \ + } \ + } while (0) + #define TYPE_LIST(...) { __VA_ARGS__ } #define CBS_UNIT_TYPE_POD(type_, structure) { \ .nb_unit_types = 1, \ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/cbs_mpeg2.c b/arm/raspi/third_party/ffmpeg/libavcodec/cbs_mpeg2.c index 04b0c7f8..37fc28a4 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/cbs_mpeg2.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/cbs_mpeg2.c @@ -40,8 +40,6 @@ #define SUBSCRIPTS(subs, ...) (subs > 0 ? ((int[subs + 1]){ subs, __VA_ARGS__ }) : NULL) -#define ui(width, name) \ - xui(width, name, current->name, 0, MAX_UINT_BITS(width), 0, ) #define uir(width, name) \ xui(width, name, current->name, 1, MAX_UINT_BITS(width), 0, ) #define uis(width, name, subs, ...) \ @@ -65,6 +63,12 @@ #define READWRITE read #define RWContext GetBitContext +#define ui(width, name) do { \ + uint32_t value; \ + CHECK(ff_cbs_read_simple_unsigned(ctx, rw, width, #name, \ + &value)); \ + current->name = value; \ + } while (0) #define xuia(width, string, var, range_min, range_max, subs, ...) do { \ uint32_t value; \ CHECK(ff_cbs_read_unsigned(ctx, rw, width, string, \ @@ -95,6 +99,7 @@ #undef READ #undef READWRITE #undef RWContext +#undef ui #undef xuia #undef xsi #undef nextbits @@ -105,6 +110,11 @@ #define READWRITE write #define RWContext PutBitContext +#define ui(width, name) do { \ + CHECK(ff_cbs_write_simple_unsigned(ctx, rw, width, #name, \ + current->name)); \ + } while (0) + #define xuia(width, string, var, range_min, range_max, subs, ...) do { \ CHECK(ff_cbs_write_unsigned(ctx, rw, width, string, \ SUBSCRIPTS(subs, __VA_ARGS__), \ @@ -134,6 +144,7 @@ #undef WRITE #undef READWRITE #undef RWContext +#undef ui #undef xuia #undef xsi #undef nextbits diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/cbs_vp9.c b/arm/raspi/third_party/ffmpeg/libavcodec/cbs_vp9.c index 184fdcad..816d06da 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/cbs_vp9.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/cbs_vp9.c @@ -28,11 +28,10 @@ static int cbs_vp9_read_s(CodedBitstreamContext *ctx, GetBitContext *gbc, const int *subscripts, int32_t *write_to) { uint32_t magnitude; - int position, sign; + int sign; int32_t value; - if (ctx->trace_enable) - position = get_bits_count(gbc); + CBS_TRACE_READ_START(); if (get_bits_left(gbc) < width + 1) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid signed value at " @@ -44,17 +43,7 @@ static int cbs_vp9_read_s(CodedBitstreamContext *ctx, GetBitContext *gbc, sign = get_bits1(gbc); value = sign ? -(int32_t)magnitude : magnitude; - if (ctx->trace_enable) { - char bits[33]; - int i; - for (i = 0; i < width; i++) - bits[i] = magnitude >> (width - i - 1) & 1 ? '1' : '0'; - bits[i] = sign ? '1' : '0'; - bits[i + 1] = 0; - - ff_cbs_trace_syntax_element(ctx, position, name, subscripts, - bits, value); - } + CBS_TRACE_READ_END(); *write_to = value; return 0; @@ -67,27 +56,19 @@ static int cbs_vp9_write_s(CodedBitstreamContext *ctx, PutBitContext *pbc, uint32_t magnitude; int sign; + CBS_TRACE_WRITE_START(); + if (put_bits_left(pbc) < width + 1) return AVERROR(ENOSPC); sign = value < 0; magnitude = sign ? -value : value; - if (ctx->trace_enable) { - char bits[33]; - int i; - for (i = 0; i < width; i++) - bits[i] = magnitude >> (width - i - 1) & 1 ? '1' : '0'; - bits[i] = sign ? '1' : '0'; - bits[i + 1] = 0; - - ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), - name, subscripts, bits, value); - } - put_bits(pbc, width, magnitude); put_bits(pbc, 1, sign); + CBS_TRACE_WRITE_END(); + return 0; } @@ -96,32 +77,24 @@ static int cbs_vp9_read_increment(CodedBitstreamContext *ctx, GetBitContext *gbc const char *name, uint32_t *write_to) { uint32_t value; - int position, i; - char bits[8]; - av_assert0(range_min <= range_max && range_max - range_min < sizeof(bits) - 1); - if (ctx->trace_enable) - position = get_bits_count(gbc); + CBS_TRACE_READ_START(); - for (i = 0, value = range_min; value < range_max;) { + av_assert0(range_min <= range_max && range_max - range_min < 32); + + for (value = range_min; value < range_max;) { if (get_bits_left(gbc) < 1) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid increment value at " "%s: bitstream ended.\n", name); return AVERROR_INVALIDDATA; } - if (get_bits1(gbc)) { - bits[i++] = '1'; + if (get_bits1(gbc)) ++value; - } else { - bits[i++] = '0'; + else break; - } } - if (ctx->trace_enable) { - bits[i] = 0; - ff_cbs_trace_syntax_element(ctx, position, name, NULL, bits, value); - } + CBS_TRACE_READ_END_NO_SUBSCRIPTS(); *write_to = value; return 0; @@ -133,6 +106,8 @@ static int cbs_vp9_write_increment(CodedBitstreamContext *ctx, PutBitContext *pb { int len; + CBS_TRACE_WRITE_START(); + av_assert0(range_min <= range_max && range_max - range_min < 8); if (value < range_min || value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " @@ -148,23 +123,11 @@ static int cbs_vp9_write_increment(CodedBitstreamContext *ctx, PutBitContext *pb if (put_bits_left(pbc) < len) return AVERROR(ENOSPC); - if (ctx->trace_enable) { - char bits[8]; - int i; - for (i = 0; i < len; i++) { - if (range_min + i == value) - bits[i] = '0'; - else - bits[i] = '1'; - } - bits[i] = 0; - ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), - name, NULL, bits, value); - } - if (len > 0) put_bits(pbc, len, (1 << len) - 1 - (value != range_max)); + CBS_TRACE_WRITE_END_NO_SUBSCRIPTS(); + return 0; } @@ -173,13 +136,12 @@ static int cbs_vp9_read_le(CodedBitstreamContext *ctx, GetBitContext *gbc, const int *subscripts, uint32_t *write_to) { uint32_t value; - int position, b; + int b; + + CBS_TRACE_READ_START(); av_assert0(width % 8 == 0); - if (ctx->trace_enable) - position = get_bits_count(gbc); - if (get_bits_left(gbc) < width) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid le value at " "%s: bitstream ended.\n", name); @@ -190,17 +152,7 @@ static int cbs_vp9_read_le(CodedBitstreamContext *ctx, GetBitContext *gbc, for (b = 0; b < width; b += 8) value |= get_bits(gbc, 8) << b; - if (ctx->trace_enable) { - char bits[33]; - int i; - for (b = 0; b < width; b += 8) - for (i = 0; i < 8; i++) - bits[b + i] = value >> (b + i) & 1 ? '1' : '0'; - bits[b] = 0; - - ff_cbs_trace_syntax_element(ctx, position, name, subscripts, - bits, value); - } + CBS_TRACE_READ_END(); *write_to = value; return 0; @@ -212,26 +164,18 @@ static int cbs_vp9_write_le(CodedBitstreamContext *ctx, PutBitContext *pbc, { int b; + CBS_TRACE_WRITE_START(); + av_assert0(width % 8 == 0); if (put_bits_left(pbc) < width) return AVERROR(ENOSPC); - if (ctx->trace_enable) { - char bits[33]; - int i; - for (b = 0; b < width; b += 8) - for (i = 0; i < 8; i++) - bits[b + i] = value >> (b + i) & 1 ? '1' : '0'; - bits[b] = 0; - - ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), - name, subscripts, bits, value); - } - for (b = 0; b < width; b += 8) put_bits(pbc, 8, value >> b & 0xff); + CBS_TRACE_WRITE_END(); + return 0; } @@ -251,8 +195,6 @@ static int cbs_vp9_write_le(CodedBitstreamContext *ctx, PutBitContext *pbc, #define SUBSCRIPTS(subs, ...) (subs > 0 ? ((int[subs + 1]){ subs, __VA_ARGS__ }) : NULL) -#define f(width, name) \ - xf(width, name, current->name, 0, ) #define s(width, name) \ xs(width, name, current->name, 0, ) #define fs(width, name, subs, ...) \ @@ -264,6 +206,12 @@ static int cbs_vp9_write_le(CodedBitstreamContext *ctx, PutBitContext *pbc, #define READWRITE read #define RWContext GetBitContext +#define f(width, name) do { \ + uint32_t value; \ + CHECK(ff_cbs_read_simple_unsigned(ctx, rw, width, #name, \ + &value)); \ + current->name = value; \ + } while (0) #define xf(width, name, var, subs, ...) do { \ uint32_t value; \ CHECK(ff_cbs_read_unsigned(ctx, rw, width, #name, \ @@ -329,6 +277,7 @@ static int cbs_vp9_write_le(CodedBitstreamContext *ctx, PutBitContext *pbc, #undef READ #undef READWRITE #undef RWContext +#undef f #undef xf #undef xs #undef increment @@ -344,6 +293,10 @@ static int cbs_vp9_write_le(CodedBitstreamContext *ctx, PutBitContext *pbc, #define READWRITE write #define RWContext PutBitContext +#define f(width, name) do { \ + CHECK(ff_cbs_write_simple_unsigned(ctx, rw, width, #name, \ + current->name)); \ + } while (0) #define xf(width, name, var, subs, ...) do { \ CHECK(ff_cbs_write_unsigned(ctx, rw, width, #name, \ SUBSCRIPTS(subs, __VA_ARGS__), \ @@ -396,6 +349,7 @@ static int cbs_vp9_write_le(CodedBitstreamContext *ctx, PutBitContext *pbc, #undef WRITE #undef READWRITE #undef RWContext +#undef f #undef xf #undef xs #undef increment diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/cdgraphics.c b/arm/raspi/third_party/ffmpeg/libavcodec/cdgraphics.c index 0c5022a5..f33f7fbf 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/cdgraphics.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/cdgraphics.c @@ -90,19 +90,19 @@ static av_cold int cdg_decode_init(AVCodecContext *avctx) static void cdg_border_preset(CDGraphicsContext *cc, uint8_t *data) { - int y; - int lsize = cc->frame->linesize[0]; + ptrdiff_t lsize = cc->frame->linesize[0]; uint8_t *buf = cc->frame->data[0]; int color = data[0] & 0x0F; if (!(data[1] & 0x0F)) { /// fill the top and bottom borders - memset(buf, color, CDG_BORDER_HEIGHT * lsize); - memset(buf + (CDG_FULL_HEIGHT - CDG_BORDER_HEIGHT) * lsize, - color, CDG_BORDER_HEIGHT * lsize); + for (int y = 0; y < CDG_BORDER_HEIGHT; y++) + memset(buf + y * lsize, color, cc->frame->width); + for (int y = CDG_FULL_HEIGHT-CDG_BORDER_HEIGHT; y < CDG_FULL_HEIGHT; y++) + memset(buf + y * lsize, color, cc->frame->width); /// fill the side borders - for (y = CDG_BORDER_HEIGHT; y < CDG_FULL_HEIGHT - CDG_BORDER_HEIGHT; y++) { + for (int y = CDG_BORDER_HEIGHT; y < CDG_FULL_HEIGHT - CDG_BORDER_HEIGHT; y++) { memset(buf + y * lsize, color, CDG_BORDER_WIDTH); memset(buf + CDG_FULL_WIDTH - CDG_BORDER_WIDTH + y * lsize, color, CDG_BORDER_WIDTH); @@ -138,7 +138,7 @@ static int cdg_tile_block(CDGraphicsContext *cc, uint8_t *data, int b) int color; int x, y; int ai; - int stride = cc->frame->linesize[0]; + ptrdiff_t stride = cc->frame->linesize[0]; uint8_t *buf = cc->frame->data[0]; ri = (data[2] & 0x1F) * CDG_TILE_HEIGHT + cc->vscroll; @@ -210,7 +210,7 @@ static void cdg_scroll(CDGraphicsContext *cc, uint8_t *data, int color; int hscmd, h_off, hinc, vscmd, v_off, vinc; int y; - int stride = cc->frame->linesize[0]; + ptrdiff_t stride = cc->frame->linesize[0]; uint8_t *in = cc->frame->data[0]; uint8_t *out = new_frame->data[0]; @@ -249,11 +249,11 @@ static void cdg_scroll(CDGraphicsContext *cc, uint8_t *data, if (vinc > 0) cdg_fill_wrapper(0, 0, out, 0, CDG_FULL_HEIGHT - vinc, in, color, - stride, vinc, stride, roll_over); + FFABS(stride), vinc, stride, roll_over); else if (vinc < 0) cdg_fill_wrapper(0, CDG_FULL_HEIGHT + vinc, out, 0, 0, in, color, - stride, -1 * vinc, stride, roll_over); + FFABS(stride), -1 * vinc, stride, roll_over); if (hinc > 0) cdg_fill_wrapper(0, 0, out, @@ -290,7 +290,8 @@ static int cdg_decode_frame(AVCodecContext *avctx, AVFrame *frame, if ((ret = ff_reget_buffer(avctx, cc->frame, 0)) < 0) return ret; if (!cc->cleared) { - memset(cc->frame->data[0], 0, cc->frame->linesize[0] * avctx->height); + for (int y = 0; y < avctx->height; y++) + memset(cc->frame->data[0] + y * cc->frame->linesize[0], 0, avctx->width); memset(cc->frame->data[1], 0, AVPALETTE_SIZE); cc->cleared = 1; } @@ -304,9 +305,11 @@ static int cdg_decode_frame(AVCodecContext *avctx, AVFrame *frame, if ((command & CDG_MASK) == CDG_COMMAND) { switch (inst) { case CDG_INST_MEMORY_PRESET: - if (!(cdg_data[1] & 0x0F)) - memset(cc->frame->data[0], cdg_data[0] & 0x0F, - cc->frame->linesize[0] * CDG_FULL_HEIGHT); + if (!(cdg_data[1] & 0x0F)) { + for (int y = 0; y < avctx->height; y++) + memset(cc->frame->data[0] + y * cc->frame->linesize[0], + cdg_data[0] & 0x0F, avctx->width); + } break; case CDG_INST_LOAD_PAL_LO: case CDG_INST_LOAD_PAL_HIGH: @@ -344,8 +347,7 @@ static int cdg_decode_frame(AVCodecContext *avctx, AVFrame *frame, return ret; cdg_scroll(cc, cdg_data, frame, inst == CDG_INST_SCROLL_COPY); - av_frame_unref(cc->frame); - ret = av_frame_ref(cc->frame, frame); + ret = av_frame_replace(cc->frame, frame); if (ret < 0) return ret; break; @@ -377,7 +379,8 @@ static void cdg_decode_flush(AVCodecContext *avctx) if (!cc->frame->data[0]) return; - memset(cc->frame->data[0], 0, cc->frame->linesize[0] * avctx->height); + for (int y = 0; y < avctx->height; y++) + memset(cc->frame->data[0] + y * cc->frame->linesize[0], 0, avctx->width); if (!avctx->frame_num) memset(cc->frame->data[1], 0, AVPALETTE_SIZE); } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/cdxl.c b/arm/raspi/third_party/ffmpeg/libavcodec/cdxl.c index 085ae97c..3c892ada 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/cdxl.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/cdxl.c @@ -125,9 +125,10 @@ static void chunky2chunky(CDXLVideoContext *c, int linesize, uint8_t *out) } } -static void import_format(CDXLVideoContext *c, int linesize, uint8_t *out) +static void import_format(CDXLVideoContext *c, ptrdiff_t linesize, uint8_t *out) { - memset(out, 0, linesize * c->avctx->height); + for (int y = 0; y < c->avctx->height; y++) + memset(out + y * linesize, 0, c->avctx->width); switch (c->format) { case BIT_PLANAR: diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/celp_math.h b/arm/raspi/third_party/ffmpeg/libavcodec/celp_math.h index 18888a42..99a04707 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/celp_math.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/celp_math.h @@ -78,7 +78,7 @@ int64_t ff_dot_product(const int16_t *a, const int16_t *b, int length); * * @return value << offset, if offset>=0; value >> -offset - otherwise */ -static inline int bidir_sal(int value, int offset) +static inline unsigned bidir_sal(unsigned value, int offset) { if(offset < 0) return value >> -offset; else return value << offset; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/cfhddata.c b/arm/raspi/third_party/ffmpeg/libavcodec/cfhddata.c index fd5cc817..a3948a14 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/cfhddata.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/cfhddata.c @@ -150,7 +150,7 @@ static av_cold int cfhd_init_vlc(CFHD_RL_VLC_ELEM out[], unsigned out_size, } } - ret = ff_init_vlc_from_lengths(&vlc, VLC_BITS, j, + ret = ff_vlc_init_from_lengths(&vlc, VLC_BITS, j, &tmp[0].len, sizeof(tmp[0]), NULL, 0, 0, 0, 0, logctx); if (ret < 0) @@ -173,7 +173,7 @@ static av_cold int cfhd_init_vlc(CFHD_RL_VLC_ELEM out[], unsigned out_size, out[i].level = level; out[i].run = run; } - ff_free_vlc(&vlc); + ff_vlc_free(&vlc); return 0; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/clearvideo.c b/arm/raspi/third_party/ffmpeg/libavcodec/clearvideo.c index f84e3e6e..7f2c1c5f 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/clearvideo.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/clearvideo.c @@ -637,8 +637,8 @@ static av_cold void build_vlc(VLC *vlc, const uint8_t counts[16], } vlc->table = &vlc_buf[*offset]; vlc->table_allocated = FF_ARRAY_ELEMS(vlc_buf) - *offset; - ff_init_vlc_from_lengths(vlc, CLV_VLC_BITS, num, lens, 1, - *syms, 2, 2, 0, INIT_VLC_STATIC_OVERLONG, NULL); + ff_vlc_init_from_lengths(vlc, CLV_VLC_BITS, num, lens, 1, + *syms, 2, 2, 0, VLC_INIT_STATIC_OVERLONG, NULL); *syms += num; *offset += vlc->table_size; } @@ -647,10 +647,10 @@ static av_cold void clv_init_static(void) { const uint16_t *mv_syms = clv_mv_syms, *bias_syms = clv_bias_syms; - INIT_VLC_STATIC_FROM_LENGTHS(&dc_vlc, CLV_VLC_BITS, NUM_DC_CODES, + VLC_INIT_STATIC_FROM_LENGTHS(&dc_vlc, CLV_VLC_BITS, NUM_DC_CODES, clv_dc_lens, 1, clv_dc_syms, 1, 1, -63, 0, 1104); - INIT_VLC_STATIC_FROM_LENGTHS(&ac_vlc, CLV_VLC_BITS, NUM_AC_CODES, + VLC_INIT_STATIC_FROM_LENGTHS(&ac_vlc, CLV_VLC_BITS, NUM_AC_CODES, clv_ac_bits, 1, clv_ac_syms, 2, 2, 0, 0, 554); for (unsigned i = 0, j = 0, k = 0, offset = 0;; i++) { @@ -663,10 +663,10 @@ static av_cold void clv_init_static(void) if (0x1B7 & (1 << i)) { lev[i].flags_cb.table = &vlc_buf[offset]; lev[i].flags_cb.table_allocated = FF_ARRAY_ELEMS(vlc_buf) - offset; - ff_init_vlc_from_lengths(&lev[i].flags_cb, CLV_VLC_BITS, 16, + ff_vlc_init_from_lengths(&lev[i].flags_cb, CLV_VLC_BITS, 16, clv_flags_bits[j], 1, clv_flags_syms[j], 1, 1, - 0, INIT_VLC_STATIC_OVERLONG, NULL); + 0, VLC_INIT_STATIC_OVERLONG, NULL); offset += lev[i].flags_cb.table_size; build_vlc(&lev[i + 1].bias_cb, clv_bias_len_counts[j], diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/cllc.c b/arm/raspi/third_party/ffmpeg/libavcodec/cllc.c index 52cb86e5..0c6ae13d 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/cllc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/cllc.c @@ -77,7 +77,7 @@ static int read_code_table(CLLCContext *ctx, GetBitContext *gb, VLC *vlc) } } - return ff_init_vlc_from_lengths(vlc, VLC_BITS, count, bits, 1, + return ff_vlc_init_from_lengths(vlc, VLC_BITS, count, bits, 1, symbols, 1, 1, 0, 0, ctx->avctx); } @@ -235,7 +235,7 @@ static int decode_argb_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic) ret = read_code_table(ctx, gb, &vlc[i]); if (ret < 0) { for (j = 0; j < i; j++) - ff_free_vlc(&vlc[j]); + ff_vlc_free(&vlc[j]); av_log(ctx->avctx, AV_LOG_ERROR, "Could not read code table %d.\n", i); @@ -251,7 +251,7 @@ static int decode_argb_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic) } for (i = 0; i < 4; i++) - ff_free_vlc(&vlc[i]); + ff_vlc_free(&vlc[i]); return 0; } @@ -278,7 +278,7 @@ static int decode_rgb24_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic) ret = read_code_table(ctx, gb, &vlc[i]); if (ret < 0) { for (j = 0; j < i; j++) - ff_free_vlc(&vlc[j]); + ff_vlc_free(&vlc[j]); av_log(ctx->avctx, AV_LOG_ERROR, "Could not read code table %d.\n", i); @@ -295,7 +295,7 @@ static int decode_rgb24_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic) } for (i = 0; i < 3; i++) - ff_free_vlc(&vlc[i]); + ff_vlc_free(&vlc[i]); return 0; } @@ -331,7 +331,7 @@ static int decode_yuv_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic) ret = read_code_table(ctx, gb, &vlc[i]); if (ret < 0) { for (j = 0; j < i; j++) - ff_free_vlc(&vlc[j]); + ff_vlc_free(&vlc[j]); av_log(ctx->avctx, AV_LOG_ERROR, "Could not read code table %d.\n", i); @@ -350,7 +350,7 @@ static int decode_yuv_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic) } for (i = 0; i < 2; i++) - ff_free_vlc(&vlc[i]); + ff_vlc_free(&vlc[i]); return 0; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/codec.h b/arm/raspi/third_party/ffmpeg/libavcodec/codec.h index 7a932d75..8034f1a5 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/codec.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/codec.h @@ -217,7 +217,7 @@ typedef struct AVCodec { const uint64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 #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} + const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {AV_PROFILE_UNKNOWN} /** * Group name of the codec implementation. diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/codec_desc.c b/arm/raspi/third_party/ffmpeg/libavcodec/codec_desc.c index 4406dd83..f556bb94 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/codec_desc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/codec_desc.c @@ -3413,6 +3413,13 @@ static const AVCodecDescriptor codec_descriptors[] = { .long_name = NULL_IF_CONFIG_SMALL("AC-4"), .props = AV_CODEC_PROP_LOSSY, }, + { + .id = AV_CODEC_ID_OSQ, + .type = AVMEDIA_TYPE_AUDIO, + .name = "osq", + .long_name = NULL_IF_CONFIG_SMALL("OSQ (Original Sound Quality)"), + .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS, + }, /* subtitle codecs */ { diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/codec_desc.h b/arm/raspi/third_party/ffmpeg/libavcodec/codec_desc.h index dd449111..96afd202 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/codec_desc.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/codec_desc.h @@ -60,7 +60,7 @@ typedef struct AVCodecDescriptor { const char *const *mime_types; /** * If non-NULL, an array of profiles recognized for this codec. - * Terminated with FF_PROFILE_UNKNOWN. + * Terminated with AV_PROFILE_UNKNOWN. */ const struct AVProfile *profiles; } AVCodecDescriptor; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/codec_id.h b/arm/raspi/third_party/ffmpeg/libavcodec/codec_id.h index a5a0cb85..29b410b8 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/codec_id.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/codec_id.h @@ -543,6 +543,7 @@ enum AVCodecID { AV_CODEC_ID_WAVARC, AV_CODEC_ID_RKA, AV_CODEC_ID_AC4, + AV_CODEC_ID_OSQ, /* subtitle codecs */ AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/codec_par.c b/arm/raspi/third_party/ffmpeg/libavcodec/codec_par.c index 775c1870..e4e4cd48 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/codec_par.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/codec_par.c @@ -47,8 +47,8 @@ static void codec_parameters_reset(AVCodecParameters *par) par->chroma_location = AVCHROMA_LOC_UNSPECIFIED; par->sample_aspect_ratio = (AVRational){ 0, 1 }; par->framerate = (AVRational){ 0, 1 }; - par->profile = FF_PROFILE_UNKNOWN; - par->level = FF_LEVEL_UNKNOWN; + par->profile = AV_PROFILE_UNKNOWN; + par->level = AV_LEVEL_UNKNOWN; } AVCodecParameters *avcodec_parameters_alloc(void) @@ -253,8 +253,8 @@ FF_ENABLE_DEPRECATION_WARNINGS break; } + av_freep(&codec->extradata); if (par->extradata) { - av_freep(&codec->extradata); codec->extradata = av_mallocz(par->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE); if (!codec->extradata) return AVERROR(ENOMEM); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/codec_par.h b/arm/raspi/third_party/ffmpeg/libavcodec/codec_par.h index add90fdb..c1679ea0 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/codec_par.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/codec_par.h @@ -29,21 +29,13 @@ #include "libavutil/pixfmt.h" #include "codec_id.h" +#include "defs.h" /** * @addtogroup lavc_core * @{ */ -enum AVFieldOrder { - AV_FIELD_UNKNOWN, - AV_FIELD_PROGRESSIVE, - AV_FIELD_TT, ///< Top coded_first, top displayed first - AV_FIELD_BB, ///< Bottom coded first, bottom displayed first - AV_FIELD_TB, ///< Top coded first, bottom displayed first - AV_FIELD_BT, ///< Bottom coded first, top displayed first -}; - /** * This struct describes the properties of an encoded stream. * diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/cook.c b/arm/raspi/third_party/ffmpeg/libavcodec/cook.c index 7d05afcc..705213de 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/cook.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/cook.c @@ -208,7 +208,7 @@ static av_cold int build_vlc(VLC *vlc, int nb_bits, const uint8_t counts[16], for (unsigned count = num + counts[i]; num < count; num++) lens[num] = i + 1; - return ff_init_vlc_from_lengths(vlc, nb_bits, num, lens, 1, + return ff_vlc_init_from_lengths(vlc, nb_bits, num, lens, 1, syms, symbol_size, symbol_size, offset, 0, logctx); } @@ -341,11 +341,11 @@ static av_cold int cook_decode_close(AVCodecContext *avctx) /* Free the VLC tables. */ for (i = 0; i < 13; i++) - ff_free_vlc(&q->envelope_quant_index[i]); + ff_vlc_free(&q->envelope_quant_index[i]); for (i = 0; i < 7; i++) - ff_free_vlc(&q->sqvh[i]); + ff_vlc_free(&q->sqvh[i]); for (i = 0; i < q->num_subpackets; i++) - ff_free_vlc(&q->subpacket[i].channel_coupling); + ff_vlc_free(&q->subpacket[i].channel_coupling); av_log(avctx, AV_LOG_DEBUG, "Memory deallocated.\n"); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/cscd.c b/arm/raspi/third_party/ffmpeg/libavcodec/cscd.c index 23dd2df9..685cf18c 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/cscd.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/cscd.c @@ -70,6 +70,9 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, int buf_size = avpkt->size; CamStudioContext *c = avctx->priv_data; int ret; + int bpp = avctx->bits_per_coded_sample / 8; + int bugdelta = FFALIGN(avctx->width * bpp, 4) * avctx->height + - (avctx->width & ~3) * bpp * avctx->height; if (buf_size < 2) { av_log(avctx, AV_LOG_ERROR, "coded frame too small\n"); @@ -83,7 +86,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, switch ((buf[0] >> 1) & 7) { case 0: { // lzo compression int outlen = c->decomp_size, inlen = buf_size - 2; - if (av_lzo1x_decode(c->decomp_buf, &outlen, &buf[2], &inlen) || outlen) { + if (av_lzo1x_decode(c->decomp_buf, &outlen, &buf[2], &inlen) || (outlen && outlen != bugdelta)) { av_log(avctx, AV_LOG_ERROR, "error during lzo decompression\n"); return AVERROR_INVALIDDATA; } @@ -92,7 +95,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, case 1: { // zlib compression #if CONFIG_ZLIB unsigned long dlen = c->decomp_size; - if (uncompress(c->decomp_buf, &dlen, &buf[2], buf_size - 2) != Z_OK || dlen != c->decomp_size) { + if (uncompress(c->decomp_buf, &dlen, &buf[2], buf_size - 2) != Z_OK || (dlen != c->decomp_size && dlen != c->decomp_size - bugdelta)) { av_log(avctx, AV_LOG_ERROR, "error during zlib decompression\n"); return AVERROR_INVALIDDATA; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/cuviddec.c b/arm/raspi/third_party/ffmpeg/libavcodec/cuviddec.c index 814bc53f..da37207c 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/cuviddec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/cuviddec.c @@ -360,6 +360,11 @@ static int CUDAAPI cuvid_handle_video_sequence(void *opaque, CUVIDEOFORMAT* form } } + if(ctx->cuparseinfo.ulMaxNumDecodeSurfaces != cuinfo.ulNumDecodeSurfaces) { + ctx->cuparseinfo.ulMaxNumDecodeSurfaces = cuinfo.ulNumDecodeSurfaces; + return cuinfo.ulNumDecodeSurfaces; + } + return 1; } @@ -1022,7 +1027,7 @@ static av_cold int cuvid_decode_init(AVCodecContext *avctx) goto error; } - ctx->cuparseinfo.ulMaxNumDecodeSurfaces = ctx->nb_surfaces; + ctx->cuparseinfo.ulMaxNumDecodeSurfaces = 1; ctx->cuparseinfo.ulMaxDisplayDelay = (avctx->flags & AV_CODEC_FLAG_LOW_DELAY) ? 0 : CUVID_MAX_DISPLAY_DELAY; ctx->cuparseinfo.pUserData = avctx; ctx->cuparseinfo.pfnSequenceCallback = cuvid_handle_video_sequence; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/dca_core.c b/arm/raspi/third_party/ffmpeg/libavcodec/dca_core.c index c50d005a..60508fab 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/dca_core.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/dca_core.c @@ -19,6 +19,7 @@ */ #include "libavutil/channel_layout.h" +#include "libavutil/emms.h" #include "dcaadpcm.h" #include "dcadec.h" #include "dcadata.h" @@ -2386,13 +2387,13 @@ int ff_dca_core_filter_frame(DCACoreDecoder *s, AVFrame *frame) // Set profile, bit rate, etc if (s->ext_audio_mask & DCA_EXSS_MASK) - avctx->profile = FF_PROFILE_DTS_HD_HRA; + avctx->profile = AV_PROFILE_DTS_HD_HRA; else if (s->ext_audio_mask & (DCA_CSS_XXCH | DCA_CSS_XCH)) - avctx->profile = FF_PROFILE_DTS_ES; + avctx->profile = AV_PROFILE_DTS_ES; else if (s->ext_audio_mask & DCA_CSS_X96) - avctx->profile = FF_PROFILE_DTS_96_24; + avctx->profile = AV_PROFILE_DTS_96_24; else - avctx->profile = FF_PROFILE_DTS; + avctx->profile = AV_PROFILE_DTS; if (s->bit_rate > 3 && !(s->ext_audio_mask & DCA_EXSS_MASK)) avctx->bit_rate = s->bit_rate; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/dca_lbr.c b/arm/raspi/third_party/ffmpeg/libavcodec/dca_lbr.c index bef0054d..c9c5c0f8 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/dca_lbr.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/dca_lbr.c @@ -1744,7 +1744,7 @@ int ff_dca_lbr_filter_frame(DCALbrDecoder *s, AVFrame *frame) avctx->sample_rate = s->sample_rate; avctx->sample_fmt = AV_SAMPLE_FMT_FLTP; avctx->bits_per_raw_sample = 0; - avctx->profile = FF_PROFILE_DTS_EXPRESS; + avctx->profile = AV_PROFILE_DTS_EXPRESS; avctx->bit_rate = s->bit_rate_scaled; if (s->flags & LBR_FLAG_LFE_PRESENT) { diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/dca_parser.c b/arm/raspi/third_party/ffmpeg/libavcodec/dca_parser.c index 3148397b..eb0ef55d 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/dca_parser.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/dca_parser.c @@ -228,7 +228,7 @@ static int dca_parse_params(DCAParseContext *pc1, const uint8_t *buf, *sample_rate = ff_dca_sampling_freqs[pc1->sr_code]; *duration = 1024 << ff_dca_freq_ranges[pc1->sr_code]; - *profile = FF_PROFILE_DTS_EXPRESS; + *profile = AV_PROFILE_DTS_EXPRESS; return 0; } @@ -253,7 +253,7 @@ static int dca_parse_params(DCAParseContext *pc1, const uint8_t *buf, *sample_rate = asset->max_sample_rate; *duration = (1 + (*sample_rate > 96000)) << nsamples_log2; - *profile = FF_PROFILE_DTS_HD_MA; + *profile = AV_PROFILE_DTS_HD_MA; return 0; } @@ -268,18 +268,18 @@ static int dca_parse_params(DCAParseContext *pc1, const uint8_t *buf, *duration = h.npcmblocks * DCA_PCMBLOCK_SAMPLES; *sample_rate = ff_dca_sample_rates[h.sr_code]; - if (*profile != FF_PROFILE_UNKNOWN) + if (*profile != AV_PROFILE_UNKNOWN) return 0; - *profile = FF_PROFILE_DTS; + *profile = AV_PROFILE_DTS; if (h.ext_audio_present) { switch (h.ext_audio_type) { case DCA_EXT_AUDIO_XCH: case DCA_EXT_AUDIO_XXCH: - *profile = FF_PROFILE_DTS_ES; + *profile = AV_PROFILE_DTS_ES; break; case DCA_EXT_AUDIO_X96: - *profile = FF_PROFILE_DTS_96_24; + *profile = AV_PROFILE_DTS_96_24; break; } } @@ -296,9 +296,9 @@ static int dca_parse_params(DCAParseContext *pc1, const uint8_t *buf, return 0; if (asset->extension_mask & DCA_EXSS_XLL) - *profile = FF_PROFILE_DTS_HD_MA; + *profile = AV_PROFILE_DTS_HD_MA; else if (asset->extension_mask & (DCA_EXSS_XBR | DCA_EXSS_XXCH | DCA_EXSS_X96)) - *profile = FF_PROFILE_DTS_HD_HRA; + *profile = AV_PROFILE_DTS_HD_HRA; return 0; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/dca_xll.c b/arm/raspi/third_party/ffmpeg/libavcodec/dca_xll.c index b8cf37a3..15f9bd91 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/dca_xll.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/dca_xll.c @@ -1446,11 +1446,11 @@ int ff_dca_xll_filter_frame(DCAXllDecoder *s, AVFrame *frame) } if (s->x_imax_syncword_present) { - avctx->profile = FF_PROFILE_DTS_HD_MA_X_IMAX; + avctx->profile = AV_PROFILE_DTS_HD_MA_X_IMAX; } else if (s->x_syncword_present) { - avctx->profile = FF_PROFILE_DTS_HD_MA_X; + avctx->profile = AV_PROFILE_DTS_HD_MA_X; } else { - avctx->profile = FF_PROFILE_DTS_HD_MA; + avctx->profile = AV_PROFILE_DTS_HD_MA; } avctx->bits_per_raw_sample = p->storage_bit_res; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/dcadec.c b/arm/raspi/third_party/ffmpeg/libavcodec/dcadec.c index 3e3e3053..1fee49cf 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/dcadec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/dcadec.c @@ -217,11 +217,10 @@ static int dcadec_decode_frame(AVCodecContext *avctx, AVFrame *frame, if (asset && (asset->extension_mask & DCA_EXSS_XLL)) { if ((ret = ff_dca_xll_parse(&s->xll, input, asset)) < 0) { // Conceal XLL synchronization error - if (ret == AVERROR(EAGAIN) - && (prev_packet & DCA_PACKET_XLL) - && (s->packet & DCA_PACKET_CORE)) - s->packet |= DCA_PACKET_XLL | DCA_PACKET_RECOVERY; - else if (ret == AVERROR(ENOMEM) || (avctx->err_recognition & AV_EF_EXPLODE)) + if (ret == AVERROR(EAGAIN)) { + if ((prev_packet & DCA_PACKET_XLL) && (s->packet & DCA_PACKET_CORE)) + s->packet |= DCA_PACKET_XLL | DCA_PACKET_RECOVERY; + } else if (ret == AVERROR(ENOMEM) || (avctx->err_recognition & AV_EF_EXPLODE)) return ret; } else { s->packet |= DCA_PACKET_XLL; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/dcahuff.c b/arm/raspi/third_party/ffmpeg/libavcodec/dcahuff.c index af3a6e53..7c4b1d82 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/dcahuff.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/dcahuff.c @@ -796,9 +796,9 @@ av_cold void ff_dca_init_vlcs(void) do { \ vlc.table = &dca_table[offset]; \ vlc.table_allocated = FF_ARRAY_ELEMS(dca_table) - offset; \ - ff_init_vlc_from_lengths(&vlc, nb_bits, nb_codes, &src_table[0][1], 2, \ + ff_vlc_init_from_lengths(&vlc, nb_bits, nb_codes, &src_table[0][1], 2, \ &src_table[0][0], 2, 1, entry_offset, \ - INIT_VLC_STATIC_OVERLONG, NULL); \ + VLC_INIT_STATIC_OVERLONG, NULL); \ offset += vlc.table_size; \ src_table += nb_codes; \ } while (0) @@ -822,9 +822,9 @@ av_cold void ff_dca_init_vlcs(void) do { \ vlc.table = &dca_table[offset]; \ vlc.table_allocated = FF_ARRAY_ELEMS(dca_table) - offset; \ - ff_init_vlc_from_lengths(&vlc, nb_bits, nb_codes, &src_table[0][1], 2, \ + ff_vlc_init_from_lengths(&vlc, nb_bits, nb_codes, &src_table[0][1], 2, \ &src_table[0][0], 2, 1, entry_offset, \ - INIT_VLC_STATIC_OVERLONG | INIT_VLC_LE,\ + VLC_INIT_STATIC_OVERLONG | VLC_INIT_LE,\ NULL); \ offset += vlc.table_size; \ src_table += nb_codes; \ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/dct.h b/arm/raspi/third_party/ffmpeg/libavcodec/dct.h index 0a03e256..17c881a6 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/dct.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/dct.h @@ -21,44 +21,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(AVCODEC_DCT_H) && (!defined(FFT_FLOAT) || FFT_FLOAT) +#ifndef AVCODEC_DCT_H #define AVCODEC_DCT_H #include #include -#include "rdft.h" - -struct DCTContext { - int nbits; - int inverse; - RDFTContext rdft; - const float *costab; - FFTSample *csc2; - void (*dct_calc)(struct DCTContext *s, FFTSample *data); - void (*dct32)(FFTSample *out, const FFTSample *in); -}; - -/** - * Set up DCT. - * @param nbits size of the input array: - * (1 << nbits) for DCT-II, DCT-III and DST-I - * (1 << nbits) + 1 for DCT-I - * - * @note the first element of the input of DST-I is ignored - */ -int ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType type); -void ff_dct_end (DCTContext *s); - -void ff_dct_init_x86(DCTContext *s); - -void ff_fdct_ifast(int16_t *data); -void ff_fdct_ifast248(int16_t *data); -void ff_jpeg_fdct_islow_8(int16_t *data); -void ff_jpeg_fdct_islow_10(int16_t *data); -void ff_fdct248_islow_8(int16_t *data); -void ff_fdct248_islow_10(int16_t *data); - void ff_j_rev_dct(int16_t *data); void ff_j_rev_dct4(int16_t *data); void ff_j_rev_dct2(int16_t *data); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/decode.c b/arm/raspi/third_party/ffmpeg/libavcodec/decode.c index f0e6acc0..8f94678e 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/decode.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/decode.c @@ -32,6 +32,7 @@ #include "libavutil/bprint.h" #include "libavutil/channel_layout.h" #include "libavutil/common.h" +#include "libavutil/emms.h" #include "libavutil/fifo.h" #include "libavutil/frame.h" #include "libavutil/hwcontext.h" @@ -44,8 +45,10 @@ #include "avcodec_internal.h" #include "bytestream.h" #include "bsf.h" +#include "codec_desc.h" #include "codec_internal.h" #include "decode.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "internal.h" #include "packet_internal.h" @@ -104,15 +107,26 @@ FF_DISABLE_DEPRECATION_WARNINGS ret = AVERROR_INVALIDDATA; goto fail2; } - avctx->channels = val; + av_channel_layout_uninit(&avctx->ch_layout); + avctx->ch_layout.nb_channels = val; + avctx->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; size -= 4; } if (flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) { if (size < 8) goto fail; - avctx->channel_layout = bytestream_get_le64(&data); + av_channel_layout_uninit(&avctx->ch_layout); + ret = av_channel_layout_from_mask(&avctx->ch_layout, bytestream_get_le64(&data)); + if (ret < 0) + goto fail2; size -= 8; } + if (flags & (AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT | + AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT)) { + avctx->channels = avctx->ch_layout.nb_channels; + avctx->channel_layout = (avctx->ch_layout.order == AV_CHANNEL_ORDER_NATIVE) ? + avctx->ch_layout.u.mask : 0; + } FF_ENABLE_DEPRECATION_WARNINGS #endif if (flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) { @@ -444,6 +458,9 @@ FF_ENABLE_DEPRECATION_WARNINGS if (ret == AVERROR(EAGAIN)) av_frame_unref(frame); + // FF_CODEC_CB_TYPE_DECODE decoders must not return AVERROR EAGAIN + // code later will add AVERROR(EAGAIN) to a pointer + av_assert0(consumed != AVERROR(EAGAIN)); if (consumed < 0) ret = consumed; if (consumed >= 0 && avctx->codec->type == AVMEDIA_TYPE_VIDEO) @@ -520,7 +537,9 @@ static int detect_colorspace(AVCodecContext *avctx, AVFrame *frame) if (!profile) return AVERROR_INVALIDDATA; - ret = ff_icc_profile_read_primaries(&avci->icc, profile, &coeffs); + ret = ff_icc_profile_sanitize(&avci->icc, profile); + if (!ret) + ret = ff_icc_profile_read_primaries(&avci->icc, profile, &coeffs); if (!ret) ret = ff_icc_profile_detect_transfer(&avci->icc, profile, &trc); cmsCloseProfile(profile); @@ -1148,7 +1167,7 @@ int avcodec_get_hw_frames_parameters(AVCodecContext *avctx, { AVBufferRef *frames_ref = NULL; const AVCodecHWConfigInternal *hw_config; - const AVHWAccel *hwa; + const FFHWAccel *hwa; int i, ret; for (i = 0;; i++) { @@ -1200,14 +1219,14 @@ int avcodec_get_hw_frames_parameters(AVCodecContext *avctx, } static int hwaccel_init(AVCodecContext *avctx, - const AVHWAccel *hwaccel) + const FFHWAccel *hwaccel) { int err; - if (hwaccel->capabilities & AV_HWACCEL_CODEC_CAP_EXPERIMENTAL && + if (hwaccel->p.capabilities & AV_HWACCEL_CODEC_CAP_EXPERIMENTAL && avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) { av_log(avctx, AV_LOG_WARNING, "Ignoring experimental hwaccel: %s\n", - hwaccel->name); + hwaccel->p.name); return AVERROR_PATCHWELCOME; } @@ -1218,13 +1237,13 @@ static int hwaccel_init(AVCodecContext *avctx, return AVERROR(ENOMEM); } - avctx->hwaccel = hwaccel; + avctx->hwaccel = &hwaccel->p; if (hwaccel->init) { err = hwaccel->init(avctx); if (err < 0) { av_log(avctx, AV_LOG_ERROR, "Failed setup for format %s: " "hwaccel initialisation returned error.\n", - av_get_pix_fmt_name(hwaccel->pix_fmt)); + av_get_pix_fmt_name(hwaccel->p.pix_fmt)); av_freep(&avctx->internal->hwaccel_priv_data); avctx->hwaccel = NULL; return err; @@ -1236,8 +1255,8 @@ static int hwaccel_init(AVCodecContext *avctx, void ff_hwaccel_uninit(AVCodecContext *avctx) { - if (avctx->hwaccel && avctx->hwaccel->uninit) - avctx->hwaccel->uninit(avctx); + if (FF_HW_HAS_CB(avctx, uninit)) + FF_HW_SIMPLE_CALL(avctx, uninit); av_freep(&avctx->internal->hwaccel_priv_data); @@ -1460,10 +1479,11 @@ FF_ENABLE_DEPRECATION_WARNINGS int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame) { - const AVPacket *pkt = avctx->internal->last_pkt_props; int ret; if (!(ffcodec(avctx->codec)->caps_internal & FF_CODEC_CAP_SETS_FRAME_PROPS)) { + const AVPacket *pkt = avctx->internal->last_pkt_props; + ret = ff_decode_frame_props_from_pkt(avctx, frame, pkt); if (ret < 0) return ret; @@ -1558,7 +1578,7 @@ int ff_attach_decode_data(AVFrame *frame) int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags) { - const AVHWAccel *hwaccel = avctx->hwaccel; + const FFHWAccel *hwaccel = ffhwaccel(avctx->hwaccel); int override_dimensions = 1; int ret; @@ -1777,24 +1797,36 @@ int ff_copy_palette(void *dst, const AVPacket *src, void *logctx) return 0; } -AVBufferRef *ff_hwaccel_frame_priv_alloc(AVCodecContext *avctx, - const AVHWAccel *hwaccel) +int ff_hwaccel_frame_priv_alloc(AVCodecContext *avctx, void **hwaccel_picture_private, + AVBufferRef **hwaccel_priv_buf) { + const FFHWAccel *hwaccel = ffhwaccel(avctx->hwaccel); AVBufferRef *ref; - AVHWFramesContext *frames_ctx = (AVHWFramesContext *)avctx->hw_frames_ctx->data; - uint8_t *data = av_mallocz(hwaccel->frame_priv_data_size); + AVHWFramesContext *frames_ctx; + uint8_t *data; + + if (!hwaccel || !hwaccel->frame_priv_data_size) + return 0; + + av_assert0(!*hwaccel_picture_private); + data = av_mallocz(hwaccel->frame_priv_data_size); if (!data) - return NULL; + return AVERROR(ENOMEM); + + frames_ctx = (AVHWFramesContext *)avctx->hw_frames_ctx->data; ref = av_buffer_create(data, hwaccel->frame_priv_data_size, hwaccel->free_frame_priv, frames_ctx->device_ctx, 0); if (!ref) { av_free(data); - return NULL; + return AVERROR(ENOMEM); } - return ref; + *hwaccel_priv_buf = ref; + *hwaccel_picture_private = ref->data; + + return 0; } void ff_decode_flush_buffers(AVCodecContext *avctx) diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/decode.h b/arm/raspi/third_party/ffmpeg/libavcodec/decode.h index 2b9fe599..a52152e4 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/decode.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/decode.h @@ -140,14 +140,17 @@ int ff_side_data_update_matrix_encoding(AVFrame *frame, enum AVMatrixEncoding matrix_encoding); /** - * Allocate a hwaccel frame private data and create an AVBufferRef - * from it. + * Allocate a hwaccel frame private data if the provided avctx + * uses a hwaccel method that needs it. The private data will + * be refcounted via the AVBuffer API (if allocated). * - * @param avctx The codec context which to attach as an opaque value - * @param hwaccel The hwaccel for which to allocate - * @return The allocated buffer + * @param avctx The codec context + * @param hwaccel_picture_private Pointer to return hwaccel_picture_private + * @param hwaccel_priv_buf Pointer to return the AVBufferRef owning + * hwaccel_picture_private + * @return 0 on success, < 0 on error */ -AVBufferRef *ff_hwaccel_frame_priv_alloc(AVCodecContext *avctx, - const AVHWAccel *hwaccel); +int ff_hwaccel_frame_priv_alloc(AVCodecContext *avctx, void **hwaccel_picture_private, + AVBufferRef **hwaccel_priv_buf); #endif /* AVCODEC_DECODE_H */ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/defs.h b/arm/raspi/third_party/ffmpeg/libavcodec/defs.h index fbe3254d..00d840ec 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/defs.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/defs.h @@ -61,6 +61,149 @@ #define FF_COMPLIANCE_UNOFFICIAL -1 ///< Allow unofficial extensions #define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things. + +#define AV_PROFILE_UNKNOWN -99 +#define AV_PROFILE_RESERVED -100 + +#define AV_PROFILE_AAC_MAIN 0 +#define AV_PROFILE_AAC_LOW 1 +#define AV_PROFILE_AAC_SSR 2 +#define AV_PROFILE_AAC_LTP 3 +#define AV_PROFILE_AAC_HE 4 +#define AV_PROFILE_AAC_HE_V2 28 +#define AV_PROFILE_AAC_LD 22 +#define AV_PROFILE_AAC_ELD 38 +#define AV_PROFILE_MPEG2_AAC_LOW 128 +#define AV_PROFILE_MPEG2_AAC_HE 131 + +#define AV_PROFILE_DNXHD 0 +#define AV_PROFILE_DNXHR_LB 1 +#define AV_PROFILE_DNXHR_SQ 2 +#define AV_PROFILE_DNXHR_HQ 3 +#define AV_PROFILE_DNXHR_HQX 4 +#define AV_PROFILE_DNXHR_444 5 + +#define AV_PROFILE_DTS 20 +#define AV_PROFILE_DTS_ES 30 +#define AV_PROFILE_DTS_96_24 40 +#define AV_PROFILE_DTS_HD_HRA 50 +#define AV_PROFILE_DTS_HD_MA 60 +#define AV_PROFILE_DTS_EXPRESS 70 +#define AV_PROFILE_DTS_HD_MA_X 61 +#define AV_PROFILE_DTS_HD_MA_X_IMAX 62 + +#define AV_PROFILE_EAC3_DDP_ATMOS 30 + +#define AV_PROFILE_TRUEHD_ATMOS 30 + +#define AV_PROFILE_MPEG2_422 0 +#define AV_PROFILE_MPEG2_HIGH 1 +#define AV_PROFILE_MPEG2_SS 2 +#define AV_PROFILE_MPEG2_SNR_SCALABLE 3 +#define AV_PROFILE_MPEG2_MAIN 4 +#define AV_PROFILE_MPEG2_SIMPLE 5 + +#define AV_PROFILE_H264_CONSTRAINED (1<<9) // 8+1; constraint_set1_flag +#define AV_PROFILE_H264_INTRA (1<<11) // 8+3; constraint_set3_flag + +#define AV_PROFILE_H264_BASELINE 66 +#define AV_PROFILE_H264_CONSTRAINED_BASELINE (66|AV_PROFILE_H264_CONSTRAINED) +#define AV_PROFILE_H264_MAIN 77 +#define AV_PROFILE_H264_EXTENDED 88 +#define AV_PROFILE_H264_HIGH 100 +#define AV_PROFILE_H264_HIGH_10 110 +#define AV_PROFILE_H264_HIGH_10_INTRA (110|AV_PROFILE_H264_INTRA) +#define AV_PROFILE_H264_MULTIVIEW_HIGH 118 +#define AV_PROFILE_H264_HIGH_422 122 +#define AV_PROFILE_H264_HIGH_422_INTRA (122|AV_PROFILE_H264_INTRA) +#define AV_PROFILE_H264_STEREO_HIGH 128 +#define AV_PROFILE_H264_HIGH_444 144 +#define AV_PROFILE_H264_HIGH_444_PREDICTIVE 244 +#define AV_PROFILE_H264_HIGH_444_INTRA (244|AV_PROFILE_H264_INTRA) +#define AV_PROFILE_H264_CAVLC_444 44 + +#define AV_PROFILE_VC1_SIMPLE 0 +#define AV_PROFILE_VC1_MAIN 1 +#define AV_PROFILE_VC1_COMPLEX 2 +#define AV_PROFILE_VC1_ADVANCED 3 + +#define AV_PROFILE_MPEG4_SIMPLE 0 +#define AV_PROFILE_MPEG4_SIMPLE_SCALABLE 1 +#define AV_PROFILE_MPEG4_CORE 2 +#define AV_PROFILE_MPEG4_MAIN 3 +#define AV_PROFILE_MPEG4_N_BIT 4 +#define AV_PROFILE_MPEG4_SCALABLE_TEXTURE 5 +#define AV_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION 6 +#define AV_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE 7 +#define AV_PROFILE_MPEG4_HYBRID 8 +#define AV_PROFILE_MPEG4_ADVANCED_REAL_TIME 9 +#define AV_PROFILE_MPEG4_CORE_SCALABLE 10 +#define AV_PROFILE_MPEG4_ADVANCED_CODING 11 +#define AV_PROFILE_MPEG4_ADVANCED_CORE 12 +#define AV_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13 +#define AV_PROFILE_MPEG4_SIMPLE_STUDIO 14 +#define AV_PROFILE_MPEG4_ADVANCED_SIMPLE 15 + +#define AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 1 +#define AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 2 +#define AV_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION 32768 +#define AV_PROFILE_JPEG2000_DCINEMA_2K 3 +#define AV_PROFILE_JPEG2000_DCINEMA_4K 4 + +#define AV_PROFILE_VP9_0 0 +#define AV_PROFILE_VP9_1 1 +#define AV_PROFILE_VP9_2 2 +#define AV_PROFILE_VP9_3 3 + +#define AV_PROFILE_HEVC_MAIN 1 +#define AV_PROFILE_HEVC_MAIN_10 2 +#define AV_PROFILE_HEVC_MAIN_STILL_PICTURE 3 +#define AV_PROFILE_HEVC_REXT 4 +#define AV_PROFILE_HEVC_SCC 9 + +#define AV_PROFILE_VVC_MAIN_10 1 +#define AV_PROFILE_VVC_MAIN_10_444 33 + +#define AV_PROFILE_AV1_MAIN 0 +#define AV_PROFILE_AV1_HIGH 1 +#define AV_PROFILE_AV1_PROFESSIONAL 2 + +#define AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT 0xc0 +#define AV_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT 0xc1 +#define AV_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT 0xc2 +#define AV_PROFILE_MJPEG_HUFFMAN_LOSSLESS 0xc3 +#define AV_PROFILE_MJPEG_JPEG_LS 0xf7 + +#define AV_PROFILE_SBC_MSBC 1 + +#define AV_PROFILE_PRORES_PROXY 0 +#define AV_PROFILE_PRORES_LT 1 +#define AV_PROFILE_PRORES_STANDARD 2 +#define AV_PROFILE_PRORES_HQ 3 +#define AV_PROFILE_PRORES_4444 4 +#define AV_PROFILE_PRORES_XQ 5 + +#define AV_PROFILE_ARIB_PROFILE_A 0 +#define AV_PROFILE_ARIB_PROFILE_C 1 + +#define AV_PROFILE_KLVA_SYNC 0 +#define AV_PROFILE_KLVA_ASYNC 1 + +#define AV_PROFILE_EVC_BASELINE 0 +#define AV_PROFILE_EVC_MAIN 1 + + +#define AV_LEVEL_UNKNOWN -99 + +enum AVFieldOrder { + AV_FIELD_UNKNOWN, + AV_FIELD_PROGRESSIVE, + AV_FIELD_TT, ///< Top coded_first, top displayed first + AV_FIELD_BB, ///< Bottom coded first, bottom displayed first + AV_FIELD_TB, ///< Top coded first, bottom displayed first + AV_FIELD_BT, ///< Bottom coded first, top displayed first +}; + /** * @ingroup lavc_decoding */ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/dirac.c b/arm/raspi/third_party/ffmpeg/libavcodec/dirac.c index bc51a2fb..47363049 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/dirac.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/dirac.c @@ -26,9 +26,12 @@ * @author Marco Gerards , David Conrad, Jordi Ortiz */ +#include "config.h" + #include "libavutil/pixdesc.h" #include "dirac.h" +#include "get_bits.h" #include "golomb.h" #include "mpeg12data.h" diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/dirac.h b/arm/raspi/third_party/ffmpeg/libavcodec/dirac.h index e6d9d346..8c348cdc 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/dirac.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/dirac.h @@ -31,7 +31,11 @@ * @author Jordi Ortiz */ -#include "avcodec.h" +#include +#include + +#include "libavutil/pixfmt.h" +#include "libavutil/rational.h" /** * The spec limits the number of wavelet decompositions to 4 for both diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/dirac_dwt.c b/arm/raspi/third_party/ffmpeg/libavcodec/dirac_dwt.c index 4039899c..d473f64d 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/dirac_dwt.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/dirac_dwt.c @@ -21,6 +21,7 @@ #include "libavutil/attributes.h" #include "libavutil/common.h" +#include "libavutil/log.h" #include "dirac_dwt.h" #define TEMPLATE_8bit diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/dnxhddata.c b/arm/raspi/third_party/ffmpeg/libavcodec/dnxhddata.c index d52abe87..ce06d77f 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/dnxhddata.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/dnxhddata.c @@ -22,7 +22,7 @@ #include #include "libavutil/log.h" #include "libavutil/macros.h" -#include "avcodec.h" +#include "defs.h" #include "dnxhddata.h" /* The quantization tables below are in zigzag order! */ @@ -1110,15 +1110,15 @@ int ff_dnxhd_get_hr_frame_size(int cid, int w, int h) static int dnxhd_find_hr_cid(AVCodecContext *avctx) { switch (avctx->profile) { - case FF_PROFILE_DNXHR_444: + case AV_PROFILE_DNXHR_444: return 1270; - case FF_PROFILE_DNXHR_HQX: + case AV_PROFILE_DNXHR_HQX: return 1271; - case FF_PROFILE_DNXHR_HQ: + case AV_PROFILE_DNXHR_HQ: return 1272; - case FF_PROFILE_DNXHR_SQ: + case AV_PROFILE_DNXHR_SQ: return 1273; - case FF_PROFILE_DNXHR_LB: + case AV_PROFILE_DNXHR_LB: return 1274; } return 0; @@ -1129,7 +1129,7 @@ int ff_dnxhd_find_cid(AVCodecContext *avctx, int bit_depth) int i, j; int mbs = avctx->bit_rate / 1000000; - if (avctx->profile != FF_PROFILE_DNXHD) + if (avctx->profile != AV_PROFILE_DNXHD) return dnxhd_find_hr_cid(avctx); if (!mbs) diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/dnxhddec.c b/arm/raspi/third_party/ffmpeg/libavcodec/dnxhddec.c index 84bd0e61..d96b82c0 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/dnxhddec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/dnxhddec.c @@ -130,21 +130,22 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, uint32_t cid, int bitdepth) ctx->cid_table = cid_table; av_log(ctx->avctx, AV_LOG_VERBOSE, "Profile cid %"PRIu32".\n", cid); - ff_free_vlc(&ctx->ac_vlc); - ff_free_vlc(&ctx->dc_vlc); - ff_free_vlc(&ctx->run_vlc); + ff_vlc_free(&ctx->ac_vlc); + ff_vlc_free(&ctx->dc_vlc); + ff_vlc_free(&ctx->run_vlc); - if ((ret = init_vlc(&ctx->ac_vlc, DNXHD_VLC_BITS, 257, + if ((ret = vlc_init(&ctx->ac_vlc, DNXHD_VLC_BITS, 257, ctx->cid_table->ac_bits, 1, 1, ctx->cid_table->ac_codes, 2, 2, 0)) < 0) goto out; - if ((ret = init_vlc(&ctx->dc_vlc, DNXHD_DC_VLC_BITS, bitdepth > 8 ? 14 : 12, + if ((ret = vlc_init(&ctx->dc_vlc, DNXHD_DC_VLC_BITS, bitdepth > 8 ? 14 : 12, ctx->cid_table->dc_bits, 1, 1, ctx->cid_table->dc_codes, 1, 1, 0)) < 0) goto out; - if ((ret = init_vlc(&ctx->run_vlc, DNXHD_VLC_BITS, 62, + if ((ret = ff_vlc_init_sparse(&ctx->run_vlc, DNXHD_VLC_BITS, 62, ctx->cid_table->run_bits, 1, 1, - ctx->cid_table->run_codes, 2, 2, 0)) < 0) + ctx->cid_table->run_codes, 2, 2, + ctx->cid_table->run, 1, 1, 0)) < 0) goto out; ctx->cid = cid; @@ -152,7 +153,7 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, uint32_t cid, int bitdepth) ret = 0; out: if (ret < 0) - av_log(ctx->avctx, AV_LOG_ERROR, "init_vlc failed\n"); + av_log(ctx->avctx, AV_LOG_ERROR, "vlc_init failed\n"); return ret; } @@ -160,17 +161,17 @@ static int dnxhd_get_profile(int cid) { switch(cid) { case 1270: - return FF_PROFILE_DNXHR_444; + return AV_PROFILE_DNXHR_444; case 1271: - return FF_PROFILE_DNXHR_HQX; + return AV_PROFILE_DNXHR_HQX; case 1272: - return FF_PROFILE_DNXHR_HQ; + return AV_PROFILE_DNXHR_HQ; case 1273: - return FF_PROFILE_DNXHR_SQ; + return AV_PROFILE_DNXHR_SQ; case 1274: - return FF_PROFILE_DNXHR_LB; + return AV_PROFILE_DNXHR_LB; } - return FF_PROFILE_DNXHD; + return AV_PROFILE_DNXHD; } static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, @@ -262,7 +263,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, ctx->decode_dct_block = dnxhd_decode_dct_block_12; ctx->pix_fmt = AV_PIX_FMT_YUV422P12; } else if (bitdepth == 10) { - if (ctx->avctx->profile == FF_PROFILE_DNXHR_HQX) + if (ctx->avctx->profile == AV_PROFILE_DNXHR_HQX) ctx->decode_dct_block = dnxhd_decode_dct_block_10_444; else ctx->decode_dct_block = dnxhd_decode_dct_block_10; @@ -358,7 +359,7 @@ static av_always_inline int dnxhd_decode_dct_block(const DNXHDContext *ctx, int level_shift, int dc_shift) { - int i, j, index1, index2, len, flags; + int i, j, index1, len, flags; int level, component, sign; const int *scale; const uint8_t *weight_matrix; @@ -425,10 +426,11 @@ static av_always_inline int dnxhd_decode_dct_block(const DNXHDContext *ctx, } if (flags & 2) { + int run; UPDATE_CACHE(bs, &row->gb); - GET_VLC(index2, bs, &row->gb, ctx->run_vlc.table, + GET_VLC(run, bs, &row->gb, ctx->run_vlc.table, DNXHD_VLC_BITS, 2); - i += ctx->cid_table->run[index2]; + i += run; } if (++i > 63) { @@ -716,9 +718,9 @@ static av_cold int dnxhd_decode_close(AVCodecContext *avctx) { DNXHDContext *ctx = avctx->priv_data; - ff_free_vlc(&ctx->ac_vlc); - ff_free_vlc(&ctx->dc_vlc); - ff_free_vlc(&ctx->run_vlc); + ff_vlc_free(&ctx->ac_vlc); + ff_vlc_free(&ctx->dc_vlc); + ff_vlc_free(&ctx->run_vlc); av_freep(&ctx->rows); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/dnxhdenc.c b/arm/raspi/third_party/ffmpeg/libavcodec/dnxhdenc.c index a1852fa6..f52a2e99 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/dnxhdenc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/dnxhdenc.c @@ -54,19 +54,19 @@ static const AVOption options[] = { offsetof(DNXHDEncContext, intra_quant_bias), AV_OPT_TYPE_INT, { .i64 = 0 }, INT_MIN, INT_MAX, VE }, { "profile", NULL, offsetof(DNXHDEncContext, profile), AV_OPT_TYPE_INT, - { .i64 = FF_PROFILE_DNXHD }, - FF_PROFILE_DNXHD, FF_PROFILE_DNXHR_444, VE, "profile" }, - { "dnxhd", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_DNXHD }, + { .i64 = AV_PROFILE_DNXHD }, + AV_PROFILE_DNXHD, AV_PROFILE_DNXHR_444, VE, "profile" }, + { "dnxhd", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_DNXHD }, 0, 0, VE, "profile" }, - { "dnxhr_444", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_DNXHR_444 }, + { "dnxhr_444", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_DNXHR_444 }, 0, 0, VE, "profile" }, - { "dnxhr_hqx", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_DNXHR_HQX }, + { "dnxhr_hqx", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_DNXHR_HQX }, 0, 0, VE, "profile" }, - { "dnxhr_hq", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_DNXHR_HQ }, + { "dnxhr_hq", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_DNXHR_HQ }, 0, 0, VE, "profile" }, - { "dnxhr_sq", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_DNXHR_SQ }, + { "dnxhr_sq", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_DNXHR_SQ }, 0, 0, VE, "profile" }, - { "dnxhr_lb", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_DNXHR_LB }, + { "dnxhr_lb", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_DNXHR_LB }, 0, 0, VE, "profile" }, { NULL } }; @@ -367,30 +367,30 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx) break; } - if ((ctx->profile == FF_PROFILE_DNXHR_444 && (avctx->pix_fmt != AV_PIX_FMT_YUV444P10 && + if ((ctx->profile == AV_PROFILE_DNXHR_444 && (avctx->pix_fmt != AV_PIX_FMT_YUV444P10 && avctx->pix_fmt != AV_PIX_FMT_GBRP10)) || - (ctx->profile != FF_PROFILE_DNXHR_444 && (avctx->pix_fmt == AV_PIX_FMT_YUV444P10 || + (ctx->profile != AV_PROFILE_DNXHR_444 && (avctx->pix_fmt == AV_PIX_FMT_YUV444P10 || avctx->pix_fmt == AV_PIX_FMT_GBRP10))) { av_log(avctx, AV_LOG_ERROR, "pixel format is incompatible with DNxHD profile\n"); return AVERROR(EINVAL); } - if (ctx->profile == FF_PROFILE_DNXHR_HQX && avctx->pix_fmt != AV_PIX_FMT_YUV422P10) { + if (ctx->profile == AV_PROFILE_DNXHR_HQX && avctx->pix_fmt != AV_PIX_FMT_YUV422P10) { av_log(avctx, AV_LOG_ERROR, "pixel format is incompatible with DNxHR HQX profile\n"); return AVERROR(EINVAL); } - if ((ctx->profile == FF_PROFILE_DNXHR_LB || - ctx->profile == FF_PROFILE_DNXHR_SQ || - ctx->profile == FF_PROFILE_DNXHR_HQ) && avctx->pix_fmt != AV_PIX_FMT_YUV422P) { + if ((ctx->profile == AV_PROFILE_DNXHR_LB || + ctx->profile == AV_PROFILE_DNXHR_SQ || + ctx->profile == AV_PROFILE_DNXHR_HQ) && avctx->pix_fmt != AV_PIX_FMT_YUV422P) { av_log(avctx, AV_LOG_ERROR, "pixel format is incompatible with DNxHR LB/SQ/HQ profile\n"); return AVERROR(EINVAL); } - ctx->is_444 = ctx->profile == FF_PROFILE_DNXHR_444; + ctx->is_444 = ctx->profile == AV_PROFILE_DNXHR_444; avctx->profile = ctx->profile; ctx->cid = ff_dnxhd_find_cid(avctx, ctx->bit_depth); if (!ctx->cid) { @@ -426,13 +426,13 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx) ff_pixblockdsp_init(&ctx->m.pdsp, avctx); ff_dct_encode_init(&ctx->m); - if (ctx->profile != FF_PROFILE_DNXHD) + if (ctx->profile != AV_PROFILE_DNXHD) ff_videodsp_init(&ctx->m.vdsp, ctx->bit_depth); if (!ctx->m.dct_quantize) ctx->m.dct_quantize = ff_dct_quantize_c; - if (ctx->is_444 || ctx->profile == FF_PROFILE_DNXHR_HQX) { + if (ctx->is_444 || ctx->profile == AV_PROFILE_DNXHR_HQX) { ctx->m.dct_quantize = dnxhd_10bit_dct_quantize_444; ctx->get_pixels_8x4_sym = dnxhd_10bit_get_pixels_8x4_sym; ctx->block_width_l2 = 4; @@ -457,7 +457,7 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx) ctx->m.mb_height /= 2; } - if (ctx->interlaced && ctx->profile != FF_PROFILE_DNXHD) { + if (ctx->interlaced && ctx->profile != AV_PROFILE_DNXHD) { av_log(avctx, AV_LOG_ERROR, "Interlaced encoding is not supported for DNxHR profiles.\n"); return AVERROR(EINVAL); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/dolby_e.c b/arm/raspi/third_party/ffmpeg/libavcodec/dolby_e.c index 921c33f3..b8dac0fa 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/dolby_e.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/dolby_e.c @@ -1200,7 +1200,7 @@ static av_cold void init_tables(void) gain_tab[i] = exp2f((i - 960) / 64.0f); // short 1 - ff_kbd_window_init(window, 3.0f, 128); + avpriv_kbd_window_init(window, 3.0f, 128); for (i = 0; i < 128; i++) window[128 + i] = window[127 - i]; @@ -1227,7 +1227,7 @@ static av_cold void init_tables(void) window[1088 + i] = 1.0f; // long - ff_kbd_window_init(window + 1408, 3.0f, 256); + avpriv_kbd_window_init(window + 1408, 3.0f, 256); for (i = 0; i < 640; i++) window[1664 + i] = 1.0f; for (i = 0; i < 256; i++) diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/dvdec.c b/arm/raspi/third_party/ffmpeg/libavcodec/dvdec.c index c57578a2..f66a5f1a 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/dvdec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/dvdec.c @@ -36,6 +36,7 @@ */ #include "libavutil/avassert.h" +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "libavutil/mem_internal.h" #include "libavutil/thread.h" @@ -174,9 +175,9 @@ static av_cold void dv_init_static(void) /* NOTE: as a trick, we use the fact the no codes are unused * to accelerate the parsing of partial codes */ - ff_init_vlc_from_lengths(&dv_vlc, TEX_VLC_BITS, j, + ff_vlc_init_from_lengths(&dv_vlc, TEX_VLC_BITS, j, &tmp[0].len, sizeof(tmp[0]), - NULL, 0, 0, 0, INIT_VLC_USE_NEW_STATIC, NULL); + NULL, 0, 0, 0, VLC_INIT_USE_STATIC, NULL); av_assert1(dv_vlc.table_size == 1664); for (int i = 0; i < dv_vlc.table_size; i++) { diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/dvenc.c b/arm/raspi/third_party/ffmpeg/libavcodec/dvenc.c index 7bd50174..ce212470 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/dvenc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/dvenc.c @@ -29,6 +29,7 @@ #include "config.h" #include "libavutil/attributes.h" +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "libavutil/mem_internal.h" #include "libavutil/opt.h" diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/dxa.c b/arm/raspi/third_party/ffmpeg/libavcodec/dxa.c index d903b7ec..d33ac3c8 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/dxa.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/dxa.c @@ -45,8 +45,8 @@ typedef struct DxaDecContext { uint32_t pal[256]; } DxaDecContext; -static const int shift1[6] = { 0, 8, 8, 8, 4, 4 }; -static const int shift2[6] = { 0, 0, 8, 4, 0, 4 }; +static const uint8_t shift1[6] = { 0, 8, 8, 8, 4, 4 }; +static const uint8_t shift2[6] = { 0, 0, 8, 4, 0, 4 }; static int decode_13(AVCodecContext *avctx, DxaDecContext *c, uint8_t* dst, int stride, uint8_t *src, int srcsize, uint8_t *ref) @@ -317,8 +317,7 @@ FF_ENABLE_DEPRECATION_WARNINGS return AVERROR_INVALIDDATA; } - av_frame_unref(c->prev); - if ((ret = av_frame_ref(c->prev, frame)) < 0) + if ((ret = av_frame_replace(c->prev, frame)) < 0) return ret; *got_frame = 1; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/dxva2.c b/arm/raspi/third_party/ffmpeg/libavcodec/dxva2.c index 568d686f..d7bc5875 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/dxva2.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/dxva2.c @@ -53,28 +53,28 @@ DEFINE_GUID(ff_IID_IDirectXVideoDecoderService, 0xfc51a551,0xd5e7,0x11d9,0xaf,0x typedef struct dxva_mode { const GUID *guid; enum AVCodecID codec; - // List of supported profiles, terminated by a FF_PROFILE_UNKNOWN entry. + // List of supported profiles, terminated by a AV_PROFILE_UNKNOWN entry. // If NULL, don't check profile. const int *profiles; } dxva_mode; -static const int prof_mpeg2_main[] = {FF_PROFILE_MPEG2_SIMPLE, - FF_PROFILE_MPEG2_MAIN, - FF_PROFILE_UNKNOWN}; -static const int prof_h264_high[] = {FF_PROFILE_H264_CONSTRAINED_BASELINE, - FF_PROFILE_H264_MAIN, - FF_PROFILE_H264_HIGH, - FF_PROFILE_UNKNOWN}; -static const int prof_hevc_main[] = {FF_PROFILE_HEVC_MAIN, - FF_PROFILE_UNKNOWN}; -static const int prof_hevc_main10[] = {FF_PROFILE_HEVC_MAIN_10, - FF_PROFILE_UNKNOWN}; -static const int prof_vp9_profile0[] = {FF_PROFILE_VP9_0, - FF_PROFILE_UNKNOWN}; -static const int prof_vp9_profile2[] = {FF_PROFILE_VP9_2, - FF_PROFILE_UNKNOWN}; -static const int prof_av1_profile0[] = {FF_PROFILE_AV1_MAIN, - FF_PROFILE_UNKNOWN}; +static const int prof_mpeg2_main[] = {AV_PROFILE_MPEG2_SIMPLE, + AV_PROFILE_MPEG2_MAIN, + AV_PROFILE_UNKNOWN}; +static const int prof_h264_high[] = {AV_PROFILE_H264_CONSTRAINED_BASELINE, + AV_PROFILE_H264_MAIN, + AV_PROFILE_H264_HIGH, + AV_PROFILE_UNKNOWN}; +static const int prof_hevc_main[] = {AV_PROFILE_HEVC_MAIN, + AV_PROFILE_UNKNOWN}; +static const int prof_hevc_main10[] = {AV_PROFILE_HEVC_MAIN_10, + AV_PROFILE_UNKNOWN}; +static const int prof_vp9_profile0[] = {AV_PROFILE_VP9_0, + AV_PROFILE_UNKNOWN}; +static const int prof_vp9_profile2[] = {AV_PROFILE_VP9_2, + AV_PROFILE_UNKNOWN}; +static const int prof_av1_profile0[] = {AV_PROFILE_AV1_MAIN, + AV_PROFILE_UNKNOWN}; static const dxva_mode dxva_modes[] = { /* MPEG-2 */ @@ -199,7 +199,7 @@ static int dxva_check_codec_compatibility(AVCodecContext *avctx, const dxva_mode if (mode->profiles && !(avctx->hwaccel_flags & AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH)) { int i, found = 0; - for (i = 0; mode->profiles[i] != FF_PROFILE_UNKNOWN; i++) { + for (i = 0; mode->profiles[i] != AV_PROFILE_UNKNOWN; i++) { if (avctx->profile == mode->profiles[i]) { found = 1; break; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/dxva2_av1.c b/arm/raspi/third_party/ffmpeg/libavcodec/dxva2_av1.c index 228f72ba..ab118a43 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/dxva2_av1.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/dxva2_av1.c @@ -27,6 +27,7 @@ #include "dxva2_internal.h" #include "av1dec.h" +#include "hwaccel_internal.h" #define MAX_TILES 256 @@ -457,11 +458,11 @@ static int dxva2_av1_uninit(AVCodecContext *avctx) } #if CONFIG_AV1_DXVA2_HWACCEL -const AVHWAccel ff_av1_dxva2_hwaccel = { - .name = "av1_dxva2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AV1, - .pix_fmt = AV_PIX_FMT_DXVA2_VLD, +const FFHWAccel ff_av1_dxva2_hwaccel = { + .p.name = "av1_dxva2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, + .p.pix_fmt = AV_PIX_FMT_DXVA2_VLD, .init = ff_dxva2_decode_init, .uninit = dxva2_av1_uninit, .start_frame = dxva2_av1_start_frame, @@ -474,11 +475,11 @@ const AVHWAccel ff_av1_dxva2_hwaccel = { #endif #if CONFIG_AV1_D3D11VA_HWACCEL -const AVHWAccel ff_av1_d3d11va_hwaccel = { - .name = "av1_d3d11va", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AV1, - .pix_fmt = AV_PIX_FMT_D3D11VA_VLD, +const FFHWAccel ff_av1_d3d11va_hwaccel = { + .p.name = "av1_d3d11va", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, + .p.pix_fmt = AV_PIX_FMT_D3D11VA_VLD, .init = ff_dxva2_decode_init, .uninit = dxva2_av1_uninit, .start_frame = dxva2_av1_start_frame, @@ -491,11 +492,11 @@ const AVHWAccel ff_av1_d3d11va_hwaccel = { #endif #if CONFIG_AV1_D3D11VA2_HWACCEL -const AVHWAccel ff_av1_d3d11va2_hwaccel = { - .name = "av1_d3d11va2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AV1, - .pix_fmt = AV_PIX_FMT_D3D11, +const FFHWAccel ff_av1_d3d11va2_hwaccel = { + .p.name = "av1_d3d11va2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, + .p.pix_fmt = AV_PIX_FMT_D3D11, .init = ff_dxva2_decode_init, .uninit = dxva2_av1_uninit, .start_frame = dxva2_av1_start_frame, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/dxva2_h264.c b/arm/raspi/third_party/ffmpeg/libavcodec/dxva2_h264.c index 6300b141..20e64f84 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/dxva2_h264.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/dxva2_h264.c @@ -28,6 +28,7 @@ #include "h264dec.h" #include "h264data.h" #include "h264_ps.h" +#include "hwaccel_internal.h" #include "mpegutils.h" struct dxva2_picture_context { @@ -516,11 +517,11 @@ static int dxva2_h264_end_frame(AVCodecContext *avctx) } #if CONFIG_H264_DXVA2_HWACCEL -const AVHWAccel ff_h264_dxva2_hwaccel = { - .name = "h264_dxva2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, - .pix_fmt = AV_PIX_FMT_DXVA2_VLD, +const FFHWAccel ff_h264_dxva2_hwaccel = { + .p.name = "h264_dxva2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, + .p.pix_fmt = AV_PIX_FMT_DXVA2_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_h264_start_frame, @@ -533,11 +534,11 @@ const AVHWAccel ff_h264_dxva2_hwaccel = { #endif #if CONFIG_H264_D3D11VA_HWACCEL -const AVHWAccel ff_h264_d3d11va_hwaccel = { - .name = "h264_d3d11va", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, - .pix_fmt = AV_PIX_FMT_D3D11VA_VLD, +const FFHWAccel ff_h264_d3d11va_hwaccel = { + .p.name = "h264_d3d11va", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, + .p.pix_fmt = AV_PIX_FMT_D3D11VA_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_h264_start_frame, @@ -550,11 +551,11 @@ const AVHWAccel ff_h264_d3d11va_hwaccel = { #endif #if CONFIG_H264_D3D11VA2_HWACCEL -const AVHWAccel ff_h264_d3d11va2_hwaccel = { - .name = "h264_d3d11va2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, - .pix_fmt = AV_PIX_FMT_D3D11, +const FFHWAccel ff_h264_d3d11va2_hwaccel = { + .p.name = "h264_d3d11va2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, + .p.pix_fmt = AV_PIX_FMT_D3D11, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_h264_start_frame, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/dxva2_hevc.c b/arm/raspi/third_party/ffmpeg/libavcodec/dxva2_hevc.c index 6b239d99..b6c08943 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/dxva2_hevc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/dxva2_hevc.c @@ -27,6 +27,7 @@ #include "dxva2_internal.h" #include "hevc_data.h" #include "hevcdec.h" +#include "hwaccel_internal.h" #define MAX_SLICES 256 @@ -420,11 +421,11 @@ static int dxva2_hevc_end_frame(AVCodecContext *avctx) } #if CONFIG_HEVC_DXVA2_HWACCEL -const AVHWAccel ff_hevc_dxva2_hwaccel = { - .name = "hevc_dxva2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, - .pix_fmt = AV_PIX_FMT_DXVA2_VLD, +const FFHWAccel ff_hevc_dxva2_hwaccel = { + .p.name = "hevc_dxva2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, + .p.pix_fmt = AV_PIX_FMT_DXVA2_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_hevc_start_frame, @@ -437,11 +438,11 @@ const AVHWAccel ff_hevc_dxva2_hwaccel = { #endif #if CONFIG_HEVC_D3D11VA_HWACCEL -const AVHWAccel ff_hevc_d3d11va_hwaccel = { - .name = "hevc_d3d11va", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, - .pix_fmt = AV_PIX_FMT_D3D11VA_VLD, +const FFHWAccel ff_hevc_d3d11va_hwaccel = { + .p.name = "hevc_d3d11va", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, + .p.pix_fmt = AV_PIX_FMT_D3D11VA_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_hevc_start_frame, @@ -454,11 +455,11 @@ const AVHWAccel ff_hevc_d3d11va_hwaccel = { #endif #if CONFIG_HEVC_D3D11VA2_HWACCEL -const AVHWAccel ff_hevc_d3d11va2_hwaccel = { - .name = "hevc_d3d11va2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, - .pix_fmt = AV_PIX_FMT_D3D11, +const FFHWAccel ff_hevc_d3d11va2_hwaccel = { + .p.name = "hevc_d3d11va2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, + .p.pix_fmt = AV_PIX_FMT_D3D11, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_hevc_start_frame, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/dxva2_mpeg2.c b/arm/raspi/third_party/ffmpeg/libavcodec/dxva2_mpeg2.c index 1989c588..75c41665 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/dxva2_mpeg2.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/dxva2_mpeg2.c @@ -25,6 +25,7 @@ #include "libavutil/log.h" #include "dxva2_internal.h" +#include "hwaccel_internal.h" #include "mpegutils.h" #include "mpegvideodec.h" @@ -316,11 +317,11 @@ static int dxva2_mpeg2_end_frame(AVCodecContext *avctx) } #if CONFIG_MPEG2_DXVA2_HWACCEL -const AVHWAccel ff_mpeg2_dxva2_hwaccel = { - .name = "mpeg2_dxva2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG2VIDEO, - .pix_fmt = AV_PIX_FMT_DXVA2_VLD, +const FFHWAccel ff_mpeg2_dxva2_hwaccel = { + .p.name = "mpeg2_dxva2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG2VIDEO, + .p.pix_fmt = AV_PIX_FMT_DXVA2_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_mpeg2_start_frame, @@ -333,11 +334,11 @@ const AVHWAccel ff_mpeg2_dxva2_hwaccel = { #endif #if CONFIG_MPEG2_D3D11VA_HWACCEL -const AVHWAccel ff_mpeg2_d3d11va_hwaccel = { - .name = "mpeg2_d3d11va", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG2VIDEO, - .pix_fmt = AV_PIX_FMT_D3D11VA_VLD, +const FFHWAccel ff_mpeg2_d3d11va_hwaccel = { + .p.name = "mpeg2_d3d11va", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG2VIDEO, + .p.pix_fmt = AV_PIX_FMT_D3D11VA_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_mpeg2_start_frame, @@ -350,11 +351,11 @@ const AVHWAccel ff_mpeg2_d3d11va_hwaccel = { #endif #if CONFIG_MPEG2_D3D11VA2_HWACCEL -const AVHWAccel ff_mpeg2_d3d11va2_hwaccel = { - .name = "mpeg2_d3d11va2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG2VIDEO, - .pix_fmt = AV_PIX_FMT_D3D11, +const FFHWAccel ff_mpeg2_d3d11va2_hwaccel = { + .p.name = "mpeg2_d3d11va2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG2VIDEO, + .p.pix_fmt = AV_PIX_FMT_D3D11, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_mpeg2_start_frame, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/dxva2_vc1.c b/arm/raspi/third_party/ffmpeg/libavcodec/dxva2_vc1.c index 12e3de59..b35fb115 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/dxva2_vc1.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/dxva2_vc1.c @@ -23,6 +23,7 @@ #include "config_components.h" #include "dxva2_internal.h" +#include "hwaccel_internal.h" #include "mpegutils.h" #include "mpegvideodec.h" #include "vc1.h" @@ -376,11 +377,11 @@ static int dxva2_vc1_end_frame(AVCodecContext *avctx) } #if CONFIG_WMV3_DXVA2_HWACCEL -const AVHWAccel ff_wmv3_dxva2_hwaccel = { - .name = "wmv3_dxva2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WMV3, - .pix_fmt = AV_PIX_FMT_DXVA2_VLD, +const FFHWAccel ff_wmv3_dxva2_hwaccel = { + .p.name = "wmv3_dxva2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WMV3, + .p.pix_fmt = AV_PIX_FMT_DXVA2_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_vc1_start_frame, @@ -393,11 +394,11 @@ const AVHWAccel ff_wmv3_dxva2_hwaccel = { #endif #if CONFIG_VC1_DXVA2_HWACCEL -const AVHWAccel ff_vc1_dxva2_hwaccel = { - .name = "vc1_dxva2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VC1, - .pix_fmt = AV_PIX_FMT_DXVA2_VLD, +const FFHWAccel ff_vc1_dxva2_hwaccel = { + .p.name = "vc1_dxva2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VC1, + .p.pix_fmt = AV_PIX_FMT_DXVA2_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_vc1_start_frame, @@ -410,11 +411,11 @@ const AVHWAccel ff_vc1_dxva2_hwaccel = { #endif #if CONFIG_WMV3_D3D11VA_HWACCEL -const AVHWAccel ff_wmv3_d3d11va_hwaccel = { - .name = "wmv3_d3d11va", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WMV3, - .pix_fmt = AV_PIX_FMT_D3D11VA_VLD, +const FFHWAccel ff_wmv3_d3d11va_hwaccel = { + .p.name = "wmv3_d3d11va", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WMV3, + .p.pix_fmt = AV_PIX_FMT_D3D11VA_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_vc1_start_frame, @@ -427,11 +428,11 @@ const AVHWAccel ff_wmv3_d3d11va_hwaccel = { #endif #if CONFIG_WMV3_D3D11VA2_HWACCEL -const AVHWAccel ff_wmv3_d3d11va2_hwaccel = { - .name = "wmv3_d3d11va2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WMV3, - .pix_fmt = AV_PIX_FMT_D3D11, +const FFHWAccel ff_wmv3_d3d11va2_hwaccel = { + .p.name = "wmv3_d3d11va2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WMV3, + .p.pix_fmt = AV_PIX_FMT_D3D11, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_vc1_start_frame, @@ -444,11 +445,11 @@ const AVHWAccel ff_wmv3_d3d11va2_hwaccel = { #endif #if CONFIG_VC1_D3D11VA_HWACCEL -const AVHWAccel ff_vc1_d3d11va_hwaccel = { - .name = "vc1_d3d11va", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VC1, - .pix_fmt = AV_PIX_FMT_D3D11VA_VLD, +const FFHWAccel ff_vc1_d3d11va_hwaccel = { + .p.name = "vc1_d3d11va", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VC1, + .p.pix_fmt = AV_PIX_FMT_D3D11VA_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_vc1_start_frame, @@ -461,11 +462,11 @@ const AVHWAccel ff_vc1_d3d11va_hwaccel = { #endif #if CONFIG_VC1_D3D11VA2_HWACCEL -const AVHWAccel ff_vc1_d3d11va2_hwaccel = { - .name = "vc1_d3d11va2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VC1, - .pix_fmt = AV_PIX_FMT_D3D11, +const FFHWAccel ff_vc1_d3d11va2_hwaccel = { + .p.name = "vc1_d3d11va2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VC1, + .p.pix_fmt = AV_PIX_FMT_D3D11, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_vc1_start_frame, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/dxva2_vp9.c b/arm/raspi/third_party/ffmpeg/libavcodec/dxva2_vp9.c index dbe6c08a..eba4df90 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/dxva2_vp9.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/dxva2_vp9.c @@ -26,6 +26,7 @@ #include "libavutil/pixdesc.h" #include "dxva2_internal.h" +#include "hwaccel_internal.h" #include "vp9shared.h" struct vp9_dxva2_picture_context { @@ -307,11 +308,11 @@ static int dxva2_vp9_end_frame(AVCodecContext *avctx) } #if CONFIG_VP9_DXVA2_HWACCEL -const AVHWAccel ff_vp9_dxva2_hwaccel = { - .name = "vp9_dxva2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP9, - .pix_fmt = AV_PIX_FMT_DXVA2_VLD, +const FFHWAccel ff_vp9_dxva2_hwaccel = { + .p.name = "vp9_dxva2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP9, + .p.pix_fmt = AV_PIX_FMT_DXVA2_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_vp9_start_frame, @@ -324,11 +325,11 @@ const AVHWAccel ff_vp9_dxva2_hwaccel = { #endif #if CONFIG_VP9_D3D11VA_HWACCEL -const AVHWAccel ff_vp9_d3d11va_hwaccel = { - .name = "vp9_d3d11va", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP9, - .pix_fmt = AV_PIX_FMT_D3D11VA_VLD, +const FFHWAccel ff_vp9_d3d11va_hwaccel = { + .p.name = "vp9_d3d11va", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP9, + .p.pix_fmt = AV_PIX_FMT_D3D11VA_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_vp9_start_frame, @@ -341,11 +342,11 @@ const AVHWAccel ff_vp9_d3d11va_hwaccel = { #endif #if CONFIG_VP9_D3D11VA2_HWACCEL -const AVHWAccel ff_vp9_d3d11va2_hwaccel = { - .name = "vp9_d3d11va2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP9, - .pix_fmt = AV_PIX_FMT_D3D11, +const FFHWAccel ff_vp9_d3d11va2_hwaccel = { + .p.name = "vp9_d3d11va2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP9, + .p.pix_fmt = AV_PIX_FMT_D3D11, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_vp9_start_frame, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/eacmv.c b/arm/raspi/third_party/ffmpeg/libavcodec/eacmv.c index e73e310c..43dba20f 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/eacmv.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/eacmv.c @@ -210,9 +210,8 @@ static int cmv_decode_frame(AVCodecContext *avctx, AVFrame *frame, cmv_decode_intra(s, frame, buf+2, buf_end); } - av_frame_unref(s->last2_frame); - av_frame_move_ref(s->last2_frame, s->last_frame); - if ((ret = av_frame_ref(s->last_frame, frame)) < 0) + FFSWAP(AVFrame*, s->last2_frame, s->last_frame); + if ((ret = av_frame_replace(s->last_frame, frame)) < 0) return ret; *got_frame = 1; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/eamad.c b/arm/raspi/third_party/ffmpeg/libavcodec/eamad.c index 45012c62..287575e0 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/eamad.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/eamad.c @@ -317,8 +317,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, *got_frame = 1; if (chunk_type != MADe_TAG) { - av_frame_unref(s->last_frame); - if ((ret = av_frame_ref(s->last_frame, frame)) < 0) + if ((ret = av_frame_replace(s->last_frame, frame)) < 0) return ret; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/eatgv.c b/arm/raspi/third_party/ffmpeg/libavcodec/eatgv.c index a2aead46..35bd88b7 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/eatgv.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/eatgv.c @@ -338,8 +338,7 @@ static int tgv_decode_frame(AVCodecContext *avctx, AVFrame *frame, } } - av_frame_unref(s->last_frame); - if ((ret = av_frame_ref(s->last_frame, frame)) < 0) + if ((ret = av_frame_replace(s->last_frame, frame)) < 0) return ret; *got_frame = 1; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/encode.c b/arm/raspi/third_party/ffmpeg/libavcodec/encode.c index 32cc903b..a436be26 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/encode.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/encode.c @@ -21,6 +21,7 @@ #include "libavutil/attributes.h" #include "libavutil/avassert.h" #include "libavutil/channel_layout.h" +#include "libavutil/emms.h" #include "libavutil/frame.h" #include "libavutil/imgutils.h" #include "libavutil/internal.h" @@ -29,6 +30,7 @@ #include "avcodec.h" #include "avcodec_internal.h" +#include "codec_desc.h" #include "codec_internal.h" #include "encode.h" #include "frame_thread_encoder.h" @@ -864,3 +866,34 @@ AVCodecInternal *ff_encode_internal_alloc(void) { return av_mallocz(sizeof(EncodeContext)); } + +AVCPBProperties *ff_encode_add_cpb_side_data(AVCodecContext *avctx) +{ + AVPacketSideData *tmp; + AVCPBProperties *props; + size_t size; + int i; + + for (i = 0; i < avctx->nb_coded_side_data; i++) + if (avctx->coded_side_data[i].type == AV_PKT_DATA_CPB_PROPERTIES) + return (AVCPBProperties *)avctx->coded_side_data[i].data; + + props = av_cpb_properties_alloc(&size); + if (!props) + return NULL; + + tmp = av_realloc_array(avctx->coded_side_data, avctx->nb_coded_side_data + 1, sizeof(*tmp)); + if (!tmp) { + av_freep(&props); + return NULL; + } + + avctx->coded_side_data = tmp; + avctx->nb_coded_side_data++; + + avctx->coded_side_data[avctx->nb_coded_side_data - 1].type = AV_PKT_DATA_CPB_PROPERTIES; + avctx->coded_side_data[avctx->nb_coded_side_data - 1].data = (uint8_t*)props; + avctx->coded_side_data[avctx->nb_coded_side_data - 1].size = size; + + return props; +} diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/encode.h b/arm/raspi/third_party/ffmpeg/libavcodec/encode.h index dfaab7c9..e019cd77 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/encode.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/encode.h @@ -73,6 +73,11 @@ int ff_encode_reordered_opaque(AVCodecContext *avctx, int ff_encode_encode_cb(AVCodecContext *avctx, AVPacket *avpkt, AVFrame *frame, int *got_packet); +/** + * Add a CPB properties side data to an encoding context. + */ +AVCPBProperties *ff_encode_add_cpb_side_data(AVCodecContext *avctx); + /** * Rescale from sample rate to AVCodecContext.time_base. */ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/error_resilience.c b/arm/raspi/third_party/ffmpeg/libavcodec/error_resilience.c index 2aa6f1d8..9d03e532 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/error_resilience.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/error_resilience.c @@ -393,7 +393,7 @@ static void guess_mv(ERContext *s) const ptrdiff_t mb_stride = s->mb_stride; const int mb_width = s->mb_width; int mb_height = s->mb_height; - int i, depth, num_avail; + int i, num_avail; int mb_x, mb_y; ptrdiff_t mot_step, mot_stride; int blocklist_length, next_blocklist_length; @@ -469,7 +469,7 @@ static void guess_mv(ERContext *s) } } - for (depth = 0; ; depth++) { + for (;;) { int changed, pass, none_left; int blocklist_index; @@ -804,7 +804,7 @@ void ff_er_frame_start(ERContext *s) static int er_supported(ERContext *s) { - if(s->avctx->hwaccel && s->avctx->hwaccel->decode_slice || + if (s->avctx->hwaccel || !s->cur_pic.f || s->cur_pic.field_picture ) @@ -828,7 +828,7 @@ void ff_er_add_slice(ERContext *s, int startx, int starty, const int end_xy = s->mb_index2xy[end_i]; int mask = -1; - if (s->avctx->hwaccel && s->avctx->hwaccel->decode_slice) + if (s->avctx->hwaccel) return; if (start_i > end_i || start_xy > end_xy) { @@ -889,7 +889,7 @@ void ff_er_add_slice(ERContext *s, int startx, int starty, } } -void ff_er_frame_end(ERContext *s) +void ff_er_frame_end(ERContext *s, int *decode_error_flags) { int *linesize = NULL; int i, mb_x, mb_y, error, error_type, dc_error, mv_error, ac_error; @@ -1114,7 +1114,10 @@ void ff_er_frame_end(ERContext *s) av_log(s->avctx, AV_LOG_INFO, "concealing %d DC, %d AC, %d MV errors in %c frame\n", dc_error, ac_error, mv_error, av_get_picture_type_char(s->cur_pic.f->pict_type)); - s->cur_pic.f->decode_error_flags |= FF_DECODE_ERROR_CONCEALMENT_ACTIVE; + if (decode_error_flags) + *decode_error_flags |= FF_DECODE_ERROR_CONCEALMENT_ACTIVE; + else + s->cur_pic.f->decode_error_flags |= FF_DECODE_ERROR_CONCEALMENT_ACTIVE; is_intra_likely = is_intra_more_likely(s); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/error_resilience.h b/arm/raspi/third_party/ffmpeg/libavcodec/error_resilience.h index 47cc8a4f..b03f8ec8 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/error_resilience.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/error_resilience.h @@ -90,7 +90,17 @@ typedef struct ERContext { } ERContext; void ff_er_frame_start(ERContext *s); -void ff_er_frame_end(ERContext *s); + +/** + * Indicate that a frame has finished decoding and perform error concealment + * in case it has been enabled and is necessary and supported. + * + * @param s ERContext in use + * @param decode_error_flags pointer where updated decode_error_flags are written + * if supplied; if not, the new flags are directly + * applied to the AVFrame whose errors are concealed + */ +void ff_er_frame_end(ERContext *s, int *decode_error_flags); void ff_er_add_slice(ERContext *s, int startx, int starty, int endx, int endy, int status); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/escape124.c b/arm/raspi/third_party/ffmpeg/libavcodec/escape124.c index 592de09a..357320ef 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/escape124.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/escape124.c @@ -234,7 +234,7 @@ static int escape124_decode_frame(AVCodecContext *avctx, AVFrame *frame, if ((ret = av_frame_ref(frame, s->frame)) < 0) return ret; - return frame_size; + return 0; } for (i = 0; i < 3; i++) { @@ -362,13 +362,12 @@ static int escape124_decode_frame(AVCodecContext *avctx, AVFrame *frame, "Escape sizes: %i, %i, %i\n", frame_size, buf_size, get_bits_count(&gb) / 8); - av_frame_unref(s->frame); - if ((ret = av_frame_ref(s->frame, frame)) < 0) + if ((ret = av_frame_replace(s->frame, frame)) < 0) return ret; *got_frame = 1; - return frame_size; + return 0; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/evc.h b/arm/raspi/third_party/ffmpeg/libavcodec/evc.h index d1fdb4fa..9711c760 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/evc.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/evc.h @@ -126,7 +126,7 @@ enum { EVC_MAX_NUM_REF_PICS = 21, - EVC_MAX_NUM_RPLS = 32, + EVC_MAX_NUM_RPLS = 64, // A.4.1: pic_width_in_luma_samples and pic_height_in_luma_samples are // constrained to be not greater than sqrt(MaxLumaPs * 8). Hence height/ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/evc_frame_merge_bsf.c b/arm/raspi/third_party/ffmpeg/libavcodec/evc_frame_merge_bsf.c index cfdf24c6..7b8e6b1c 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/evc_frame_merge_bsf.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/evc_frame_merge_bsf.c @@ -18,13 +18,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "get_bits.h" -#include "golomb.h" #include "bsf.h" #include "bsf_internal.h" -#include "avcodec.h" #include "evc.h" #include "evc_parse.h" +#include "evc_ps.h" // Access unit data typedef struct AccessUnitBuffer { diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/evc_parse.c b/arm/raspi/third_party/ffmpeg/libavcodec/evc_parse.c index 447f6195..bd3a4416 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/evc_parse.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/evc_parse.c @@ -17,7 +17,6 @@ */ #include "golomb.h" -#include "parser.h" #include "evc.h" #include "evc_parse.h" diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/evc_parse.h b/arm/raspi/third_party/ffmpeg/libavcodec/evc_parse.h index 55cdd553..47123108 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/evc_parse.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/evc_parse.h @@ -28,7 +28,6 @@ #include "libavutil/intreadwrite.h" #include "libavutil/log.h" -#include "libavutil/rational.h" #include "evc.h" #include "evc_ps.h" diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/evc_parser.c b/arm/raspi/third_party/ffmpeg/libavcodec/evc_parser.c index 76790d81..8590ebcd 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/evc_parser.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/evc_parser.c @@ -20,7 +20,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "parser.h" +#include "avcodec.h" #include "bytestream.h" #include "evc.h" #include "evc_parse.h" diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/evc_ps.c b/arm/raspi/third_party/ffmpeg/libavcodec/evc_ps.c index fc2105b3..c11b92d1 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/evc_ps.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/evc_ps.c @@ -16,18 +16,22 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "get_bits.h" #include "golomb.h" -#include "parser.h" #include "evc.h" #include "evc_ps.h" #define EXTENDED_SAR 255 // @see ISO_IEC_23094-1 (7.3.7 Reference picture list structure syntax) -static int ref_pic_list_struct(GetBitContext *gb, RefPicListStruct *rpl) +static int ref_pic_list_struct(const EVCParserSPS *sps, GetBitContext *gb, RefPicListStruct *rpl) { uint32_t delta_poc_st, strp_entry_sign_flag = 0; rpl->ref_pic_num = get_ue_golomb_long(gb); + + if ((unsigned)rpl->ref_pic_num > sps->sps_max_dec_pic_buffering_minus1) + return AVERROR_INVALIDDATA; + if (rpl->ref_pic_num > 0) { delta_poc_st = get_ue_golomb_long(gb); @@ -53,6 +57,9 @@ static int ref_pic_list_struct(GetBitContext *gb, RefPicListStruct *rpl) static int hrd_parameters(GetBitContext *gb, HRDParameters *hrd) { hrd->cpb_cnt_minus1 = get_ue_golomb_31(gb); + if (hrd->cpb_cnt_minus1 >= FF_ARRAY_ELEMS(hrd->cpb_size_value_minus1)) + return AVERROR_INVALIDDATA; + hrd->bit_rate_scale = get_bits(gb, 4); hrd->cpb_size_scale = get_bits(gb, 4); for (int SchedSelIdx = 0; SchedSelIdx <= hrd->cpb_cnt_minus1; SchedSelIdx++) { @@ -71,6 +78,8 @@ static int hrd_parameters(GetBitContext *gb, HRDParameters *hrd) // @see ISO_IEC_23094-1 (E.2.1 VUI parameters syntax) static int vui_parameters(GetBitContext *gb, VUIParameters *vui) { + int ret; + vui->aspect_ratio_info_present_flag = get_bits(gb, 1); if (vui->aspect_ratio_info_present_flag) { vui->aspect_ratio_idc = get_bits(gb, 8); @@ -109,11 +118,18 @@ static int vui_parameters(GetBitContext *gb, VUIParameters *vui) vui->fixed_pic_rate_flag = get_bits(gb, 1); } vui->nal_hrd_parameters_present_flag = get_bits(gb, 1); - if (vui->nal_hrd_parameters_present_flag) - hrd_parameters(gb, &vui->hrd_parameters); + if (vui->nal_hrd_parameters_present_flag) { + ret = hrd_parameters(gb, &vui->hrd_parameters); + if (ret < 0) + return ret; + } + vui->vcl_hrd_parameters_present_flag = get_bits(gb, 1); - if (vui->vcl_hrd_parameters_present_flag) - hrd_parameters(gb, &vui->hrd_parameters); + if (vui->vcl_hrd_parameters_present_flag) { + ret = hrd_parameters(gb, &vui->hrd_parameters); + if (ret < 0) + return ret; + } if (vui->nal_hrd_parameters_present_flag || vui->vcl_hrd_parameters_present_flag) vui->low_delay_hrd_flag = get_bits(gb, 1); vui->pic_struct_present_flag = get_bits(gb, 1); @@ -239,17 +255,36 @@ int ff_evc_parse_sps(GetBitContext *gb, EVCParamSets *ps) sps->max_num_tid0_ref_pics = get_ue_golomb_31(gb); else { sps->sps_max_dec_pic_buffering_minus1 = get_ue_golomb_long(gb); + if ((unsigned)sps->sps_max_dec_pic_buffering_minus1 > 16 - 1) { + ret = AVERROR_INVALIDDATA; + goto fail; + } sps->long_term_ref_pic_flag = get_bits1(gb); sps->rpl1_same_as_rpl0_flag = get_bits1(gb); sps->num_ref_pic_list_in_sps[0] = get_ue_golomb(gb); - for (int i = 0; i < sps->num_ref_pic_list_in_sps[0]; ++i) - ref_pic_list_struct(gb, &sps->rpls[0][i]); + if ((unsigned)sps->num_ref_pic_list_in_sps[0] >= EVC_MAX_NUM_RPLS) { + ret = AVERROR_INVALIDDATA; + goto fail; + } + + for (int i = 0; i < sps->num_ref_pic_list_in_sps[0]; ++i) { + ret = ref_pic_list_struct(sps, gb, &sps->rpls[0][i]); + if (ret < 0) + goto fail; + } if (!sps->rpl1_same_as_rpl0_flag) { sps->num_ref_pic_list_in_sps[1] = get_ue_golomb(gb); - for (int i = 0; i < sps->num_ref_pic_list_in_sps[1]; ++i) - ref_pic_list_struct(gb, &sps->rpls[1][i]); + if ((unsigned)sps->num_ref_pic_list_in_sps[1] >= EVC_MAX_NUM_RPLS) { + ret = AVERROR_INVALIDDATA; + goto fail; + } + for (int i = 0; i < sps->num_ref_pic_list_in_sps[1]; ++i) { + ret = ref_pic_list_struct(sps, gb, &sps->rpls[1][i]); + if (ret < 0) + goto fail; + } } } @@ -283,8 +318,11 @@ int ff_evc_parse_sps(GetBitContext *gb, EVCParamSets *ps) } sps->vui_parameters_present_flag = get_bits1(gb); - if (sps->vui_parameters_present_flag) - vui_parameters(gb, &(sps->vui_parameters)); + if (sps->vui_parameters_present_flag) { + ret = vui_parameters(gb, &(sps->vui_parameters)); + if (ret < 0) + goto fail; + } // @note // If necessary, add the missing fields to the EVCParserSPS structure diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/exr.c b/arm/raspi/third_party/ffmpeg/libavcodec/exr.c index fae1d08a..b30d3b74 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/exr.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/exr.c @@ -404,8 +404,8 @@ static int huf_build_dec_table(const EXRContext *s, td->he[j].code = td->freq[iM] >> 6; j++; - ff_free_vlc(&td->vlc); - return ff_init_vlc_sparse(&td->vlc, 12, j, + ff_vlc_free(&td->vlc); + return ff_vlc_init_sparse(&td->vlc, 12, j, &td->he[0].len, sizeof(td->he[0]), sizeof(td->he[0].len), &td->he[0].code, sizeof(td->he[0]), sizeof(td->he[0].code), &td->he[0].sym, sizeof(td->he[0]), sizeof(td->he[0].sym), 0); @@ -760,8 +760,8 @@ static int pxr24_uncompress(const EXRContext *s, const uint8_t *src, static void unpack_14(const uint8_t b[14], uint16_t s[16]) { - unsigned short shift = (b[ 2] >> 2) & 15; - unsigned short bias = (0x20 << shift); + uint16_t shift = (b[ 2] >> 2) & 15; + uint16_t bias = (0x20 << shift); int i; s[ 0] = (b[0] << 8) | b[1]; @@ -1870,7 +1870,7 @@ static int decode_header(EXRContext *s, AVFrame *frame) continue; } else if ((var_size = check_header_variable(s, "tiles", "tiledesc", 22)) >= 0) { - char tileLevel; + uint8_t tileLevel; if (!s->is_tile) av_log(s->avctx, AV_LOG_WARNING, @@ -2088,6 +2088,8 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture, if (s->apply_trc_type != AVCOL_TRC_UNSPECIFIED) avctx->color_trc = s->apply_trc_type; + else if (s->gamma > 0.9999f && s->gamma < 1.0001f) + avctx->color_trc = AVCOL_TRC_LINEAR; switch (s->compression) { case EXR_RAW: @@ -2282,7 +2284,7 @@ static av_cold int decode_end(AVCodecContext *avctx) av_freep(&td->dc_data); av_freep(&td->rle_data); av_freep(&td->rle_raw_data); - ff_free_vlc(&td->vlc); + ff_vlc_free(&td->vlc); } av_freep(&s->thread_data); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/extract_extradata_bsf.c b/arm/raspi/third_party/ffmpeg/libavcodec/extract_extradata_bsf.c index d5c81a27..baa62929 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/extract_extradata_bsf.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/extract_extradata_bsf.c @@ -49,25 +49,53 @@ typedef struct ExtractExtradataContext { int remove; } ExtractExtradataContext; -static int val_in_array(const int *arr, int len, int val) +static int val_in_array(const int *arr, size_t len, int val) { - int i; - for (i = 0; i < len; i++) + for (size_t i = 0; i < len; i++) if (arr[i] == val) return 1; return 0; } -static int extract_extradata_av1(AVBSFContext *ctx, AVPacket *pkt, - uint8_t **data, int *size) +static int metadata_is_global(const AV1OBU *obu) +{ + static const int metadata_obu_types[] = { + AV1_METADATA_TYPE_HDR_CLL, AV1_METADATA_TYPE_HDR_MDCV, + }; + GetBitContext gb; + int metadata_type; + + if (init_get_bits(&gb, obu->data, obu->size_bits) < 0) + return 0; + + metadata_type = leb128(&gb); + + return val_in_array(metadata_obu_types, FF_ARRAY_ELEMS(metadata_obu_types), + metadata_type); +} + +static int obu_is_global(const AV1OBU *obu) { static const int extradata_obu_types[] = { AV1_OBU_SEQUENCE_HEADER, AV1_OBU_METADATA, }; + + if (!val_in_array(extradata_obu_types, FF_ARRAY_ELEMS(extradata_obu_types), + obu->type)) + return 0; + if (obu->type != AV1_OBU_METADATA) + return 1; + + return metadata_is_global(obu); +} + +static int extract_extradata_av1(AVBSFContext *ctx, AVPacket *pkt, + uint8_t **data, int *size) +{ + ExtractExtradataContext *s = ctx->priv_data; int extradata_size = 0, filtered_size = 0; - int nb_extradata_obu_types = FF_ARRAY_ELEMS(extradata_obu_types); int i, has_seq = 0, ret = 0; ret = ff_av1_packet_split(&s->av1_pkt, pkt->data, pkt->size, ctx); @@ -76,7 +104,7 @@ static int extract_extradata_av1(AVBSFContext *ctx, AVPacket *pkt, for (i = 0; i < s->av1_pkt.nb_obus; i++) { AV1OBU *obu = &s->av1_pkt.obus[i]; - if (val_in_array(extradata_obu_types, nb_extradata_obu_types, obu->type)) { + if (obu_is_global(obu)) { extradata_size += obu->raw_size; if (obu->type == AV1_OBU_SEQUENCE_HEADER) has_seq = 1; @@ -113,8 +141,7 @@ static int extract_extradata_av1(AVBSFContext *ctx, AVPacket *pkt, for (i = 0; i < s->av1_pkt.nb_obus; i++) { AV1OBU *obu = &s->av1_pkt.obus[i]; - if (val_in_array(extradata_obu_types, nb_extradata_obu_types, - obu->type)) { + if (obu_is_global(obu)) { bytestream2_put_bufferu(&pb_extradata, obu->raw_data, obu->raw_size); } else if (s->remove) { bytestream2_put_bufferu(&pb_filtered_data, obu->raw_data, obu->raw_size); @@ -149,7 +176,7 @@ static int extract_extradata_h2645(AVBSFContext *ctx, AVPacket *pkt, int extradata_size = 0, filtered_size = 0; const int *extradata_nal_types; - int nb_extradata_nal_types; + size_t nb_extradata_nal_types; int i, has_sps = 0, has_vps = 0, ret = 0; if (ctx->par_in->codec_id == AV_CODEC_ID_VVC) { diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/faandct.c b/arm/raspi/third_party/ffmpeg/libavcodec/faandct.c index 38c392bb..b0b11859 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/faandct.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/faandct.c @@ -26,6 +26,7 @@ */ #include "faandct.h" +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "libavutil/libm.h" diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/faanidct.c b/arm/raspi/third_party/ffmpeg/libavcodec/faanidct.c index 3921f82d..f2667fb7 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/faanidct.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/faanidct.c @@ -20,6 +20,7 @@ */ #include "faanidct.h" #include "libavutil/common.h" +#include "libavutil/emms.h" /* To allow switching to double. */ typedef float FLOAT; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/faxcompr.c b/arm/raspi/third_party/ffmpeg/libavcodec/faxcompr.c index d9dec3fc..62729fe9 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/faxcompr.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/faxcompr.c @@ -108,13 +108,13 @@ static av_cold void ccitt_unpack_init(void) ccitt_vlc[1].table = code_table2; ccitt_vlc[1].table_allocated = 648; for (i = 0; i < 2; i++) { - ff_init_vlc_sparse(&ccitt_vlc[i], 9, CCITT_SYMS, + ff_vlc_init_sparse(&ccitt_vlc[i], 9, CCITT_SYMS, ccitt_codes_lens[i], 1, 1, ccitt_codes_bits[i], 1, 1, ccitt_syms, 2, 2, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); } - INIT_VLC_STATIC(&ccitt_group3_2d_vlc, 9, 11, + VLC_INIT_STATIC(&ccitt_group3_2d_vlc, 9, 11, ccitt_group3_2d_lens, 1, 1, ccitt_group3_2d_bits, 1, 1, 512); } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/fdctdsp.c b/arm/raspi/third_party/ffmpeg/libavcodec/fdctdsp.c index 5306c9d0..f8ba1742 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/fdctdsp.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/fdctdsp.c @@ -18,7 +18,6 @@ #include "libavutil/attributes.h" #include "avcodec.h" -#include "dct.h" #include "faandct.h" #include "fdctdsp.h" #include "config.h" diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/fdctdsp.h b/arm/raspi/third_party/ffmpeg/libavcodec/fdctdsp.h index 3e1f683b..7378eab8 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/fdctdsp.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/fdctdsp.h @@ -21,17 +21,28 @@ #include -#include "avcodec.h" +#include "libavutil/attributes_internal.h" + +struct AVCodecContext; typedef struct FDCTDSPContext { void (*fdct)(int16_t *block /* align 16 */); void (*fdct248)(int16_t *block /* align 16 */); } FDCTDSPContext; -void ff_fdctdsp_init(FDCTDSPContext *c, AVCodecContext *avctx); -void ff_fdctdsp_init_ppc(FDCTDSPContext *c, AVCodecContext *avctx, +FF_VISIBILITY_PUSH_HIDDEN +void ff_fdctdsp_init(FDCTDSPContext *c, struct AVCodecContext *avctx); +void ff_fdctdsp_init_ppc(FDCTDSPContext *c, struct AVCodecContext *avctx, unsigned high_bit_depth); -void ff_fdctdsp_init_x86(FDCTDSPContext *c, AVCodecContext *avctx, +void ff_fdctdsp_init_x86(FDCTDSPContext *c, struct AVCodecContext *avctx, unsigned high_bit_depth); +void ff_fdct_ifast(int16_t *data); +void ff_fdct_ifast248(int16_t *data); +void ff_jpeg_fdct_islow_8(int16_t *data); +void ff_jpeg_fdct_islow_10(int16_t *data); +void ff_fdct248_islow_8(int16_t *data); +void ff_fdct248_islow_10(int16_t *data); +FF_VISIBILITY_POP_HIDDEN + #endif /* AVCODEC_FDCTDSP_H */ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/ffjni.c b/arm/raspi/third_party/ffmpeg/libavcodec/ffjni.c index 154be9ae..e3cf24d3 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/ffjni.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/ffjni.c @@ -25,6 +25,7 @@ #include #include "libavutil/bprint.h" +#include "libavutil/error.h" #include "libavutil/log.h" #include "libavutil/mem.h" diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/fflcms2.c b/arm/raspi/third_party/ffmpeg/libavcodec/fflcms2.c index 5443f178..3b67e62d 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/fflcms2.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/fflcms2.c @@ -201,6 +201,57 @@ static av_always_inline void XYZ_xy(cmsCIEXYZ XYZ, AVCIExy *xy) xy->y = av_d2q(k * XYZ.Y, 100000); } +static av_always_inline AVRational abs_sub_q(AVRational r1, AVRational r2) +{ + AVRational diff = av_sub_q(r1, r2); + /* denominator assumed to be positive */ + return av_make_q(abs(diff.num), diff.den); +} + +static const AVCIExy wp_d50 = { {3457, 10000}, {3585, 10000} }; /* CIE D50 */ + +int ff_icc_profile_sanitize(FFIccContext *s, cmsHPROFILE profile) +{ + cmsCIEXYZ *white, fixed; + AVCIExy wpxy; + AVRational diff, z; + if (!profile) + return 0; + + if (cmsGetEncodedICCversion(profile) >= 0x4000000) { // ICC v4 + switch (cmsGetHeaderRenderingIntent(profile)) { + case INTENT_RELATIVE_COLORIMETRIC: + case INTENT_ABSOLUTE_COLORIMETRIC: ; + /* ICC v4 colorimetric profiles are specified to always use D50 + * media white point, anything else is a violation of the spec. + * Sadly, such profiles are incredibly common (Apple...), so make + * an effort to fix them. */ + if (!(white = cmsReadTag(profile, cmsSigMediaWhitePointTag))) + return AVERROR_INVALIDDATA; + XYZ_xy(*white, &wpxy); + diff = av_add_q(abs_sub_q(wpxy.x, wp_d50.x), abs_sub_q(wpxy.y, wp_d50.y)); + if (av_cmp_q(diff, av_make_q(1, 1000)) > 0) { + av_log(s->avctx, AV_LOG_WARNING, "Invalid colorimetric ICCv4 " + "profile media white point tag (expected %.4f %.4f, " + "got %.4f %.4f)\n", + av_q2d(wp_d50.x), av_q2d(wp_d50.y), + av_q2d(wpxy.x), av_q2d(wpxy.y)); + /* x+y+z = 1 */ + z = av_sub_q(av_sub_q(av_make_q(1, 1), wp_d50.x), wp_d50.y); + fixed.X = av_q2d(av_div_q(wp_d50.x, wp_d50.y)) * white->Y; + fixed.Y = white->Y; + fixed.Z = av_q2d(av_div_q(z, wp_d50.y)) * white->Y; + if (!cmsWriteTag(profile, cmsSigMediaWhitePointTag, &fixed)) + return AVERROR_EXTERNAL; + } + break; + default: break; + } + } + + return 0; +} + int ff_icc_profile_read_primaries(FFIccContext *s, cmsHPROFILE profile, AVColorPrimariesDesc *out_primaries) { diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/fflcms2.h b/arm/raspi/third_party/ffmpeg/libavcodec/fflcms2.h index af63c9a1..b54173e5 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/fflcms2.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/fflcms2.h @@ -65,6 +65,13 @@ int ff_icc_profile_generate(FFIccContext *s, */ int ff_icc_profile_attach(FFIccContext *s, cmsHPROFILE profile, AVFrame *frame); +/** + * Sanitize an ICC profile to try and fix badly broken values. + * + * Returns 0 on success, or a negative error code. + */ +int ff_icc_profile_sanitize(FFIccContext *s, cmsHPROFILE profile); + /** * Read the color primaries and white point coefficients encoded by an ICC * profile, and return the raw values in `out_primaries`. diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/ffv1dec.c b/arm/raspi/third_party/ffmpeg/libavcodec/ffv1dec.c index 54cf075b..a376a4c8 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/ffv1dec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/ffv1dec.c @@ -626,6 +626,9 @@ static int read_header(FFV1Context *f) } else if (f->avctx->bits_per_raw_sample == 12) { f->packed_at_lsb = 1; f->avctx->pix_fmt = AV_PIX_FMT_GRAY12; + } else if (f->avctx->bits_per_raw_sample == 14) { + f->packed_at_lsb = 1; + f->avctx->pix_fmt = AV_PIX_FMT_GRAY14; } else if (f->avctx->bits_per_raw_sample == 16) { f->packed_at_lsb = 1; f->avctx->pix_fmt = AV_PIX_FMT_GRAY16; @@ -690,6 +693,12 @@ static int read_header(FFV1Context *f) case 0x10: f->avctx->pix_fmt = AV_PIX_FMT_YUV422P12; break; case 0x11: f->avctx->pix_fmt = AV_PIX_FMT_YUV420P12; break; } + } else if (f->avctx->bits_per_raw_sample == 12 && f->transparency) { + f->packed_at_lsb = 1; + switch(16 * f->chroma_h_shift + f->chroma_v_shift) { + case 0x00: f->avctx->pix_fmt = AV_PIX_FMT_YUVA444P12; break; + case 0x10: f->avctx->pix_fmt = AV_PIX_FMT_YUVA422P12; break; + } } else if (f->avctx->bits_per_raw_sample == 14 && !f->transparency) { f->packed_at_lsb = 1; switch(16 * f->chroma_h_shift + f->chroma_v_shift) { @@ -734,6 +743,8 @@ static int read_header(FFV1Context *f) f->avctx->pix_fmt = AV_PIX_FMT_GBRAP12; else if (f->avctx->bits_per_raw_sample == 14 && !f->transparency) f->avctx->pix_fmt = AV_PIX_FMT_GBRP14; + else if (f->avctx->bits_per_raw_sample == 14 && f->transparency) + f->avctx->pix_fmt = AV_PIX_FMT_GBRAP14; else if (f->avctx->bits_per_raw_sample == 16 && !f->transparency) { f->avctx->pix_fmt = AV_PIX_FMT_GBRP16; f->use32bit = 1; @@ -1061,26 +1072,19 @@ static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src) if (dst == src) return 0; - { - ThreadFrame picture = fdst->picture, last_picture = fdst->last_picture; - uint8_t (*initial_states[MAX_QUANT_TABLES])[32]; - struct FFV1Context *slice_context[MAX_SLICES]; - memcpy(initial_states, fdst->initial_states, sizeof(fdst->initial_states)); - memcpy(slice_context, fdst->slice_context , sizeof(fdst->slice_context)); + copy_fields(fdst, fsrc, fsrc); + fdst->use32bit = fsrc->use32bit; + memcpy(fdst->state_transition, fsrc->state_transition, + sizeof(fdst->state_transition)); + memcpy(fdst->quant_table, fsrc->quant_table, sizeof(fsrc->quant_table)); - memcpy(fdst, fsrc, sizeof(*fdst)); - memcpy(fdst->initial_states, initial_states, sizeof(fdst->initial_states)); - memcpy(fdst->slice_context, slice_context , sizeof(fdst->slice_context)); - fdst->picture = picture; - fdst->last_picture = last_picture; - for (i = 0; inum_h_slices * fdst->num_v_slices; i++) { - FFV1Context *fssrc = fsrc->slice_context[i]; - FFV1Context *fsdst = fdst->slice_context[i]; - copy_fields(fsdst, fssrc, fsrc); - } - av_assert0(!fdst->plane[0].state); - av_assert0(!fdst->sample_buffer); + for (i = 0; i < fdst->num_h_slices * fdst->num_v_slices; i++) { + FFV1Context *fssrc = fsrc->slice_context[i]; + FFV1Context *fsdst = fdst->slice_context[i]; + copy_fields(fsdst, fssrc, fsrc); } + av_assert0(!fdst->plane[0].state); + av_assert0(!fdst->sample_buffer); av_assert1(fdst->max_slice_count == fsrc->max_slice_count); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/ffv1enc.c b/arm/raspi/third_party/ffmpeg/libavcodec/ffv1enc.c index 746f7175..2778c630 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/ffv1enc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/ffv1enc.c @@ -585,8 +585,11 @@ static av_cold int encode_init(AVCodecContext *avctx) case AV_PIX_FMT_YUV440P12: case AV_PIX_FMT_YUV420P12: case AV_PIX_FMT_YUV422P12: + case AV_PIX_FMT_YUVA444P12: + case AV_PIX_FMT_YUVA422P12: if (!avctx->bits_per_raw_sample && !s->bits_per_raw_sample) s->bits_per_raw_sample = 12; + case AV_PIX_FMT_GRAY14: case AV_PIX_FMT_YUV444P14: case AV_PIX_FMT_YUV420P14: case AV_PIX_FMT_YUV422P14: @@ -667,6 +670,7 @@ static av_cold int encode_init(AVCodecContext *avctx) if (!avctx->bits_per_raw_sample && !s->bits_per_raw_sample) s->bits_per_raw_sample = 12; case AV_PIX_FMT_GBRP14: + case AV_PIX_FMT_GBRAP14: if (!avctx->bits_per_raw_sample && !s->bits_per_raw_sample) s->bits_per_raw_sample = 14; case AV_PIX_FMT_GBRP16: @@ -1284,13 +1288,14 @@ const FFCodec ff_ffv1_encoder = { AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUVA444P16, AV_PIX_FMT_YUVA422P16, AV_PIX_FMT_YUVA420P16, + AV_PIX_FMT_YUVA444P12, AV_PIX_FMT_YUVA422P12, AV_PIX_FMT_YUVA444P10, AV_PIX_FMT_YUVA422P10, AV_PIX_FMT_YUVA420P10, AV_PIX_FMT_YUVA444P9, AV_PIX_FMT_YUVA422P9, AV_PIX_FMT_YUVA420P9, AV_PIX_FMT_GRAY16, AV_PIX_FMT_GRAY8, AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10, - AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14, + AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14, AV_PIX_FMT_GBRAP14, AV_PIX_FMT_GBRAP10, AV_PIX_FMT_GBRAP12, AV_PIX_FMT_YA8, - AV_PIX_FMT_GRAY10, AV_PIX_FMT_GRAY12, + AV_PIX_FMT_GRAY10, AV_PIX_FMT_GRAY12, AV_PIX_FMT_GRAY14, AV_PIX_FMT_GBRP16, AV_PIX_FMT_RGB48, AV_PIX_FMT_GBRAP16, AV_PIX_FMT_RGBA64, AV_PIX_FMT_GRAY9, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/flac.c b/arm/raspi/third_party/ffmpeg/libavcodec/flac.c index 174b4801..fac4cff9 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/flac.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/flac.c @@ -48,14 +48,14 @@ static int64_t get_utf8(GetBitContext *gb) return val; } -int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, +int ff_flac_decode_frame_header(void *logctx, GetBitContext *gb, FLACFrameInfo *fi, int log_level_offset) { int bs_code, sr_code, bps_code; /* frame sync code */ if ((get_bits(gb, 15) & 0x7FFF) != 0x7FFC) { - av_log(avctx, AV_LOG_ERROR + log_level_offset, "invalid sync code\n"); + av_log(logctx, AV_LOG_ERROR + log_level_offset, "invalid sync code\n"); return AVERROR_INVALIDDATA; } @@ -75,7 +75,7 @@ int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, fi->channels = 2; fi->ch_mode -= FLAC_MAX_CHANNELS - 1; } else { - av_log(avctx, AV_LOG_ERROR + log_level_offset, + av_log(logctx, AV_LOG_ERROR + log_level_offset, "invalid channel mode: %d\n", fi->ch_mode); return AVERROR_INVALIDDATA; } @@ -83,7 +83,7 @@ int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, /* bits per sample */ bps_code = get_bits(gb, 3); if (bps_code == 3) { - av_log(avctx, AV_LOG_ERROR + log_level_offset, + av_log(logctx, AV_LOG_ERROR + log_level_offset, "invalid sample size code (%d)\n", bps_code); return AVERROR_INVALIDDATA; @@ -92,7 +92,7 @@ int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, /* reserved bit */ if (get_bits1(gb)) { - av_log(avctx, AV_LOG_ERROR + log_level_offset, + av_log(logctx, AV_LOG_ERROR + log_level_offset, "broken stream, invalid padding\n"); return AVERROR_INVALIDDATA; } @@ -100,14 +100,14 @@ int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, /* sample or frame count */ fi->frame_or_sample_num = get_utf8(gb); if (fi->frame_or_sample_num < 0) { - av_log(avctx, AV_LOG_ERROR + log_level_offset, + av_log(logctx, AV_LOG_ERROR + log_level_offset, "sample/frame number invalid; utf8 fscked\n"); return AVERROR_INVALIDDATA; } /* blocksize */ if (bs_code == 0) { - av_log(avctx, AV_LOG_ERROR + log_level_offset, + av_log(logctx, AV_LOG_ERROR + log_level_offset, "reserved blocksize code: 0\n"); return AVERROR_INVALIDDATA; } else if (bs_code == 6) { @@ -128,7 +128,7 @@ int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, } else if (sr_code == 14) { fi->samplerate = get_bits(gb, 16) * 10; } else { - av_log(avctx, AV_LOG_ERROR + log_level_offset, + av_log(logctx, AV_LOG_ERROR + log_level_offset, "illegal sample rate code %d\n", sr_code); return AVERROR_INVALIDDATA; @@ -138,7 +138,7 @@ int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, skip_bits(gb, 8); if (av_crc(av_crc_get_table(AV_CRC_8_ATM), 0, gb->buffer, get_bits_count(gb)/8)) { - av_log(avctx, AV_LOG_ERROR + log_level_offset, + av_log(logctx, AV_LOG_ERROR + log_level_offset, "header crc mismatch\n"); return AVERROR_INVALIDDATA; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/flac_parse.h b/arm/raspi/third_party/ffmpeg/libavcodec/flac_parse.h index 67a7320b..b0cbad82 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/flac_parse.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/flac_parse.h @@ -75,13 +75,13 @@ int ff_flac_is_extradata_valid(AVCodecContext *avctx, /** * Validate and decode a frame header. - * @param avctx AVCodecContext to use as av_log() context + * @param logctx context for logging * @param gb GetBitContext from which to read frame header * @param[out] fi frame information * @param log_level_offset log level offset. can be used to silence error messages. * @return non-zero on error, 0 if ok */ -int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, +int ff_flac_decode_frame_header(void *logctx, GetBitContext *gb, FLACFrameInfo *fi, int log_level_offset); void ff_flac_set_channel_layout(AVCodecContext *avctx, int channels); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/flacdec.c b/arm/raspi/third_party/ffmpeg/libavcodec/flacdec.c index 524a0469..ed2de14d 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/flacdec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/flacdec.c @@ -366,19 +366,19 @@ static int decode_subframe_fixed(FLACContext *s, int32_t *decoded, break; \ case 1: \ for (int i = pred_order; i < blocksize; i++) \ - decoded[i] = (int64_t)residual[i] + (int64_t)decoded[i-1];\ + decoded[i] = (uint64_t)residual[i] + (uint64_t)decoded[i-1];\ break; \ case 2: \ for (int i = pred_order; i < blocksize; i++) \ - decoded[i] = (int64_t)residual[i] + 2*(int64_t)decoded[i-1] - (int64_t)decoded[i-2]; \ + decoded[i] = (uint64_t)residual[i] + 2*(uint64_t)decoded[i-1] - (uint64_t)decoded[i-2]; \ break; \ case 3: \ for (int i = pred_order; i < blocksize; i++) \ - decoded[i] = (int64_t)residual[i] + 3*(int64_t)decoded[i-1] - 3*(int64_t)decoded[i-2] + (int64_t)decoded[i-3]; \ + decoded[i] = (uint64_t)residual[i] + 3*(uint64_t)decoded[i-1] - 3*(uint64_t)decoded[i-2] + (uint64_t)decoded[i-3]; \ break; \ case 4: \ for (int i = pred_order; i < blocksize; i++) \ - decoded[i] = (int64_t)residual[i] + 4*(int64_t)decoded[i-1] - 6*(int64_t)decoded[i-2] + 4*(int64_t)decoded[i-3] - (int64_t)decoded[i-4]; \ + decoded[i] = (uint64_t)residual[i] + 4*(uint64_t)decoded[i-1] - 6*(uint64_t)decoded[i-2] + 4*(uint64_t)decoded[i-3] - (uint64_t)decoded[i-4]; \ break; \ default: \ av_log(s->avctx, AV_LOG_ERROR, "illegal pred order %d\n", pred_order); \ @@ -706,10 +706,10 @@ static void decorrelate_33bps(int ch_mode, int32_t **decoded, int64_t *decoded_3 int i; if (ch_mode == FLAC_CHMODE_LEFT_SIDE ) { for (i = 0; i < len; i++) - decoded[1][i] = decoded[0][i] - decoded_33bps[i]; + decoded[1][i] = decoded[0][i] - (uint64_t)decoded_33bps[i]; } else if (ch_mode == FLAC_CHMODE_RIGHT_SIDE ) { for (i = 0; i < len; i++) - decoded[0][i] = decoded[1][i] + decoded_33bps[i]; + decoded[0][i] = decoded[1][i] + (uint64_t)decoded_33bps[i]; } else if (ch_mode == FLAC_CHMODE_MID_SIDE ) { for (i = 0; i < len; i++) { uint64_t a = decoded[0][i]; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/flicvideo.c b/arm/raspi/third_party/ffmpeg/libavcodec/flicvideo.c index e4b334e1..6ce033ba 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/flicvideo.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/flicvideo.c @@ -60,12 +60,28 @@ #define FLC_DTA_TYPE_CODE (0xAF44) /* Marks an "Extended FLC" comes from Dave's Targa Animator (DTA) */ #define FLC_MAGIC_CARPET_SYNTHETIC_TYPE_CODE (0xAF13) +static inline int check_pixel_ptr(ptrdiff_t ptr, int n, + ptrdiff_t limit, int direction) +{ + if (( direction && ptr + n > limit) || + (!direction && ptr + n < limit)) + return AVERROR_INVALIDDATA; + return 0; +} + #define CHECK_PIXEL_PTR(n) \ - if (pixel_ptr + n > pixel_limit) { \ - av_log (s->avctx, AV_LOG_ERROR, "Invalid pixel_ptr = %d > pixel_limit = %d\n", \ - pixel_ptr + n, pixel_limit); \ - return AVERROR_INVALIDDATA; \ - } \ +{ \ + ret = check_pixel_ptr(pixel_ptr, (n), pixel_limit, direction); \ + if (ret < 0) \ + return ret; \ +} + +#define CHECK_Y_PTR() \ +{ \ + ret = check_pixel_ptr(y_ptr, 0, pixel_limit, direction); \ + if (ret < 0) \ + return ret; \ +} typedef struct FlicDecodeContext { AVCodecContext *avctx; @@ -79,7 +95,7 @@ typedef struct FlicDecodeContext { static av_cold int flic_decode_init(AVCodecContext *avctx) { FlicDecodeContext *s = avctx->priv_data; - unsigned char *fli_header = (unsigned char *)avctx->extradata; + uint8_t *fli_header = avctx->extradata; int depth; if (avctx->extradata_size != 0 && @@ -128,6 +144,7 @@ static av_cold int flic_decode_init(AVCodecContext *avctx) } switch (depth) { + case 1 : avctx->pix_fmt = AV_PIX_FMT_MONOBLACK; break; case 8 : avctx->pix_fmt = AV_PIX_FMT_PAL8; break; case 15 : avctx->pix_fmt = AV_PIX_FMT_RGB555; break; case 16 : avctx->pix_fmt = AV_PIX_FMT_RGB565; break; @@ -146,6 +163,198 @@ static av_cold int flic_decode_init(AVCodecContext *avctx) return 0; } +static int flic_decode_frame_1BPP(AVCodecContext *avctx, + AVFrame *rframe, int *got_frame, + const uint8_t *buf, int buf_size) +{ + FlicDecodeContext *s = avctx->priv_data; + + GetByteContext g2; + ptrdiff_t pixel_ptr; + + unsigned int frame_size; + int num_chunks; + + unsigned int chunk_size; + int chunk_type; + + int i, j, ret, direction; + + int lines; + int compressed_lines; + int starting_line; + int line_packets; + ptrdiff_t y_ptr; + int byte_run; + int pixel_skip; + int pixel_countdown; + unsigned char *pixels; + ptrdiff_t pixel_limit; + + bytestream2_init(&g2, buf, buf_size); + + if ((ret = ff_reget_buffer(avctx, s->frame, 0)) < 0) + return ret; + + direction = s->frame->linesize[0] > 0; + pixels = s->frame->data[0]; + pixel_limit = s->avctx->height * s->frame->linesize[0]; + if (buf_size < 16 || buf_size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE) + return AVERROR_INVALIDDATA; + frame_size = bytestream2_get_le32(&g2); + if (frame_size > buf_size) + frame_size = buf_size; + bytestream2_skip(&g2, 2); /* skip the magic number */ + num_chunks = bytestream2_get_le16(&g2); + bytestream2_skip(&g2, 8); /* skip padding */ + + if (frame_size < 16) + return AVERROR_INVALIDDATA; + + frame_size -= 16; + + /* iterate through the chunks */ + while ((frame_size >= 6) && (num_chunks > 0) && + bytestream2_get_bytes_left(&g2) >= 4) { + int stream_ptr_after_chunk; + chunk_size = bytestream2_get_le32(&g2); + if (chunk_size > frame_size) { + av_log(avctx, AV_LOG_WARNING, + "Invalid chunk_size = %u > frame_size = %u\n", chunk_size, frame_size); + chunk_size = frame_size; + } + stream_ptr_after_chunk = bytestream2_tell(&g2) - 4 + chunk_size; + + chunk_type = bytestream2_get_le16(&g2); + + switch (chunk_type) { + case FLI_BRUN: + /* Byte run compression: This chunk type only occurs in the first + * FLI frame and it will update the entire frame. */ + y_ptr = 0; + for (lines = 0; lines < s->avctx->height; lines++) { + pixel_ptr = y_ptr; + /* disregard the line packets; instead, iterate through all + * pixels on a row */ + bytestream2_skip(&g2, 1); + pixel_countdown = (s->avctx->width + 7) >> 3; + while (pixel_countdown > 0) { + if (bytestream2_tell(&g2) + 1 > stream_ptr_after_chunk) + break; + byte_run = sign_extend(bytestream2_get_byte(&g2), 8); + if (!byte_run) { + av_log(avctx, AV_LOG_ERROR, "Invalid byte run value.\n"); + return AVERROR_INVALIDDATA; + } + + if (byte_run > 0) { + int value = bytestream2_get_byte(&g2); + CHECK_PIXEL_PTR(byte_run); + for (j = 0; j < byte_run; j++) { + pixels[pixel_ptr++] = value; + pixel_countdown--; + if (pixel_countdown < 0) + av_log(avctx, AV_LOG_ERROR, "pixel_countdown < 0 (%d) at line %d\n", + pixel_countdown, lines); + } + } else { /* copy bytes if byte_run < 0 */ + byte_run = -byte_run; + CHECK_PIXEL_PTR(byte_run); + if (bytestream2_tell(&g2) + byte_run > stream_ptr_after_chunk) + break; + for (j = 0; j < byte_run; j++) { + pixels[pixel_ptr++] = bytestream2_get_byte(&g2); + pixel_countdown--; + if (pixel_countdown < 0) + av_log(avctx, AV_LOG_ERROR, "pixel_countdown < 0 (%d) at line %d\n", + pixel_countdown, lines); + } + } + } + + y_ptr += s->frame->linesize[0]; + } + break; + + case FLI_LC: + /* line compressed */ + starting_line = bytestream2_get_le16(&g2); + if (starting_line >= s->avctx->height) + return AVERROR_INVALIDDATA; + y_ptr = 0; + y_ptr += starting_line * s->frame->linesize[0]; + + compressed_lines = bytestream2_get_le16(&g2); + while (compressed_lines > 0) { + pixel_ptr = y_ptr; + CHECK_PIXEL_PTR(0); + pixel_countdown = (s->avctx->width + 7) >> 3; + if (bytestream2_tell(&g2) + 1 > stream_ptr_after_chunk) + break; + line_packets = bytestream2_get_byte(&g2); + if (line_packets > 0) { + for (i = 0; i < line_packets; i++) { + /* account for the skip bytes */ + if (bytestream2_tell(&g2) + 1 > stream_ptr_after_chunk) + break; + pixel_skip = bytestream2_get_byte(&g2); + pixel_ptr += pixel_skip; + pixel_countdown -= pixel_skip; + byte_run = sign_extend(bytestream2_get_byte(&g2),8); + if (byte_run > 0) { + CHECK_PIXEL_PTR(byte_run); + if (bytestream2_tell(&g2) + byte_run > stream_ptr_after_chunk) + break; + for (j = 0; j < byte_run; j++, pixel_countdown--) { + pixels[pixel_ptr++] = bytestream2_get_byte(&g2); + } + } else if (byte_run < 0) { + int value = bytestream2_get_byte(&g2); + byte_run = -byte_run; + CHECK_PIXEL_PTR(byte_run); + for (j = 0; j < byte_run; j++, pixel_countdown--) { + pixels[pixel_ptr++] = value; + } + } + } + } + + y_ptr += s->frame->linesize[0]; + compressed_lines--; + } + break; + + default: + av_log(avctx, AV_LOG_ERROR, "Unrecognized chunk type: %d\n", chunk_type); + break; + } + + if (stream_ptr_after_chunk - bytestream2_tell(&g2) >= 0) { + bytestream2_skip(&g2, stream_ptr_after_chunk - bytestream2_tell(&g2)); + } else { + av_log(avctx, AV_LOG_ERROR, "Chunk overread\n"); + break; + } + + frame_size -= chunk_size; + num_chunks--; + } + + /* by the end of the chunk, the stream ptr should equal the frame + * size (minus 1 or 2, possibly); if it doesn't, issue a warning */ + if (bytestream2_get_bytes_left(&g2) > 2) + av_log(avctx, AV_LOG_ERROR, "Processed FLI chunk where chunk size = %d " \ + "and final chunk ptr = %d\n", buf_size, + buf_size - bytestream2_get_bytes_left(&g2)); + + if ((ret = av_frame_ref(rframe, s->frame)) < 0) + return ret; + + *got_frame = 1; + + return buf_size; +} + static int flic_decode_frame_8BPP(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, const uint8_t *buf, int buf_size) @@ -153,7 +362,7 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx, FlicDecodeContext *s = avctx->priv_data; GetByteContext g2; - int pixel_ptr; + ptrdiff_t pixel_ptr; int palette_ptr; unsigned char palette_idx1; unsigned char palette_idx2; @@ -164,7 +373,7 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx, unsigned int chunk_size; int chunk_type; - int i, j, ret; + int i, j, ret, direction; int color_packets; int color_changes; @@ -175,18 +384,19 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx, int compressed_lines; int starting_line; int line_packets; - int y_ptr; + ptrdiff_t y_ptr; int byte_run; int pixel_skip; int pixel_countdown; unsigned char *pixels; - unsigned int pixel_limit; + ptrdiff_t pixel_limit; bytestream2_init(&g2, buf, buf_size); if ((ret = ff_reget_buffer(avctx, s->frame, 0)) < 0) return ret; + direction = s->frame->linesize[0] > 0; pixels = s->frame->data[0]; pixel_limit = s->avctx->height * s->frame->linesize[0]; if (buf_size < 16 || buf_size > INT_MAX - (3 * 256 + AV_INPUT_BUFFER_PADDING_SIZE)) @@ -271,8 +481,7 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx, while (compressed_lines > 0) { if (bytestream2_tell(&g2) + 2 > stream_ptr_after_chunk) break; - if (y_ptr > pixel_limit) - return AVERROR_INVALIDDATA; + CHECK_Y_PTR() line_packets = sign_extend(bytestream2_get_le16(&g2), 16); if ((line_packets & 0xC000) == 0xC000) { // line skip opcode @@ -374,8 +583,8 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx, case FLI_BLACK: /* set the whole frame to color 0 (which is usually black) */ - memset(pixels, 0, - s->frame->linesize[0] * s->avctx->height); + for (int y = 0; y < s->avctx->height; y++) + memset(pixels + y * s->frame->linesize[0], 0, s->avctx->width); break; case FLI_BRUN: @@ -433,7 +642,7 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx, "has incorrect size, skipping chunk\n", chunk_size - 6); bytestream2_skip(&g2, chunk_size - 6); } else { - for (y_ptr = 0; y_ptr < s->frame->linesize[0] * s->avctx->height; + for (y_ptr = 0; check_pixel_ptr(y_ptr, 0, pixel_limit, direction) == 0; y_ptr += s->frame->linesize[0]) { bytestream2_get_buffer(&g2, &pixels[y_ptr], s->avctx->width); @@ -498,7 +707,7 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx, FlicDecodeContext *s = avctx->priv_data; GetByteContext g2; - int pixel_ptr; + ptrdiff_t pixel_ptr; unsigned char palette_idx1; unsigned int frame_size; @@ -507,24 +716,25 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx, unsigned int chunk_size; int chunk_type; - int i, j, ret; + int i, j, ret, direction; int lines; int compressed_lines; int line_packets; - int y_ptr; + ptrdiff_t y_ptr; int byte_run; int pixel_skip; int pixel_countdown; unsigned char *pixels; int pixel; - unsigned int pixel_limit; + ptrdiff_t pixel_limit; bytestream2_init(&g2, buf, buf_size); if ((ret = ff_reget_buffer(avctx, s->frame, 0)) < 0) return ret; + direction = s->frame->linesize[0] > 0; pixels = s->frame->data[0]; pixel_limit = s->avctx->height * s->frame->linesize[0]; @@ -573,8 +783,7 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx, while (compressed_lines > 0) { if (bytestream2_tell(&g2) + 2 > stream_ptr_after_chunk) break; - if (y_ptr > pixel_limit) - return AVERROR_INVALIDDATA; + CHECK_Y_PTR() line_packets = sign_extend(bytestream2_get_le16(&g2), 16); if (line_packets < 0) { line_packets = -line_packets; @@ -625,8 +834,8 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx, case FLI_BLACK: /* set the whole frame to 0x0000 which is black in both 15Bpp and 16Bpp modes. */ - memset(pixels, 0x0000, - s->frame->linesize[0] * s->avctx->height); + for (int y = 0; y < s->avctx->height; y++) + memset(pixels + y * s->frame->linesize[0], 0, s->avctx->width * 2); break; case FLI_BRUN: @@ -740,7 +949,7 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx, if (bytestream2_get_bytes_left(&g2) < 2 * s->avctx->width * s->avctx->height ) return AVERROR_INVALIDDATA; - for (y_ptr = 0; y_ptr < s->frame->linesize[0] * s->avctx->height; + for (y_ptr = 0; check_pixel_ptr(y_ptr, 0, pixel_limit, direction) == 0; y_ptr += s->frame->linesize[0]) { pixel_countdown = s->avctx->width; @@ -798,7 +1007,7 @@ static int flic_decode_frame_24BPP(AVCodecContext *avctx, FlicDecodeContext *s = avctx->priv_data; GetByteContext g2; - int pixel_ptr; + ptrdiff_t pixel_ptr; unsigned char palette_idx1; unsigned int frame_size; @@ -807,24 +1016,25 @@ static int flic_decode_frame_24BPP(AVCodecContext *avctx, unsigned int chunk_size; int chunk_type; - int i, j, ret; + int i, j, ret, direction; int lines; int compressed_lines; int line_packets; - int y_ptr; + ptrdiff_t y_ptr; int byte_run; int pixel_skip; int pixel_countdown; unsigned char *pixels; int pixel; - unsigned int pixel_limit; + ptrdiff_t pixel_limit; bytestream2_init(&g2, buf, buf_size); if ((ret = ff_reget_buffer(avctx, s->frame, 0)) < 0) return ret; + direction = s->frame->linesize[0] > 0; pixels = s->frame->data[0]; pixel_limit = s->avctx->height * s->frame->linesize[0]; @@ -873,8 +1083,7 @@ static int flic_decode_frame_24BPP(AVCodecContext *avctx, while (compressed_lines > 0) { if (bytestream2_tell(&g2) + 2 > stream_ptr_after_chunk) break; - if (y_ptr > pixel_limit) - return AVERROR_INVALIDDATA; + CHECK_Y_PTR() line_packets = sign_extend(bytestream2_get_le16(&g2), 16); if (line_packets < 0) { line_packets = -line_packets; @@ -926,8 +1135,8 @@ static int flic_decode_frame_24BPP(AVCodecContext *avctx, case FLI_BLACK: /* set the whole frame to 0x00 which is black for 24 bit mode. */ - memset(pixels, 0x00, - s->frame->linesize[0] * s->avctx->height); + for (int y = 0; y < s->avctx->height; y++) + memset(pixels + y * s->frame->linesize[0], 0, s->avctx->width * 3); break; case FLI_BRUN: @@ -1026,7 +1235,7 @@ static int flic_decode_frame_24BPP(AVCodecContext *avctx, "bigger than image, skipping chunk\n", chunk_size - 6); bytestream2_skip(&g2, chunk_size - 6); } else { - for (y_ptr = 0; y_ptr < s->frame->linesize[0] * s->avctx->height; + for (y_ptr = 0; check_pixel_ptr(y_ptr, 0, pixel_limit, direction) == 0; y_ptr += s->frame->linesize[0]) { bytestream2_get_buffer(&g2, pixels + y_ptr, 3*s->avctx->width); @@ -1076,7 +1285,10 @@ static int flic_decode_frame(AVCodecContext *avctx, AVFrame *frame, { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; - if (avctx->pix_fmt == AV_PIX_FMT_PAL8) { + if (avctx->pix_fmt == AV_PIX_FMT_MONOBLACK) { + return flic_decode_frame_1BPP(avctx, frame, got_frame, + buf, buf_size); + } else if (avctx->pix_fmt == AV_PIX_FMT_PAL8) { return flic_decode_frame_8BPP(avctx, frame, got_frame, buf, buf_size); } else if ((avctx->pix_fmt == AV_PIX_FMT_RGB555) || diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/fraps.c b/arm/raspi/third_party/ffmpeg/libavcodec/fraps.c index 834e6576..7790e689 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/fraps.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/fraps.c @@ -56,7 +56,6 @@ typedef struct FrapsContext { int tmpbuf_size; } FrapsContext; - /** * initializes decoder * @param avctx codec context @@ -123,13 +122,13 @@ static int fraps2_decode_plane(FrapsContext *s, uint8_t *dst, int stride, int w, else if (Uoff) dst[i] += 0x80; if (get_bits_left(&gb) < 0) { - ff_free_vlc(&vlc); + ff_vlc_free(&vlc); return AVERROR_INVALIDDATA; } } dst += stride; } - ff_free_vlc(&vlc); + ff_vlc_free(&vlc); return 0; } @@ -323,7 +322,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *f, return buf_size; } - /** * closes decoder * @param avctx codec context @@ -331,13 +329,12 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *f, */ static av_cold int decode_end(AVCodecContext *avctx) { - FrapsContext *s = (FrapsContext*)avctx->priv_data; + FrapsContext *s = avctx->priv_data; av_freep(&s->tmpbuf); return 0; } - const FFCodec ff_fraps_decoder = { .p.name = "fraps", CODEC_LONG_NAME("Fraps"), diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/g2meet.c b/arm/raspi/third_party/ffmpeg/libavcodec/g2meet.c index 2dfa73df..34ff60a3 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/g2meet.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/g2meet.c @@ -195,8 +195,8 @@ static av_cold void jpg_free_context(JPGContext *ctx) int i; for (i = 0; i < 2; i++) { - ff_free_vlc(&ctx->dc_vlc[i]); - ff_free_vlc(&ctx->ac_vlc[i]); + ff_vlc_free(&ctx->dc_vlc[i]); + ff_vlc_free(&ctx->ac_vlc[i]); } av_freep(&ctx->buf); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/g722dsp.c b/arm/raspi/third_party/ffmpeg/libavcodec/g722dsp.c index c770bfbd..30228368 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/g722dsp.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/g722dsp.c @@ -71,6 +71,8 @@ av_cold void ff_g722dsp_init(G722DSPContext *c) #if ARCH_ARM ff_g722dsp_init_arm(c); +#elif ARCH_RISCV + ff_g722dsp_init_riscv(c); #elif ARCH_X86 ff_g722dsp_init_x86(c); #endif diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/g722dsp.h b/arm/raspi/third_party/ffmpeg/libavcodec/g722dsp.h index c956a1e1..1aa7078a 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/g722dsp.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/g722dsp.h @@ -29,6 +29,7 @@ typedef struct G722DSPContext { void ff_g722dsp_init(G722DSPContext *c); void ff_g722dsp_init_arm(G722DSPContext *c); +void ff_g722dsp_init_riscv(G722DSPContext *c); void ff_g722dsp_init_x86(G722DSPContext *c); #endif /* AVCODEC_G722DSP_H */ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/g729postfilter.c b/arm/raspi/third_party/ffmpeg/libavcodec/g729postfilter.c index 26e937f0..382db924 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/g729postfilter.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/g729postfilter.c @@ -581,7 +581,7 @@ void ff_g729_postfilter(AudioDSPContext *adsp, int16_t* ht_prev_data, int* voici int16_t ff_g729_adaptive_gain_control(int gain_before, int gain_after, int16_t *speech, int subframe_size, int16_t gain_prev) { - int gain; // (3.12) + unsigned gain; // (3.12) int n; int exp_before, exp_after; @@ -603,7 +603,7 @@ int16_t ff_g729_adaptive_gain_control(int gain_before, int gain_after, int16_t * gain = ((gain_before - gain_after) << 14) / gain_after + 0x4000; gain = bidir_sal(gain, exp_after - exp_before); } - gain = av_clip_int16(gain); + gain = FFMIN(gain, 32767); gain = (gain * G729_AGC_FAC1 + 0x4000) >> 15; // gain * (1-0.9875) } else gain = 0; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/get_bits.h b/arm/raspi/third_party/ffmpeg/libavcodec/get_bits.h index 65dc080d..cfcf97c0 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/get_bits.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/get_bits.h @@ -93,6 +93,7 @@ typedef BitstreamContext GetBitContext; #define init_get_bits8 bits_init8 #define align_get_bits bits_align #define get_vlc2 bits_read_vlc +#define get_vlc_multi bits_read_vlc_multi #define init_get_bits8_le(s, buffer, byte_size) bits_init8_le((BitstreamContextLE*)s, buffer, byte_size) #define get_bits_le(s, n) bits_read_le((BitstreamContextLE*)s, n) @@ -186,21 +187,28 @@ static inline unsigned int show_bits(GetBitContext *s, int n); #define CLOSE_READER(name, gb) (gb)->index = name ## _index +#define UPDATE_CACHE_BE_EXT(name, gb, bits, dst_bits) name ## _cache = \ + AV_RB ## bits((gb)->buffer + (name ## _index >> 3)) << (name ## _index & 7) >> (bits - dst_bits) + +#define UPDATE_CACHE_LE_EXT(name, gb, bits, dst_bits) name ## _cache = \ + (uint ## dst_bits ## _t)(AV_RL ## bits((gb)->buffer + (name ## _index >> 3)) >> (name ## _index & 7)) + +/* Using these two macros ensures that 32 bits are available. */ +# define UPDATE_CACHE_LE_32(name, gb) UPDATE_CACHE_LE_EXT(name, (gb), 64, 32) + +# define UPDATE_CACHE_BE_32(name, gb) UPDATE_CACHE_BE_EXT(name, (gb), 64, 32) + # ifdef LONG_BITSTREAM_READER -# define UPDATE_CACHE_LE(name, gb) name ## _cache = \ - AV_RL64((gb)->buffer + (name ## _index >> 3)) >> (name ## _index & 7) +# define UPDATE_CACHE_LE(name, gb) UPDATE_CACHE_LE_32(name, (gb)) -# define UPDATE_CACHE_BE(name, gb) name ## _cache = \ - AV_RB64((gb)->buffer + (name ## _index >> 3)) >> (32 - (name ## _index & 7)) +# define UPDATE_CACHE_BE(name, gb) UPDATE_CACHE_BE_32(name, (gb)) #else -# define UPDATE_CACHE_LE(name, gb) name ## _cache = \ - AV_RL32((gb)->buffer + (name ## _index >> 3)) >> (name ## _index & 7) +# define UPDATE_CACHE_LE(name, gb) UPDATE_CACHE_LE_EXT(name, (gb), 32, 32) -# define UPDATE_CACHE_BE(name, gb) name ## _cache = \ - AV_RB32((gb)->buffer + (name ## _index >> 3)) << (name ## _index & 7) +# define UPDATE_CACHE_BE(name, gb) UPDATE_CACHE_BE_EXT(name, (gb), 32, 32) #endif @@ -208,12 +216,14 @@ static inline unsigned int show_bits(GetBitContext *s, int n); #ifdef BITSTREAM_READER_LE # define UPDATE_CACHE(name, gb) UPDATE_CACHE_LE(name, gb) +# define UPDATE_CACHE_32(name, gb) UPDATE_CACHE_LE_32(name, (gb)) # define SKIP_CACHE(name, gb, num) name ## _cache >>= (num) #else # define UPDATE_CACHE(name, gb) UPDATE_CACHE_BE(name, gb) +# define UPDATE_CACHE_32(name, gb) UPDATE_CACHE_BE_32(name, (gb)) # define SKIP_CACHE(name, gb, num) name ## _cache <<= (num) @@ -413,15 +423,26 @@ static inline unsigned int get_bits_long(GetBitContext *s, int n) av_assert2(n>=0 && n<=32); if (!n) { return 0; - } else if (n <= MIN_CACHE_BITS) { + } else if ((!HAVE_FAST_64BIT || av_builtin_constant_p(n <= MIN_CACHE_BITS)) + && n <= MIN_CACHE_BITS) { return get_bits(s, n); } else { +#if HAVE_FAST_64BIT + unsigned tmp; + OPEN_READER(re, s); + UPDATE_CACHE_32(re, s); + tmp = SHOW_UBITS(re, s, n); + LAST_SKIP_BITS(re, s, n); + CLOSE_READER(re, s); + return tmp; +#else #ifdef BITSTREAM_READER_LE unsigned ret = get_bits(s, 16); return ret | (get_bits(s, n - 16) << 16); #else unsigned ret = get_bits(s, 16) << (n - 16); return ret | get_bits(s, n - 16); +#endif #endif } } @@ -622,7 +643,7 @@ static inline const uint8_t *align_get_bits(GetBitContext *s) /** * Parse a vlc code. * @param bits is the number of bits which will be read at once, must be - * identical to nb_bits in init_vlc() + * identical to nb_bits in vlc_init() * @param max_depth is the number of times bits bits must be read to completely * read the longest vlc code * = (max_vlc_length + bits - 1) / bits @@ -643,6 +664,15 @@ static av_always_inline int get_vlc2(GetBitContext *s, const VLCElem *table, return code; } +static inline int get_vlc_multi(GetBitContext *s, uint8_t *dst, + const VLC_MULTI_ELEM *const Jtable, + const VLCElem *const table, + const int bits, const int max_depth) +{ + dst[0] = get_vlc2(s, table, bits, max_depth); + return 1; +} + static inline int decode012(GetBitContext *gb) { int n; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/gif.c b/arm/raspi/third_party/ffmpeg/libavcodec/gif.c index 131af619..11add644 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/gif.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/gif.c @@ -503,8 +503,7 @@ static int gif_encode_frame(AVCodecContext *avctx, AVPacket *pkt, } if (!s->image) { - av_frame_unref(s->last_frame); - ret = av_frame_ref(s->last_frame, pict); + ret = av_frame_replace(s->last_frame, pict); if (ret < 0) return ret; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/gifdec.c b/arm/raspi/third_party/ffmpeg/libavcodec/gifdec.c index 86aaa888..a97a6d15 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/gifdec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/gifdec.c @@ -59,7 +59,7 @@ typedef struct GifState { /* depending on disposal method we store either part of the image * drawn on the canvas or background color that * should be used upon disposal */ - uint32_t * stored_img; + uint8_t *stored_img; int stored_img_size; int stored_bg_color; @@ -86,52 +86,55 @@ static void gif_read_palette(GifState *s, uint32_t *pal, int nb) static void gif_fill(AVFrame *picture, uint32_t color) { - uint32_t *p = (uint32_t *)picture->data[0]; - uint32_t *p_end = p + (picture->linesize[0] / sizeof(uint32_t)) * picture->height; + const ptrdiff_t linesize = picture->linesize[0]; + uint8_t *py = picture->data[0]; + const int w = picture->width; + const int h = picture->height; - for (; p < p_end; p++) - *p = color; + for (int y = 0; y < h; y++) { + uint32_t *px = (uint32_t *)py; + for (int x = 0; x < w; x++) + px[x] = color; + py += linesize; + } } static void gif_fill_rect(AVFrame *picture, uint32_t color, int l, int t, int w, int h) { - const int linesize = picture->linesize[0] / sizeof(uint32_t); - const uint32_t *py = (uint32_t *)picture->data[0] + t * linesize; - const uint32_t *pr, *pb = py + h * linesize; - uint32_t *px; + const ptrdiff_t linesize = picture->linesize[0]; + uint8_t *py = picture->data[0] + t * linesize; - for (; py < pb; py += linesize) { - px = (uint32_t *)py + l; - pr = px + w; - - for (; px < pr; px++) - *px = color; + for (int y = 0; y < h; y++) { + uint32_t *px = ((uint32_t *)py) + l; + for (int x = 0; x < w; x++) + px[x] = color; + py += linesize; } } -static void gif_copy_img_rect(const uint32_t *src, uint32_t *dst, - int linesize, int l, int t, int w, int h) +static void gif_copy_img_rect(const uint8_t *src, uint8_t *dst, + ptrdiff_t src_linesize, + ptrdiff_t dst_linesize, + int l, int t, int w, int h) { - const int y_start = t * linesize; - const uint32_t *src_px, - *src_py = src + y_start, - *dst_py = dst + y_start; - const uint32_t *src_pb = src_py + h * linesize; - uint32_t *dst_px; + const uint8_t *src_py = src; + uint8_t *dst_py = dst; - for (; src_py < src_pb; src_py += linesize, dst_py += linesize) { - src_px = src_py + l; - dst_px = (uint32_t *)dst_py + l; - - memcpy(dst_px, src_px, w * sizeof(uint32_t)); + src_py += t * src_linesize; + dst_py += t * dst_linesize; + for (int y = 0; y < h; y++) { + memcpy(dst_py + l * 4, src_py + l * 4, w * 4); + src_py += src_linesize; + dst_py += dst_linesize; } } static int gif_read_image(GifState *s, AVFrame *frame) { int left, top, width, height, bits_per_pixel, code_size, flags, pw; - int is_interleaved, has_local_palette, y, pass, y1, linesize, pal_size, lzwed_len; + int is_interleaved, has_local_palette, y, pass, y1, pal_size, lzwed_len; uint32_t *ptr, *pal, *px, *pr, *ptr1; + ptrdiff_t linesize; int ret; uint8_t *idx; @@ -214,8 +217,8 @@ static int gif_read_image(GifState *s, AVFrame *frame) if (s->gce_prev_disposal == GCE_DISPOSAL_BACKGROUND) { gif_fill_rect(frame, s->stored_bg_color, s->gce_l, s->gce_t, s->gce_w, s->gce_h); } else if (s->gce_prev_disposal == GCE_DISPOSAL_RESTORE) { - gif_copy_img_rect(s->stored_img, (uint32_t *)frame->data[0], - frame->linesize[0] / sizeof(uint32_t), s->gce_l, s->gce_t, s->gce_w, s->gce_h); + gif_copy_img_rect(s->stored_img, frame->data[0], + FFABS(frame->linesize[0]), frame->linesize[0], s->gce_l, s->gce_t, s->gce_w, s->gce_h); } s->gce_prev_disposal = s->gce_disposal; @@ -230,12 +233,12 @@ static int gif_read_image(GifState *s, AVFrame *frame) else s->stored_bg_color = s->bg_color; } else if (s->gce_disposal == GCE_DISPOSAL_RESTORE) { - av_fast_malloc(&s->stored_img, &s->stored_img_size, frame->linesize[0] * frame->height); + av_fast_malloc(&s->stored_img, &s->stored_img_size, FFABS(frame->linesize[0]) * frame->height); if (!s->stored_img) return AVERROR(ENOMEM); - gif_copy_img_rect((uint32_t *)frame->data[0], s->stored_img, - frame->linesize[0] / sizeof(uint32_t), left, top, pw, height); + gif_copy_img_rect(frame->data[0], s->stored_img, + frame->linesize[0], FFABS(frame->linesize[0]), left, top, pw, height); } } @@ -252,8 +255,8 @@ static int gif_read_image(GifState *s, AVFrame *frame) } /* read all the image */ - linesize = frame->linesize[0] / sizeof(uint32_t); - ptr1 = (uint32_t *)frame->data[0] + top * linesize + left; + linesize = frame->linesize[0]; + ptr1 = (uint32_t *)(frame->data[0] + top * linesize) + left; ptr = ptr1; pass = 0; y1 = 0; @@ -278,24 +281,24 @@ static int gif_read_image(GifState *s, AVFrame *frame) case 0: case 1: y1 += 8; - ptr += linesize * 8; + ptr += linesize * 2; break; case 2: y1 += 4; - ptr += linesize * 4; + ptr += linesize * 1; break; case 3: y1 += 2; - ptr += linesize * 2; + ptr += linesize / 2; break; } while (y1 >= height) { y1 = 4 >> pass; - ptr = ptr1 + linesize * y1; + ptr = ptr1 + linesize / 4 * y1; pass++; } } else { - ptr += linesize; + ptr += linesize / 4; } } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/h261dec.c b/arm/raspi/third_party/ffmpeg/libavcodec/h261dec.c index 620b7eef..c41b96c3 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/h261dec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/h261dec.c @@ -64,16 +64,16 @@ typedef struct H261DecContext { static av_cold void h261_decode_init_static(void) { - INIT_VLC_STATIC(&h261_mba_vlc, H261_MBA_VLC_BITS, 35, + VLC_INIT_STATIC(&h261_mba_vlc, H261_MBA_VLC_BITS, 35, ff_h261_mba_bits, 1, 1, ff_h261_mba_code, 1, 1, 540); - INIT_VLC_STATIC(&h261_mtype_vlc, H261_MTYPE_VLC_BITS, 10, + VLC_INIT_STATIC(&h261_mtype_vlc, H261_MTYPE_VLC_BITS, 10, ff_h261_mtype_bits, 1, 1, ff_h261_mtype_code, 1, 1, 80); - INIT_VLC_STATIC(&h261_mv_vlc, H261_MV_VLC_BITS, 17, + VLC_INIT_STATIC(&h261_mv_vlc, H261_MV_VLC_BITS, 17, &ff_h261_mv_tab[0][1], 2, 1, &ff_h261_mv_tab[0][0], 2, 1, 144); - INIT_VLC_STATIC(&h261_cbp_vlc, H261_CBP_VLC_BITS, 63, + VLC_INIT_STATIC(&h261_cbp_vlc, H261_CBP_VLC_BITS, 63, &ff_h261_cbp_tab[0][1], 2, 1, &ff_h261_cbp_tab[0][0], 2, 1, 512); INIT_FIRST_VLC_RL(ff_h261_rl_tcoeff, 552); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/h263dec.c b/arm/raspi/third_party/ffmpeg/libavcodec/h263dec.c index b5c0f4a5..3dc9f7f5 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/h263dec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/h263dec.c @@ -36,6 +36,7 @@ #include "flvdec.h" #include "h263.h" #include "h263dec.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "mpeg_er.h" #include "mpeg4video.h" @@ -190,7 +191,7 @@ static int decode_slice(MpegEncContext *s) if (s->avctx->hwaccel) { const uint8_t *start = s->gb.buffer + get_bits_count(&s->gb) / 8; - ret = s->avctx->hwaccel->decode_slice(s->avctx, start, s->gb.buffer_end - start); + ret = FF_HW_CALL(s->avctx, decode_slice, start, s->gb.buffer_end - start); // ensure we exit decode loop s->mb_y = s->mb_height; return ret; @@ -568,8 +569,8 @@ retry: ff_thread_finish_setup(avctx); if (avctx->hwaccel) { - ret = avctx->hwaccel->start_frame(avctx, s->gb.buffer, - s->gb.buffer_end - s->gb.buffer); + ret = FF_HW_CALL(avctx, start_frame, + s->gb.buffer, s->gb.buffer_end - s->gb.buffer); if (ret < 0 ) return ret; } @@ -621,10 +622,10 @@ retry: av_assert1(s->bitstream_buffer_size == 0); frame_end: if (!s->studio_profile) - ff_er_frame_end(&s->er); + ff_er_frame_end(&s->er, NULL); if (avctx->hwaccel) { - ret = avctx->hwaccel->end_frame(avctx); + ret = FF_HW_SIMPLE_CALL(avctx, end_frame); if (ret < 0) return ret; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/h2645_sei.c b/arm/raspi/third_party/ffmpeg/libavcodec/h2645_sei.c index 63ab711b..cb6be059 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/h2645_sei.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/h2645_sei.c @@ -29,6 +29,7 @@ #include "libavutil/display.h" #include "libavutil/hdr_dynamic_metadata.h" #include "libavutil/film_grain_params.h" +#include "libavutil/mastering_display_metadata.h" #include "libavutil/pixdesc.h" #include "libavutil/stereo3d.h" @@ -392,6 +393,52 @@ static int decode_film_grain_characteristics(H2645SEIFilmGrainCharacteristics *h return 0; } +static int decode_nal_sei_mastering_display_info(H2645SEIMasteringDisplay *s, + GetByteContext *gb) +{ + int i; + + if (bytestream2_get_bytes_left(gb) < 24) + return AVERROR_INVALIDDATA; + + // Mastering primaries + for (i = 0; i < 3; i++) { + s->display_primaries[i][0] = bytestream2_get_be16u(gb); + s->display_primaries[i][1] = bytestream2_get_be16u(gb); + } + // White point (x, y) + s->white_point[0] = bytestream2_get_be16u(gb); + s->white_point[1] = bytestream2_get_be16u(gb); + + // Max and min luminance of mastering display + s->max_luminance = bytestream2_get_be32u(gb); + s->min_luminance = bytestream2_get_be32u(gb); + + // As this SEI message comes before the first frame that references it, + // initialize the flag to 2 and decrement on IRAP access unit so it + // persists for the coded video sequence (e.g., between two IRAPs) + s->present = 2; + + return 0; +} + +static int decode_nal_sei_content_light_info(H2645SEIContentLight *s, + GetByteContext *gb) +{ + if (bytestream2_get_bytes_left(gb) < 4) + return AVERROR_INVALIDDATA; + + // Max and average light levels + s->max_content_light_level = bytestream2_get_be16u(gb); + s->max_pic_average_light_level = bytestream2_get_be16u(gb); + // As this SEI message comes before the first frame that references it, + // initialize the flag to 2 and decrement on IRAP access unit so it + // persists for the coded video sequence (e.g., between two IRAPs) + s->present = 2; + + return 0; +} + int ff_h2645_sei_message_decode(H2645SEI *h, enum SEIType type, enum AVCodecID codec_id, GetBitContext *gb, GetByteContext *gbyte, void *logctx) @@ -412,6 +459,11 @@ int ff_h2645_sei_message_decode(H2645SEI *h, enum SEIType type, case SEI_TYPE_AMBIENT_VIEWING_ENVIRONMENT: return decode_ambient_viewing_environment(&h->ambient_viewing_environment, gbyte); + case SEI_TYPE_MASTERING_DISPLAY_COLOUR_VOLUME: + return decode_nal_sei_mastering_display_info(&h->mastering_display, + gbyte); + case SEI_TYPE_CONTENT_LIGHT_LEVEL_INFO: + return decode_nal_sei_content_light_info(&h->content_light, gbyte); default: return FF_H2645_SEI_MESSAGE_UNHANDLED; } @@ -652,6 +704,64 @@ int ff_h2645_sei_to_frame(AVFrame *frame, H2645SEI *sei, dst_env->ambient_light_y = av_make_q(env->ambient_light_y, 50000); } + if (sei->mastering_display.present) { + // HEVC uses a g,b,r ordering, which we convert to a more natural r,g,b + const int mapping[3] = {2, 0, 1}; + const int chroma_den = 50000; + const int luma_den = 10000; + int i; + AVMasteringDisplayMetadata *metadata = + av_mastering_display_metadata_create_side_data(frame); + if (!metadata) + return AVERROR(ENOMEM); + + for (i = 0; i < 3; i++) { + const int j = mapping[i]; + metadata->display_primaries[i][0].num = sei->mastering_display.display_primaries[j][0]; + metadata->display_primaries[i][0].den = chroma_den; + metadata->display_primaries[i][1].num = sei->mastering_display.display_primaries[j][1]; + metadata->display_primaries[i][1].den = chroma_den; + } + metadata->white_point[0].num = sei->mastering_display.white_point[0]; + metadata->white_point[0].den = chroma_den; + metadata->white_point[1].num = sei->mastering_display.white_point[1]; + metadata->white_point[1].den = chroma_den; + + metadata->max_luminance.num = sei->mastering_display.max_luminance; + metadata->max_luminance.den = luma_den; + metadata->min_luminance.num = sei->mastering_display.min_luminance; + metadata->min_luminance.den = luma_den; + metadata->has_luminance = 1; + metadata->has_primaries = 1; + + av_log(avctx, AV_LOG_DEBUG, "Mastering Display Metadata:\n"); + av_log(avctx, AV_LOG_DEBUG, + "r(%5.4f,%5.4f) g(%5.4f,%5.4f) b(%5.4f %5.4f) wp(%5.4f, %5.4f)\n", + av_q2d(metadata->display_primaries[0][0]), + av_q2d(metadata->display_primaries[0][1]), + av_q2d(metadata->display_primaries[1][0]), + av_q2d(metadata->display_primaries[1][1]), + av_q2d(metadata->display_primaries[2][0]), + av_q2d(metadata->display_primaries[2][1]), + av_q2d(metadata->white_point[0]), av_q2d(metadata->white_point[1])); + av_log(avctx, AV_LOG_DEBUG, + "min_luminance=%f, max_luminance=%f\n", + av_q2d(metadata->min_luminance), av_q2d(metadata->max_luminance)); + } + + if (sei->content_light.present) { + AVContentLightMetadata *metadata = + av_content_light_metadata_create_side_data(frame); + if (!metadata) + return AVERROR(ENOMEM); + metadata->MaxCLL = sei->content_light.max_content_light_level; + metadata->MaxFALL = sei->content_light.max_pic_average_light_level; + + av_log(avctx, AV_LOG_DEBUG, "Content Light Level Metadata:\n"); + av_log(avctx, AV_LOG_DEBUG, "MaxCLL=%d, MaxFALL=%d\n", + metadata->MaxCLL, metadata->MaxFALL); + } + return 0; } @@ -667,4 +777,6 @@ void ff_h2645_sei_reset(H2645SEI *s) av_buffer_unref(&s->dynamic_hdr_vivid.info); s->ambient_viewing_environment.present = 0; + s->mastering_display.present = 0; + s->content_light.present = 0; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/h2645_sei.h b/arm/raspi/third_party/ffmpeg/libavcodec/h2645_sei.h index e07ae103..0ebf4801 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/h2645_sei.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/h2645_sei.h @@ -105,6 +105,20 @@ typedef struct H2645SEIFilmGrainCharacteristics { int persistence_flag; //< HEVC only } H2645SEIFilmGrainCharacteristics; +typedef struct H2645SEIMasteringDisplay { + int present; + uint16_t display_primaries[3][2]; + uint16_t white_point[2]; + uint32_t max_luminance; + uint32_t min_luminance; +} H2645SEIMasteringDisplay; + +typedef struct H2645SEIContentLight { + int present; + uint16_t max_content_light_level; + uint16_t max_pic_average_light_level; +} H2645SEIContentLight; + typedef struct H2645SEI { H2645SEIA53Caption a53_caption; H2645SEIAFD afd; @@ -116,6 +130,8 @@ typedef struct H2645SEI { H2645SEIAlternativeTransfer alternative_transfer; H2645SEIFilmGrainCharacteristics film_grain_characteristics; H2645SEIAmbientViewingEnvironment ambient_viewing_environment; + H2645SEIMasteringDisplay mastering_display; + H2645SEIContentLight content_light; } H2645SEI; enum { diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/h264_cavlc.c b/arm/raspi/third_party/ffmpeg/libavcodec/h264_cavlc.c index 2ace4ca9..13c87bf9 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/h264_cavlc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/h264_cavlc.c @@ -328,26 +328,26 @@ av_cold void ff_h264_decode_init_vlc(void) chroma_dc_coeff_token_vlc.table = chroma_dc_coeff_token_vlc_table; chroma_dc_coeff_token_vlc.table_allocated = chroma_dc_coeff_token_vlc_table_size; - init_vlc(&chroma_dc_coeff_token_vlc, CHROMA_DC_COEFF_TOKEN_VLC_BITS, 4*5, + vlc_init(&chroma_dc_coeff_token_vlc, CHROMA_DC_COEFF_TOKEN_VLC_BITS, 4*5, &chroma_dc_coeff_token_len [0], 1, 1, &chroma_dc_coeff_token_bits[0], 1, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); chroma422_dc_coeff_token_vlc.table = chroma422_dc_coeff_token_vlc_table; chroma422_dc_coeff_token_vlc.table_allocated = chroma422_dc_coeff_token_vlc_table_size; - init_vlc(&chroma422_dc_coeff_token_vlc, CHROMA422_DC_COEFF_TOKEN_VLC_BITS, 4*9, + vlc_init(&chroma422_dc_coeff_token_vlc, CHROMA422_DC_COEFF_TOKEN_VLC_BITS, 4*9, &chroma422_dc_coeff_token_len [0], 1, 1, &chroma422_dc_coeff_token_bits[0], 1, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); offset = 0; for (int i = 0; i < 4; i++) { coeff_token_vlc[i].table = coeff_token_vlc_tables + offset; coeff_token_vlc[i].table_allocated = coeff_token_vlc_tables_size[i]; - init_vlc(&coeff_token_vlc[i], COEFF_TOKEN_VLC_BITS, 4*17, + vlc_init(&coeff_token_vlc[i], COEFF_TOKEN_VLC_BITS, 4*17, &coeff_token_len [i][0], 1, 1, &coeff_token_bits[i][0], 1, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); offset += coeff_token_vlc_tables_size[i]; } /* @@ -360,48 +360,48 @@ av_cold void ff_h264_decode_init_vlc(void) for (int i = 0; i < 3; i++) { chroma_dc_total_zeros_vlc[i + 1].table = chroma_dc_total_zeros_vlc_tables[i]; chroma_dc_total_zeros_vlc[i + 1].table_allocated = chroma_dc_total_zeros_vlc_tables_size; - init_vlc(&chroma_dc_total_zeros_vlc[i + 1], + vlc_init(&chroma_dc_total_zeros_vlc[i + 1], CHROMA_DC_TOTAL_ZEROS_VLC_BITS, 4, &chroma_dc_total_zeros_len [i][0], 1, 1, &chroma_dc_total_zeros_bits[i][0], 1, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); } for (int i = 0; i < 7; i++) { chroma422_dc_total_zeros_vlc[i + 1].table = chroma422_dc_total_zeros_vlc_tables[i]; chroma422_dc_total_zeros_vlc[i + 1].table_allocated = chroma422_dc_total_zeros_vlc_tables_size; - init_vlc(&chroma422_dc_total_zeros_vlc[i + 1], + vlc_init(&chroma422_dc_total_zeros_vlc[i + 1], CHROMA422_DC_TOTAL_ZEROS_VLC_BITS, 8, &chroma422_dc_total_zeros_len [i][0], 1, 1, &chroma422_dc_total_zeros_bits[i][0], 1, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); } for (int i = 0; i < 15; i++) { total_zeros_vlc[i + 1].table = total_zeros_vlc_tables[i]; total_zeros_vlc[i + 1].table_allocated = total_zeros_vlc_tables_size; - init_vlc(&total_zeros_vlc[i + 1], + vlc_init(&total_zeros_vlc[i + 1], TOTAL_ZEROS_VLC_BITS, 16, &total_zeros_len [i][0], 1, 1, &total_zeros_bits[i][0], 1, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); } for (int i = 0; i < 6; i++) { run_vlc[i + 1].table = run_vlc_tables[i]; run_vlc[i + 1].table_allocated = run_vlc_tables_size; - init_vlc(&run_vlc[i + 1], + vlc_init(&run_vlc[i + 1], RUN_VLC_BITS, 7, &run_len [i][0], 1, 1, &run_bits[i][0], 1, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); } run7_vlc.table = run7_vlc_table; run7_vlc.table_allocated = run7_vlc_table_size; - init_vlc(&run7_vlc, RUN7_VLC_BITS, 16, + vlc_init(&run7_vlc, RUN7_VLC_BITS, 16, &run_len [6][0], 1, 1, &run_bits[6][0], 1, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); init_cavlc_level_tab(); } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/h264_mb.c b/arm/raspi/third_party/ffmpeg/libavcodec/h264_mb.c index 0b317745..32d29cfb 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/h264_mb.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/h264_mb.c @@ -34,6 +34,7 @@ #include "h264dec.h" #include "h264_ps.h" #include "qpeldsp.h" +#include "rectangle.h" #include "threadframe.h" static inline int get_lowest_part_list_y(H264SliceContext *sl, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/h264_metadata_bsf.c b/arm/raspi/third_party/ffmpeg/libavcodec/h264_metadata_bsf.c index b9cfeaba..39b9e8ee 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/h264_metadata_bsf.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/h264_metadata_bsf.c @@ -26,10 +26,11 @@ #include "cbs.h" #include "cbs_bsf.h" #include "cbs_h264.h" +#include "cbs_sei.h" #include "h264.h" #include "h264_levels.h" -#include "h264_sei.h" #include "h2645data.h" +#include "sei.h" enum { FLIP_HORIZONTAL = 1, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/h264_mvpred.h b/arm/raspi/third_party/ffmpeg/libavcodec/h264_mvpred.h index 46ae2738..bc9fef50 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/h264_mvpred.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/h264_mvpred.h @@ -30,10 +30,142 @@ #include "h264dec.h" #include "mpegutils.h" +#include "rectangle.h" + #include "libavutil/avassert.h" #include "libavutil/mem_internal.h" +/** + * Get the predicted intra4x4 prediction mode. + */ +static av_always_inline int pred_intra_mode(const H264Context *h, + H264SliceContext *sl, int n) +{ + const int index8 = scan8[n]; + const int left = sl->intra4x4_pred_mode_cache[index8 - 1]; + const int top = sl->intra4x4_pred_mode_cache[index8 - 8]; + const int min = FFMIN(left, top); + + ff_tlog(h->avctx, "mode:%d %d min:%d\n", left, top, min); + + if (min < 0) + return DC_PRED; + else + return min; +} + +static av_always_inline void write_back_intra_pred_mode(const H264Context *h, + H264SliceContext *sl) +{ + int8_t *i4x4 = sl->intra4x4_pred_mode + h->mb2br_xy[sl->mb_xy]; + int8_t *i4x4_cache = sl->intra4x4_pred_mode_cache; + + AV_COPY32(i4x4, i4x4_cache + 4 + 8 * 4); + i4x4[4] = i4x4_cache[7 + 8 * 3]; + i4x4[5] = i4x4_cache[7 + 8 * 2]; + i4x4[6] = i4x4_cache[7 + 8 * 1]; +} + +static av_always_inline void write_back_non_zero_count(const H264Context *h, + H264SliceContext *sl) +{ + const int mb_xy = sl->mb_xy; + uint8_t *nnz = h->non_zero_count[mb_xy]; + uint8_t *nnz_cache = sl->non_zero_count_cache; + + AV_COPY32(&nnz[ 0], &nnz_cache[4 + 8 * 1]); + AV_COPY32(&nnz[ 4], &nnz_cache[4 + 8 * 2]); + AV_COPY32(&nnz[ 8], &nnz_cache[4 + 8 * 3]); + AV_COPY32(&nnz[12], &nnz_cache[4 + 8 * 4]); + AV_COPY32(&nnz[16], &nnz_cache[4 + 8 * 6]); + AV_COPY32(&nnz[20], &nnz_cache[4 + 8 * 7]); + AV_COPY32(&nnz[32], &nnz_cache[4 + 8 * 11]); + AV_COPY32(&nnz[36], &nnz_cache[4 + 8 * 12]); + + if (!h->chroma_y_shift) { + AV_COPY32(&nnz[24], &nnz_cache[4 + 8 * 8]); + AV_COPY32(&nnz[28], &nnz_cache[4 + 8 * 9]); + AV_COPY32(&nnz[40], &nnz_cache[4 + 8 * 13]); + AV_COPY32(&nnz[44], &nnz_cache[4 + 8 * 14]); + } +} + +static av_always_inline void write_back_motion_list(const H264Context *h, + H264SliceContext *sl, + int b_stride, + int b_xy, int b8_xy, + int mb_type, int list) +{ + int16_t(*mv_dst)[2] = &h->cur_pic.motion_val[list][b_xy]; + int16_t(*mv_src)[2] = &sl->mv_cache[list][scan8[0]]; + AV_COPY128(mv_dst + 0 * b_stride, mv_src + 8 * 0); + AV_COPY128(mv_dst + 1 * b_stride, mv_src + 8 * 1); + AV_COPY128(mv_dst + 2 * b_stride, mv_src + 8 * 2); + AV_COPY128(mv_dst + 3 * b_stride, mv_src + 8 * 3); + if (CABAC(h)) { + uint8_t (*mvd_dst)[2] = &sl->mvd_table[list][FMO ? 8 * sl->mb_xy + : h->mb2br_xy[sl->mb_xy]]; + uint8_t(*mvd_src)[2] = &sl->mvd_cache[list][scan8[0]]; + if (IS_SKIP(mb_type)) { + AV_ZERO128(mvd_dst); + } else { + AV_COPY64(mvd_dst, mvd_src + 8 * 3); + AV_COPY16(mvd_dst + 3 + 3, mvd_src + 3 + 8 * 0); + AV_COPY16(mvd_dst + 3 + 2, mvd_src + 3 + 8 * 1); + AV_COPY16(mvd_dst + 3 + 1, mvd_src + 3 + 8 * 2); + } + } + + { + int8_t *ref_index = &h->cur_pic.ref_index[list][b8_xy]; + int8_t *ref_cache = sl->ref_cache[list]; + ref_index[0 + 0 * 2] = ref_cache[scan8[0]]; + ref_index[1 + 0 * 2] = ref_cache[scan8[4]]; + ref_index[0 + 1 * 2] = ref_cache[scan8[8]]; + ref_index[1 + 1 * 2] = ref_cache[scan8[12]]; + } +} + +static av_always_inline void write_back_motion(const H264Context *h, + H264SliceContext *sl, + int mb_type) +{ + const int b_stride = h->b_stride; + const int b_xy = 4 * sl->mb_x + 4 * sl->mb_y * h->b_stride; // try mb2b(8)_xy + const int b8_xy = 4 * sl->mb_xy; + + if (USES_LIST(mb_type, 0)) { + write_back_motion_list(h, sl, b_stride, b_xy, b8_xy, mb_type, 0); + } else { + fill_rectangle(&h->cur_pic.ref_index[0][b8_xy], + 2, 2, 2, (uint8_t)LIST_NOT_USED, 1); + } + if (USES_LIST(mb_type, 1)) + write_back_motion_list(h, sl, b_stride, b_xy, b8_xy, mb_type, 1); + + if (sl->slice_type_nos == AV_PICTURE_TYPE_B && CABAC(h)) { + if (IS_8X8(mb_type)) { + uint8_t *direct_table = &h->direct_table[4 * sl->mb_xy]; + direct_table[1] = sl->sub_mb_type[1] >> 1; + direct_table[2] = sl->sub_mb_type[2] >> 1; + direct_table[3] = sl->sub_mb_type[3] >> 1; + } + } +} + +static av_always_inline int get_dct8x8_allowed(const H264Context *h, H264SliceContext *sl) +{ + if (h->ps.sps->direct_8x8_inference_flag) + return !(AV_RN64A(sl->sub_mb_type) & + ((MB_TYPE_16x8 | MB_TYPE_8x16 | MB_TYPE_8x8) * + 0x0001000100010001ULL)); + else + return !(AV_RN64A(sl->sub_mb_type) & + ((MB_TYPE_16x8 | MB_TYPE_8x16 | MB_TYPE_8x8 | MB_TYPE_DIRECT2) * + 0x0001000100010001ULL)); +} + static av_always_inline int fetch_diagonal_mv(const H264Context *h, H264SliceContext *sl, const int16_t **C, int i, int list, int part_width) diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/h264_parse.c b/arm/raspi/third_party/ffmpeg/libavcodec/h264_parse.c index 97ddf0e4..3378650f 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/h264_parse.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/h264_parse.c @@ -526,22 +526,22 @@ int ff_h264_decode_extradata(const uint8_t *data, int size, H264ParamSets *ps, * * @param sps SPS * - * @return profile as defined by FF_PROFILE_H264_* + * @return profile as defined by AV_PROFILE_H264_* */ int ff_h264_get_profile(const SPS *sps) { int profile = sps->profile_idc; switch (sps->profile_idc) { - case FF_PROFILE_H264_BASELINE: + case AV_PROFILE_H264_BASELINE: // constraint_set1_flag set to 1 - profile |= (sps->constraint_set_flags & 1 << 1) ? FF_PROFILE_H264_CONSTRAINED : 0; + profile |= (sps->constraint_set_flags & 1 << 1) ? AV_PROFILE_H264_CONSTRAINED : 0; break; - case FF_PROFILE_H264_HIGH_10: - case FF_PROFILE_H264_HIGH_422: - case FF_PROFILE_H264_HIGH_444_PREDICTIVE: + case AV_PROFILE_H264_HIGH_10: + case AV_PROFILE_H264_HIGH_422: + case AV_PROFILE_H264_HIGH_444_PREDICTIVE: // constraint_set3_flag set to 1 - profile |= (sps->constraint_set_flags & 1 << 3) ? FF_PROFILE_H264_INTRA : 0; + profile |= (sps->constraint_set_flags & 1 << 3) ? AV_PROFILE_H264_INTRA : 0; break; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/h264_picture.c b/arm/raspi/third_party/ffmpeg/libavcodec/h264_picture.c index dcaf0fdb..31b5e231 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/h264_picture.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/h264_picture.c @@ -26,9 +26,11 @@ */ #include "libavutil/avassert.h" +#include "libavutil/emms.h" #include "error_resilience.h" #include "avcodec.h" #include "h264dec.h" +#include "hwaccel_internal.h" #include "mpegutils.h" #include "thread.h" #include "threadframe.h" @@ -52,6 +54,7 @@ void ff_h264_unref_picture(H264Context *h, H264Picture *pic) av_buffer_unref(&pic->motion_val_buf[i]); av_buffer_unref(&pic->ref_index_buf[i]); } + av_buffer_unref(&pic->decode_error_flags); memset((uint8_t*)pic + off, 0, sizeof(*pic) - off); } @@ -134,6 +137,10 @@ int ff_h264_ref_picture(H264Context *h, H264Picture *dst, H264Picture *src) dst->hwaccel_picture_private = dst->hwaccel_priv_buf->data; } + ret = av_buffer_replace(&dst->decode_error_flags, src->decode_error_flags); + if (ret < 0) + goto fail; + h264_copy_picture_params(dst, src); return 0; @@ -184,6 +191,10 @@ int ff_h264_replace_picture(H264Context *h, H264Picture *dst, const H264Picture dst->hwaccel_picture_private = src->hwaccel_picture_private; + ret = av_buffer_replace(&dst->decode_error_flags, src->decode_error_flags); + if (ret < 0) + goto fail; + h264_copy_picture_params(dst, src); return 0; @@ -233,7 +244,7 @@ int ff_h264_field_end(H264Context *h, H264SliceContext *sl, int in_setup) } if (avctx->hwaccel) { - err = avctx->hwaccel->end_frame(avctx); + err = FF_HW_SIMPLE_CALL(avctx, end_frame); if (err < 0) av_log(avctx, AV_LOG_ERROR, "hardware accelerator failed to decode picture\n"); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/h264_slice.c b/arm/raspi/third_party/ffmpeg/libavcodec/h264_slice.c index 41bf30ee..24f4690e 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/h264_slice.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/h264_slice.c @@ -28,15 +28,11 @@ #include "config_components.h" #include "libavutil/avassert.h" -#include "libavutil/display.h" -#include "libavutil/film_grain_params.h" #include "libavutil/pixdesc.h" #include "libavutil/timecode.h" -#include "internal.h" #include "decode.h" #include "cabac.h" #include "cabac_functions.h" -#include "decode.h" #include "error_resilience.h" #include "avcodec.h" #include "h264.h" @@ -209,16 +205,18 @@ static int alloc_picture(H264Context *h, H264Picture *pic) goto fail; } - if (h->avctx->hwaccel) { - const AVHWAccel *hwaccel = h->avctx->hwaccel; - av_assert0(!pic->hwaccel_picture_private); - if (hwaccel->frame_priv_data_size) { - pic->hwaccel_priv_buf = ff_hwaccel_frame_priv_alloc(h->avctx, hwaccel); - if (!pic->hwaccel_priv_buf) - return AVERROR(ENOMEM); - pic->hwaccel_picture_private = pic->hwaccel_priv_buf->data; - } + ret = ff_hwaccel_frame_priv_alloc(h->avctx, &pic->hwaccel_picture_private, + &pic->hwaccel_priv_buf); + if (ret < 0) + goto fail; + + if (h->decode_error_flags_pool) { + pic->decode_error_flags = av_buffer_pool_get(h->decode_error_flags_pool); + if (!pic->decode_error_flags) + goto fail; + atomic_init((atomic_int*)pic->decode_error_flags->data, 0); } + 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, @@ -304,6 +302,34 @@ static void copy_picture_range(H264Picture **to, H264Picture **from, int count, } } +static void color_frame(AVFrame *frame, const int c[4]) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format); + + av_assert0(desc->flags & AV_PIX_FMT_FLAG_PLANAR); + + for (int p = 0; p < desc->nb_components; p++) { + uint8_t *dst = frame->data[p]; + int is_chroma = p == 1 || p == 2; + int bytes = is_chroma ? AV_CEIL_RSHIFT(frame->width, desc->log2_chroma_w) : frame->width; + int height = is_chroma ? AV_CEIL_RSHIFT(frame->height, desc->log2_chroma_h) : frame->height; + if (desc->comp[0].depth >= 9) { + ((uint16_t*)dst)[0] = c[p]; + av_memcpy_backptr(dst + 2, 2, bytes - 2); + dst += frame->linesize[p]; + for (int y = 1; y < height; y++) { + memcpy(dst, frame->data[p], 2*bytes); + dst += frame->linesize[p]; + } + } else { + for (int y = 0; y < height; y++) { + memset(dst, c[p], bytes); + dst += frame->linesize[p]; + } + } + } +} + static int h264_slice_header_init(H264Context *h); int ff_h264_update_thread_context(AVCodecContext *dst, @@ -378,10 +404,6 @@ int ff_h264_update_thread_context(AVCodecContext *dst, memcpy(h->block_offset, h1->block_offset, sizeof(h->block_offset)); } - h->avctx->coded_height = h1->avctx->coded_height; - h->avctx->coded_width = h1->avctx->coded_width; - h->avctx->width = h1->avctx->width; - h->avctx->height = h1->avctx->height; h->width_from_caller = h1->width_from_caller; h->height_from_caller = h1->height_from_caller; h->coded_picture_number = h1->coded_picture_number; @@ -439,6 +461,8 @@ int ff_h264_update_thread_context(AVCodecContext *dst, return ret; h->sei.common.unregistered.x264_build = h1->sei.common.unregistered.x264_build; + h->sei.common.mastering_display = h1->sei.common.mastering_display; + h->sei.common.content_light = h1->sei.common.content_light; if (!h->cur_pic_ptr) return 0; @@ -784,8 +808,6 @@ static enum AVPixelFormat get_pixel_format(H264Context *h, int force_callback) CONFIG_H264_VDPAU_HWACCEL + \ CONFIG_H264_VULKAN_HWACCEL) enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmt = pix_fmts; - const enum AVPixelFormat *choices = pix_fmts; - int i; switch (h->ps.sps->bit_depth_luma) { case 9: @@ -886,9 +908,7 @@ static enum AVPixelFormat get_pixel_format(H264Context *h, int force_callback) #if CONFIG_H264_VAAPI_HWACCEL *fmt++ = AV_PIX_FMT_VAAPI; #endif - if (h->avctx->codec->pix_fmts) - choices = h->avctx->codec->pix_fmts; - else if (h->avctx->color_range == AVCOL_RANGE_JPEG) + if (h->avctx->color_range == AVCOL_RANGE_JPEG) *fmt++ = AV_PIX_FMT_YUVJ420P; else *fmt++ = AV_PIX_FMT_YUV420P; @@ -902,10 +922,10 @@ static enum AVPixelFormat get_pixel_format(H264Context *h, int force_callback) *fmt = AV_PIX_FMT_NONE; - for (i=0; choices[i] != AV_PIX_FMT_NONE; i++) - if (choices[i] == h->avctx->pix_fmt && !force_callback) - return choices[i]; - return ff_thread_get_format(h->avctx, choices); + for (int i = 0; pix_fmts[i] != AV_PIX_FMT_NONE; i++) + if (pix_fmts[i] == h->avctx->pix_fmt && !force_callback) + return pix_fmts[i]; + return ff_get_format(h->avctx, pix_fmts); } /* export coded and cropped frame dimensions to AVCodecContext */ @@ -1554,7 +1574,7 @@ static int h264_field_start(H264Context *h, const H264SliceContext *sl, if (h->short_ref[0]->field_picture) ff_thread_report_progress(&h->short_ref[0]->tf, INT_MAX, 1); } else if (!h->frame_recovered && !h->avctx->hwaccel) - ff_color_frame(h->short_ref[0]->f, c); + color_frame(h->short_ref[0]->f, c); h->short_ref[0]->frame_num = h->poc.prev_frame_num; } } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/h264dec.c b/arm/raspi/third_party/ffmpeg/libavcodec/h264dec.c index 17763939..70733d65 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/h264dec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/h264dec.c @@ -30,6 +30,7 @@ #include "config_components.h" #include "libavutil/avassert.h" +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/opt.h" #include "libavutil/thread.h" @@ -45,6 +46,7 @@ #include "h264data.h" #include "h264_ps.h" #include "golomb.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "mpegutils.h" #include "profiles.h" @@ -305,6 +307,12 @@ static int h264_init_context(AVCodecContext *avctx, H264Context *h) ff_h264_sei_uninit(&h->sei); + if (avctx->active_thread_type & FF_THREAD_FRAME) { + h->decode_error_flags_pool = av_buffer_pool_init(sizeof(atomic_int), NULL); + if (!h->decode_error_flags_pool) + return AVERROR(ENOMEM); + } + h->nb_slice_ctx = (avctx->active_thread_type & FF_THREAD_SLICE) ? avctx->thread_count : 1; h->slice_ctx = av_calloc(h->nb_slice_ctx, sizeof(*h->slice_ctx)); if (!h->slice_ctx) { @@ -351,6 +359,8 @@ static av_cold int h264_decode_end(AVCodecContext *avctx) h->cur_pic_ptr = NULL; + av_buffer_pool_uninit(&h->decode_error_flags_pool); + av_freep(&h->slice_ctx); h->nb_slice_ctx = 0; @@ -485,8 +495,8 @@ static void h264_decode_flush(AVCodecContext *avctx) ff_h264_free_tables(h); h->context_initialized = 0; - if (avctx->hwaccel && avctx->hwaccel->flush) - avctx->hwaccel->flush(avctx); + if (FF_HW_HAS_CB(avctx, flush)) + FF_HW_SIMPLE_CALL(avctx, flush); } static int get_last_needed_nal(H264Context *h) @@ -652,14 +662,14 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size) } if (h->avctx->hwaccel && - (ret = h->avctx->hwaccel->start_frame(h->avctx, buf, buf_size)) < 0) + (ret = FF_HW_CALL(h->avctx, start_frame, buf, buf_size)) < 0) goto end; } max_slice_ctx = avctx->hwaccel ? 1 : h->nb_slice_ctx; if (h->nb_slice_ctx_queued == max_slice_ctx) { if (h->avctx->hwaccel) { - ret = avctx->hwaccel->decode_slice(avctx, nal->raw_data, nal->raw_size); + ret = FF_HW_CALL(avctx, decode_slice, nal->raw_data, nal->raw_size); h->nb_slice_ctx_queued = 0; } else ret = ff_h264_execute_decode_slices(h); @@ -686,11 +696,9 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size) break; case H264_NAL_SPS: { GetBitContext tmp_gb = nal->gb; - if (avctx->hwaccel && avctx->hwaccel->decode_params) { - ret = avctx->hwaccel->decode_params(avctx, - nal->type, - nal->raw_data, - nal->raw_size); + if (FF_HW_HAS_CB(avctx, decode_params)) { + ret = FF_HW_CALL(avctx, decode_params, + nal->type, nal->raw_data, nal->raw_size); if (ret < 0) goto end; } @@ -705,11 +713,9 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size) break; } case H264_NAL_PPS: - if (avctx->hwaccel && avctx->hwaccel->decode_params) { - ret = avctx->hwaccel->decode_params(avctx, - nal->type, - nal->raw_data, - nal->raw_size); + if (FF_HW_HAS_CB(avctx, decode_params)) { + ret = FF_HW_CALL(avctx, decode_params, + nal->type, nal->raw_data, nal->raw_size); if (ret < 0) goto end; } @@ -741,7 +747,16 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size) // set decode_error_flags to allow users to detect concealed decoding errors if ((ret < 0 || h->er.error_occurred) && h->cur_pic_ptr) { - h->cur_pic_ptr->f->decode_error_flags |= FF_DECODE_ERROR_DECODE_SLICES; + if (h->cur_pic_ptr->decode_error_flags) { + /* Frame-threading in use */ + atomic_int *decode_error = (atomic_int*)h->cur_pic_ptr->decode_error_flags->data; + /* Using atomics here is not supposed to provide syncronisation; + * they are merely used to allow to set decode_error from both + * decoding threads in case of coded slices. */ + atomic_fetch_or_explicit(decode_error, FF_DECODE_ERROR_DECODE_SLICES, + memory_order_relaxed); + } else + h->cur_pic_ptr->f->decode_error_flags |= FF_DECODE_ERROR_DECODE_SLICES; } ret = 0; @@ -764,6 +779,7 @@ end: H264SliceContext *sl = h->slice_ctx; int use_last_pic = h->last_pic_for_ec.f->buf[0] && !sl->ref_count[0]; + int decode_error_flags = 0; ff_h264_set_erpic(&h->er.cur_pic, h->cur_pic_ptr); @@ -781,7 +797,15 @@ end: if (sl->ref_count[1]) ff_h264_set_erpic(&h->er.next_pic, sl->ref_list[1][0].parent); - ff_er_frame_end(&h->er); + ff_er_frame_end(&h->er, &decode_error_flags); + if (decode_error_flags) { + if (h->cur_pic_ptr->decode_error_flags) { + atomic_int *decode_error = (atomic_int*)h->cur_pic_ptr->decode_error_flags->data; + atomic_fetch_or_explicit(decode_error, decode_error_flags, + memory_order_relaxed); + } else + h->cur_pic_ptr->f->decode_error_flags |= decode_error_flags; + } if (use_last_pic) memset(&sl->ref_list[0][0], 0, sizeof(sl->ref_list[0][0])); } @@ -853,6 +877,14 @@ static int output_frame(H264Context *h, AVFrame *dst, H264Picture *srcp) if (srcp->needs_fg && (ret = av_frame_copy_props(dst, srcp->f)) < 0) return ret; + if (srcp->decode_error_flags) { + atomic_int *decode_error = (atomic_int*)srcp->decode_error_flags->data; + /* The following is not supposed to provide synchronisation at all: + * given that srcp has already finished decoding, decode_error + * has already been set to its final value. */ + dst->decode_error_flags |= atomic_load_explicit(decode_error, memory_order_relaxed); + } + av_dict_set(&dst->metadata, "stereo_mode", ff_h264_sei_stereo_mode(&h->sei.common.frame_packing), 0); if (srcp->sei_recovery_frame_cnt == 0) diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/h264dec.h b/arm/raspi/third_party/ffmpeg/libavcodec/h264dec.h index 9a1ec1ba..322c06a1 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/h264dec.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/h264dec.h @@ -29,7 +29,6 @@ #define AVCODEC_H264DEC_H #include "libavutil/buffer.h" -#include "libavutil/intreadwrite.h" #include "libavutil/mem_internal.h" #include "cabac.h" @@ -44,7 +43,6 @@ #include "h264qpel.h" #include "h274.h" #include "mpegutils.h" -#include "rectangle.h" #include "videodsp.h" #define H264_MAX_PICTURE_COUNT 36 @@ -154,6 +152,9 @@ typedef struct H264Picture { int mb_width, mb_height; int mb_stride; + + /* data points to an atomic_int */ + AVBufferRef *decode_error_flags; } H264Picture; typedef struct H264Ref { @@ -551,6 +552,7 @@ typedef struct H264Context { AVBufferPool *mb_type_pool; AVBufferPool *motion_val_pool; AVBufferPool *ref_index_pool; + AVBufferPool *decode_error_flags_pool; int ref2frm[MAX_SLICES][2][64]; ///< reference to frame number lists, used in the loop filter, the first 2 are for -2,-1 } H264Context; @@ -649,136 +651,6 @@ static av_always_inline int get_chroma_qp(const PPS *pps, int t, int qscale) return pps->chroma_qp_table[t][qscale]; } -/** - * Get the predicted intra4x4 prediction mode. - */ -static av_always_inline int pred_intra_mode(const H264Context *h, - H264SliceContext *sl, int n) -{ - const int index8 = scan8[n]; - const int left = sl->intra4x4_pred_mode_cache[index8 - 1]; - const int top = sl->intra4x4_pred_mode_cache[index8 - 8]; - const int min = FFMIN(left, top); - - ff_tlog(h->avctx, "mode:%d %d min:%d\n", left, top, min); - - if (min < 0) - return DC_PRED; - else - return min; -} - -static av_always_inline void write_back_intra_pred_mode(const H264Context *h, - H264SliceContext *sl) -{ - int8_t *i4x4 = sl->intra4x4_pred_mode + h->mb2br_xy[sl->mb_xy]; - int8_t *i4x4_cache = sl->intra4x4_pred_mode_cache; - - AV_COPY32(i4x4, i4x4_cache + 4 + 8 * 4); - i4x4[4] = i4x4_cache[7 + 8 * 3]; - i4x4[5] = i4x4_cache[7 + 8 * 2]; - i4x4[6] = i4x4_cache[7 + 8 * 1]; -} - -static av_always_inline void write_back_non_zero_count(const H264Context *h, - H264SliceContext *sl) -{ - const int mb_xy = sl->mb_xy; - uint8_t *nnz = h->non_zero_count[mb_xy]; - uint8_t *nnz_cache = sl->non_zero_count_cache; - - AV_COPY32(&nnz[ 0], &nnz_cache[4 + 8 * 1]); - AV_COPY32(&nnz[ 4], &nnz_cache[4 + 8 * 2]); - AV_COPY32(&nnz[ 8], &nnz_cache[4 + 8 * 3]); - AV_COPY32(&nnz[12], &nnz_cache[4 + 8 * 4]); - AV_COPY32(&nnz[16], &nnz_cache[4 + 8 * 6]); - AV_COPY32(&nnz[20], &nnz_cache[4 + 8 * 7]); - AV_COPY32(&nnz[32], &nnz_cache[4 + 8 * 11]); - AV_COPY32(&nnz[36], &nnz_cache[4 + 8 * 12]); - - if (!h->chroma_y_shift) { - AV_COPY32(&nnz[24], &nnz_cache[4 + 8 * 8]); - AV_COPY32(&nnz[28], &nnz_cache[4 + 8 * 9]); - AV_COPY32(&nnz[40], &nnz_cache[4 + 8 * 13]); - AV_COPY32(&nnz[44], &nnz_cache[4 + 8 * 14]); - } -} - -static av_always_inline void write_back_motion_list(const H264Context *h, - H264SliceContext *sl, - int b_stride, - int b_xy, int b8_xy, - int mb_type, int list) -{ - int16_t(*mv_dst)[2] = &h->cur_pic.motion_val[list][b_xy]; - int16_t(*mv_src)[2] = &sl->mv_cache[list][scan8[0]]; - AV_COPY128(mv_dst + 0 * b_stride, mv_src + 8 * 0); - AV_COPY128(mv_dst + 1 * b_stride, mv_src + 8 * 1); - AV_COPY128(mv_dst + 2 * b_stride, mv_src + 8 * 2); - AV_COPY128(mv_dst + 3 * b_stride, mv_src + 8 * 3); - if (CABAC(h)) { - uint8_t (*mvd_dst)[2] = &sl->mvd_table[list][FMO ? 8 * sl->mb_xy - : h->mb2br_xy[sl->mb_xy]]; - uint8_t(*mvd_src)[2] = &sl->mvd_cache[list][scan8[0]]; - if (IS_SKIP(mb_type)) { - AV_ZERO128(mvd_dst); - } else { - AV_COPY64(mvd_dst, mvd_src + 8 * 3); - AV_COPY16(mvd_dst + 3 + 3, mvd_src + 3 + 8 * 0); - AV_COPY16(mvd_dst + 3 + 2, mvd_src + 3 + 8 * 1); - AV_COPY16(mvd_dst + 3 + 1, mvd_src + 3 + 8 * 2); - } - } - - { - int8_t *ref_index = &h->cur_pic.ref_index[list][b8_xy]; - int8_t *ref_cache = sl->ref_cache[list]; - ref_index[0 + 0 * 2] = ref_cache[scan8[0]]; - ref_index[1 + 0 * 2] = ref_cache[scan8[4]]; - ref_index[0 + 1 * 2] = ref_cache[scan8[8]]; - ref_index[1 + 1 * 2] = ref_cache[scan8[12]]; - } -} - -static av_always_inline void write_back_motion(const H264Context *h, - H264SliceContext *sl, - int mb_type) -{ - const int b_stride = h->b_stride; - const int b_xy = 4 * sl->mb_x + 4 * sl->mb_y * h->b_stride; // try mb2b(8)_xy - const int b8_xy = 4 * sl->mb_xy; - - if (USES_LIST(mb_type, 0)) { - write_back_motion_list(h, sl, b_stride, b_xy, b8_xy, mb_type, 0); - } else { - fill_rectangle(&h->cur_pic.ref_index[0][b8_xy], - 2, 2, 2, (uint8_t)LIST_NOT_USED, 1); - } - if (USES_LIST(mb_type, 1)) - write_back_motion_list(h, sl, b_stride, b_xy, b8_xy, mb_type, 1); - - if (sl->slice_type_nos == AV_PICTURE_TYPE_B && CABAC(h)) { - if (IS_8X8(mb_type)) { - uint8_t *direct_table = &h->direct_table[4 * sl->mb_xy]; - direct_table[1] = sl->sub_mb_type[1] >> 1; - direct_table[2] = sl->sub_mb_type[2] >> 1; - direct_table[3] = sl->sub_mb_type[3] >> 1; - } - } -} - -static av_always_inline int get_dct8x8_allowed(const H264Context *h, H264SliceContext *sl) -{ - if (h->ps.sps->direct_8x8_inference_flag) - return !(AV_RN64A(sl->sub_mb_type) & - ((MB_TYPE_16x8 | MB_TYPE_8x16 | MB_TYPE_8x8) * - 0x0001000100010001ULL)); - else - return !(AV_RN64A(sl->sub_mb_type) & - ((MB_TYPE_16x8 | MB_TYPE_8x16 | MB_TYPE_8x8 | MB_TYPE_DIRECT2) * - 0x0001000100010001ULL)); -} - int ff_h264_field_end(H264Context *h, H264SliceContext *sl, int in_setup); int ff_h264_ref_picture(H264Context *h, H264Picture *dst, H264Picture *src); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/h266_metadata_bsf.c b/arm/raspi/third_party/ffmpeg/libavcodec/h266_metadata_bsf.c index c0dbf8ef..1f0f875c 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/h266_metadata_bsf.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/h266_metadata_bsf.c @@ -43,7 +43,7 @@ static int h266_metadata_update_fragment(AVBSFContext *bsf, AVPacket *pkt, int err, i; // If an AUD is present, it must be the first NAL unit. - if (pu->units[0].type == VVC_AUD_NUT) { + if (pu->nb_units && pu->units[0].type == VVC_AUD_NUT) { if (ctx->aud == BSF_ELEMENT_REMOVE) ff_cbs_delete_unit(pu, 0); } else if ( pkt && ctx->aud == BSF_ELEMENT_INSERT) { diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/h274.c b/arm/raspi/third_party/ffmpeg/libavcodec/h274.c index a69f9411..57092003 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/h274.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/h274.c @@ -38,7 +38,7 @@ static void prng_shift(uint32_t *state) { // Primitive polynomial x^31 + x^3 + 1 (modulo 2) uint32_t x = *state; - uint8_t feedback = (x >> 2) ^ (x >> 30); + uint8_t feedback = 1u ^ (x >> 2) ^ (x >> 30); *state = (x << 1) | (feedback & 1u); } @@ -59,13 +59,13 @@ static void init_slice_c(int8_t out[64][64], uint8_t h, uint8_t v, // // Note: To make the subsequent matrix multiplication cache friendlier, we // store each *column* of the starting image in a *row* of `out` - for (int y = 0; y <= freq_v; y++) { - for (int x = 0; x <= freq_h; x += 4) { + for (int l = 0; l <= freq_v; l++) { + for (int k = 0; k <= freq_h; k += 4) { uint16_t offset = seed % 2048; - out[x + 0][y] = Gaussian_LUT[offset + 0]; - out[x + 1][y] = Gaussian_LUT[offset + 1]; - out[x + 2][y] = Gaussian_LUT[offset + 2]; - out[x + 3][y] = Gaussian_LUT[offset + 3]; + out[l][k + 0] = Gaussian_LUT[offset + 0]; + out[l][k + 1] = Gaussian_LUT[offset + 1]; + out[l][k + 2] = Gaussian_LUT[offset + 2]; + out[l][k + 3] = Gaussian_LUT[offset + 3]; prng_shift(&seed); } } @@ -74,9 +74,9 @@ static void init_slice_c(int8_t out[64][64], uint8_t h, uint8_t v, // 64x64 inverse integer transform for (int y = 0; y < 64; y++) { - for (int x = 0; x <= freq_h; x++) { + for (int x = 0; x <= freq_v; x++) { int32_t sum = 0; - for (int p = 0; p <= freq_v; p++) + for (int p = 0; p <= freq_h; p++) sum += R64T[y][p] * out[x][p]; tmp[y][x] = (sum + 128) >> 8; } @@ -85,8 +85,8 @@ static void init_slice_c(int8_t out[64][64], uint8_t h, uint8_t v, for (int y = 0; y < 64; y++) { for (int x = 0; x < 64; x++) { int32_t sum = 0; - for (int p = 0; p <= freq_h; p++) - sum += tmp[y][p] * R64T[x][p]; // R64T^T = R64 + for (int p = 0; p <= freq_v; p++) + sum += tmp[x][p] * R64T[y][p]; // R64T^T = R64 // Renormalize and clip to [-127, 127] out[y][x] = av_clip((sum + 128) >> 8, -127, 127); } @@ -110,7 +110,7 @@ static void init_slice(H274FilmGrainDatabase *database, uint8_t h, uint8_t v) init_slice_c(database->db[h][v], h, v, database->slice_tmp); } -// Computes the average of an 8x8 block, right-shifted by 6 +// Computes the average of an 8x8 block static uint16_t avg_8x8_c(const uint8_t *in, int in_stride) { uint16_t avg[8] = {0}; // summing over an array vectorizes better @@ -259,11 +259,11 @@ int ff_h274_apply_film_grain(AVFrame *out_frame, const AVFrame *in_frame, // only advanced in 16x16 blocks, so use a nested loop for (int y = 0; y < height; y += 16) { for (int x = 0; x < width; x += 16) { - uint16_t y_offset = (seed >> 16) % 52; - uint16_t x_offset = (seed & 0xFFFF) % 56; + uint16_t x_offset = (seed >> 16) % 52; + uint16_t y_offset = (seed & 0xFFFF) % 56; const int invert = (seed & 0x1); - y_offset &= 0xFFFC; - x_offset &= 0xFFF8; + x_offset &= 0xFFFC; + y_offset &= 0xFFF8; prng_shift(&seed); for (int yy = 0; yy < 16 && y+yy < height; yy += 8) { diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/h274.h b/arm/raspi/third_party/ffmpeg/libavcodec/h274.h index 920f6991..cebc8bec 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/h274.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/h274.h @@ -40,11 +40,26 @@ typedef struct H274FilmGrainDatabase { int16_t slice_tmp[64][64]; } H274FilmGrainDatabase; +/** + * Check whether ff_h274_apply_film_grain() supports the given parameter combination. + * + * @param model_id model_id from AVFilmGrainParams to be supplied + * @param pix_fmt pixel format of the frames to be supplied + */ +static inline int ff_h274_film_grain_params_supported(int model_id, enum AVPixelFormat pix_fmt) +{ + return model_id == 0 && pix_fmt == AV_PIX_FMT_YUV420P; +} + // Synthesizes film grain on top of `in` and stores the result to `out`. `out` // must already have been allocated and set to the same size and format as // `in`. // // Returns a negative error code on error, such as invalid params. +// If ff_h274_film_grain_params_supported() indicated that the parameters +// are supported, no error will be returned if the arguments given to +// ff_h274_film_grain_params_supported() coincide with actual values +// from the frames and params. int ff_h274_apply_film_grain(AVFrame *out, const AVFrame *in, H274FilmGrainDatabase *db, const AVFilmGrainParams *params); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/hcadec.c b/arm/raspi/third_party/ffmpeg/libavcodec/hcadec.c index 2f019a82..6f277afb 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/hcadec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/hcadec.c @@ -28,8 +28,12 @@ #include "get_bits.h" #include "hca_data.h" +#define HCA_MASK 0x7f7f7f7f +#define MAX_CHANNELS 16 + typedef struct ChannelContext { - float base[128]; + DECLARE_ALIGNED(32, float, base)[128]; + DECLARE_ALIGNED(32, float, factors)[128]; DECLARE_ALIGNED(32, float, imdct_in)[128]; DECLARE_ALIGNED(32, float, imdct_out)[128]; DECLARE_ALIGNED(32, float, imdct_prev)[128]; @@ -44,11 +48,15 @@ typedef struct ChannelContext { typedef struct HCAContext { const AVCRC *crc_table; - ChannelContext ch[16]; + ChannelContext ch[MAX_CHANNELS]; uint8_t ath[128]; + uint8_t cipher[256]; + uint64_t key; + uint16_t subkey; int ath_type; + int ciph_type; unsigned hfr_group_count; uint8_t track_count; uint8_t channel_config; @@ -62,6 +70,93 @@ typedef struct HCAContext { AVFloatDSPContext *fdsp; } HCAContext; +static void cipher_init56_create_table(uint8_t *r, uint8_t key) +{ + const int mul = ((key & 1) << 3) | 5; + const int add = (key & 0xE) | 1; + + key >>= 4; + for (int i = 0; i < 16; i++) { + key = (key * mul + add) & 0xF; + r[i] = key; + } +} + +static void cipher_init56(uint8_t *cipher, uint64_t keycode) +{ + uint8_t base[256], base_r[16], base_c[16], kc[8], seed[16]; + + /* 56bit keycode encryption (given as a uint64_t number, but upper 8b aren't used) */ + /* keycode = keycode - 1 */ + if (keycode != 0) + keycode--; + + /* init keycode table */ + for (int r = 0; r < (8-1); r++) { + kc[r] = keycode & 0xFF; + keycode = keycode >> 8; + } + + /* init seed table */ + seed[ 0] = kc[1]; + seed[ 1] = kc[1] ^ kc[6]; + seed[ 2] = kc[2] ^ kc[3]; + seed[ 3] = kc[2]; + seed[ 4] = kc[2] ^ kc[1]; + seed[ 5] = kc[3] ^ kc[4]; + seed[ 6] = kc[3]; + seed[ 7] = kc[3] ^ kc[2]; + seed[ 8] = kc[4] ^ kc[5]; + seed[ 9] = kc[4]; + seed[10] = kc[4] ^ kc[3]; + seed[11] = kc[5] ^ kc[6]; + seed[12] = kc[5]; + seed[13] = kc[5] ^ kc[4]; + seed[14] = kc[6] ^ kc[1]; + seed[15] = kc[6]; + + /* init base table */ + cipher_init56_create_table(base_r, kc[0]); + for (int r = 0; r < 16; r++) { + uint8_t nb; + cipher_init56_create_table(base_c, seed[r]); + nb = base_r[r] << 4; + for (int c = 0; c < 16; c++) + base[r*16 + c] = nb | base_c[c]; /* combine nibbles */ + } + + /* final shuffle table */ + { + unsigned x = 0; + unsigned pos = 1; + + for (int i = 0; i < 256; i++) { + x = (x + 17) & 0xFF; + if (base[x] != 0 && base[x] != 0xFF) + cipher[pos++] = base[x]; + } + cipher[0] = 0; + cipher[0xFF] = 0xFF; + } +} + +static void cipher_init(uint8_t *cipher, int type, uint64_t keycode, uint16_t subkey) +{ + switch (type) { + case 56: + if (keycode) { + if (subkey) + keycode = keycode * (((uint64_t)subkey<<16u)|((uint16_t)~subkey+2u)); + cipher_init56(cipher, keycode); + } + break; + case 0: + for (int i = 0; i < 256; i++) + cipher[i] = i; + break; + } +} + static void ath_init1(uint8_t *ath, int sample_rate) { unsigned int index; @@ -101,24 +196,19 @@ static inline unsigned ceil2(unsigned a, unsigned b) return (b > 0) ? (a / b + ((a % b) ? 1 : 0)) : 0; } -static av_cold int decode_init(AVCodecContext *avctx) +static int init_hca(AVCodecContext *avctx, const uint8_t *extradata, + const int extradata_size) { HCAContext *c = avctx->priv_data; GetByteContext gb0, *const gb = &gb0; int8_t r[16] = { 0 }; - float scale = 1.f / 8.f; unsigned b, chunk; int version, ret; - avctx->sample_fmt = AV_SAMPLE_FMT_FLTP; - c->crc_table = av_crc_get_table(AV_CRC_16_ANSI); - - if (avctx->ch_layout.nb_channels <= 0 || avctx->ch_layout.nb_channels > 16) - return AVERROR(EINVAL); - - if (avctx->extradata_size < 36) + if (extradata_size < 36) return AVERROR_INVALIDDATA; - bytestream2_init(gb, avctx->extradata, avctx->extradata_size); + + bytestream2_init(gb, extradata, extradata_size); bytestream2_skipu(gb, 4); version = bytestream2_get_be16(gb); @@ -126,13 +216,13 @@ static av_cold int decode_init(AVCodecContext *avctx) c->ath_type = version >= 0x200 ? 0 : 1; - if (bytestream2_get_be32u(gb) != MKBETAG('f', 'm', 't', 0)) + if ((bytestream2_get_be32u(gb) & HCA_MASK) != MKBETAG('f', 'm', 't', 0)) return AVERROR_INVALIDDATA; bytestream2_skipu(gb, 4); bytestream2_skipu(gb, 4); bytestream2_skipu(gb, 4); - chunk = bytestream2_get_be32u(gb); + chunk = bytestream2_get_be32u(gb) & HCA_MASK; if (chunk == MKBETAG('c', 'o', 'm', 'p')) { bytestream2_skipu(gb, 2); bytestream2_skipu(gb, 1); @@ -161,9 +251,8 @@ static av_cold int decode_init(AVCodecContext *avctx) if (c->total_band_count > FF_ARRAY_ELEMS(c->ch->imdct_in)) return AVERROR_INVALIDDATA; - while (bytestream2_get_bytes_left(gb) >= 4) { - chunk = bytestream2_get_be32u(gb); + chunk = bytestream2_get_be32u(gb) & HCA_MASK; if (chunk == MKBETAG('v', 'b', 'r', 0)) { bytestream2_skip(gb, 2 + 2); } else if (chunk == MKBETAG('a', 't', 'h', 0)) { @@ -173,7 +262,7 @@ static av_cold int decode_init(AVCodecContext *avctx) } else if (chunk == MKBETAG('c', 'o', 'm', 'm')) { bytestream2_skip(gb, bytestream2_get_byte(gb) * 8); } else if (chunk == MKBETAG('c', 'i', 'p', 'h')) { - bytestream2_skip(gb, 2); + c->ciph_type = bytestream2_get_be16(gb); } else if (chunk == MKBETAG('l', 'o', 'o', 'p')) { bytestream2_skip(gb, 4 + 4 + 2 + 2); } else if (chunk == MKBETAG('p', 'a', 'd', 0)) { @@ -183,6 +272,14 @@ static av_cold int decode_init(AVCodecContext *avctx) } } + if (bytestream2_get_bytes_left(gb) >= 10) { + bytestream2_skip(gb, bytestream2_get_bytes_left(gb) - 10); + c->key = bytestream2_get_be64u(gb); + c->subkey = bytestream2_get_be16u(gb); + } + + cipher_init(c->cipher, c->ciph_type, c->key, c->subkey); + ret = ath_init(c->ath, c->ath_type, avctx->sample_rate); if (ret < 0) return ret; @@ -243,11 +340,36 @@ static av_cold int decode_init(AVCodecContext *avctx) return AVERROR_INVALIDDATA; } + return 0; +} + +static av_cold int decode_init(AVCodecContext *avctx) +{ + HCAContext *c = avctx->priv_data; + float scale = 1.f / 8.f; + int ret; + + avctx->sample_fmt = AV_SAMPLE_FMT_FLTP; + c->crc_table = av_crc_get_table(AV_CRC_16_ANSI); + + if (avctx->ch_layout.nb_channels <= 0 || avctx->ch_layout.nb_channels > FF_ARRAY_ELEMS(c->ch)) + return AVERROR(EINVAL); + c->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT); if (!c->fdsp) return AVERROR(ENOMEM); - return av_tx_init(&c->tx_ctx, &c->tx_fn, AV_TX_FLOAT_MDCT, 1, 128, &scale, 0); + ret = av_tx_init(&c->tx_ctx, &c->tx_fn, AV_TX_FLOAT_MDCT, 1, 128, &scale, 0); + if (ret < 0) + return ret; + + if (avctx->extradata_size != 0 && avctx->extradata_size < 36) + return AVERROR_INVALIDDATA; + + if (!avctx->extradata_size) + return 0; + + return init_hca(avctx, avctx->extradata, avctx->extradata_size); } static void run_imdct(HCAContext *c, ChannelContext *ch, int index, float *out) @@ -273,8 +395,8 @@ static void apply_intensity_stereo(HCAContext *s, ChannelContext *ch1, ChannelCo return; for (int i = 0; i < band_count; i++) { - *(c2++) = *c1 * ratio_r; - *(c1++) *= ratio_l; + c2[i] = c1[i] * ratio_r; + c1[i] *= ratio_l; } } @@ -299,6 +421,10 @@ static void reconstruct_hfr(HCAContext *s, ChannelContext *ch, static void dequantize_coefficients(HCAContext *c, ChannelContext *ch, GetBitContext *gb) { + const float *base = ch->base; + float *factors = ch->factors; + float *out = ch->imdct_in; + for (int i = 0; i < ch->count; i++) { unsigned scale = ch->scale[i]; int nb_bits = max_bits_table[scale]; @@ -315,10 +441,11 @@ static void dequantize_coefficients(HCAContext *c, ChannelContext *ch, skip_bits_long(gb, quant_spectrum_bits[value] - nb_bits); factor = quant_spectrum_value[value]; } - ch->imdct_in[i] = factor * ch->base[i]; + factors[i] = factor; } - memset(ch->imdct_in + ch->count, 0, sizeof(ch->imdct_in) - ch->count * sizeof(ch->imdct_in[0])); + memset(factors + ch->count, 0, 512 - ch->count * sizeof(*factors)); + c->fdsp->vector_fmul(out, factors, base, 128); } static void unpack(HCAContext *c, ChannelContext *ch, @@ -385,16 +512,44 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { HCAContext *c = avctx->priv_data; - int ch, ret, packed_noise_level; + int ch, offset = 0, ret, packed_noise_level; GetBitContext gb0, *const gb = &gb0; float **samples; + if (avpkt->size <= 8) + return AVERROR_INVALIDDATA; + + if (AV_RN16(avpkt->data) != 0xFFFF) { + if ((AV_RL32(avpkt->data)) != MKTAG('H','C','A',0)) { + return AVERROR_INVALIDDATA; + } else if (AV_RB16(avpkt->data + 6) <= avpkt->size) { + ret = init_hca(avctx, avpkt->data, AV_RB16(avpkt->data + 6)); + if (ret < 0) + return ret; + offset = AV_RB16(avpkt->data + 6); + if (offset == avpkt->size) + return avpkt->size; + } else { + return AVERROR_INVALIDDATA; + } + } + + if (c->key || c->subkey) { + uint8_t *data, *cipher = c->cipher; + + if ((ret = av_packet_make_writable(avpkt)) < 0) + return ret; + data = avpkt->data; + for (int n = 0; n < avpkt->size; n++) + data[n] = cipher[data[n]]; + } + if (avctx->err_recognition & AV_EF_CRCCHECK) { - if (av_crc(c->crc_table, 0, avpkt->data, avpkt->size)) + if (av_crc(c->crc_table, 0, avpkt->data + offset, avpkt->size - offset)) return AVERROR_INVALIDDATA; } - if ((ret = init_get_bits8(gb, avpkt->data, avpkt->size)) < 0) + if ((ret = init_get_bits8(gb, avpkt->data + offset, avpkt->size - offset)) < 0) return ret; if (get_bits(gb, 16) != 0xFFFF) diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/hevc_ps.c b/arm/raspi/third_party/ffmpeg/libavcodec/hevc_ps.c index 1db2d3a2..7507d2bf 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/hevc_ps.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/hevc_ps.c @@ -250,15 +250,15 @@ static int decode_profile_tier_level(GetBitContext *gb, AVCodecContext *avctx, ptl->profile_space = get_bits(gb, 2); ptl->tier_flag = get_bits1(gb); ptl->profile_idc = get_bits(gb, 5); - if (ptl->profile_idc == FF_PROFILE_HEVC_MAIN) + if (ptl->profile_idc == AV_PROFILE_HEVC_MAIN) av_log(avctx, AV_LOG_DEBUG, "Main profile bitstream\n"); - else if (ptl->profile_idc == FF_PROFILE_HEVC_MAIN_10) + else if (ptl->profile_idc == AV_PROFILE_HEVC_MAIN_10) av_log(avctx, AV_LOG_DEBUG, "Main 10 profile bitstream\n"); - else if (ptl->profile_idc == FF_PROFILE_HEVC_MAIN_STILL_PICTURE) + else if (ptl->profile_idc == AV_PROFILE_HEVC_MAIN_STILL_PICTURE) av_log(avctx, AV_LOG_DEBUG, "Main Still Picture profile bitstream\n"); - else if (ptl->profile_idc == FF_PROFILE_HEVC_REXT) + else if (ptl->profile_idc == AV_PROFILE_HEVC_REXT) av_log(avctx, AV_LOG_DEBUG, "Range Extension profile bitstream\n"); - else if (ptl->profile_idc == FF_PROFILE_HEVC_SCC) + else if (ptl->profile_idc == AV_PROFILE_HEVC_SCC) av_log(avctx, AV_LOG_DEBUG, "Screen Content Coding Extension profile bitstream\n"); else av_log(avctx, AV_LOG_WARNING, "Unknown HEVC profile: %d\n", ptl->profile_idc); @@ -406,12 +406,11 @@ static int decode_hrd(GetBitContext *gb, int common_inf_present, for (int i = 0; i < max_sublayers; i++) { hdr->flags.fixed_pic_rate_general_flag = get_bits1(gb); - hdr->cpb_cnt_minus1[i] = 1; - if (!hdr->flags.fixed_pic_rate_general_flag) hdr->flags.fixed_pic_rate_within_cvs_flag = get_bits1(gb); - if (hdr->flags.fixed_pic_rate_within_cvs_flag) + if (hdr->flags.fixed_pic_rate_within_cvs_flag || + hdr->flags.fixed_pic_rate_general_flag) hdr->elemental_duration_in_tc_minus1[i] = get_ue_golomb_long(gb); else hdr->flags.low_delay_hrd_flag = get_bits1(gb); @@ -426,11 +425,11 @@ static int decode_hrd(GetBitContext *gb, int common_inf_present, } if (hdr->flags.nal_hrd_parameters_present_flag) - decode_sublayer_hrd(gb, hdr->cpb_cnt_minus1[i], &hdr->nal_params[i], + decode_sublayer_hrd(gb, hdr->cpb_cnt_minus1[i]+1, &hdr->nal_params[i], hdr->flags.sub_pic_hrd_params_present_flag); if (hdr->flags.vcl_hrd_parameters_present_flag) - decode_sublayer_hrd(gb, hdr->cpb_cnt_minus1[i], &hdr->vcl_params[i], + decode_sublayer_hrd(gb, hdr->cpb_cnt_minus1[i]+1, &hdr->vcl_params[i], hdr->flags.sub_pic_hrd_params_present_flag); } @@ -1968,7 +1967,7 @@ int ff_hevc_decode_nal_pps(GetBitContext *gb, AVCodecContext *avctx, pps->pps_scc_extension_flag = get_bits1(gb); skip_bits(gb, 4); // pps_extension_4bits - if (sps->ptl.general_ptl.profile_idc >= FF_PROFILE_HEVC_REXT && pps->pps_range_extensions_flag) { + if (sps->ptl.general_ptl.profile_idc >= AV_PROFILE_HEVC_REXT && pps->pps_range_extensions_flag) { if ((ret = pps_range_extensions(gb, avctx, pps, sps)) < 0) goto err; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/hevc_refs.c b/arm/raspi/third_party/ffmpeg/libavcodec/hevc_refs.c index 3aa8e199..c5c1203e 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/hevc_refs.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/hevc_refs.c @@ -118,16 +118,10 @@ static HEVCFrame *alloc_frame(HEVCContext *s) (s->sei.picture_timing.picture_struct == AV_PICTURE_STRUCTURE_BOTTOM_FIELD)) frame->frame->flags |= AV_FRAME_FLAG_INTERLACED; - if (s->avctx->hwaccel) { - const AVHWAccel *hwaccel = s->avctx->hwaccel; - av_assert0(!frame->hwaccel_picture_private); - if (hwaccel->frame_priv_data_size) { - frame->hwaccel_priv_buf = ff_hwaccel_frame_priv_alloc(s->avctx, hwaccel); - if (!frame->hwaccel_priv_buf) - goto fail; - frame->hwaccel_picture_private = frame->hwaccel_priv_buf->data; - } - } + ret = ff_hwaccel_frame_priv_alloc(s->avctx, &frame->hwaccel_picture_private, + &frame->hwaccel_priv_buf); + if (ret < 0) + goto fail; return frame; fail: diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/hevc_sei.c b/arm/raspi/third_party/ffmpeg/libavcodec/hevc_sei.c index 3c6bde1b..351e6997 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/hevc_sei.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/hevc_sei.c @@ -49,52 +49,6 @@ static int decode_nal_sei_decoded_picture_hash(HEVCSEIPictureHash *s, return 0; } -static int decode_nal_sei_mastering_display_info(HEVCSEIMasteringDisplay *s, - GetByteContext *gb) -{ - int i; - - if (bytestream2_get_bytes_left(gb) < 24) - return AVERROR_INVALIDDATA; - - // Mastering primaries - for (i = 0; i < 3; i++) { - s->display_primaries[i][0] = bytestream2_get_be16u(gb); - s->display_primaries[i][1] = bytestream2_get_be16u(gb); - } - // White point (x, y) - s->white_point[0] = bytestream2_get_be16u(gb); - s->white_point[1] = bytestream2_get_be16u(gb); - - // Max and min luminance of mastering display - s->max_luminance = bytestream2_get_be32u(gb); - s->min_luminance = bytestream2_get_be32u(gb); - - // As this SEI message comes before the first frame that references it, - // initialize the flag to 2 and decrement on IRAP access unit so it - // persists for the coded video sequence (e.g., between two IRAPs) - s->present = 2; - - return 0; -} - -static int decode_nal_sei_content_light_info(HEVCSEIContentLight *s, - GetByteContext *gb) -{ - if (bytestream2_get_bytes_left(gb) < 4) - return AVERROR_INVALIDDATA; - - // Max and average light levels - s->max_content_light_level = bytestream2_get_be16u(gb); - s->max_pic_average_light_level = bytestream2_get_be16u(gb); - // As this SEI message comes before the first frame that references it, - // initialize the flag to 2 and decrement on IRAP access unit so it - // persists for the coded video sequence (e.g., between two IRAPs) - s->present = 2; - - return 0; -} - static int decode_nal_sei_pic_timing(HEVCSEI *s, GetBitContext *gb, const HEVCParamSets *ps, void *logctx) { @@ -206,10 +160,6 @@ static int decode_nal_sei_prefix(GetBitContext *gb, GetByteContext *gbyte, return decode_nal_sei_decoded_picture_hash(&s->picture_hash, gbyte); case SEI_TYPE_PIC_TIMING: return decode_nal_sei_pic_timing(s, gb, ps, logctx); - case SEI_TYPE_MASTERING_DISPLAY_COLOUR_VOLUME: - return decode_nal_sei_mastering_display_info(&s->mastering_display, gbyte); - case SEI_TYPE_CONTENT_LIGHT_LEVEL_INFO: - return decode_nal_sei_content_light_info(&s->content_light, gbyte); case SEI_TYPE_ACTIVE_PARAMETER_SETS: return decode_nal_sei_active_parameter_sets(s, gb, logctx); case SEI_TYPE_TIME_CODE: diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/hevc_sei.h b/arm/raspi/third_party/ffmpeg/libavcodec/hevc_sei.h index 4189f5e6..a23a64ec 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/hevc_sei.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/hevc_sei.h @@ -53,20 +53,6 @@ typedef struct HEVCSEIPictureTiming { int picture_struct; } HEVCSEIPictureTiming; -typedef struct HEVCSEIMasteringDisplay { - int present; - uint16_t display_primaries[3][2]; - uint16_t white_point[2]; - uint32_t max_luminance; - uint32_t min_luminance; -} HEVCSEIMasteringDisplay; - -typedef struct HEVCSEIContentLight { - int present; - uint16_t max_content_light_level; - uint16_t max_pic_average_light_level; -} HEVCSEIContentLight; - typedef struct HEVCSEIAlternativeTransfer { int present; int preferred_transfer_characteristics; @@ -96,8 +82,6 @@ typedef struct HEVCSEI { H2645SEI common; HEVCSEIPictureHash picture_hash; HEVCSEIPictureTiming picture_timing; - HEVCSEIMasteringDisplay mastering_display; - HEVCSEIContentLight content_light; int active_seq_parameter_set_id; HEVCSEITimeCode timecode; } HEVCSEI; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/hevcdec.c b/arm/raspi/third_party/ffmpeg/libavcodec/hevcdec.c index fcf19b4e..2be62ddf 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/hevcdec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/hevcdec.c @@ -31,7 +31,6 @@ #include "libavutil/display.h" #include "libavutil/film_grain_params.h" #include "libavutil/internal.h" -#include "libavutil/mastering_display_metadata.h" #include "libavutil/md5.h" #include "libavutil/opt.h" #include "libavutil/pixdesc.h" @@ -47,6 +46,7 @@ #include "hevc_data.h" #include "hevc_parse.h" #include "hevcdec.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "internal.h" #include "profiles.h" @@ -521,7 +521,7 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps) *fmt++ = sps->pix_fmt; *fmt = AV_PIX_FMT_NONE; - return ff_thread_get_format(s->avctx, pix_fmts); + return ff_get_format(s->avctx, pix_fmts); } static int set_sps(HEVCContext *s, const HEVCSPS *sps, @@ -1563,7 +1563,8 @@ static void luma_mc_uni(HEVCLocalContext *lc, uint8_t *dst, ptrdiff_t dststride, 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) { + y_off >= pic_height - block_h - QPEL_EXTRA_AFTER || + ref == s->frame) { const ptrdiff_t 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); @@ -1713,6 +1714,7 @@ static void chroma_mc_uni(HEVCLocalContext *lc, uint8_t *dst0, intptr_t my = av_mod_uintp2(mv->y, 2 + vshift); intptr_t _mx = mx << (1 - hshift); intptr_t _my = my << (1 - vshift); + int emu = src0 == s->frame->data[1] || src0 == s->frame->data[2]; x_off += mv->x >> (2 + hshift); y_off += mv->y >> (2 + vshift); @@ -1720,7 +1722,8 @@ static void chroma_mc_uni(HEVCLocalContext *lc, uint8_t *dst0, 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) { + y_off >= pic_height - block_h - EPEL_EXTRA_AFTER || + emu) { 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 * @@ -2761,73 +2764,15 @@ static int set_side_data(HEVCContext *s) AVFrame *out = s->ref->frame; int ret; - // Decrement the mastering display flag when IRAP frame has no_rasl_output_flag=1 - // so the side data persists for the entire coded video sequence. - if (s->sei.mastering_display.present > 0 && - IS_IRAP(s) && s->no_rasl_output_flag) { - s->sei.mastering_display.present--; - } - if (s->sei.mastering_display.present) { - // HEVC uses a g,b,r ordering, which we convert to a more natural r,g,b - const int mapping[3] = {2, 0, 1}; - const int chroma_den = 50000; - const int luma_den = 10000; - int i; - AVMasteringDisplayMetadata *metadata = - av_mastering_display_metadata_create_side_data(out); - if (!metadata) - return AVERROR(ENOMEM); + // Decrement the mastering display and content light level flag when IRAP + // frame has no_rasl_output_flag=1 so the side data persists for the entire + // coded video sequence. + if (IS_IRAP(s) && s->no_rasl_output_flag) { + if (s->sei.common.mastering_display.present > 0) + s->sei.common.mastering_display.present--; - for (i = 0; i < 3; i++) { - const int j = mapping[i]; - metadata->display_primaries[i][0].num = s->sei.mastering_display.display_primaries[j][0]; - metadata->display_primaries[i][0].den = chroma_den; - metadata->display_primaries[i][1].num = s->sei.mastering_display.display_primaries[j][1]; - metadata->display_primaries[i][1].den = chroma_den; - } - metadata->white_point[0].num = s->sei.mastering_display.white_point[0]; - metadata->white_point[0].den = chroma_den; - metadata->white_point[1].num = s->sei.mastering_display.white_point[1]; - metadata->white_point[1].den = chroma_den; - - metadata->max_luminance.num = s->sei.mastering_display.max_luminance; - metadata->max_luminance.den = luma_den; - metadata->min_luminance.num = s->sei.mastering_display.min_luminance; - metadata->min_luminance.den = luma_den; - metadata->has_luminance = 1; - metadata->has_primaries = 1; - - av_log(s->avctx, AV_LOG_DEBUG, "Mastering Display Metadata:\n"); - av_log(s->avctx, AV_LOG_DEBUG, - "r(%5.4f,%5.4f) g(%5.4f,%5.4f) b(%5.4f %5.4f) wp(%5.4f, %5.4f)\n", - av_q2d(metadata->display_primaries[0][0]), - av_q2d(metadata->display_primaries[0][1]), - av_q2d(metadata->display_primaries[1][0]), - av_q2d(metadata->display_primaries[1][1]), - av_q2d(metadata->display_primaries[2][0]), - av_q2d(metadata->display_primaries[2][1]), - av_q2d(metadata->white_point[0]), av_q2d(metadata->white_point[1])); - av_log(s->avctx, AV_LOG_DEBUG, - "min_luminance=%f, max_luminance=%f\n", - av_q2d(metadata->min_luminance), av_q2d(metadata->max_luminance)); - } - // Decrement the mastering display flag when IRAP frame has no_rasl_output_flag=1 - // so the side data persists for the entire coded video sequence. - if (s->sei.content_light.present > 0 && - IS_IRAP(s) && s->no_rasl_output_flag) { - s->sei.content_light.present--; - } - if (s->sei.content_light.present) { - AVContentLightMetadata *metadata = - av_content_light_metadata_create_side_data(out); - if (!metadata) - return AVERROR(ENOMEM); - metadata->MaxCLL = s->sei.content_light.max_content_light_level; - metadata->MaxFALL = s->sei.content_light.max_pic_average_light_level; - - av_log(s->avctx, AV_LOG_DEBUG, "Content Light Level Metadata:\n"); - av_log(s->avctx, AV_LOG_DEBUG, "MaxCLL=%d, MaxFALL=%d\n", - metadata->MaxCLL, metadata->MaxFALL); + if (s->sei.common.content_light.present > 0) + s->sei.common.content_light.present--; } ret = ff_h2645_sei_to_frame(out, &s->sei.common, AV_CODEC_ID_HEVC, NULL, @@ -2939,6 +2884,14 @@ static int hevc_frame_start(HEVCContext *s) !(s->avctx->export_side_data & AV_CODEC_EXPORT_DATA_FILM_GRAIN) && !s->avctx->hwaccel; + if (s->ref->needs_fg && + !ff_h274_film_grain_params_supported(s->sei.common.film_grain_characteristics.model_id, + s->ref->frame->format)) { + av_log_once(s->avctx, AV_LOG_WARNING, AV_LOG_DEBUG, &s->film_grain_warning_shown, + "Unsupported film grain parameters. Ignoring film grain.\n"); + s->ref->needs_fg = 0; + } + if (s->ref->needs_fg) { s->ref->frame_grain->format = s->ref->frame->format; s->ref->frame_grain->width = s->ref->frame->width; @@ -2977,19 +2930,14 @@ static int hevc_frame_end(HEVCContext *s) { HEVCFrame *out = s->ref; const AVFrameSideData *sd; - int ret; + av_unused int ret; if (out->needs_fg) { sd = av_frame_get_side_data(out->frame, AV_FRAME_DATA_FILM_GRAIN_PARAMS); av_assert0(out->frame_grain->buf[0] && sd); ret = ff_h274_apply_film_grain(out->frame_grain, out->frame, &s->h274db, (AVFilmGrainParams *) sd->data); - - if (ret < 0) { - av_log(s->avctx, AV_LOG_WARNING, "Failed synthesizing film " - "grain, ignoring: %s\n", av_err2str(ret)); - out->needs_fg = 0; - } + av_assert1(ret >= 0); } return 0; @@ -3007,11 +2955,9 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal) switch (s->nal_unit_type) { case HEVC_NAL_VPS: - if (s->avctx->hwaccel && s->avctx->hwaccel->decode_params) { - ret = s->avctx->hwaccel->decode_params(s->avctx, - nal->type, - nal->raw_data, - nal->raw_size); + if (FF_HW_HAS_CB(s->avctx, decode_params)) { + ret = FF_HW_CALL(s->avctx, decode_params, + nal->type, nal->raw_data, nal->raw_size); if (ret < 0) goto fail; } @@ -3020,11 +2966,9 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal) goto fail; break; case HEVC_NAL_SPS: - if (s->avctx->hwaccel && s->avctx->hwaccel->decode_params) { - ret = s->avctx->hwaccel->decode_params(s->avctx, - nal->type, - nal->raw_data, - nal->raw_size); + if (FF_HW_HAS_CB(s->avctx, decode_params)) { + ret = FF_HW_CALL(s->avctx, decode_params, + nal->type, nal->raw_data, nal->raw_size); if (ret < 0) goto fail; } @@ -3034,11 +2978,9 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal) goto fail; break; case HEVC_NAL_PPS: - if (s->avctx->hwaccel && s->avctx->hwaccel->decode_params) { - ret = s->avctx->hwaccel->decode_params(s->avctx, - nal->type, - nal->raw_data, - nal->raw_size); + if (FF_HW_HAS_CB(s->avctx, decode_params)) { + ret = FF_HW_CALL(s->avctx, decode_params, + nal->type, nal->raw_data, nal->raw_size); if (ret < 0) goto fail; } @@ -3048,11 +2990,9 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal) break; case HEVC_NAL_SEI_PREFIX: case HEVC_NAL_SEI_SUFFIX: - if (s->avctx->hwaccel && s->avctx->hwaccel->decode_params) { - ret = s->avctx->hwaccel->decode_params(s->avctx, - nal->type, - nal->raw_data, - nal->raw_size); + if (FF_HW_HAS_CB(s->avctx, decode_params)) { + ret = FF_HW_CALL(s->avctx, decode_params, + nal->type, nal->raw_data, nal->raw_size); if (ret < 0) goto fail; } @@ -3138,17 +3078,17 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal) } if (s->sh.first_slice_in_pic_flag && s->avctx->hwaccel) { - ret = s->avctx->hwaccel->start_frame(s->avctx, NULL, 0); + ret = FF_HW_CALL(s->avctx, start_frame, NULL, 0); if (ret < 0) goto fail; } if (s->avctx->hwaccel) { - ret = s->avctx->hwaccel->decode_slice(s->avctx, nal->raw_data, nal->raw_size); + ret = FF_HW_CALL(s->avctx, decode_slice, nal->raw_data, nal->raw_size); if (ret < 0) goto fail; } else { - if (s->avctx->profile == FF_PROFILE_HEVC_SCC) { + if (s->avctx->profile == AV_PROFILE_HEVC_SCC) { av_log(s->avctx, AV_LOG_ERROR, "SCC profile is not yet implemented in hevc native decoder.\n"); ret = AVERROR_PATCHWELCOME; @@ -3412,7 +3352,7 @@ static int hevc_decode_frame(AVCodecContext *avctx, AVFrame *rframe, return ret; if (avctx->hwaccel) { - if (s->ref && (ret = avctx->hwaccel->end_frame(avctx)) < 0) { + if (s->ref && (ret = FF_HW_SIMPLE_CALL(avctx, end_frame)) < 0) { av_log(avctx, AV_LOG_ERROR, "hardware accelerator failed to decode picture\n"); ff_hevc_unref_frame(s, s->ref, ~0); @@ -3637,6 +3577,8 @@ static int hevc_update_thread_context(AVCodecContext *dst, s->threads_number = s0->threads_number; s->threads_type = s0->threads_type; + s->film_grain_warning_shown = s0->film_grain_warning_shown; + if (s0->eos) { s->seq_decode = (s->seq_decode + 1) & HEVC_SEQUENCE_COUNTER_MASK; s->max_ra = INT_MAX; @@ -3667,8 +3609,8 @@ static int hevc_update_thread_context(AVCodecContext *dst, s->sei.common.frame_packing = s0->sei.common.frame_packing; s->sei.common.display_orientation = s0->sei.common.display_orientation; s->sei.common.alternative_transfer = s0->sei.common.alternative_transfer; - s->sei.mastering_display = s0->sei.mastering_display; - s->sei.content_light = s0->sei.content_light; + s->sei.common.mastering_display = s0->sei.common.mastering_display; + s->sei.common.content_light = s0->sei.common.content_light; ret = export_stream_params_from_sei(s); if (ret < 0) @@ -3728,8 +3670,8 @@ static void hevc_decode_flush(AVCodecContext *avctx) s->max_ra = INT_MAX; s->eos = 1; - if (avctx->hwaccel && avctx->hwaccel->flush) - avctx->hwaccel->flush(avctx); + if (FF_HW_HAS_CB(avctx, flush)) + FF_HW_SIMPLE_CALL(avctx, flush); } #define OFFSET(x) offsetof(HEVCContext, x) diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/hevcdec.h b/arm/raspi/third_party/ffmpeg/libavcodec/hevcdec.h index 94609e46..9b232df6 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/hevcdec.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/hevcdec.h @@ -596,6 +596,8 @@ typedef struct HEVCContext { int nal_length_size; ///< Number of bytes used for nal length (1, 2 or 4) int nuh_layer_id; + int film_grain_warning_shown; + AVBufferRef *rpu_buf; ///< 0 or 1 Dolby Vision RPUs. DOVIContext dovi_ctx; ///< Dolby Vision decoding context } HEVCContext; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/hevcpred_template.c b/arm/raspi/third_party/ffmpeg/libavcodec/hevcpred_template.c index 16d1c7f3..46bd8065 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/hevcpred_template.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/hevcpred_template.c @@ -213,13 +213,10 @@ do { \ j = 0; while (j < size_max_x && !IS_INTRA(j, -1)) j++; - if (j > 0) - if (cand_up_left) { - EXTEND_LEFT_CIP(top, j, j + 1); - } else { - EXTEND_LEFT_CIP(top, j, j); - top[-1] = top[0]; - } + if (j > 0) { + EXTEND_LEFT_CIP(top, j, j); + top[-1] = top[0]; + } left[-1] = top[-1]; } left[-1] = top[-1]; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/hq_hqa.c b/arm/raspi/third_party/ffmpeg/libavcodec/hq_hqa.c index db0ac7d9..0df7995f 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/hq_hqa.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/hq_hqa.c @@ -376,8 +376,8 @@ static av_cold int hq_hqa_decode_close(AVCodecContext *avctx) { HQContext *ctx = avctx->priv_data; - ff_free_vlc(&ctx->hq_ac_vlc); - ff_free_vlc(&ctx->hqa_cbp_vlc); + ff_vlc_free(&ctx->hq_ac_vlc); + ff_vlc_free(&ctx->hqa_cbp_vlc); return 0; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/hq_hqadata.c b/arm/raspi/third_party/ffmpeg/libavcodec/hq_hqadata.c index 56470ead..438bdf09 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/hq_hqadata.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/hq_hqadata.c @@ -8367,11 +8367,11 @@ const HQProfile ff_hq_profile[NUM_HQ_PROFILES] = { av_cold int ff_hq_init_vlcs(HQContext *c) { - int ret = init_vlc(&c->hqa_cbp_vlc, 5, FF_ARRAY_ELEMS(cbp_vlc_lens), + int ret = vlc_init(&c->hqa_cbp_vlc, 5, FF_ARRAY_ELEMS(cbp_vlc_lens), cbp_vlc_lens, 1, 1, cbp_vlc_bits, 1, 1, 0); if (ret < 0) return ret; - return init_vlc(&c->hq_ac_vlc, 9, NUM_HQ_AC_ENTRIES, + return vlc_init(&c->hq_ac_vlc, 9, NUM_HQ_AC_ENTRIES, hq_ac_bits, 1, 1, hq_ac_codes, 2, 2, 0); } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/hqx.c b/arm/raspi/third_party/ffmpeg/libavcodec/hqx.c index 6554b15e..51099aa6 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/hqx.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/hqx.c @@ -517,9 +517,9 @@ static av_cold int hqx_decode_close(AVCodecContext *avctx) int i; HQXContext *ctx = avctx->priv_data; - ff_free_vlc(&ctx->cbp_vlc); + ff_vlc_free(&ctx->cbp_vlc); for (i = 0; i < 3; i++) { - ff_free_vlc(&ctx->dc_vlc[i]); + ff_vlc_free(&ctx->dc_vlc[i]); } return 0; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/hqxvlc.c b/arm/raspi/third_party/ffmpeg/libavcodec/hqxvlc.c index 7ab24276..1eeda4fc 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/hqxvlc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/hqxvlc.c @@ -2140,7 +2140,7 @@ const HQXAC ff_hqx_ac[NUM_HQX_AC] = { #define INIT_DC_TABLE(idx, name) \ do { \ - ret = init_vlc(&ctx->dc_vlc[idx], HQX_DC_VLC_BITS, \ + ret = vlc_init(&ctx->dc_vlc[idx], HQX_DC_VLC_BITS, \ FF_ARRAY_ELEMS(name ## _vlc_lens), \ name ## _vlc_lens, 1, 1, \ name ## _vlc_bits, 2, 2, 0); \ @@ -2150,7 +2150,7 @@ const HQXAC ff_hqx_ac[NUM_HQX_AC] = { av_cold int ff_hqx_init_vlcs(HQXContext *ctx) { - int ret = init_vlc(&ctx->cbp_vlc, HQX_CBP_VLC_BITS, FF_ARRAY_ELEMS(cbp_vlc_lens), + int ret = vlc_init(&ctx->cbp_vlc, HQX_CBP_VLC_BITS, FF_ARRAY_ELEMS(cbp_vlc_lens), cbp_vlc_lens, 1, 1, cbp_vlc_bits, 1, 1, 0); if (ret < 0) return ret; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/huffman.c b/arm/raspi/third_party/ffmpeg/libavcodec/huffman.c index 99aa39c5..d47fe100 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/huffman.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/huffman.c @@ -148,7 +148,7 @@ static int build_huff_tree(VLC *vlc, Node *nodes, int head, int flags, int nb_bi get_tree_codes(bits, lens, xlat, nodes, head, 0, 0, &pos, no_zero_count); - return ff_init_vlc_sparse(vlc, nb_bits, pos, lens, 2, 2, bits, 4, 4, xlat, 1, 1, 0); + return ff_vlc_init_sparse(vlc, nb_bits, pos, lens, 2, 2, bits, 4, 4, xlat, 1, 1, 0); } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/huffyuvdec.c b/arm/raspi/third_party/ffmpeg/libavcodec/huffyuvdec.c index c9fcec30..9e9047c5 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/huffyuvdec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/huffyuvdec.c @@ -42,6 +42,7 @@ #include "huffyuvdsp.h" #include "lossless_videodsp.h" #include "thread.h" +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/pixdesc.h" @@ -168,8 +169,9 @@ static int generate_joint_tables(HYuvDecContext *s) len = (uint8_t *)(bits + (1 << VLC_BITS)); if (s->bitstream_bpp < 24 || s->version > 2) { + int count = 1 + s->alpha + 2 * s->chroma; int p, i, y, u; - for (p = 0; p < 4; p++) { + for (p = 0; p < count; p++) { int p0 = s->version > 2 ? p : 0; for (i = y = 0; y < s->vlc_n; y++) { int len0 = s->len[p0][y]; @@ -191,8 +193,8 @@ static int generate_joint_tables(HYuvDecContext *s) i++; } } - ff_free_vlc(&s->vlc[4 + p]); - if ((ret = ff_init_vlc_sparse(&s->vlc[4 + p], VLC_BITS, i, len, 1, 1, + ff_vlc_free(&s->vlc[4 + p]); + if ((ret = ff_vlc_init_sparse(&s->vlc[4 + p], VLC_BITS, i, len, 1, 1, bits, 2, 2, symbols, 2, 2, 0)) < 0) goto out; } @@ -235,8 +237,8 @@ static int generate_joint_tables(HYuvDecContext *s) } } } - ff_free_vlc(&s->vlc[4]); - if ((ret = init_vlc(&s->vlc[4], VLC_BITS, i, len, 1, 1, + ff_vlc_free(&s->vlc[4]); + if ((ret = vlc_init(&s->vlc[4], VLC_BITS, i, len, 1, 1, bits, 2, 2, 0)) < 0) goto out; } @@ -263,8 +265,8 @@ static int read_huffman_tables(HYuvDecContext *s, const uint8_t *src, int length return ret; if ((ret = ff_huffyuv_generate_bits_table(s->bits[i], s->len[i], s->vlc_n)) < 0) return ret; - ff_free_vlc(&s->vlc[i]); - if ((ret = init_vlc(&s->vlc[i], VLC_BITS, s->vlc_n, s->len[i], 1, 1, + ff_vlc_free(&s->vlc[i]); + if ((ret = vlc_init(&s->vlc[i], VLC_BITS, s->vlc_n, s->len[i], 1, 1, s->bits[i], 4, 4, 0)) < 0) return ret; } @@ -303,8 +305,8 @@ static int read_old_huffman_tables(HYuvDecContext *s) memcpy(s->len[2], s->len[1], 256 * sizeof(uint8_t)); for (i = 0; i < 4; i++) { - ff_free_vlc(&s->vlc[i]); - if ((ret = init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1, + ff_vlc_free(&s->vlc[i]); + if ((ret = vlc_init(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1, s->bits[i], 4, 4, 0)) < 0) return ret; } @@ -324,7 +326,7 @@ static av_cold int decode_end(AVCodecContext *avctx) av_freep(&s->bitstream_buffer); for (i = 0; i < 8; i++) - ff_free_vlc(&s->vlc[i]); + ff_vlc_free(&s->vlc[i]); return 0; } @@ -755,7 +757,7 @@ static void decode_plane_bitstream(HYuvDecContext *s, int width, int plane) } } if( width&1 && get_bits_left(&s->gb)>0 ) { - int dst = get_vlc2(&s->gb, s->vlc[plane].table, VLC_BITS, 3)<<2; + int dst = (unsigned)get_vlc2(&s->gb, s->vlc[plane].table, VLC_BITS, 3)<<2; s->temp16[0][width-1] = dst + get_bits(&s->gb, 2); } } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/huffyuvenc.c b/arm/raspi/third_party/ffmpeg/libavcodec/huffyuvenc.c index 72d6246e..b02b3c7a 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/huffyuvenc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/huffyuvenc.c @@ -39,6 +39,7 @@ #include "huffyuvencdsp.h" #include "lossless_videoencdsp.h" #include "put_bits.h" +#include "libavutil/emms.h" #include "libavutil/opt.h" #include "libavutil/pixdesc.h" diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/hwaccel_internal.h b/arm/raspi/third_party/ffmpeg/libavcodec/hwaccel_internal.h new file mode 100644 index 00000000..edfe2831 --- /dev/null +++ b/arm/raspi/third_party/ffmpeg/libavcodec/hwaccel_internal.h @@ -0,0 +1,179 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * Header providing the internals of AVHWAccel. + */ + +#ifndef AVCODEC_HWACCEL_INTERNAL_H +#define AVCODEC_HWACCEL_INTERNAL_H + +#include + +#include "avcodec.h" + +#define HWACCEL_CAP_ASYNC_SAFE (1 << 0) +#define HWACCEL_CAP_THREAD_SAFE (1 << 1) + +typedef struct FFHWAccel { + /** + * The public AVHWAccel. See avcodec.h for it. + */ + AVHWAccel p; + + /** + * Allocate a custom buffer + */ + int (*alloc_frame)(AVCodecContext *avctx, AVFrame *frame); + + /** + * Called at the beginning of each frame or field picture. + * + * Meaningful frame information (codec specific) is guaranteed to + * be parsed at this point. This function is mandatory. + * + * Note that buf can be NULL along with buf_size set to 0. + * Otherwise, this means the whole frame is available at this point. + * + * @param avctx the codec context + * @param buf the frame data buffer base + * @param buf_size the size of the frame in bytes + * @return zero if successful, a negative value otherwise + */ + int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size); + + /** + * Callback for parameter data (SPS/PPS/VPS etc). + * + * Useful for hardware decoders which keep persistent state about the + * video parameters, and need to receive any changes to update that state. + * + * @param avctx the codec context + * @param type the nal unit type + * @param buf the nal unit data buffer + * @param buf_size the size of the nal unit in bytes + * @return zero if successful, a negative value otherwise + */ + int (*decode_params)(AVCodecContext *avctx, int type, const uint8_t *buf, uint32_t buf_size); + + /** + * Callback for each slice. + * + * Meaningful slice information (codec specific) is guaranteed to + * be parsed at this point. This function is mandatory. + * + * @param avctx the codec context + * @param buf the slice data buffer base + * @param buf_size the size of the slice in bytes + * @return zero if successful, a negative value otherwise + */ + int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size); + + /** + * Called at the end of each frame or field picture. + * + * The whole picture is parsed at this point and can now be sent + * to the hardware accelerator. This function is mandatory. + * + * @param avctx the codec context + * @return zero if successful, a negative value otherwise + */ + int (*end_frame)(AVCodecContext *avctx); + + /** + * Size of per-frame hardware accelerator private data. + * + * Private data is allocated with av_mallocz() before + * AVCodecContext.get_buffer() and deallocated after + * AVCodecContext.release_buffer(). + */ + int frame_priv_data_size; + + /** + * Size of the private data to allocate in + * AVCodecInternal.hwaccel_priv_data. + */ + int priv_data_size; + + /** + * Internal hwaccel capabilities. + */ + int caps_internal; + + /** + * Initialize the hwaccel private data. + * + * This will be called from ff_get_format(), after hwaccel and + * hwaccel_context are set and the hwaccel private data in AVCodecInternal + * is allocated. + */ + int (*init)(AVCodecContext *avctx); + + /** + * Uninitialize the hwaccel private data. + * + * This will be called from get_format() or avcodec_close(), after hwaccel + * and hwaccel_context are already uninitialized. + */ + int (*uninit)(AVCodecContext *avctx); + + /** + * Fill the given hw_frames context with current codec parameters. Called + * from get_format. Refer to avcodec_get_hw_frames_parameters() for + * details. + * + * This CAN be called before AVHWAccel.init is called, and you must assume + * that avctx->hwaccel_priv_data is invalid. + */ + int (*frame_params)(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx); + + /** + * Copy necessary context variables from a previous thread context to the current one. + * For thread-safe hwaccels only. + */ + int (*update_thread_context)(AVCodecContext *dst, const AVCodecContext *src); + + /** + * Callback to free the hwaccel-specific frame data. + * + * @param hwctx a pointer to an AVHWDeviceContext. + * @param data the per-frame hardware accelerator private data to be freed. + */ + void (*free_frame_priv)(void *hwctx, uint8_t *data); + + /** + * Callback to flush the hwaccel state. + */ + void (*flush)(AVCodecContext *avctx); +} FFHWAccel; + +static inline const FFHWAccel *ffhwaccel(const AVHWAccel *codec) +{ + return (const FFHWAccel*)codec; +} + +#define FF_HW_CALL(avctx, function, ...) \ + (ffhwaccel((avctx)->hwaccel)->function((avctx), __VA_ARGS__)) + +#define FF_HW_SIMPLE_CALL(avctx, function) \ + (ffhwaccel((avctx)->hwaccel)->function(avctx)) + +#define FF_HW_HAS_CB(avctx, function) \ + ((avctx)->hwaccel && ffhwaccel((avctx)->hwaccel)->function) + +#endif /* AVCODEC_HWACCEL_INTERNAL */ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/hwaccels.h b/arm/raspi/third_party/ffmpeg/libavcodec/hwaccels.h index 48dfc17f..c4630718 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/hwaccels.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/hwaccels.h @@ -19,70 +19,68 @@ #ifndef AVCODEC_HWACCELS_H #define AVCODEC_HWACCELS_H -#include "avcodec.h" - -extern const AVHWAccel ff_av1_d3d11va_hwaccel; -extern const AVHWAccel ff_av1_d3d11va2_hwaccel; -extern const AVHWAccel ff_av1_dxva2_hwaccel; -extern const AVHWAccel ff_av1_nvdec_hwaccel; -extern const AVHWAccel ff_av1_vaapi_hwaccel; -extern const AVHWAccel ff_av1_vdpau_hwaccel; -extern const AVHWAccel ff_av1_vulkan_hwaccel; -extern const AVHWAccel ff_h263_vaapi_hwaccel; -extern const AVHWAccel ff_h263_videotoolbox_hwaccel; -extern const AVHWAccel ff_h264_d3d11va_hwaccel; -extern const AVHWAccel ff_h264_d3d11va2_hwaccel; -extern const AVHWAccel ff_h264_dxva2_hwaccel; -extern const AVHWAccel ff_h264_nvdec_hwaccel; -extern const AVHWAccel ff_h264_vaapi_hwaccel; -extern const AVHWAccel ff_h264_vdpau_hwaccel; -extern const AVHWAccel ff_h264_videotoolbox_hwaccel; -extern const AVHWAccel ff_h264_vulkan_hwaccel; -extern const AVHWAccel ff_hevc_d3d11va_hwaccel; -extern const AVHWAccel ff_hevc_d3d11va2_hwaccel; -extern const AVHWAccel ff_hevc_dxva2_hwaccel; -extern const AVHWAccel ff_hevc_nvdec_hwaccel; -extern const AVHWAccel ff_hevc_vaapi_hwaccel; -extern const AVHWAccel ff_hevc_vdpau_hwaccel; -extern const AVHWAccel ff_hevc_videotoolbox_hwaccel; -extern const AVHWAccel ff_hevc_vulkan_hwaccel; -extern const AVHWAccel ff_mjpeg_nvdec_hwaccel; -extern const AVHWAccel ff_mjpeg_vaapi_hwaccel; -extern const AVHWAccel ff_mpeg1_nvdec_hwaccel; -extern const AVHWAccel ff_mpeg1_vdpau_hwaccel; -extern const AVHWAccel ff_mpeg1_videotoolbox_hwaccel; -extern const AVHWAccel ff_mpeg2_d3d11va_hwaccel; -extern const AVHWAccel ff_mpeg2_d3d11va2_hwaccel; -extern const AVHWAccel ff_mpeg2_nvdec_hwaccel; -extern const AVHWAccel ff_mpeg2_dxva2_hwaccel; -extern const AVHWAccel ff_mpeg2_vaapi_hwaccel; -extern const AVHWAccel ff_mpeg2_vdpau_hwaccel; -extern const AVHWAccel ff_mpeg2_videotoolbox_hwaccel; -extern const AVHWAccel ff_mpeg4_nvdec_hwaccel; -extern const AVHWAccel ff_mpeg4_vaapi_hwaccel; -extern const AVHWAccel ff_mpeg4_vdpau_hwaccel; -extern const AVHWAccel ff_mpeg4_videotoolbox_hwaccel; -extern const AVHWAccel ff_prores_videotoolbox_hwaccel; -extern const AVHWAccel ff_vc1_d3d11va_hwaccel; -extern const AVHWAccel ff_vc1_d3d11va2_hwaccel; -extern const AVHWAccel ff_vc1_dxva2_hwaccel; -extern const AVHWAccel ff_vc1_nvdec_hwaccel; -extern const AVHWAccel ff_vc1_vaapi_hwaccel; -extern const AVHWAccel ff_vc1_vdpau_hwaccel; -extern const AVHWAccel ff_vp8_nvdec_hwaccel; -extern const AVHWAccel ff_vp8_vaapi_hwaccel; -extern const AVHWAccel ff_vp9_d3d11va_hwaccel; -extern const AVHWAccel ff_vp9_d3d11va2_hwaccel; -extern const AVHWAccel ff_vp9_dxva2_hwaccel; -extern const AVHWAccel ff_vp9_nvdec_hwaccel; -extern const AVHWAccel ff_vp9_vaapi_hwaccel; -extern const AVHWAccel ff_vp9_vdpau_hwaccel; -extern const AVHWAccel ff_vp9_videotoolbox_hwaccel; -extern const AVHWAccel ff_wmv3_d3d11va_hwaccel; -extern const AVHWAccel ff_wmv3_d3d11va2_hwaccel; -extern const AVHWAccel ff_wmv3_dxva2_hwaccel; -extern const AVHWAccel ff_wmv3_nvdec_hwaccel; -extern const AVHWAccel ff_wmv3_vaapi_hwaccel; -extern const AVHWAccel ff_wmv3_vdpau_hwaccel; +extern const struct FFHWAccel ff_av1_d3d11va_hwaccel; +extern const struct FFHWAccel ff_av1_d3d11va2_hwaccel; +extern const struct FFHWAccel ff_av1_dxva2_hwaccel; +extern const struct FFHWAccel ff_av1_nvdec_hwaccel; +extern const struct FFHWAccel ff_av1_vaapi_hwaccel; +extern const struct FFHWAccel ff_av1_vdpau_hwaccel; +extern const struct FFHWAccel ff_av1_vulkan_hwaccel; +extern const struct FFHWAccel ff_h263_vaapi_hwaccel; +extern const struct FFHWAccel ff_h263_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_h264_d3d11va_hwaccel; +extern const struct FFHWAccel ff_h264_d3d11va2_hwaccel; +extern const struct FFHWAccel ff_h264_dxva2_hwaccel; +extern const struct FFHWAccel ff_h264_nvdec_hwaccel; +extern const struct FFHWAccel ff_h264_vaapi_hwaccel; +extern const struct FFHWAccel ff_h264_vdpau_hwaccel; +extern const struct FFHWAccel ff_h264_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_h264_vulkan_hwaccel; +extern const struct FFHWAccel ff_hevc_d3d11va_hwaccel; +extern const struct FFHWAccel ff_hevc_d3d11va2_hwaccel; +extern const struct FFHWAccel ff_hevc_dxva2_hwaccel; +extern const struct FFHWAccel ff_hevc_nvdec_hwaccel; +extern const struct FFHWAccel ff_hevc_vaapi_hwaccel; +extern const struct FFHWAccel ff_hevc_vdpau_hwaccel; +extern const struct FFHWAccel ff_hevc_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_hevc_vulkan_hwaccel; +extern const struct FFHWAccel ff_mjpeg_nvdec_hwaccel; +extern const struct FFHWAccel ff_mjpeg_vaapi_hwaccel; +extern const struct FFHWAccel ff_mpeg1_nvdec_hwaccel; +extern const struct FFHWAccel ff_mpeg1_vdpau_hwaccel; +extern const struct FFHWAccel ff_mpeg1_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_mpeg2_d3d11va_hwaccel; +extern const struct FFHWAccel ff_mpeg2_d3d11va2_hwaccel; +extern const struct FFHWAccel ff_mpeg2_dxva2_hwaccel; +extern const struct FFHWAccel ff_mpeg2_nvdec_hwaccel; +extern const struct FFHWAccel ff_mpeg2_vaapi_hwaccel; +extern const struct FFHWAccel ff_mpeg2_vdpau_hwaccel; +extern const struct FFHWAccel ff_mpeg2_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_mpeg4_nvdec_hwaccel; +extern const struct FFHWAccel ff_mpeg4_vaapi_hwaccel; +extern const struct FFHWAccel ff_mpeg4_vdpau_hwaccel; +extern const struct FFHWAccel ff_mpeg4_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_prores_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_vc1_d3d11va_hwaccel; +extern const struct FFHWAccel ff_vc1_d3d11va2_hwaccel; +extern const struct FFHWAccel ff_vc1_dxva2_hwaccel; +extern const struct FFHWAccel ff_vc1_nvdec_hwaccel; +extern const struct FFHWAccel ff_vc1_vaapi_hwaccel; +extern const struct FFHWAccel ff_vc1_vdpau_hwaccel; +extern const struct FFHWAccel ff_vp8_nvdec_hwaccel; +extern const struct FFHWAccel ff_vp8_vaapi_hwaccel; +extern const struct FFHWAccel ff_vp9_d3d11va_hwaccel; +extern const struct FFHWAccel ff_vp9_d3d11va2_hwaccel; +extern const struct FFHWAccel ff_vp9_dxva2_hwaccel; +extern const struct FFHWAccel ff_vp9_nvdec_hwaccel; +extern const struct FFHWAccel ff_vp9_vaapi_hwaccel; +extern const struct FFHWAccel ff_vp9_vdpau_hwaccel; +extern const struct FFHWAccel ff_vp9_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_wmv3_d3d11va_hwaccel; +extern const struct FFHWAccel ff_wmv3_d3d11va2_hwaccel; +extern const struct FFHWAccel ff_wmv3_dxva2_hwaccel; +extern const struct FFHWAccel ff_wmv3_nvdec_hwaccel; +extern const struct FFHWAccel ff_wmv3_vaapi_hwaccel; +extern const struct FFHWAccel ff_wmv3_vdpau_hwaccel; #endif /* AVCODEC_HWACCELS_H */ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/hwconfig.h b/arm/raspi/third_party/ffmpeg/libavcodec/hwconfig.h index e8c61861..e164722a 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/hwconfig.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/hwconfig.h @@ -22,11 +22,6 @@ #include "avcodec.h" #include "hwaccels.h" - -#define HWACCEL_CAP_ASYNC_SAFE (1 << 0) -#define HWACCEL_CAP_THREAD_SAFE (1 << 1) - - typedef struct AVCodecHWConfigInternal { /** * This is the structure which will be returned to the user by @@ -37,7 +32,7 @@ typedef struct AVCodecHWConfigInternal { * If this configuration uses a hwaccel, a pointer to it. * If not, NULL. */ - const AVHWAccel *hwaccel; + const struct FFHWAccel *hwaccel; } AVCodecHWConfigInternal; void ff_hwaccel_uninit(AVCodecContext *avctx); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/idctdsp.h b/arm/raspi/third_party/ffmpeg/libavcodec/idctdsp.h index 72244633..c840a518 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/idctdsp.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/idctdsp.h @@ -19,11 +19,12 @@ #ifndef AVCODEC_IDCTDSP_H #define AVCODEC_IDCTDSP_H +#include #include #include "config.h" -#include "avcodec.h" +struct AVCodecContext; enum idct_permutation_type { FF_IDCT_PERM_NONE, @@ -95,23 +96,23 @@ void ff_put_pixels_clamped_c(const int16_t *block, uint8_t *av_restrict pixels, void ff_add_pixels_clamped_c(const int16_t *block, uint8_t *av_restrict pixels, ptrdiff_t line_size); -void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx); +void ff_idctdsp_init(IDCTDSPContext *c, struct AVCodecContext *avctx); -void ff_idctdsp_init_aarch64(IDCTDSPContext *c, AVCodecContext *avctx, +void ff_idctdsp_init_aarch64(IDCTDSPContext *c, struct AVCodecContext *avctx, unsigned high_bit_depth); -void ff_idctdsp_init_alpha(IDCTDSPContext *c, AVCodecContext *avctx, +void ff_idctdsp_init_alpha(IDCTDSPContext *c, struct AVCodecContext *avctx, unsigned high_bit_depth); -void ff_idctdsp_init_arm(IDCTDSPContext *c, AVCodecContext *avctx, +void ff_idctdsp_init_arm(IDCTDSPContext *c, struct AVCodecContext *avctx, unsigned high_bit_depth); -void ff_idctdsp_init_ppc(IDCTDSPContext *c, AVCodecContext *avctx, +void ff_idctdsp_init_ppc(IDCTDSPContext *c, struct AVCodecContext *avctx, unsigned high_bit_depth); -void ff_idctdsp_init_riscv(IDCTDSPContext *c, AVCodecContext *avctx, +void ff_idctdsp_init_riscv(IDCTDSPContext *c, struct AVCodecContext *avctx, unsigned high_bit_depth); -void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx, +void ff_idctdsp_init_x86(IDCTDSPContext *c, struct AVCodecContext *avctx, unsigned high_bit_depth); -void ff_idctdsp_init_mips(IDCTDSPContext *c, AVCodecContext *avctx, +void ff_idctdsp_init_mips(IDCTDSPContext *c, struct AVCodecContext *avctx, unsigned high_bit_depth); -void ff_idctdsp_init_loongarch(IDCTDSPContext *c, AVCodecContext *avctx, +void ff_idctdsp_init_loongarch(IDCTDSPContext *c, struct AVCodecContext *avctx, unsigned high_bit_depth); #endif /* AVCODEC_IDCTDSP_H */ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/iirfilter.c b/arm/raspi/third_party/ffmpeg/libavcodec/iirfilter.c index 903d64e8..727a3704 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/iirfilter.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/iirfilter.c @@ -26,8 +26,12 @@ #include +#include "config.h" + #include "libavutil/attributes.h" #include "libavutil/common.h" +#include "libavutil/log.h" +#include "libavutil/mem.h" #include "iirfilter.h" diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/imc.c b/arm/raspi/third_party/ffmpeg/libavcodec/imc.c index 174332de..754ceff9 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/imc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/imc.c @@ -176,10 +176,10 @@ static av_cold void imc_init_static(void) for (int j = 0; j < 4; j++) { huffman_vlc[i][j].table = &vlc_tables[offset]; huffman_vlc[i][j].table_allocated = VLC_TABLES_SIZE - offset; - ff_init_vlc_from_lengths(&huffman_vlc[i][j], IMC_VLC_BITS, imc_huffman_sizes[i], + ff_vlc_init_from_lengths(&huffman_vlc[i][j], IMC_VLC_BITS, imc_huffman_sizes[i], imc_huffman_lens[i][j], 1, imc_huffman_syms[i][j], 1, 1, - 0, INIT_VLC_STATIC_OVERLONG, NULL); + 0, VLC_INIT_STATIC_OVERLONG, NULL); offset += huffman_vlc[i][j].table_size; } } @@ -1038,6 +1038,7 @@ const FFCodec ff_imc_decoder = { .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; #endif #if CONFIG_IAC_DECODER @@ -1054,5 +1055,6 @@ const FFCodec ff_iac_decoder = { .p.capabilities = AV_CODEC_CAP_DR1, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; #endif diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/imm4.c b/arm/raspi/third_party/ffmpeg/libavcodec/imm4.c index b95ad869..d4011b33 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/imm4.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/imm4.c @@ -453,8 +453,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, if (ret < 0) return ret; - av_frame_unref(s->prev_frame); - if ((ret = av_frame_ref(s->prev_frame, frame)) < 0) + if ((ret = av_frame_replace(s->prev_frame, frame)) < 0) return ret; } else { if (!s->prev_frame->data[0]) { @@ -474,18 +473,18 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, static av_cold void imm4_init_static_data(void) { - INIT_VLC_STATIC_FROM_LENGTHS(&cbplo_tab, CBPLO_VLC_BITS, FF_ARRAY_ELEMS(cbplo), + VLC_INIT_STATIC_FROM_LENGTHS(&cbplo_tab, CBPLO_VLC_BITS, FF_ARRAY_ELEMS(cbplo), &cbplo[0][1], 2, &cbplo[0][0], 2, 1, 0, 0, 1 << CBPLO_VLC_BITS); - INIT_VLC_SPARSE_STATIC(&cbphi_tab, CBPHI_VLC_BITS, FF_ARRAY_ELEMS(cbphi_bits), + VLC_INIT_SPARSE_STATIC(&cbphi_tab, CBPHI_VLC_BITS, FF_ARRAY_ELEMS(cbphi_bits), cbphi_bits, 1, 1, cbphi_codes, 1, 1, NULL, 0, 0, 64); - INIT_VLC_STATIC_FROM_LENGTHS(&blktype_tab, BLKTYPE_VLC_BITS, FF_ARRAY_ELEMS(blktype), + VLC_INIT_STATIC_FROM_LENGTHS(&blktype_tab, BLKTYPE_VLC_BITS, FF_ARRAY_ELEMS(blktype), &blktype[0][1], 2, &blktype[0][0], 2, 1, 0, 0, 1 << BLKTYPE_VLC_BITS); - INIT_VLC_STATIC_FROM_LENGTHS(&block_tab, BLOCK_VLC_BITS, FF_ARRAY_ELEMS(block_bits), + VLC_INIT_STATIC_FROM_LENGTHS(&block_tab, BLOCK_VLC_BITS, FF_ARRAY_ELEMS(block_bits), block_bits, 1, block_symbols, 2, 2, 0, 0, 1 << BLOCK_VLC_BITS); } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/indeo2.c b/arm/raspi/third_party/ffmpeg/libavcodec/indeo2.c index dd88ebf7..2f643206 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/indeo2.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/indeo2.c @@ -226,9 +226,9 @@ static int ir2_decode_frame(AVCodecContext *avctx, AVFrame *picture, static av_cold void ir2_init_static(void) { - INIT_VLC_STATIC_FROM_LENGTHS(&ir2_vlc, CODE_VLC_BITS, IR2_CODES, + VLC_INIT_STATIC_FROM_LENGTHS(&ir2_vlc, CODE_VLC_BITS, IR2_CODES, &ir2_tab[0][1], 2, &ir2_tab[0][0], 2, 1, - 0, INIT_VLC_OUTPUT_LE, 1 << CODE_VLC_BITS); + 0, VLC_INIT_OUTPUT_LE, 1 << CODE_VLC_BITS); } static av_cold int ir2_decode_init(AVCodecContext *avctx) diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/internal.h b/arm/raspi/third_party/ffmpeg/libavcodec/internal.h index 4dce9f6f..83e0bc3f 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/internal.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/internal.h @@ -157,15 +157,6 @@ int ff_match_2uint16(const uint16_t (*tab)[2], int size, int a, int b); unsigned int ff_toupper4(unsigned int x); -void ff_color_frame(AVFrame *frame, const int color[4]); - -/** - * Maximum size in bytes of extradata. - * 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) - AV_INPUT_BUFFER_PADDING_SIZE) - /** * 2^(x) for integer x * @return correctly rounded float @@ -189,11 +180,6 @@ int avpriv_h264_has_num_reorder_frames(AVCodecContext *avctx); int avpriv_codec_get_cap_skip_frame_fill_param(const AVCodec *codec); -/** - * Add a CPB properties side data to an encoding context. - */ -AVCPBProperties *ff_add_cpb_side_data(AVCodecContext *avctx); - /** * Check AVFrame for S12M timecode side data and allocate and fill TC SEI message with timecode info * @@ -216,16 +202,4 @@ int ff_alloc_timecode_sei(const AVFrame *frame, AVRational rate, size_t prefix_l */ int64_t ff_guess_coded_bitrate(AVCodecContext *avctx); -/** - * Check if a value is in the list. If not, return the default value - * - * @param ctx Context for the log msg - * @param val_name Name of the checked value, for log msg - * @param array_valid_values Array of valid int, ended with INT_MAX - * @param default_value Value return if checked value is not in the array - * @return Value or default_value. - */ -int ff_int_from_list_or_default(void *ctx, const char * val_name, int val, - const int * array_valid_values, int default_value); - #endif /* AVCODEC_INTERNAL_H */ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/interplayvideo.c b/arm/raspi/third_party/ffmpeg/libavcodec/interplayvideo.c index 1f0414bb..9c13707f 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/interplayvideo.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/interplayvideo.c @@ -1340,9 +1340,8 @@ FF_ENABLE_DEPRECATION_WARNINGS *got_frame = send_buffer; /* shuffle frames */ - av_frame_unref(s->second_last_frame); FFSWAP(AVFrame*, s->second_last_frame, s->last_frame); - if ((ret = av_frame_ref(s->last_frame, frame)) < 0) + if ((ret = av_frame_replace(s->last_frame, frame)) < 0) return ret; /* report that the buffer was completely consumed */ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/intrax8.c b/arm/raspi/third_party/ffmpeg/libavcodec/intrax8.c index c5c67272..0d90e370 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/intrax8.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/intrax8.c @@ -56,8 +56,8 @@ static av_cold void x8_init_vlc(VLC *vlc, int nb_bits, int nb_codes, vlc->table = &vlc_buf[*offset]; vlc->table_allocated = VLC_BUFFER_SIZE - *offset; - ff_init_vlc_from_lengths(vlc, nb_bits, nb_codes, &table[0][1], 2, - &table[0][0], 2, 1, 0, INIT_VLC_STATIC_OVERLONG, NULL); + ff_vlc_init_from_lengths(vlc, nb_bits, nb_codes, &table[0][1], 2, + &table[0][0], 2, 1, 0, VLC_INIT_STATIC_OVERLONG, NULL); *offset += vlc->table_size; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/ituh263dec.c b/arm/raspi/third_party/ffmpeg/libavcodec/ituh263dec.c index c7c0a549..80fd78dd 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/ituh263dec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/ituh263dec.c @@ -110,25 +110,25 @@ static VLC cbpc_b_vlc; static av_cold void h263_decode_init_vlc(void) { - INIT_VLC_STATIC(&ff_h263_intra_MCBPC_vlc, INTRA_MCBPC_VLC_BITS, 9, + VLC_INIT_STATIC(&ff_h263_intra_MCBPC_vlc, INTRA_MCBPC_VLC_BITS, 9, ff_h263_intra_MCBPC_bits, 1, 1, ff_h263_intra_MCBPC_code, 1, 1, 72); - INIT_VLC_STATIC(&ff_h263_inter_MCBPC_vlc, INTER_MCBPC_VLC_BITS, 28, + VLC_INIT_STATIC(&ff_h263_inter_MCBPC_vlc, INTER_MCBPC_VLC_BITS, 28, ff_h263_inter_MCBPC_bits, 1, 1, ff_h263_inter_MCBPC_code, 1, 1, 198); - INIT_VLC_STATIC(&ff_h263_cbpy_vlc, CBPY_VLC_BITS, 16, + VLC_INIT_STATIC(&ff_h263_cbpy_vlc, CBPY_VLC_BITS, 16, &ff_h263_cbpy_tab[0][1], 2, 1, &ff_h263_cbpy_tab[0][0], 2, 1, 64); - INIT_VLC_STATIC(&ff_h263_mv_vlc, H263_MV_VLC_BITS, 33, + VLC_INIT_STATIC(&ff_h263_mv_vlc, H263_MV_VLC_BITS, 33, &ff_mvtab[0][1], 2, 1, &ff_mvtab[0][0], 2, 1, 538); ff_h263_init_rl_inter(); - INIT_VLC_RL(ff_h263_rl_inter, 554); + VLC_INIT_RL(ff_h263_rl_inter, 554); INIT_FIRST_VLC_RL(ff_rl_intra_aic, 554); - INIT_VLC_STATIC(&h263_mbtype_b_vlc, H263_MBTYPE_B_VLC_BITS, 15, + VLC_INIT_STATIC(&h263_mbtype_b_vlc, H263_MBTYPE_B_VLC_BITS, 15, &ff_h263_mbtype_b_tab[0][1], 2, 1, &ff_h263_mbtype_b_tab[0][0], 2, 1, 80); - INIT_VLC_STATIC(&cbpc_b_vlc, CBPC_B_VLC_BITS, 4, + VLC_INIT_STATIC(&cbpc_b_vlc, CBPC_B_VLC_BITS, 4, &ff_cbpc_b_tab[0][1], 2, 1, &ff_cbpc_b_tab[0][0], 2, 1, 8); } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/ivi.c b/arm/raspi/third_party/ffmpeg/libavcodec/ivi.c index 43f3cb1d..60769664 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/ivi.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/ivi.c @@ -154,8 +154,8 @@ static int ivi_create_huff_from_desc(const IVIHuffDesc *cb, VLC *vlc, int flag) }//for i /* number of codewords = pos */ - return init_vlc(vlc, IVI_VLC_BITS, pos, bits, 1, 1, codewords, 2, 2, - (flag ? INIT_VLC_USE_NEW_STATIC : 0) | INIT_VLC_OUTPUT_LE); + return vlc_init(vlc, IVI_VLC_BITS, pos, bits, 1, 1, codewords, 2, 2, + (flag ? VLC_INIT_USE_STATIC : 0) | VLC_INIT_OUTPUT_LE); } static av_cold void ivi_init_static_vlc(void) @@ -237,7 +237,7 @@ int ff_ivi_dec_huff_desc(GetBitContext *gb, int desc_coded, int which_tab, ivi_huff_desc_copy(&huff_tab->cust_desc, &new_huff); if (huff_tab->cust_tab.table) - ff_free_vlc(&huff_tab->cust_tab); + ff_vlc_free(&huff_tab->cust_tab); result = ivi_create_huff_from_desc(&huff_tab->cust_desc, &huff_tab->cust_tab, 0); if (result) { @@ -277,7 +277,7 @@ static av_cold void ivi_free_buffers(IVIPlaneDesc *planes) av_freep(&band->bufs[3]); if (band->blk_vlc.cust_tab.table) - ff_free_vlc(&band->blk_vlc.cust_tab); + ff_vlc_free(&band->blk_vlc.cust_tab); for (t = 0; t < band->num_tiles; t++) av_freep(&band->tiles[t].mbs); av_freep(&band->tiles); @@ -1215,10 +1215,10 @@ av_cold int ff_ivi_decode_close(AVCodecContext *avctx) ivi_free_buffers(&ctx->planes[0]); if (ctx->mb_vlc.cust_tab.table) - ff_free_vlc(&ctx->mb_vlc.cust_tab); + ff_vlc_free(&ctx->mb_vlc.cust_tab); if (ctx->blk_vlc.cust_tab.table) - ff_free_vlc(&ctx->blk_vlc.cust_tab); + ff_vlc_free(&ctx->blk_vlc.cust_tab); av_frame_free(&ctx->p_frame); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/jfdctfst.c b/arm/raspi/third_party/ffmpeg/libavcodec/jfdctfst.c index 805e0580..946b12f3 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/jfdctfst.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/jfdctfst.c @@ -68,7 +68,7 @@ #include #include "libavutil/attributes.h" -#include "dct.h" +#include "fdctdsp.h" #define DCTSIZE 8 #define GLOBAL(x) x diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/jfdctint_template.c b/arm/raspi/third_party/ffmpeg/libavcodec/jfdctint_template.c index 67fb77b5..ca17300c 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/jfdctint_template.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/jfdctint_template.c @@ -60,7 +60,7 @@ */ #include "libavutil/common.h" -#include "dct.h" +#include "fdctdsp.h" #include "bit_depth_template.c" diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/jni.c b/arm/raspi/third_party/ffmpeg/libavcodec/jni.c index 85dcf2ab..ae6490de 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/jni.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/jni.c @@ -34,8 +34,8 @@ #include "libavutil/log.h" #include "ffjni.h" -void *java_vm; -pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; +static void *java_vm; +static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; int av_jni_set_java_vm(void *vm, void *log_ctx) { diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/jpeg2000dec.c b/arm/raspi/third_party/ffmpeg/libavcodec/jpeg2000dec.c index d6f2a593..eda959e5 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/jpeg2000dec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/jpeg2000dec.c @@ -308,12 +308,12 @@ static int get_siz(Jpeg2000DecoderContext *s) dimy = FFMAX(dimy, ff_jpeg2000_ceildiv(o_dimy, s->cdy[i])); } - ret = ff_set_dimensions(s->avctx, dimx, dimy); + ret = ff_set_dimensions(s->avctx, dimx << s->avctx->lowres, dimy << s->avctx->lowres); if (ret < 0) return ret; - if (s->avctx->profile == FF_PROFILE_JPEG2000_DCINEMA_2K || - s->avctx->profile == FF_PROFILE_JPEG2000_DCINEMA_4K) { + if (s->avctx->profile == AV_PROFILE_JPEG2000_DCINEMA_2K || + s->avctx->profile == AV_PROFILE_JPEG2000_DCINEMA_4K) { possible_fmts = xyz_pix_fmts; possible_fmts_nb = FF_ARRAY_ELEMS(xyz_pix_fmts); } else { @@ -2426,6 +2426,14 @@ static av_cold int jpeg2000_decode_init(AVCodecContext *avctx) { Jpeg2000DecoderContext *s = avctx->priv_data; + if (avctx->lowres) + av_log(avctx, AV_LOG_WARNING, "lowres is overriden by reduction_factor but set anyway\n"); + if (!s->reduction_factor && avctx->lowres < JPEG2000_MAX_RESLEVELS) { + s->reduction_factor = avctx->lowres; + } + if (avctx->lowres != s->reduction_factor && avctx->lowres) + return AVERROR(EINVAL); + ff_jpeg2000dsp_init(&s->dsp); ff_jpeg2000_init_tier1_luts(); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/jpeg2000htdec.c b/arm/raspi/third_party/ffmpeg/libavcodec/jpeg2000htdec.c index 4c4e5471..2c4cea5d 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/jpeg2000htdec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/jpeg2000htdec.c @@ -144,36 +144,20 @@ static void jpeg2000_init_mel_decoder(MelDecoderState *mel_state) static int jpeg2000_bitbuf_refill_backwards(StateVars *buffer, const uint8_t *array) { uint64_t tmp = 0; - int32_t position = buffer->pos; + int32_t position = buffer->pos - 4; uint32_t new_bits = 32; if (buffer->bits_left >= 32) return 0; // enough data, no need to pull in more bits - /** - * We are reading bytes from end to start and need to handle being close to - * the end. Subtracting by 4 means we will read some of the bytes of the MEL - * byte stream since the MEL byte stream ends at the start of the VLC byte - * stream. This is okay as they are masked away since we check for cases - * where that occurs (when the position is less than 4). - */ - position -= 4; - - tmp = AV_RB32(&array[position + 1]); - - if (buffer->pos < 4){ - /* mask un-needed bits if we are close to input end */ - uint64_t mask = (1ull << (buffer->pos + 1) * 8) - 1; - tmp &= mask; - } - /** * Unstuff bits. Load a temporary byte, which precedes the position we * currently at, to ensure that we can also un-stuff if the stuffed bit is * the bottom most bits. */ - tmp <<= 8; - tmp |= array[buffer->pos + 1]; + + for(int i = FFMAX(0, position + 1); i <= buffer->pos + 1; i++) + tmp = 256*tmp + array[i]; if ((tmp & 0x7FFF000000) > 0x7F8F000000) { tmp &= 0x7FFFFFFFFF; @@ -1174,8 +1158,8 @@ ff_jpeg2000_decode_htj2k(const Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c int ret; /* Temporary buffers */ - int32_t *sample_buf; - uint8_t *block_states; + int32_t *sample_buf = NULL; + uint8_t *block_states = NULL; int32_t n, val; // Post-processing diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/jpegls.c b/arm/raspi/third_party/ffmpeg/libavcodec/jpegls.c index cc598f3c..7b4bc30e 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/jpegls.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/jpegls.c @@ -28,6 +28,7 @@ #include #include "libavutil/internal.h" #include "libavutil/intmath.h" +#include "libavutil/log.h" #include "jpegls.h" void ff_jpegls_init_state(JLSState *state) diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/jpegxl.h b/arm/raspi/third_party/ffmpeg/libavcodec/jpegxl.h new file mode 100644 index 00000000..66a6be35 --- /dev/null +++ b/arm/raspi/third_party/ffmpeg/libavcodec/jpegxl.h @@ -0,0 +1,94 @@ +/* + * JPEG XL Common Header Definitions + * Copyright (c) 2023 Leo Izen + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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_JPEGXL_H +#define AVCODEC_JPEGXL_H + +#define FF_JPEGXL_CODESTREAM_SIGNATURE_LE 0x0aff +#define FF_JPEGXL_CONTAINER_SIGNATURE_LE 0x204c584a0c000000 +#define FF_JPEGXL_CODESTREAM_SIGNATURE_BE 0xff0a +#define FF_JPEGXL_CONTAINER_SIGNATURE_BE 0x0000000c4a584c20 + +typedef enum FFJXLFrameEncoding { + JPEGXL_ENC_VARDCT, + JPEGXL_ENC_MODULAR +} FFJXLFrameEncoding; + +typedef enum FFJXLFrameType { + JPEGXL_FRAME_REGULAR, + JPEGXL_FRAME_LF, + JPEGXL_FRAME_REFERENCE_ONLY, + JPEGXL_FRAME_SKIP_PROGRESSIVE +} FFJXLFrameType; + +typedef enum FFJXLBlendMode { + JPEGXL_BM_REPLACE, + JPEGXL_BM_ADD, + JPEGXL_BM_BLEND, + JPEGXL_BM_MULADD, + JPEGXL_BM_MUL +} FFJXLBlendMode; + +typedef enum FFJXLExtraChannelType { + JPEGXL_CT_ALPHA = 0, + JPEGXL_CT_DEPTH, + JPEGXL_CT_SPOT_COLOR, + JPEGXL_CT_SELECTION_MASK, + JPEGXL_CT_BLACK, + JPEGXL_CT_CFA, + JPEGXL_CT_THERMAL, + JPEGXL_CT_NON_OPTIONAL = 15, + JPEGXL_CT_OPTIONAL +} FFJXLExtraChannelType; + +typedef enum FFJXLColorSpace { + JPEGXL_CS_RGB = 0, + JPEGXL_CS_GRAY, + JPEGXL_CS_XYB, + JPEGXL_CS_UNKNOWN +} FFJXLColorSpace; + +typedef enum FFJXLWhitePoint { + JPEGXL_WP_D65 = 1, + JPEGXL_WP_CUSTOM, + JPEGXL_WP_E = 10, + JPEGXL_WP_DCI = 11 +} FFJXLWhitePoint; + +typedef enum FFJXLPrimaries { + JPEGXL_PR_SRGB = 1, + JPEGXL_PR_CUSTOM, + JPEGXL_PR_2100 = 9, + JPEGXL_PR_P3 = 11, +} FFJXLPrimaries; + +typedef enum FFJXLTransferCharacteristic { + JPEGXL_TR_BT709 = 1, + JPEGXL_TR_UNKNOWN, + JPEGXL_TR_LINEAR = 8, + JPEGXL_TR_SRGB = 13, + JPEGXL_TR_PQ = 16, + JPEGXL_TR_DCI, + JPEGXL_TR_HLG, + JPEGXL_TR_GAMMA = 1 << 24, +} FFJXLTransferCharacteristic; + +#endif /* AVCODEC_JPEGXL_H */ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/jpegxl_parse.c b/arm/raspi/third_party/ffmpeg/libavcodec/jpegxl_parse.c new file mode 100644 index 00000000..eb28e808 --- /dev/null +++ b/arm/raspi/third_party/ffmpeg/libavcodec/jpegxl_parse.c @@ -0,0 +1,520 @@ +/* + * JPEG XL Header Parser + * Copyright (c) 2023 Leo Izen + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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 + +#include "bytestream.h" +#define UNCHECKED_BITSTREAM_READER 0 +#define BITSTREAM_READER_LE +#include "get_bits.h" +#include "jpegxl.h" +#include "jpegxl_parse.h" + +/* read a U32(c_i + u(u_i)) */ +static av_always_inline uint32_t jxl_u32(GetBitContext *gb, + uint32_t c0, uint32_t c1, uint32_t c2, uint32_t c3, + uint32_t u0, uint32_t u1, uint32_t u2, uint32_t u3) +{ + const uint32_t constants[4] = {c0, c1, c2, c3}; + const uint32_t ubits [4] = {u0, u1, u2, u3}; + uint32_t ret, choice = get_bits(gb, 2); + + ret = constants[choice]; + if (ubits[choice]) + ret += get_bits_long(gb, ubits[choice]); + + return ret; +} + +static av_always_inline uint32_t jxl_enum(GetBitContext *gb) +{ + return jxl_u32(gb, 0, 1, 2, 18, 0, 0, 4, 6); +} + +/* read a U64() */ +static uint64_t jxl_u64(GetBitContext *gb) +{ + uint64_t shift = 12, ret; + + switch (get_bits(gb, 2)) { + case 1: + ret = 1 + get_bits(gb, 4); + break; + case 2: + ret = 17 + get_bits(gb, 8); + break; + case 3: + ret = get_bits(gb, 12); + while (get_bits1(gb)) { + if (shift < 60) { + ret |= (uint64_t)get_bits(gb, 8) << shift; + shift += 8; + } else { + ret |= (uint64_t)get_bits(gb, 4) << shift; + break; + } + } + break; + default: + ret = 0; + } + + return ret; +} + +static uint32_t jpegxl_width_from_ratio(uint32_t height, int ratio) +{ + uint64_t height64 = height; /* avoid integer overflow */ + switch (ratio) { + case 1: + return height; + case 2: + return (uint32_t)((height64 * 12) / 10); + case 3: + return (uint32_t)((height64 * 4) / 3); + case 4: + return (uint32_t)((height64 * 3) / 2); + case 5: + return (uint32_t)((height64 * 16) / 9); + case 6: + return (uint32_t)((height64 * 5) / 4); + case 7: + return (uint32_t)(height64 * 2); + default: + break; + } + + return 0; /* manual width */ +} + +/** + * validate a Jpeg XL Size Header + * @return >= 0 upon valid size, < 0 upon invalid size found + */ +static int jpegxl_read_size_header(GetBitContext *gb, FFJXLMetadata *meta, int validate) +{ + uint32_t width, height; + + if (get_bits1(gb)) { + /* small size header */ + height = (get_bits(gb, 5) + 1) << 3; + width = jpegxl_width_from_ratio(height, get_bits(gb, 3)); + if (!width) + width = (get_bits(gb, 5) + 1) << 3; + } else { + /* large size header */ + height = 1 + jxl_u32(gb, 0, 0, 0, 0, 9, 13, 18, 30); + width = jpegxl_width_from_ratio(height, get_bits(gb, 3)); + if (!width) + width = 1 + jxl_u32(gb, 0, 0, 0, 0, 9, 13, 18, 30); + } + if (validate && (width > (1 << 18) || height > (1 << 18) + || (width >> 4) * (height >> 4) > (1 << 20))) + return AVERROR_INVALIDDATA; + + if (meta) { + meta->width = meta->coded_width = width; + meta->height = meta->coded_height = height; + } + + return 0; +} + +/** + * validate a Jpeg XL Preview Header + * @return >= 0 upon valid size, < 0 upon invalid size found + */ +static int jpegxl_read_preview_header(GetBitContext *gb, int validate) +{ + uint32_t width, height; + + if (get_bits1(gb)) { + /* coded height and width divided by eight */ + height = jxl_u32(gb, 16, 32, 1, 33, 0, 0, 5, 9) << 3; + width = jpegxl_width_from_ratio(height, get_bits(gb, 3)); + if (!width) + width = jxl_u32(gb, 16, 32, 1, 33, 0, 0, 5, 9) << 3; + } else { + /* full height and width coded */ + height = jxl_u32(gb, 1, 65, 321, 1345, 6, 8, 10, 12); + width = jpegxl_width_from_ratio(height, get_bits(gb, 3)); + if (!width) + width = jxl_u32(gb, 1, 65, 321, 1345, 6, 8, 10, 12); + } + if (validate && (width > 4096 || height > 4096)) + return AVERROR_INVALIDDATA; + + return 0; +} + +/** + * get a Jpeg XL BitDepth Header. These cannot be invalid. + */ +static void jpegxl_get_bit_depth(GetBitContext *gb, FFJXLMetadata *meta) +{ + int bit_depth; + if (get_bits1(gb)) { + /* float samples */ + bit_depth = jxl_u32(gb, 32, 16, 24, 1, 0, 0, 0, 6); /* mantissa */ + skip_bits_long(gb, 4); /* exponent */ + } else { + /* integer samples */ + bit_depth = jxl_u32(gb, 8, 10, 12, 1, 0, 0, 0, 6); + } + if (meta) + meta->bit_depth = bit_depth; +} + +/** + * validate a Jpeg XL Extra Channel Info bundle + * @return >= 0 upon valid, < 0 upon invalid + */ +static int jpegxl_read_extra_channel_info(GetBitContext *gb, FFJXLMetadata *meta, int validate) +{ + int default_alpha = get_bits1(gb); + uint32_t type, name_len = 0; + + if (!default_alpha) { + type = jxl_enum(gb); + if (validate && type > 63) + return AVERROR_INVALIDDATA; /* enum types cannot be 64+ */ + if (validate && validate < 10 && type == JPEGXL_CT_BLACK) + return AVERROR_INVALIDDATA; + jpegxl_get_bit_depth(gb, NULL); + jxl_u32(gb, 0, 3, 4, 1, 0, 0, 0, 3); /* dim-shift */ + /* max of name_len is 1071 = 48 + 2^10 - 1 */ + name_len = 8 * jxl_u32(gb, 0, 0, 16, 48, 0, 4, 5, 10); + } else { + type = JPEGXL_CT_ALPHA; + } + + if (get_bits_left(gb) < name_len) + return AVERROR_BUFFER_TOO_SMALL; + + /* skip over the name */ + skip_bits_long(gb, name_len); + + if (!default_alpha && type == JPEGXL_CT_ALPHA) + skip_bits1(gb); + + if (type == JPEGXL_CT_SPOT_COLOR) + skip_bits_long(gb, 16 * 4); + + if (type == JPEGXL_CT_CFA) + jxl_u32(gb, 1, 0, 3, 19, 0, 2, 4, 8); + + if (meta && type == JPEGXL_CT_ALPHA) + meta->have_alpha = 1; + + return 0; +} + +static int jpegxl_skip_extensions(GetBitContext *gb) +{ + uint64_t extensions = jxl_u64(gb), extensions_len = 0; + + if (get_bits_left(gb) <= 0) + return AVERROR_BUFFER_TOO_SMALL; + + if (!extensions) + return 0; + + for (int i = 0; i < 64; i++) { + if (extensions & (UINT64_C(1) << i)) + extensions_len += jxl_u64(gb); + if (get_bits_left(gb) <= 0) + return AVERROR_BUFFER_TOO_SMALL; + } + + if (extensions_len > INT_MAX || get_bits_left(gb) <= extensions_len) + return AVERROR_BUFFER_TOO_SMALL; + + skip_bits_long(gb, extensions_len); + + return 0; +} + +int ff_jpegxl_parse_codestream_header(const uint8_t *buf, int buflen, FFJXLMetadata *meta, int validate) +{ + GetBitContext gbi, *gb = &gbi; + + int all_default, extra_fields = 0; + int xyb_encoded = 1, have_icc_profile = 0; + int animation_offset = 0, have_timecodes = 0; + + FFJXLPrimaries primaries = JPEGXL_PR_SRGB; + FFJXLTransferCharacteristic trc = JPEGXL_TR_SRGB + (1U << 24); + FFJXLWhitePoint white_point = JPEGXL_WP_D65; + FFJXLColorSpace color_space = JPEGXL_CS_RGB; + + AVRational tb; + uint32_t num_extra_channels = 0; + int ret; + + ret = init_get_bits8(gb, buf, buflen); + if (ret < 0) + return ret; + + if (get_bits(gb, 16) != FF_JPEGXL_CODESTREAM_SIGNATURE_LE && validate) + return AVERROR_INVALIDDATA; + + ret = jpegxl_read_size_header(gb, meta, validate); + if (ret < 0) + return ret; + + all_default = get_bits1(gb); + if (!all_default) + extra_fields = get_bits1(gb); + + if (extra_fields) { + int orientation = get_bits(gb, 3); + if (orientation > 3 && meta) + FFSWAP(uint32_t, meta->width, meta->height); + + /* + * intrinstic size + * any size header here is valid, but as it + * is variable length we have to read it + */ + if (get_bits1(gb)) + jpegxl_read_size_header(gb, NULL, 0); + + /* preview header */ + if (get_bits1(gb)) { + ret = jpegxl_read_preview_header(gb, 0); + if (ret < 0) + return ret; + } + + /* animation header */ + if (get_bits1(gb)) { + animation_offset = get_bits_count(gb); + tb.den = jxl_u32(gb, 100, 1000, 1, 1, 0, 0, 10, 30); + tb.num = jxl_u32(gb, 1, 1001, 1, 1, 0, 0, 8, 10); + jxl_u32(gb, 0, 0, 0, 0, 0, 3, 16, 32); + have_timecodes = get_bits1(gb); + } + } + + if (animation_offset && meta) { + meta->animation_offset = animation_offset; + meta->timebase = tb; + meta->have_timecodes = have_timecodes; + } + + if (get_bits_left(gb) <= 0) + return AVERROR_BUFFER_TOO_SMALL; + + if (!all_default) { + jpegxl_get_bit_depth(gb, meta); + + /* modular_16bit_buffers must equal 1 */ + if (!get_bits1(gb) && validate && validate < 10) + return AVERROR_INVALIDDATA; + + num_extra_channels = jxl_u32(gb, 0, 1, 2, 1, 0, 0, 4, 12); + if (num_extra_channels > 4 && validate && validate < 10) + return AVERROR_INVALIDDATA; + for (uint32_t i = 0; i < num_extra_channels; i++) { + ret = jpegxl_read_extra_channel_info(gb, meta, validate); + if (ret < 0) + return ret; + if (get_bits_left(gb) <= 0) + return AVERROR_BUFFER_TOO_SMALL; + } + + xyb_encoded = get_bits1(gb); + + /* color encoding bundle */ + if (!get_bits1(gb)) { + have_icc_profile = get_bits1(gb); + color_space = jxl_enum(gb); + if (color_space > 63 && validate) + return AVERROR_INVALIDDATA; + if (!have_icc_profile) { + if (color_space != JPEGXL_CS_XYB) { + white_point = jxl_enum(gb); + if (white_point > 63 && validate) + return AVERROR_INVALIDDATA; + if (white_point == JPEGXL_WP_CUSTOM) { + /* ux and uy values */ + jxl_u32(gb, 0, 524288, 1048576, 2097152, 19, 19, 20, 21); + jxl_u32(gb, 0, 524288, 1048576, 2097152, 19, 19, 20, 21); + } + if (color_space != JPEGXL_CS_GRAY) { + /* primaries */ + primaries = jxl_enum(gb); + if (primaries > 63 && validate) + return AVERROR_INVALIDDATA; + if (primaries == JPEGXL_PR_CUSTOM) { + /* ux/uy values for r,g,b */ + for (int i = 0; i < 6; i++) { + jxl_u32(gb, 0, 524288, 1048576, 2097152, 19, 19, 20, 21); + if (get_bits_left(gb) <= 0) + return AVERROR_BUFFER_TOO_SMALL; + } + } + } + } + + /* transfer characteristics */ + if (get_bits1(gb)) { + /* gamma */ + trc = get_bits(gb, 24); + } else { + /* transfer function */ + trc = jxl_enum(gb); + if (trc > 63 && validate) + return AVERROR_INVALIDDATA; + trc += (1U << 24); + } + + /* rendering intent */ + if (jxl_enum(gb) > 63 && validate) + return AVERROR_INVALIDDATA; + } + } + + /* tone mapping bundle */ + if (extra_fields && !get_bits1(gb)) + skip_bits_long(gb, 16 + 16 + 1 + 16); + + ret = jpegxl_skip_extensions(gb); + if (ret < 0) + return ret; + } + + if (meta) { + meta->xyb_encoded = xyb_encoded; + meta->have_icc_profile = have_icc_profile; + meta->csp = color_space; + meta->primaries = primaries; + meta->wp = white_point; + meta->trc = trc; + if (!meta->bit_depth) + meta->bit_depth = 8; + meta->num_extra_channels = num_extra_channels; + } + + /* default transform */ + if (!get_bits1(gb)) { + /* opsin inverse matrix */ + if (xyb_encoded && !get_bits1(gb)) + skip_bits_long(gb, 16 * 16); + /* cw_mask and default weights */ + if (get_bits1(gb)) + skip_bits_long(gb, 16 * 15); + if (get_bits1(gb)) + skip_bits_long(gb, 16 * 55); + if (get_bits1(gb)) + skip_bits_long(gb, 16 * 210); + } + + if (!have_icc_profile) { + int bits_remaining = 7 - ((get_bits_count(gb) - 1) & 0x7); + if (bits_remaining && get_bits(gb, bits_remaining)) + return AVERROR_INVALIDDATA; + } + + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + + return get_bits_count(gb); +} + +/* + * copies as much of the codestream into the buffer as possible + * pass a shorter buflen to request less + * returns the number of bytes consumed from input, may be greater than input_len + * if the input doesn't end on an ISOBMFF-box boundary + */ +int ff_jpegxl_collect_codestream_header(const uint8_t *input_buffer, int input_len, + uint8_t *buffer, int buflen, int *copied) +{ + GetByteContext gb; + int pos = 0, last_box = 0; + bytestream2_init(&gb, input_buffer, input_len); + + while (1) { + uint64_t size; + uint32_t tag; + int head_size = 8; + + if (bytestream2_get_bytes_left(&gb) < 8) + return AVERROR_BUFFER_TOO_SMALL; + + size = bytestream2_get_be32(&gb); + if (size == 1) { + if (bytestream2_get_bytes_left(&gb) < 12) + return AVERROR_BUFFER_TOO_SMALL; + size = bytestream2_get_be64(&gb); + head_size = 16; + } + /* invalid ISOBMFF size */ + if (size && size <= head_size) + return AVERROR_INVALIDDATA; + if (size) + size -= head_size; + + tag = bytestream2_get_le32(&gb); + + if (tag == MKTAG('j','x','l','p')) { + uint32_t idx; + if (bytestream2_get_bytes_left(&gb) < 4) + return AVERROR_BUFFER_TOO_SMALL; + idx = bytestream2_get_be32(&gb); + if (idx >= UINT32_C(0x80000000)) + last_box = 1; + if (size) { + if (size <= 4) + return AVERROR_INVALIDDATA; + size -= 4; + } + } + if (tag == MKTAG('j','x','l','c')) + last_box = 1; + + /* + * size = 0 means "until EOF". this is legal but uncommon + * here we just set it to the remaining size of the probe buffer + */ + if (!size) + size = bytestream2_get_bytes_left(&gb); + else + pos += size + head_size; + + if (tag == MKTAG('j','x','l','c') || tag == MKTAG('j','x','l','p')) { + if (size > buflen - *copied) + size = buflen - *copied; + /* + * arbitrary chunking of the payload makes this memcpy hard to avoid + * in practice this will only be performed one or two times at most + */ + *copied += bytestream2_get_buffer(&gb, buffer + *copied, size); + } else { + bytestream2_skip(&gb, size); + } + if (last_box || bytestream2_get_bytes_left(&gb) <= 0 || *copied >= buflen) + break; + } + + return pos; +} diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/jpegxl_parse.h b/arm/raspi/third_party/ffmpeg/libavcodec/jpegxl_parse.h new file mode 100644 index 00000000..0602f4d4 --- /dev/null +++ b/arm/raspi/third_party/ffmpeg/libavcodec/jpegxl_parse.h @@ -0,0 +1,72 @@ +/* + * JPEG XL Header Parser + * Copyright (c) 2023 Leo Izen + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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_JPEGXL_PARSE_H +#define AVCODEC_JPEGXL_PARSE_H + +#include + +#include "libavutil/rational.h" + +#include "jpegxl.h" + +typedef struct FFJXLMetadata { + uint32_t width; + uint32_t height; + uint32_t coded_width; + uint32_t coded_height; + int bit_depth; + int have_alpha; + /* + * offset, in bits, of the animation header + * zero if not animated + */ + int animation_offset; + AVRational timebase; + FFJXLColorSpace csp; + FFJXLWhitePoint wp; + FFJXLPrimaries primaries; + FFJXLTransferCharacteristic trc; + + /* used by the parser */ + int xyb_encoded; + int have_icc_profile; + int have_timecodes; + uint32_t num_extra_channels; +} FFJXLMetadata; + +/* + * copies as much of the codestream into the buffer as possible + * pass a shorter buflen to request less + * returns the number of bytes consumed from input, may be greater than input_len + * if the input doesn't end on an ISOBMFF-box boundary + */ +int ff_jpegxl_collect_codestream_header(const uint8_t *input_buffer, int input_len, + uint8_t *buffer, int buflen, int *copied); + +/* + * Parse the codestream header with the provided buffer. Returns negative upon failure, + * or the number of bits consumed upon success. + * The FFJXLMetadata parameter may be NULL, in which case it's ignored. + */ +int ff_jpegxl_parse_codestream_header(const uint8_t *buf, int buflen, FFJXLMetadata *meta, int validate); + +#endif /* AVCODEC_JPEGXL_PARSE_H */ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/jpegxl_parser.c b/arm/raspi/third_party/ffmpeg/libavcodec/jpegxl_parser.c new file mode 100644 index 00000000..d25a1b6e --- /dev/null +++ b/arm/raspi/third_party/ffmpeg/libavcodec/jpegxl_parser.c @@ -0,0 +1,1472 @@ +/** + * JPEG XL parser + * Copyright (c) 2023 Leo Izen + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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 +#include +#include + +#include "libavutil/attributes.h" +#include "libavutil/error.h" +#include "libavutil/intmath.h" +#include "libavutil/macros.h" +#include "libavutil/mem.h" +#include "libavutil/pixfmt.h" + +#include "bytestream.h" +#include "codec_id.h" +#define UNCHECKED_BITSTREAM_READER 0 +#define BITSTREAM_READER_LE +#include "get_bits.h" +#include "jpegxl.h" +#include "jpegxl_parse.h" +#include "parser.h" +#include "vlc.h" + +#define JXL_FLAG_NOISE 1 +#define JXL_FLAG_PATCHES 2 +#define JXL_FLAG_SPLINES 16 +#define JXL_FLAG_USE_LF_FRAME 32 +#define JXL_FLAG_SKIP_ADAPTIVE_LF_SMOOTH 128 + +#define clog1p(x) (ff_log2(x) + !!(x)) +#define unpack_signed(x) (((x) & 1 ? -(x)-1 : (x))/2) +#define div_ceil(x, y) (((x) - 1) / (y) + 1) +#define vlm(a,b) {.sym = (a), .len = (b)} + +typedef struct JXLHybridUintConf { + int split_exponent; + uint32_t msb_in_token; + uint32_t lsb_in_token; +} JXLHybridUintConf; + +typedef struct JXLSymbolDistribution { + JXLHybridUintConf config; + int log_bucket_size; + /* this is the actual size of the alphabet */ + int alphabet_size; + /* ceil(log(alphabet_size)) */ + int log_alphabet_size; + + /* for prefix code distributions */ + VLC vlc; + /* in case bits == 0 */ + uint32_t default_symbol; + + /* + * each (1 << log_alphabet_size) length + * with log_alphabet_size <= 8 + */ + /* frequencies associated with this Distribution */ + uint32_t freq[258]; + /* cutoffs for using the symbol table */ + uint16_t cutoffs[258]; + /* the symbol table for this distribution */ + uint16_t symbols[258]; + /* the offset for symbols */ + uint16_t offsets[258]; + + /* if this distribution contains only one symbol this is its index */ + int uniq_pos; +} JXLSymbolDistribution; + +typedef struct JXLDistributionBundle { + /* lz77 flags */ + int lz77_enabled; + uint32_t lz77_min_symbol; + uint32_t lz77_min_length; + JXLHybridUintConf lz_len_conf; + + /* one entry for each distribution */ + uint8_t *cluster_map; + /* length of cluster_map */ + int num_dist; + + /* one for each cluster */ + JXLSymbolDistribution *dists; + int num_clusters; + + /* whether to use brotli prefixes or ans */ + int use_prefix_code; + /* bundle log alphabet size, dist ones may be smaller */ + int log_alphabet_size; +} JXLDistributionBundle; + +typedef struct JXLEntropyDecoder { + + /* state is a positive 32-bit integer, or -1 if unset */ + int64_t state; + + /* lz77 values */ + uint32_t num_to_copy; + uint32_t copy_pos; + uint32_t num_decoded; + + /* length is (1 << 20) */ + /* if lz77 is enabled for this bundle */ + /* if lz77 is disabled it's NULL */ + uint32_t *window; + + /* primary bundle associated with this distribution */ + JXLDistributionBundle bundle; + + /* for av_log */ + void *logctx; +} JXLEntropyDecoder; + +typedef struct JXLFrame { + FFJXLFrameType type; + FFJXLFrameEncoding encoding; + + int is_last; + int full_frame; + + uint32_t total_length; + uint32_t body_length; +} JXLFrame; + +typedef struct JXLCodestream { + FFJXLMetadata meta; + JXLFrame frame; +} JXLCodestream; + +typedef struct JXLParseContext { + ParseContext pc; + JXLCodestream codestream; + + /* using ISOBMFF-based container */ + int container; + int skip; + int copied; + int collected_size; + int codestream_length; + int skipped_icc; + int next; + + uint8_t cs_buffer[4096]; +} JXLParseContext; + +/* used for reading brotli prefixes */ +static const VLCElem level0_table[16] = { + vlm(0, 2), vlm(4, 2), vlm(3, 2), vlm(2, 3), vlm(0, 2), vlm(4, 2), vlm(3, 2), vlm(1, 4), + vlm(0, 2), vlm(4, 2), vlm(3, 2), vlm(2, 3), vlm(0, 2), vlm(4, 2), vlm(3, 2), vlm(5, 4), +}; + +/* prefix table for populating ANS distribution */ +static const VLCElem dist_prefix_table[128] = { + vlm(10, 3), vlm(12, 7), vlm(7, 3), vlm(3, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(5, 4), + vlm(10, 3), vlm(4, 4), vlm(7, 3), vlm(1, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(2, 4), + vlm(10, 3), vlm(0, 5), vlm(7, 3), vlm(3, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(5, 4), + vlm(10, 3), vlm(4, 4), vlm(7, 3), vlm(1, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(2, 4), + vlm(10, 3), vlm(11, 6), vlm(7, 3), vlm(3, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(5, 4), + vlm(10, 3), vlm(4, 4), vlm(7, 3), vlm(1, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(2, 4), + vlm(10, 3), vlm(0, 5), vlm(7, 3), vlm(3, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(5, 4), + vlm(10, 3), vlm(4, 4), vlm(7, 3), vlm(1, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(2, 4), + vlm(10, 3), vlm(13, 7), vlm(7, 3), vlm(3, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(5, 4), + vlm(10, 3), vlm(4, 4), vlm(7, 3), vlm(1, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(2, 4), + vlm(10, 3), vlm(0, 5), vlm(7, 3), vlm(3, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(5, 4), + vlm(10, 3), vlm(4, 4), vlm(7, 3), vlm(1, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(2, 4), + vlm(10, 3), vlm(11, 6), vlm(7, 3), vlm(3, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(5, 4), + vlm(10, 3), vlm(4, 4), vlm(7, 3), vlm(1, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(2, 4), + vlm(10, 3), vlm(0, 5), vlm(7, 3), vlm(3, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(5, 4), + vlm(10, 3), vlm(4, 4), vlm(7, 3), vlm(1, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(2, 4), +}; + +static const uint8_t prefix_codelen_map[18] = { + 1, 2, 3, 4, 0, 5, 17, 6, 16, 7, 8, 9, 10, 11, 12, 13, 14, 15, +}; + +/** + * Read a variable-length 8-bit integer. + * Used when populating the ANS frequency tables. + */ +static av_always_inline uint8_t jxl_u8(GetBitContext *gb) +{ + int n; + if (!get_bits1(gb)) + return 0; + n = get_bits(gb, 3); + + return get_bitsz(gb, n) | (1 << n); +} + +/* read a U32(c_i + u(u_i)) */ +static av_always_inline uint32_t jxl_u32(GetBitContext *gb, + uint32_t c0, uint32_t c1, uint32_t c2, uint32_t c3, + uint32_t u0, uint32_t u1, uint32_t u2, uint32_t u3) +{ + const uint32_t constants[4] = {c0, c1, c2, c3}; + const uint32_t ubits [4] = {u0, u1, u2, u3}; + uint32_t ret, choice = get_bits(gb, 2); + + ret = constants[choice]; + if (ubits[choice]) + ret += get_bits_long(gb, ubits[choice]); + + return ret; +} + +/* read a U64() */ +static uint64_t jxl_u64(GetBitContext *gb) +{ + uint64_t shift = 12, ret; + + switch (get_bits(gb, 2)) { + case 1: + ret = 1 + get_bits(gb, 4); + break; + case 2: + ret = 17 + get_bits(gb, 8); + break; + case 3: + ret = get_bits(gb, 12); + while (get_bits1(gb)) { + if (shift < 60) { + ret |= (uint64_t)get_bits(gb, 8) << shift; + shift += 8; + } else { + ret |= (uint64_t)get_bits(gb, 4) << shift; + break; + } + } + break; + default: + ret = 0; + } + + return ret; +} + +static int read_hybrid_uint_conf(GetBitContext *gb, JXLHybridUintConf *conf, int log_alphabet_size) +{ + conf->split_exponent = get_bitsz(gb, clog1p(log_alphabet_size)); + if (conf->split_exponent == log_alphabet_size) { + conf->msb_in_token = conf->lsb_in_token = 0; + return 0; + } + + conf->msb_in_token = get_bitsz(gb, clog1p(conf->split_exponent)); + if (conf->msb_in_token > conf->split_exponent) + return AVERROR_INVALIDDATA; + conf->lsb_in_token = get_bitsz(gb, clog1p(conf->split_exponent - conf->msb_in_token)); + if (conf->msb_in_token + conf->lsb_in_token > conf->split_exponent) + return AVERROR_INVALIDDATA; + + return 0; +} + +static int read_hybrid_uint(GetBitContext *gb, const JXLHybridUintConf *conf, uint32_t token, uint32_t *hybrid_uint) +{ + uint32_t n, low, split = 1 << conf->split_exponent; + + if (token < split) { + *hybrid_uint = token; + return 0; + } + + n = conf->split_exponent - conf->lsb_in_token - conf->msb_in_token + + ((token - split) >> (conf->msb_in_token + conf->lsb_in_token)); + if (n >= 32) + return AVERROR_INVALIDDATA; + low = token & ((1 << conf->lsb_in_token) - 1); + token >>= conf->lsb_in_token; + token &= (1 << conf->msb_in_token) - 1; + token |= 1 << conf->msb_in_token; + *hybrid_uint = (((token << n) | get_bits_long(gb, n)) << conf->lsb_in_token ) | low; + + return 0; +} + +static inline uint32_t read_prefix_symbol(GetBitContext *gb, const JXLSymbolDistribution *dist) +{ + if (!dist->vlc.bits) + return dist->default_symbol; + + return get_vlc2(gb, dist->vlc.table, dist->vlc.bits, 1); +} + +static uint32_t read_ans_symbol(GetBitContext *gb, JXLEntropyDecoder *dec, const JXLSymbolDistribution *dist) +{ + uint32_t index, i, pos, symbol, offset; + + if (dec->state < 0) + dec->state = get_bits_long(gb, 32); + + index = dec->state & 0xFFF; + i = index >> dist->log_bucket_size; + pos = index & ((1 << dist->log_bucket_size) - 1); + symbol = pos >= dist->cutoffs[i] ? dist->symbols[i] : i; + offset = pos >= dist->cutoffs[i] ? dist->offsets[i] + pos : pos; + dec->state = dist->freq[symbol] * (dec->state >> 12) + offset; + if (dec->state < (1 << 16)) + dec->state = (dec->state << 16) | get_bits(gb, 16); + dec->state &= 0xFFFFFFFF; + + return symbol; +} + +static int decode_hybrid_varlen_uint(GetBitContext *gb, JXLEntropyDecoder *dec, + const JXLDistributionBundle *bundle, + uint32_t context, uint32_t *hybrid_uint) +{ + int ret; + uint32_t token, distance; + const JXLSymbolDistribution *dist; + + if (dec->num_to_copy > 0) { + *hybrid_uint = dec->window[dec->copy_pos++ & 0xFFFFF]; + dec->num_to_copy--; + dec->window[dec->num_decoded++ & 0xFFFFF] = *hybrid_uint; + return 0; + } + + if (context >= bundle->num_dist) + return AVERROR(EINVAL); + if (bundle->cluster_map[context] >= bundle->num_clusters) + return AVERROR_INVALIDDATA; + + dist = &bundle->dists[bundle->cluster_map[context]]; + if (bundle->use_prefix_code) + token = read_prefix_symbol(gb, dist); + else + token = read_ans_symbol(gb, dec, dist); + + if (bundle->lz77_enabled && token >= bundle->lz77_min_symbol) { + const JXLSymbolDistribution *lz77dist = &bundle->dists[bundle->cluster_map[bundle->num_dist - 1]]; + ret = read_hybrid_uint(gb, &bundle->lz_len_conf, token - bundle->lz77_min_symbol, &dec->num_to_copy); + if (ret < 0) + return ret; + dec->num_to_copy += bundle->lz77_min_length; + if (bundle->use_prefix_code) + token = read_prefix_symbol(gb, lz77dist); + else + token = read_ans_symbol(gb, dec, lz77dist); + ret = read_hybrid_uint(gb, &lz77dist->config, token, &distance); + if (ret < 0) + return ret; + distance++; + distance = FFMIN3(distance, dec->num_decoded, 1 << 20); + dec->copy_pos = dec->num_decoded - distance; + return decode_hybrid_varlen_uint(gb, dec, bundle, context, hybrid_uint); + } + ret = read_hybrid_uint(gb, &dist->config, token, hybrid_uint); + if (ret < 0) + return ret; + if (bundle->lz77_enabled) + dec->window[dec->num_decoded++ & 0xFFFFF] = *hybrid_uint; + + return 0; +} + +static int populate_distribution(GetBitContext *gb, JXLSymbolDistribution *dist, int log_alphabet_size) +{ + int len = 0, shift, omit_log = -1, omit_pos = -1; + int prev = 0, num_same = 0; + uint32_t total_count = 0; + uint8_t logcounts[258] = { 0 }; + uint8_t same[258] = { 0 }; + dist->uniq_pos = -1; + + if (get_bits1(gb)) { + /* simple code */ + dist->alphabet_size = 256; + if (get_bits1(gb)) { + uint8_t v1 = jxl_u8(gb); + uint8_t v2 = jxl_u8(gb); + if (v1 == v2) + return AVERROR_INVALIDDATA; + dist->freq[v1] = get_bits(gb, 12); + dist->freq[v2] = (1 << 12) - dist->freq[v1]; + if (!dist->freq[v1]) + dist->uniq_pos = v2; + } else { + uint8_t x = jxl_u8(gb); + dist->freq[x] = 1 << 12; + dist->uniq_pos = x; + } + return 0; + } + + if (get_bits1(gb)) { + /* flat code */ + dist->alphabet_size = jxl_u8(gb) + 1; + for (int i = 0; i < dist->alphabet_size; i++) + dist->freq[i] = (1 << 12) / dist->alphabet_size; + for (int i = 0; i < (1 << 12) % dist->alphabet_size; i++) + dist->freq[i]++; + return 0; + } + + do { + if (!get_bits1(gb)) + break; + } while (++len < 3); + + shift = (get_bitsz(gb, len) | (1 << len)) - 1; + if (shift > 13) + return AVERROR_INVALIDDATA; + + dist->alphabet_size = jxl_u8(gb) + 3; + for (int i = 0; i < dist->alphabet_size; i++) { + logcounts[i] = get_vlc2(gb, dist_prefix_table, 7, 1); + if (logcounts[i] == 13) { + int rle = jxl_u8(gb); + same[i] = rle + 5; + i += rle + 3; + continue; + } + if (logcounts[i] > omit_log) { + omit_log = logcounts[i]; + omit_pos = i; + } + } + if (omit_pos < 0 || omit_pos + 1 < dist->alphabet_size && logcounts[omit_pos + 1] == 13) + return AVERROR_INVALIDDATA; + + for (int i = 0; i < dist->alphabet_size; i++) { + if (same[i]) { + num_same = same[i] - 1; + prev = i > 0 ? dist->freq[i - 1] : 0; + } + if (num_same) { + dist->freq[i] = prev; + num_same--; + } else { + if (i == omit_pos || !logcounts[i]) + continue; + if (logcounts[i] == 1) { + dist->freq[i] = 1; + } else { + int bitcount = FFMIN(FFMAX(0, shift - ((12 - logcounts[i] + 1) >> 1)), logcounts[i] - 1); + dist->freq[i] = (1 << (logcounts[i] - 1)) + (get_bitsz(gb, bitcount) << (logcounts[i] - 1 - bitcount)); + } + } + total_count += dist->freq[i]; + } + dist->freq[omit_pos] = (1 << 12) - total_count; + + return 0; +} + +static void dist_bundle_close(JXLDistributionBundle *bundle) +{ + if (bundle->use_prefix_code && bundle->dists) + for (int i = 0; i < bundle->num_clusters; i++) + ff_vlc_free(&bundle->dists[i].vlc); + av_freep(&bundle->dists); + av_freep(&bundle->cluster_map); +} + + +static int read_distribution_bundle(GetBitContext *gb, JXLEntropyDecoder *dec, + JXLDistributionBundle *bundle, int num_dist, int disallow_lz77); + +static int read_dist_clustering(GetBitContext *gb, JXLEntropyDecoder *dec, JXLDistributionBundle *bundle) +{ + int ret; + + bundle->cluster_map = av_malloc(bundle->num_dist); + if (!bundle->cluster_map) + return AVERROR(ENOMEM); + + if (bundle->num_dist == 1) { + bundle->cluster_map[0] = 0; + bundle->num_clusters = 1; + return 0; + } + + if (get_bits1(gb)) { + /* simple clustering */ + uint32_t nbits = get_bits(gb, 2); + for (int i = 0; i < bundle->num_dist; i++) + bundle->cluster_map[i] = get_bitsz(gb, nbits); + } else { + /* complex clustering */ + int use_mtf = get_bits1(gb); + JXLDistributionBundle nested = { 0 }; + /* num_dist == 1 prevents this from recursing again */ + ret = read_distribution_bundle(gb, dec, &nested, 1, bundle->num_dist <= 2); + if (ret < 0) { + dist_bundle_close(&nested); + return ret; + } + for (int i = 0; i < bundle->num_dist; i++) { + uint32_t clust; + ret = decode_hybrid_varlen_uint(gb, dec, &nested, 0, &clust); + if (ret < 0) { + dist_bundle_close(&nested); + return ret; + } + bundle->cluster_map[i] = clust; + } + dec->state = -1; + /* it's not going to necessarily be zero after reading */ + dec->num_to_copy = 0; + dist_bundle_close(&nested); + if (use_mtf) { + uint8_t mtf[256]; + for (int i = 0; i < 256; i++) + mtf[i] = i; + for (int i = 0; i < bundle->num_dist; i++) { + int index = bundle->cluster_map[i]; + bundle->cluster_map[i] = mtf[index]; + if (index) { + int value = mtf[index]; + for (int j = index; j > 0; j--) + mtf[j] = mtf[j - 1]; + mtf[0] = value; + } + } + } + } + for (int i = 0; i < bundle->num_dist; i++) { + if (bundle->cluster_map[i] >= bundle->num_clusters) + bundle->num_clusters = bundle->cluster_map[i] + 1; + } + + if (bundle->num_clusters > bundle->num_dist) + return AVERROR_INVALIDDATA; + + return 0; +} + +static int gen_alias_map(JXLEntropyDecoder *dec, JXLSymbolDistribution *dist, int log_alphabet_size) +{ + uint32_t bucket_size, table_size; + uint8_t overfull[256], underfull[256]; + int overfull_pos = 0, underfull_pos = 0; + dist->log_bucket_size = 12 - log_alphabet_size; + bucket_size = 1 << dist->log_bucket_size; + table_size = 1 << log_alphabet_size; + + if (dist->uniq_pos >= 0) { + for (int i = 0; i < table_size; i++) { + dist->symbols[i] = dist->uniq_pos; + dist->offsets[i] = bucket_size * i; + dist->cutoffs[i] = 0; + } + return 0; + } + + for (int i = 0; i < dist->alphabet_size; i++) { + dist->cutoffs[i] = dist->freq[i]; + dist->symbols[i] = i; + if (dist->cutoffs[i] > bucket_size) + overfull[overfull_pos++] = i; + else if (dist->cutoffs[i] < bucket_size) + underfull[underfull_pos++] = i; + } + + for (int i = dist->alphabet_size; i < table_size; i++) { + dist->cutoffs[i] = 0; + underfull[underfull_pos++] = i; + } + + while (overfull_pos) { + int o, u, by; + /* this should be impossible */ + if (!underfull_pos) + return AVERROR_INVALIDDATA; + u = underfull[--underfull_pos]; + o = overfull[--overfull_pos]; + by = bucket_size - dist->cutoffs[u]; + dist->cutoffs[o] -= by; + dist->symbols[u] = o; + dist->offsets[u] = dist->cutoffs[o]; + if (dist->cutoffs[o] < bucket_size) + underfull[underfull_pos++] = o; + else if (dist->cutoffs[o] > bucket_size) + overfull[overfull_pos++] = o; + } + + for (int i = 0; i < table_size; i++) { + if (dist->cutoffs[i] == bucket_size) { + dist->symbols[i] = i; + dist->offsets[i] = 0; + dist->cutoffs[i] = 0; + } else { + dist->offsets[i] -= dist->cutoffs[i]; + } + } + + return 0; +} + +static int read_simple_vlc_prefix(GetBitContext *gb, JXLEntropyDecoder *dec, JXLSymbolDistribution *dist) +{ + int nsym, tree_select, bits; + + int8_t lens[4]; + int16_t symbols[4]; + + nsym = 1 + get_bits(gb, 2); + for (int i = 0; i < nsym; i++) + symbols[i] = get_bitsz(gb, dist->log_alphabet_size); + if (nsym == 4) + tree_select = get_bits1(gb); + switch (nsym) { + case 1: + dist->vlc.bits = 0; + dist->default_symbol = symbols[0]; + return 0; + case 2: + bits = 1; + lens[0] = 1, lens[1] = 1, lens[2] = 0, lens[3] = 0; + if (symbols[1] < symbols[0]) + FFSWAP(int16_t, symbols[0], symbols[1]); + break; + case 3: + bits = 2; + lens[0] = 1, lens[1] = 2, lens[2] = 2, lens[3] = 0; + if (symbols[2] < symbols[1]) + FFSWAP(int16_t, symbols[1], symbols[2]); + break; + case 4: + if (tree_select) { + bits = 3; + lens[0] = 1, lens[1] = 2, lens[2] = 3, lens[3] = 3; + if (symbols[3] < symbols[2]) + FFSWAP(int16_t, symbols[2], symbols[3]); + } else { + bits = 2; + lens[0] = 2, lens[1] = 2, lens[2] = 2, lens[3] = 2; + while (1) { + if (symbols[1] < symbols[0]) + FFSWAP(int16_t, symbols[0], symbols[1]); + if (symbols[3] < symbols[2]) + FFSWAP(int16_t, symbols[2], symbols[3]); + if (symbols[1] <= symbols[2]) + break; + FFSWAP(int16_t, symbols[1], symbols[2]); + } + } + break; + default: + // Challenge Complete! How did we get here? + return AVERROR_BUG; + } + + return ff_vlc_init_from_lengths(&dist->vlc, bits, nsym, lens, 1, symbols, + 2, 2, 0, VLC_INIT_LE, dec->logctx); +} + +static int read_vlc_prefix(GetBitContext *gb, JXLEntropyDecoder *dec, JXLSymbolDistribution *dist) +{ + int8_t level1_lens[18] = { 0 }; + int8_t level1_lens_s[18] = { 0 }; + int16_t level1_syms[18] = { 0 }; + uint32_t level1_codecounts[19] = { 0 }; + uint8_t *buf = NULL; + int8_t *level2_lens, *level2_lens_s; + int16_t *level2_syms; + uint32_t *level2_codecounts; + + int repeat_count_prev = 0, repeat_count_zero = 0, prev = 8; + int total_code = 0, len, hskip, num_codes = 0, ret; + + VLC level1_vlc; + + if (dist->alphabet_size == 1) { + dist->vlc.bits = 0; + dist->default_symbol = 0; + return 0; + } + + hskip = get_bits(gb, 2); + if (hskip == 1) + return read_simple_vlc_prefix(gb, dec, dist); + + level1_codecounts[0] = hskip; + for (int i = hskip; i < 18; i++) { + len = level1_lens[prefix_codelen_map[i]] = get_vlc2(gb, level0_table, 4, 1); + level1_codecounts[len]++; + if (len) { + total_code += (32 >> len); + num_codes++; + } + if (total_code >= 32) { + level1_codecounts[0] += 18 - i - 1; + break; + } + } + + if (total_code != 32 && num_codes >= 2 || num_codes < 1) + return AVERROR_INVALIDDATA; + + for (int i = 1; i < 19; i++) + level1_codecounts[i] += level1_codecounts[i - 1]; + + for (int i = 17; i >= 0; i--) { + int idx = --level1_codecounts[level1_lens[i]]; + level1_lens_s[idx] = level1_lens[i]; + level1_syms[idx] = i; + } + + ret = ff_vlc_init_from_lengths(&level1_vlc, 5, 18, level1_lens_s, 1, level1_syms, 2, 2, + 0, VLC_INIT_LE, dec->logctx); + if (ret < 0) + goto end; + + buf = av_calloc(1, 262148); // 32768 * 8 + 4 + if (!buf) { + ret = AVERROR(ENOMEM); + goto end; + } + + level2_lens = (int8_t *)buf; + level2_lens_s = (int8_t *)(buf + 32768); + level2_syms = (int16_t *)(buf + 65536); + level2_codecounts = (uint32_t *)(buf + 131072); + + total_code = 0; + for (int i = 0; i < dist->alphabet_size; i++) { + len = get_vlc2(gb, level1_vlc.table, 5, 1); + if (len == 16) { + int extra = 3 + get_bits(gb, 2); + if (repeat_count_prev) + extra = 4 * (repeat_count_prev - 2) - repeat_count_prev + extra; + for (int j = 0; j < extra; j++) + level2_lens[i + j] = prev; + total_code += (32768 >> prev) * extra; + i += extra - 1; + repeat_count_prev += extra; + repeat_count_zero = 0; + level2_codecounts[prev] += extra; + } else if (len == 17) { + int extra = 3 + get_bits(gb, 3); + if (repeat_count_zero > 0) + extra = 8 * (repeat_count_zero - 2) - repeat_count_zero + extra; + i += extra - 1; + repeat_count_prev = 0; + repeat_count_zero += extra; + level2_codecounts[0] += extra; + } else { + level2_lens[i] = len; + repeat_count_prev = repeat_count_zero = 0; + if (len) { + total_code += (32768 >> len); + prev = len; + } + level2_codecounts[len]++; + } + if (total_code >= 32768) { + level2_codecounts[0] += dist->alphabet_size - i - 1; + break; + } + } + + if (total_code != 32768 && level2_codecounts[0] < dist->alphabet_size - 1) + return AVERROR_INVALIDDATA; + + for (int i = 1; i < dist->alphabet_size + 1; i++) + level2_codecounts[i] += level2_codecounts[i - 1]; + + for (int i = dist->alphabet_size - 1; i >= 0; i--) { + int idx = --level2_codecounts[level2_lens[i]]; + level2_lens_s[idx] = level2_lens[i]; + level2_syms[idx] = i; + } + + ret = ff_vlc_init_from_lengths(&dist->vlc, 15, dist->alphabet_size, level2_lens_s, + 1, level2_syms, 2, 2, 0, VLC_INIT_LE, dec->logctx); + +end: + av_freep(&buf); + ff_vlc_free(&level1_vlc); + + return ret; +} + +static int read_distribution_bundle(GetBitContext *gb, JXLEntropyDecoder *dec, + JXLDistributionBundle *bundle, int num_dist, int disallow_lz77) +{ + int ret; + + if (num_dist <= 0) + return AVERROR(EINVAL); + + bundle->num_dist = num_dist; + bundle->lz77_enabled = get_bits1(gb); + if (bundle->lz77_enabled) { + if (disallow_lz77) + return AVERROR_INVALIDDATA; + bundle->lz77_min_symbol = jxl_u32(gb, 224, 512, 4096, 8, 0, 0, 0, 15); + bundle->lz77_min_length = jxl_u32(gb, 3, 4, 5, 9, 0, 0, 2, 8); + bundle->num_dist++; + ret = read_hybrid_uint_conf(gb, &bundle->lz_len_conf, 8); + if (ret < 0) + return ret; + } + + if (bundle->lz77_enabled && !dec->window) { + dec->window = av_malloc_array(1 << 20, sizeof(uint32_t)); + if (!dec->window) + return AVERROR(ENOMEM); + } + + ret = read_dist_clustering(gb, dec, bundle); + if (ret < 0) + return ret; + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + + bundle->dists = av_calloc(bundle->num_clusters, sizeof(JXLSymbolDistribution)); + if (!bundle->dists) + return AVERROR(ENOMEM); + + bundle->use_prefix_code = get_bits1(gb); + bundle->log_alphabet_size = bundle->use_prefix_code ? 15 : 5 + get_bits(gb, 2); + + for (int i = 0; i < bundle->num_clusters; i++) { + ret = read_hybrid_uint_conf(gb, &bundle->dists[i].config, bundle->log_alphabet_size); + if (ret < 0) + return ret; + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + } + + if (bundle->use_prefix_code) { + for (int i = 0; i < bundle->num_clusters; i++) { + JXLSymbolDistribution *dist = &bundle->dists[i]; + if (get_bits1(gb)) { + int n = get_bits(gb, 4); + dist->alphabet_size = 1 + (1 << n) + get_bitsz(gb, n); + } else { + dist->alphabet_size = 1; + } + dist->log_alphabet_size = clog1p(dist->alphabet_size - 1); + } + for (int i = 0; i < bundle->num_clusters; i++) { + ret = read_vlc_prefix(gb, dec, &bundle->dists[i]); + if (ret < 0) + return ret; + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + } + } else { + for (int i = 0; i < bundle->num_clusters; i++) { + ret = populate_distribution(gb, &bundle->dists[i], bundle->log_alphabet_size); + if (ret < 0) + return ret; + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + } + for (int i = 0; i < bundle->num_clusters; i++) { + ret = gen_alias_map(dec, &bundle->dists[i], bundle->log_alphabet_size); + if (ret < 0) + return ret; + } + } + + return 0; +} + +static void entropy_decoder_close(JXLEntropyDecoder *dec) +{ + if (!dec) + return; + av_freep(&dec->window); + dist_bundle_close(&dec->bundle); +} + +static int entropy_decoder_init(void *avctx, GetBitContext *gb, JXLEntropyDecoder *dec, int num_dist) +{ + int ret; + + memset(dec, 0, sizeof(*dec)); + dec->logctx = avctx; + dec->state = -1; + + ret = read_distribution_bundle(gb, dec, &dec->bundle, num_dist, 0); + if (ret < 0) { + entropy_decoder_close(dec); + return ret; + } + + return 0; +} + +static int64_t entropy_decoder_read_symbol(GetBitContext *gb, JXLEntropyDecoder *dec, uint32_t context) +{ + int ret; + uint32_t hybrid_uint; + + ret = decode_hybrid_varlen_uint(gb, dec, &dec->bundle, context, &hybrid_uint); + if (ret < 0) + return ret; + + return hybrid_uint; +} + +static inline uint32_t icc_context(uint64_t i, uint32_t b1, uint32_t b2) +{ + uint32_t p1, p2; + if (i <= 128) + return 0; + if (b1 >= 'a' && b1 <= 'z' || b1 >= 'A' && b1 <= 'Z') + p1 = 0; + else if (b1 >= '0' && b1 <= '9' || b1 == '.' || b1 == ',') + p1 = 1; + else if (b1 <= 1) + p1 = b1 + 2; + else if (b1 > 1 && b1 < 16) + p1 = 4; + else if (b1 > 240 && b1 < 255) + p1 = 5; + else if (b1 == 255) + p1 = 6; + else + p1 = 7; + + if (b2 >= 'a' && b2 <= 'z' || b2 >= 'A' && b2 <= 'Z') + p2 = 0; + else if (b2 >= '0' && b2 <= '9' || b2 == '.' || b2 == ',') + p2 = 1; + else if (b2 < 16) + p2 = 2; + else if (b2 > 240) + p2 = 3; + else + p2 = 4; + + return 1 + p1 + p2 * 8; +} + +static inline uint32_t toc_context(uint32_t x) +{ + return FFMIN(7, clog1p(x)); +} + +static void populate_fields(AVCodecParserContext *s, AVCodecContext *avctx, const FFJXLMetadata *meta) +{ + s->width = meta->width; + s->height = meta->height; + + switch (meta->csp) { + case JPEGXL_CS_RGB: + case JPEGXL_CS_XYB: + avctx->colorspace = AVCOL_SPC_RGB; + break; + default: + avctx->colorspace = AVCOL_SPC_UNSPECIFIED; + } + + if (meta->wp == JPEGXL_WP_D65) { + switch (meta->primaries) { + case JPEGXL_PR_SRGB: + avctx->color_primaries = AVCOL_PRI_BT709; + break; + case JPEGXL_PR_P3: + avctx->color_primaries = AVCOL_PRI_SMPTE432; + break; + case JPEGXL_PR_2100: + avctx->color_primaries = AVCOL_PRI_BT2020; + break; + default: + avctx->color_primaries = AVCOL_PRI_UNSPECIFIED; + } + } else if (meta->wp == JPEGXL_WP_DCI && meta->primaries == JPEGXL_PR_P3) { + avctx->color_primaries = AVCOL_PRI_SMPTE431; + } else { + avctx->color_primaries = AVCOL_PRI_UNSPECIFIED; + } + + if (meta->trc > JPEGXL_TR_GAMMA) { + FFJXLTransferCharacteristic trc = meta->trc - JPEGXL_TR_GAMMA; + switch (trc) { + case JPEGXL_TR_BT709: + avctx->color_trc = AVCOL_TRC_BT709; + break; + case JPEGXL_TR_LINEAR: + avctx->color_trc = AVCOL_TRC_LINEAR; + break; + case JPEGXL_TR_SRGB: + avctx->color_trc = AVCOL_TRC_IEC61966_2_1; + break; + case JPEGXL_TR_PQ: + avctx->color_trc = AVCOL_TRC_SMPTEST2084; + break; + case JPEGXL_TR_DCI: + avctx->color_trc = AVCOL_TRC_SMPTE428; + break; + case JPEGXL_TR_HLG: + avctx->color_trc = AVCOL_TRC_ARIB_STD_B67; + break; + default: + avctx->color_trc = AVCOL_TRC_UNSPECIFIED; + } + } else if (meta->trc > 0) { + if (meta->trc > 45355 && meta->trc < 45555) + avctx->color_trc = AVCOL_TRC_GAMMA22; + else if (meta->trc > 35614 && meta->trc < 35814) + avctx->color_trc = AVCOL_TRC_GAMMA28; + else + avctx->color_trc = AVCOL_TRC_UNSPECIFIED; + } else { + avctx->color_trc = AVCOL_TRC_UNSPECIFIED; + } + + if (meta->csp == JPEGXL_CS_GRAY) { + if (meta->bit_depth <= 8) + s->format = meta->have_alpha ? AV_PIX_FMT_YA8 : AV_PIX_FMT_GRAY8; + else if (meta->bit_depth <= 16) + s->format = meta->have_alpha ? AV_PIX_FMT_YA16 : AV_PIX_FMT_GRAY16; + else + s->format = meta->have_alpha ? AV_PIX_FMT_NONE : AV_PIX_FMT_GRAYF32; + } else { + if (meta->bit_depth <= 8) + s->format = meta->have_alpha ? AV_PIX_FMT_RGBA : AV_PIX_FMT_RGB24; + else if (meta->bit_depth <= 16) + s->format = meta->have_alpha ? AV_PIX_FMT_RGBA64 : AV_PIX_FMT_RGB48; + else + s->format = meta->have_alpha ? AV_PIX_FMT_RGBAF32 : AV_PIX_FMT_RGBF32; + } +} + +static int skip_icc_profile(void *avctx, JXLParseContext *ctx, GetBitContext *gb) +{ + int64_t ret; + uint32_t last = 0, last2 = 0; + JXLEntropyDecoder dec; + uint64_t enc_size = jxl_u64(gb); + + if (!enc_size) + return AVERROR_INVALIDDATA; + + ret = entropy_decoder_init(avctx, gb, &dec, 41); + if (ret < 0) + return ret; + + if (get_bits_left(gb) < 0) { + entropy_decoder_close(&dec); + return AVERROR_BUFFER_TOO_SMALL; + } + + for (uint64_t read = 0; read < enc_size; read++) { + ret = entropy_decoder_read_symbol(gb, &dec, icc_context(read, last, last2)); + if (ret < 0 || get_bits_left(gb) < 0) { + entropy_decoder_close(&dec); + return ret < 0 ? ret : AVERROR_BUFFER_TOO_SMALL; + } + last2 = last; + last = ret; + } + + entropy_decoder_close(&dec); + + return 0; +} + +static int skip_extensions(GetBitContext *gb) +{ + uint64_t extensions = jxl_u64(gb), extensions_len = 0; + + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + + if (!extensions) + return 0; + + for (int i = 0; i < 64; i++) { + if (extensions & (UINT64_C(1) << i)) + extensions_len += jxl_u64(gb); + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + } + + if (extensions_len > INT_MAX || get_bits_left(gb) < extensions_len) + return AVERROR_BUFFER_TOO_SMALL; + + skip_bits_long(gb, extensions_len); + + return 0; +} + +static int parse_frame_header(void *avctx, JXLParseContext *ctx, GetBitContext *gb) +{ + int all_default, do_yCbCr = 0, num_passes = 1, ret; + int group_size_shift = 1, lf_level = 0, save_as_ref = 0; + int have_crop = 0, full_frame = 1, resets_canvas = 1, upsampling = 1; + JXLFrame *frame = &ctx->codestream.frame; + const FFJXLMetadata *meta = &ctx->codestream.meta; + int32_t x0 = 0, y0 = 0; + uint32_t duration = 0, width = meta->coded_width, height = meta->coded_height; + uint32_t name_len, num_groups, num_lf_groups, group_dim, lf_group_dim, toc_count; + uint64_t flags = 0; + int start_len = get_bits_count(gb); + + memset(frame, 0, sizeof(*frame)); + frame->is_last = 1; + + all_default = get_bits1(gb); + if (!all_default) { + frame->type = get_bits(gb, 2); + frame->encoding = get_bits1(gb); + flags = jxl_u64(gb); + if (!meta->xyb_encoded) + do_yCbCr = get_bits1(gb); + if (!(flags & JXL_FLAG_USE_LF_FRAME)) { + if (do_yCbCr) + skip_bits(gb, 6); // jpeg upsampling + upsampling = jxl_u32(gb, 1, 2, 4, 8, 0, 0, 0, 0); + skip_bits_long(gb, 2 * meta->num_extra_channels); + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + } + if (frame->encoding == JPEGXL_ENC_MODULAR) + group_size_shift = get_bits(gb, 2); + else if (meta->xyb_encoded) + skip_bits(gb, 6); // xqm and bqm scales + if (frame->type != JPEGXL_FRAME_REFERENCE_ONLY) { + num_passes = jxl_u32(gb, 1, 2, 3, 4, 0, 0, 0, 3); + if (num_passes != 1) { + int num_ds = jxl_u32(gb, 0, 1, 2, 3, 0, 0, 0, 1); + skip_bits(gb, 2 * (num_passes - 1)); // shift + skip_bits(gb, 2 * num_ds); // downsample + for (int i = 0; i < num_ds; i++) + jxl_u32(gb, 0, 1, 2, 0, 0, 0, 0, 3); + } + } + if (frame->type == JPEGXL_FRAME_LF) + lf_level = 1 + get_bits(gb, 2); + else + have_crop = get_bits1(gb); + if (have_crop) { + if (frame->type != JPEGXL_FRAME_REFERENCE_ONLY) { + uint32_t ux0 = jxl_u32(gb, 0, 256, 2304, 18688, 8, 11, 14, 30); + uint32_t uy0 = jxl_u32(gb, 0, 256, 2304, 18688, 8, 11, 14, 30); + x0 = unpack_signed(ux0); + y0 = unpack_signed(uy0); + } + width = jxl_u32(gb, 0, 256, 2304, 18688, 8, 11, 14, 30); + height = jxl_u32(gb, 0, 256, 2304, 18688, 8, 11, 14, 30); + full_frame = x0 <= 0 && y0 <= 0 && width + x0 >= meta->coded_width + && height + y0 >= meta->coded_height; + } + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + if (frame->type == JPEGXL_FRAME_REGULAR || frame->type == JPEGXL_FRAME_SKIP_PROGRESSIVE) { + for (int i = 0; i <= meta->num_extra_channels; i++) { + int mode = jxl_u32(gb, 0, 1, 2, 3, 0, 0, 0, 2); + if (meta->num_extra_channels && (mode == JPEGXL_BM_BLEND || mode == JPEGXL_BM_MULADD)) + jxl_u32(gb, 0, 1, 2, 3, 0, 0, 0, 2); + if (meta->num_extra_channels && (mode == JPEGXL_BM_BLEND || mode == JPEGXL_BM_MULADD + || mode == JPEGXL_BM_MUL)) + skip_bits1(gb); + if (!i) + resets_canvas = mode == JPEGXL_BM_REPLACE && full_frame; + if (!resets_canvas) + skip_bits(gb, 2); + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + } + if (meta->animation_offset) + duration = jxl_u32(gb, 0, 1, 0, 0, 0, 0, 8, 32); + if (meta->have_timecodes) + skip_bits_long(gb, 32); + frame->is_last = get_bits1(gb); + } else { + frame->is_last = 0; + } + if (frame->type != JPEGXL_FRAME_LF && !frame->is_last) + save_as_ref = get_bits(gb, 2); + if (frame->type == JPEGXL_FRAME_REFERENCE_ONLY || + (resets_canvas && !frame->is_last && (!duration || save_as_ref) + && frame->type != JPEGXL_FRAME_LF)) + skip_bits1(gb); // save before color transform + name_len = 8 * jxl_u32(gb, 0, 0, 16, 48, 0, 4, 5, 10); + if (get_bits_left(gb) < name_len) + return AVERROR_BUFFER_TOO_SMALL; + skip_bits_long(gb, name_len); + } + + if (!all_default) { + int restd = get_bits1(gb), gab = 1; + if (!restd) + gab = get_bits1(gb); + if (gab && !restd && get_bits1(gb)) + // gab custom + skip_bits_long(gb, 16 * 6); + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + if (!restd) { + int epf = get_bits(gb, 2); + if (epf) { + if (frame->encoding == JPEGXL_ENC_VARDCT && get_bits1(gb)) { + skip_bits_long(gb, 16 * 8); // custom epf sharpness + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + } + if (get_bits1(gb)) { + skip_bits_long(gb, 3 * 16 + 32); // custom epf weight + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + } + if (get_bits1(gb)) { // custom epf sigma + if (frame->encoding == JPEGXL_ENC_VARDCT) + skip_bits(gb, 16); + skip_bits_long(gb, 16 * 3); + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + } + if (frame->encoding == JPEGXL_ENC_MODULAR) + skip_bits(gb, 16); + } + ret = skip_extensions(gb); + if (ret < 0) + return ret; + } + ret = skip_extensions(gb); + if (ret < 0) + return ret; + } + + width = div_ceil(div_ceil(width, upsampling), 1 << (3 * lf_level)); + height = div_ceil(div_ceil(height, upsampling), 1 << (3 * lf_level)); + group_dim = 128 << group_size_shift; + lf_group_dim = group_dim << 3; + num_groups = div_ceil(width, group_dim) * div_ceil(height, group_dim); + num_lf_groups = div_ceil(width, lf_group_dim) * div_ceil(height, lf_group_dim); + if (num_groups == 1 && num_passes == 1) + toc_count = 1; + else + toc_count = 2 + num_lf_groups + num_groups * num_passes; + + // permuted toc + if (get_bits1(gb)) { + JXLEntropyDecoder dec; + uint32_t end, lehmer = 0; + ret = entropy_decoder_init(avctx, gb, &dec, 8); + if (ret < 0) + return ret; + if (get_bits_left(gb) < 0) { + entropy_decoder_close(&dec); + return AVERROR_BUFFER_TOO_SMALL; + } + end = entropy_decoder_read_symbol(gb, &dec, toc_context(toc_count)); + if (end > toc_count) { + entropy_decoder_close(&dec); + return AVERROR_INVALIDDATA; + } + for (uint32_t i = 0; i < end; i++) { + lehmer = entropy_decoder_read_symbol(gb, &dec, toc_context(lehmer)); + if (get_bits_left(gb) < 0) { + entropy_decoder_close(&dec); + return AVERROR_BUFFER_TOO_SMALL; + } + } + entropy_decoder_close(&dec); + } + align_get_bits(gb); + + for (uint32_t i = 0; i < toc_count; i++) { + frame->body_length += 8 * jxl_u32(gb, 0, 1024, 17408, 4211712, 10, 14, 22, 30); + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + } + align_get_bits(gb); + + frame->total_length = frame->body_length + get_bits_count(gb) - start_len; + + return 0; +} + +static int skip_boxes(JXLParseContext *ctx, const uint8_t *buf, int buf_size) +{ + GetByteContext gb; + + if (ctx->skip > buf_size) + return AVERROR_BUFFER_TOO_SMALL; + + buf += ctx->skip; + buf_size -= ctx->skip; + bytestream2_init(&gb, buf, buf_size); + + while (1) { + uint64_t size; + int head_size = 4; + + if (bytestream2_peek_le16(&gb) == FF_JPEGXL_CODESTREAM_SIGNATURE_LE) + break; + if (bytestream2_peek_le64(&gb) == FF_JPEGXL_CONTAINER_SIGNATURE_LE) + break; + + if (bytestream2_get_bytes_left(&gb) < 8) + return AVERROR_BUFFER_TOO_SMALL; + + size = bytestream2_get_be32(&gb); + if (size == 1) { + if (bytestream2_get_bytes_left(&gb) < 12) + return AVERROR_BUFFER_TOO_SMALL; + size = bytestream2_get_be64(&gb); + head_size = 12; + } + if (!size) + return AVERROR_INVALIDDATA; + /* invalid ISOBMFF size */ + if (size <= head_size + 4 || size > INT_MAX - ctx->skip) + return AVERROR_INVALIDDATA; + + ctx->skip += size; + bytestream2_skip(&gb, size - head_size); + if (bytestream2_get_bytes_left(&gb) <= 0) + return AVERROR_BUFFER_TOO_SMALL; + } + + return 0; +} + +static int try_parse(AVCodecParserContext *s, AVCodecContext *avctx, JXLParseContext *ctx, + const uint8_t *buf, int buf_size) +{ + int ret, cs_buflen, header_skip; + const uint8_t *cs_buffer; + GetBitContext gb; + + if (ctx->skip > buf_size) + return AVERROR_BUFFER_TOO_SMALL; + + buf += ctx->skip; + buf_size -= ctx->skip; + + if (ctx->container || AV_RL64(buf) == FF_JPEGXL_CONTAINER_SIGNATURE_LE) { + ctx->container = 1; + ret = ff_jpegxl_collect_codestream_header(buf, buf_size, ctx->cs_buffer, + sizeof(ctx->cs_buffer), &ctx->copied); + if (ret < 0) + return ret; + ctx->collected_size = ret; + if (!ctx->copied) { + ctx->skip += ret; + return AVERROR_BUFFER_TOO_SMALL; + } + cs_buffer = ctx->cs_buffer; + cs_buflen = FFMIN(sizeof(ctx->cs_buffer), ctx->copied); + } else { + cs_buffer = buf; + cs_buflen = buf_size; + } + + if (!ctx->codestream_length) { + header_skip = ff_jpegxl_parse_codestream_header(cs_buffer, cs_buflen, &ctx->codestream.meta, 0); + if (header_skip < 0) + return header_skip; + ctx->codestream_length = header_skip; + populate_fields(s, avctx, &ctx->codestream.meta); + } + + if (ctx->container) + return ctx->collected_size; + + ret = init_get_bits8(&gb, cs_buffer, cs_buflen); + if (ret < 0) + return ret; + + skip_bits_long(&gb, ctx->codestream_length); + + if (!ctx->skipped_icc && ctx->codestream.meta.have_icc_profile) { + ret = skip_icc_profile(avctx, ctx, &gb); + if (ret < 0) + return ret; + ctx->skipped_icc = 1; + align_get_bits(&gb); + ctx->codestream_length = get_bits_count(&gb); + } + + if (get_bits_left(&gb) <= 0) + return AVERROR_BUFFER_TOO_SMALL; + + while (1) { + ret = parse_frame_header(avctx, ctx, &gb); + if (ret < 0) + return ret; + ctx->codestream_length += ctx->codestream.frame.total_length; + if (ctx->codestream.frame.is_last) + return ctx->codestream_length / 8; + if (get_bits_left(&gb) <= ctx->codestream.frame.body_length) + return AVERROR_BUFFER_TOO_SMALL; + skip_bits_long(&gb, ctx->codestream.frame.body_length); + } +} + +static int jpegxl_parse(AVCodecParserContext *s, AVCodecContext *avctx, + const uint8_t **poutbuf, int *poutbuf_size, + const uint8_t *buf, int buf_size) +{ + JXLParseContext *ctx = s->priv_data; + int next = END_NOT_FOUND, ret; + + *poutbuf_size = 0; + *poutbuf = NULL; + + if (!ctx->pc.index) + goto flush; + + if ((!ctx->container || !ctx->codestream_length) && !ctx->next) { + ret = try_parse(s, avctx, ctx, ctx->pc.buffer, ctx->pc.index); + if (ret < 0) + goto flush; + ctx->next = ret; + if (ctx->container) + ctx->skip += ctx->next; + } + + if (ctx->container && ctx->next >= 0) { + ret = skip_boxes(ctx, ctx->pc.buffer, ctx->pc.index); + if (ret < 0) { + if (ret == AVERROR_INVALIDDATA) + ctx->next = -1; + goto flush; + } + ctx->next = ret + ctx->skip; + } + + if (ctx->next >= 0) + next = ctx->next - ctx->pc.index; + +flush: + if (next > buf_size) + next = END_NOT_FOUND; + + ret = ff_combine_frame(&ctx->pc, next, &buf, &buf_size); + if (ret < 0) + return buf_size; + + *poutbuf = buf; + *poutbuf_size = buf_size; + + ctx->codestream_length = 0; + ctx->collected_size = 0; + ctx->container = 0; + ctx->copied = 0; + ctx->skip = 0; + ctx->skipped_icc = 0; + ctx->next = 0; + memset(&ctx->codestream, 0, sizeof(ctx->codestream)); + + return next; +} + +const AVCodecParser ff_jpegxl_parser = { + .codec_ids = { AV_CODEC_ID_JPEGXL }, + .priv_data_size = sizeof(JXLParseContext), + .parser_parse = jpegxl_parse, + .parser_close = ff_parse_close, +}; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/kbdwin.c b/arm/raspi/third_party/ffmpeg/libavcodec/kbdwin.c index 163f9d52..ff7a7d61 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/kbdwin.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/kbdwin.c @@ -17,22 +17,27 @@ */ #include "libavutil/avassert.h" +#include "libavutil/error.h" +#include "libavutil/libm.h" #include "libavutil/mathematics.h" #include "libavutil/attributes.h" +#include "libavutil/mem.h" #include "kbdwin.h" -av_cold static void kbd_window_init(float *float_window, int *int_window, float alpha, int n) +av_cold static int kbd_window_init(float *float_window, int *int_window, float alpha, int n) { int i; double sum = 0.0, tmp; double scale = 0.0; - double temp[FF_KBD_WINDOW_MAX / 2 + 1]; + double temp_small[FF_KBD_WINDOW_MAX / 2 + 1]; + double *temp= n<=FF_KBD_WINDOW_MAX ? temp_small : av_malloc((n/2+1) * sizeof(*temp)); double alpha2 = 4 * (alpha * M_PI / n) * (alpha * M_PI / n); - av_assert0(n <= FF_KBD_WINDOW_MAX); + if (!temp) + return AVERROR(ENOMEM); for (i = 0; i <= n / 2; i++) { - tmp = i * (n - i) * alpha2; + tmp = alpha2 * i * (n - i); temp[i] = av_bessel_i0(sqrt(tmp)); scale += temp[i] * (1 + (i && i /** - * Maximum window size for ff_kbd_window_init. + * Maximum window size for avpriv_kbd_window_init. */ #define FF_KBD_WINDOW_MAX 1024 @@ -30,9 +30,11 @@ * Generate a Kaiser-Bessel Derived Window. * @param window pointer to half window * @param alpha determines window shape - * @param n size of half window, max FF_KBD_WINDOW_MAX + * @param n size of half window + * + * @return if n is larger than FF_KBD_WINDOW_MAX then AVERROR(ENOMEM) is possible */ -void ff_kbd_window_init(float *window, float alpha, int n); -void ff_kbd_window_init_fixed(int32_t *window, float alpha, int n); +int avpriv_kbd_window_init(float *window, float alpha, int n); +int avpriv_kbd_window_init_fixed(int32_t *window, float alpha, int n); #endif /* AVCODEC_KBDWIN_H */ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/lagarith.c b/arm/raspi/third_party/ffmpeg/libavcodec/lagarith.c index ebc1f761..9574f788 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/lagarith.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/lagarith.c @@ -27,6 +27,8 @@ #include +#include "libavutil/thread.h" + #include "avcodec.h" #include "codec_internal.h" #include "get_bits.h" @@ -35,6 +37,8 @@ #include "lossless_videodsp.h" #include "thread.h" +#define VLC_BITS 7 + enum LagarithFrameType { FRAME_RAW = 1, /**< uncompressed */ FRAME_U_RGB24 = 2, /**< unaligned RGB24 */ @@ -56,6 +60,35 @@ typedef struct LagarithContext { int zeros_rem; /**< number of zero bytes remaining to output */ } LagarithContext; +static VLC lag_tab; + +static const uint8_t lag_bits[] = { + 7, 7, 2, 7, 3, 4, 5, 6, 7, 7, 7, 7, 7, 6, 7, 4, 5, 7, 7, 7, 7, + 5, 6, 7, 7, 7, 7, 7, 7, 6, 7, 7, 7, 7, 7, 6, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, +}; + +static const uint8_t lag_codes[] = { + 0x01, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x05, + 0x08, 0x09, 0x0A, 0x0B, 0x0B, 0x0B, 0x0B, 0x10, 0x11, 0x12, 0x13, + 0x13, 0x13, 0x14, 0x15, 0x20, 0x21, 0x22, 0x23, 0x23, 0x24, 0x25, + 0x28, 0x29, 0x2A, 0x2B, 0x2B, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, + 0x48, 0x49, 0x4A, 0x4B, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, +}; + +static const uint8_t lag_symbols[] = { + 20, 12, 0, 12, 1, 2, 4, 7, 7, 28, 4, 25, 17, + 10, 17, 3, 6, 2, 23, 15, 15, 5, 9, 10, 31, 1, 22, + 14, 14, 8, 9, 30, 6, 27, 19, 11, 19, 0, 21, 13, 13, + 8, 29, 5, 26, 18, 18, 3, 24, 16, 16, 11, 32, +}; + +static av_cold void lag_init_static_data(void) +{ + VLC_INIT_SPARSE_STATIC(&lag_tab, VLC_BITS, FF_ARRAY_ELEMS(lag_bits), + lag_bits, 1, 1, lag_codes, 1, 1, lag_symbols, 1, 1, 128); +} + /** * Compute the 52-bit mantissa of 1/(double)denom. * This crazy format uses floats in an entropy coder and we have to match x86 @@ -101,23 +134,10 @@ static uint8_t lag_calc_zero_run(int8_t x) static int lag_decode_prob(GetBitContext *gb, uint32_t *value) { - static const uint8_t series[] = { 1, 2, 3, 5, 8, 13, 21 }; - int i; - int bit = 0; - int bits = 0; - int prevbit = 0; - unsigned val; + unsigned val, bits; - for (i = 0; i < 7; i++) { - if (prevbit && bit) - break; - prevbit = bit; - bit = get_bits1(gb); - if (bit && !prevbit) - bits += series[i]; - } - bits--; - if (bits < 0 || bits > 31) { + bits = get_vlc2(gb, lag_tab.table, VLC_BITS, 1); + if (bits > 31) { *value = 0; return AVERROR_INVALIDDATA; } else if (bits == 0) { @@ -146,17 +166,17 @@ static int lag_read_prob_header(lag_rac *rac, GetBitContext *gb) /* Read probabilities from bitstream */ for (i = 1; i < 257; i++) { if (lag_decode_prob(gb, &rac->prob[i]) < 0) { - av_log(rac->avctx, AV_LOG_ERROR, "Invalid probability encountered.\n"); + av_log(rac->logctx, AV_LOG_ERROR, "Invalid probability encountered.\n"); return AVERROR_INVALIDDATA; } if ((uint64_t)cumul_prob + rac->prob[i] > UINT_MAX) { - av_log(rac->avctx, AV_LOG_ERROR, "Integer overflow encountered in cumulative probability calculation.\n"); + av_log(rac->logctx, AV_LOG_ERROR, "Integer overflow encountered in cumulative probability calculation.\n"); return AVERROR_INVALIDDATA; } cumul_prob += rac->prob[i]; if (!rac->prob[i]) { if (lag_decode_prob(gb, &prob)) { - av_log(rac->avctx, AV_LOG_ERROR, "Invalid probability run encountered.\n"); + av_log(rac->logctx, AV_LOG_ERROR, "Invalid probability run encountered.\n"); return AVERROR_INVALIDDATA; } if (prob > 256 - i) @@ -169,7 +189,7 @@ static int lag_read_prob_header(lag_rac *rac, GetBitContext *gb) } if (!cumul_prob) { - av_log(rac->avctx, AV_LOG_ERROR, "All probabilities are 0!\n"); + av_log(rac->logctx, AV_LOG_ERROR, "All probabilities are 0!\n"); return AVERROR_INVALIDDATA; } @@ -187,7 +207,7 @@ static int lag_read_prob_header(lag_rac *rac, GetBitContext *gb) scaled_cumul_prob += rac->prob[i]; } if (scaled_cumul_prob <= 0) { - av_log(rac->avctx, AV_LOG_ERROR, "Scaled probabilities invalid\n"); + av_log(rac->logctx, AV_LOG_ERROR, "Scaled probabilities invalid\n"); return AVERROR_INVALIDDATA; } for (; i < 257; i++) { @@ -201,7 +221,7 @@ static int lag_read_prob_header(lag_rac *rac, GetBitContext *gb) cumulative_target = 1U << scale_factor; if (scaled_cumul_prob > cumulative_target) { - av_log(rac->avctx, AV_LOG_ERROR, + av_log(rac->logctx, AV_LOG_ERROR, "Scaled probabilities are larger than target!\n"); return AVERROR_INVALIDDATA; } @@ -443,7 +463,7 @@ static int lag_decode_arith_plane(LagarithContext *l, uint8_t *dst, const uint8_t *src_end = src + src_size; int ret; - rac.avctx = l->avctx; + rac.logctx = l->avctx; l->zeros = 0; if(src_size < 2) @@ -720,10 +740,12 @@ static int lag_decode_frame(AVCodecContext *avctx, AVFrame *p, static av_cold int lag_decode_init(AVCodecContext *avctx) { + static AVOnce init_static_once = AV_ONCE_INIT; LagarithContext *l = avctx->priv_data; l->avctx = avctx; ff_llviddsp_init(&l->llviddsp); + ff_thread_once(&init_static_once, lag_init_static_data); return 0; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/lagarithrac.h b/arm/raspi/third_party/ffmpeg/libavcodec/lagarithrac.h index a31b054d..2c8cb738 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/lagarithrac.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/lagarithrac.h @@ -32,11 +32,10 @@ #include #include "libavutil/intreadwrite.h" -#include "avcodec.h" #include "get_bits.h" typedef struct lag_rac { - AVCodecContext *avctx; + void *logctx; unsigned low; unsigned range; unsigned scale; /**< Number of bits of precision in range. */ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/lcldec.c b/arm/raspi/third_party/ffmpeg/libavcodec/lcldec.c index ed78d9d5..b4304618 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/lcldec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/lcldec.c @@ -167,7 +167,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; LclDecContext * const c = avctx->priv_data; - unsigned int pixel_ptr; + ptrdiff_t pixel_ptr; int row, col; unsigned char *encoded = avpkt->data, *outptr; uint8_t *y_out, *u_out, *v_out; @@ -231,16 +231,19 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, break; case COMP_MSZH_NOCOMP: { int bppx2; + int aligned_width = width; switch (c->imgtype) { case IMGTYPE_YUV111: case IMGTYPE_RGB24: bppx2 = 6; break; case IMGTYPE_YUV422: + aligned_width &= ~3; case IMGTYPE_YUV211: bppx2 = 4; break; case IMGTYPE_YUV411: + aligned_width &= ~3; case IMGTYPE_YUV420: bppx2 = 3; break; @@ -248,7 +251,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, bppx2 = 0; // will error out below break; } - if (len < ((width * height * bppx2) >> 1)) + if (len < ((aligned_width * height * bppx2) >> 1)) return AVERROR_INVALIDDATA; break; } @@ -314,8 +317,8 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, } break; case IMGTYPE_YUV422: + pixel_ptr = 0; for (row = 0; row < height; row++) { - pixel_ptr = row * width * 2; yq = uq = vq =0; for (col = 0; col < width/4; col++) { encoded[pixel_ptr] = yq -= encoded[pixel_ptr]; @@ -331,8 +334,8 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, } break; case IMGTYPE_YUV411: + pixel_ptr = 0; for (row = 0; row < height; row++) { - pixel_ptr = row * width / 2 * 3; yq = uq = vq =0; for (col = 0; col < width/4; col++) { encoded[pixel_ptr] = yq -= encoded[pixel_ptr]; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/libaomdec.c b/arm/raspi/third_party/ffmpeg/libavcodec/libaomdec.c index 767c216a..695d9010 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/libaomdec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/libaomdec.c @@ -78,17 +78,17 @@ static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img) if (img->bit_depth == 8) { avctx->pix_fmt = img->monochrome ? AV_PIX_FMT_GRAY8 : AV_PIX_FMT_YUV420P; - avctx->profile = FF_PROFILE_AV1_MAIN; + avctx->profile = AV_PROFILE_AV1_MAIN; return 0; } else if (img->bit_depth == 10) { avctx->pix_fmt = img->monochrome ? AV_PIX_FMT_GRAY10 : AV_PIX_FMT_YUV420P10; - avctx->profile = FF_PROFILE_AV1_MAIN; + avctx->profile = AV_PROFILE_AV1_MAIN; return 0; } else if (img->bit_depth == 12) { avctx->pix_fmt = img->monochrome ? AV_PIX_FMT_GRAY12 : AV_PIX_FMT_YUV420P12; - avctx->profile = FF_PROFILE_AV1_PROFESSIONAL; + avctx->profile = AV_PROFILE_AV1_PROFESSIONAL; return 0; } else { return AVERROR_INVALIDDATA; @@ -97,15 +97,15 @@ static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img) case AOM_IMG_FMT_I42216: if (img->bit_depth == 8) { avctx->pix_fmt = AV_PIX_FMT_YUV422P; - avctx->profile = FF_PROFILE_AV1_PROFESSIONAL; + avctx->profile = AV_PROFILE_AV1_PROFESSIONAL; return 0; } else if (img->bit_depth == 10) { avctx->pix_fmt = AV_PIX_FMT_YUV422P10; - avctx->profile = FF_PROFILE_AV1_PROFESSIONAL; + avctx->profile = AV_PROFILE_AV1_PROFESSIONAL; return 0; } else if (img->bit_depth == 12) { avctx->pix_fmt = AV_PIX_FMT_YUV422P12; - avctx->profile = FF_PROFILE_AV1_PROFESSIONAL; + avctx->profile = AV_PROFILE_AV1_PROFESSIONAL; return 0; } else { return AVERROR_INVALIDDATA; @@ -115,18 +115,18 @@ static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img) if (img->bit_depth == 8) { avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ? AV_PIX_FMT_GBRP : AV_PIX_FMT_YUV444P; - avctx->profile = FF_PROFILE_AV1_HIGH; + avctx->profile = AV_PROFILE_AV1_HIGH; return 0; } else if (img->bit_depth == 10) { avctx->pix_fmt = AV_PIX_FMT_YUV444P10; avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ? AV_PIX_FMT_GBRP10 : AV_PIX_FMT_YUV444P10; - avctx->profile = FF_PROFILE_AV1_HIGH; + avctx->profile = AV_PROFILE_AV1_HIGH; return 0; } else if (img->bit_depth == 12) { avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ? AV_PIX_FMT_GBRP12 : AV_PIX_FMT_YUV444P12; - avctx->profile = FF_PROFILE_AV1_PROFESSIONAL; + avctx->profile = AV_PROFILE_AV1_PROFESSIONAL; return 0; } else { return AVERROR_INVALIDDATA; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/libaomenc.c b/arm/raspi/third_party/ffmpeg/libavcodec/libaomenc.c index 16747e7e..aa800834 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/libaomenc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/libaomenc.c @@ -451,16 +451,16 @@ static int set_pix_fmt(AVCodecContext *avctx, aom_codec_caps_t codec_caps, enccfg->monochrome = 1; /* Fall-through */ case AV_PIX_FMT_YUV420P: - enccfg->g_profile = FF_PROFILE_AV1_MAIN; + enccfg->g_profile = AV_PROFILE_AV1_MAIN; *img_fmt = AOM_IMG_FMT_I420; return 0; case AV_PIX_FMT_YUV422P: - enccfg->g_profile = FF_PROFILE_AV1_PROFESSIONAL; + enccfg->g_profile = AV_PROFILE_AV1_PROFESSIONAL; *img_fmt = AOM_IMG_FMT_I422; return 0; case AV_PIX_FMT_YUV444P: case AV_PIX_FMT_GBRP: - enccfg->g_profile = FF_PROFILE_AV1_HIGH; + enccfg->g_profile = AV_PROFILE_AV1_HIGH; *img_fmt = AOM_IMG_FMT_I444; return 0; case AV_PIX_FMT_GRAY10: @@ -471,7 +471,7 @@ static int set_pix_fmt(AVCodecContext *avctx, aom_codec_caps_t codec_caps, case AV_PIX_FMT_YUV420P12: if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) { enccfg->g_profile = - enccfg->g_bit_depth == 10 ? FF_PROFILE_AV1_MAIN : FF_PROFILE_AV1_PROFESSIONAL; + enccfg->g_bit_depth == 10 ? AV_PROFILE_AV1_MAIN : AV_PROFILE_AV1_PROFESSIONAL; *img_fmt = AOM_IMG_FMT_I42016; *flags |= AOM_CODEC_USE_HIGHBITDEPTH; return 0; @@ -480,7 +480,7 @@ static int set_pix_fmt(AVCodecContext *avctx, aom_codec_caps_t codec_caps, case AV_PIX_FMT_YUV422P10: case AV_PIX_FMT_YUV422P12: if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) { - enccfg->g_profile = FF_PROFILE_AV1_PROFESSIONAL; + enccfg->g_profile = AV_PROFILE_AV1_PROFESSIONAL; *img_fmt = AOM_IMG_FMT_I42216; *flags |= AOM_CODEC_USE_HIGHBITDEPTH; return 0; @@ -492,7 +492,7 @@ static int set_pix_fmt(AVCodecContext *avctx, aom_codec_caps_t codec_caps, case AV_PIX_FMT_GBRP12: if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) { enccfg->g_profile = - enccfg->g_bit_depth == 10 ? FF_PROFILE_AV1_HIGH : FF_PROFILE_AV1_PROFESSIONAL; + enccfg->g_bit_depth == 10 ? AV_PROFILE_AV1_HIGH : AV_PROFILE_AV1_PROFESSIONAL; *img_fmt = AOM_IMG_FMT_I44416; *flags |= AOM_CODEC_USE_HIGHBITDEPTH; return 0; @@ -842,7 +842,7 @@ static av_cold int aom_init(AVCodecContext *avctx, /* 0-3: For non-zero values the encoder increasingly optimizes for reduced * complexity playback on low powered devices at the expense of encode * quality. */ - if (avctx->profile != FF_PROFILE_UNKNOWN) + if (avctx->profile != AV_PROFILE_UNKNOWN) enccfg.g_profile = avctx->profile; enccfg.g_error_resilient = ctx->error_resilient; @@ -1018,7 +1018,7 @@ static av_cold int aom_init(AVCodecContext *avctx, if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) ctx->rawimg.bit_depth = enccfg.g_bit_depth; - cpb_props = ff_add_cpb_side_data(avctx); + cpb_props = ff_encode_add_cpb_side_data(avctx); if (!cpb_props) return AVERROR(ENOMEM); @@ -1299,7 +1299,7 @@ static int aom_encode(AVCodecContext *avctx, AVPacket *pkt, duration = frame->duration; else if (avctx->framerate.num > 0 && avctx->framerate.den > 0) duration = av_rescale_q(1, av_inv_q(avctx->framerate), avctx->time_base); - else + else { FF_DISABLE_DEPRECATION_WARNINGS duration = #if FF_API_TICKS_PER_FRAME @@ -1307,6 +1307,7 @@ FF_DISABLE_DEPRECATION_WARNINGS #endif 1; FF_ENABLE_DEPRECATION_WARNINGS + } switch (frame->color_range) { case AVCOL_RANGE_MPEG: diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/libaribb24.c b/arm/raspi/third_party/ffmpeg/libavcodec/libaribb24.c index e3e244be..29479e37 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/libaribb24.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/libaribb24.c @@ -49,13 +49,13 @@ static unsigned int get_profile_font_size(AVCodecContext *avctx) Libaribb24Context *b24 = avctx->priv_data; int profile = avctx->profile; - if (profile == FF_PROFILE_UNKNOWN) + if (profile == AV_PROFILE_UNKNOWN) profile = b24->default_profile; switch (profile) { - case FF_PROFILE_ARIB_PROFILE_A: + case AV_PROFILE_ARIB_PROFILE_A: return 36; - case FF_PROFILE_ARIB_PROFILE_C: + case AV_PROFILE_ARIB_PROFILE_C: return 18; default: return 0; @@ -75,15 +75,15 @@ static int libaribb24_generate_ass_header(AVCodecContext *avctx) unsigned int font_size = 0; int profile = avctx->profile; - if (profile == FF_PROFILE_UNKNOWN) + if (profile == AV_PROFILE_UNKNOWN) profile = b24->default_profile; switch (profile) { - case FF_PROFILE_ARIB_PROFILE_A: + case AV_PROFILE_ARIB_PROFILE_A: plane_width = 960; plane_height = 540; break; - case FF_PROFILE_ARIB_PROFILE_C: + case AV_PROFILE_ARIB_PROFILE_C: plane_width = 320; plane_height = 180; break; @@ -147,12 +147,12 @@ static int libaribb24_init(AVCodecContext *avctx) { Libaribb24Context *b24 = avctx->priv_data; void(* arib_dec_init)(arib_decoder_t* decoder) = NULL; - int ret_code = AVERROR_EXTERNAL; + int ret; int profile = avctx->profile; if (!(b24->lib_instance = arib_instance_new(avctx))) { av_log(avctx, AV_LOG_ERROR, "Failed to initialize libaribb24!\n"); - goto init_fail; + return AVERROR_EXTERNAL; } if (b24->aribb24_base_path) { @@ -165,46 +165,35 @@ static int libaribb24_init(AVCodecContext *avctx) if (!(b24->parser = arib_get_parser(b24->lib_instance))) { av_log(avctx, AV_LOG_ERROR, "Failed to initialize libaribb24 PES parser!\n"); - goto init_fail; + return AVERROR_EXTERNAL; } if (!(b24->decoder = arib_get_decoder(b24->lib_instance))) { av_log(avctx, AV_LOG_ERROR, "Failed to initialize libaribb24 decoder!\n"); - goto init_fail; + return AVERROR_EXTERNAL; } - if (profile == FF_PROFILE_UNKNOWN) + if (profile == AV_PROFILE_UNKNOWN) profile = b24->default_profile; switch (profile) { - case FF_PROFILE_ARIB_PROFILE_A: + case AV_PROFILE_ARIB_PROFILE_A: arib_dec_init = arib_initialize_decoder_a_profile; break; - case FF_PROFILE_ARIB_PROFILE_C: + case AV_PROFILE_ARIB_PROFILE_C: arib_dec_init = arib_initialize_decoder_c_profile; break; default: av_log(avctx, AV_LOG_ERROR, "Unknown or unsupported profile set!\n"); - ret_code = AVERROR(EINVAL); - goto init_fail; + return AVERROR(EINVAL); } arib_dec_init(b24->decoder); - if (libaribb24_generate_ass_header(avctx) < 0) { - ret_code = AVERROR(ENOMEM); - goto init_fail; - } + ret = libaribb24_generate_ass_header(avctx); + if (ret < 0) + return ret; return 0; - -init_fail: - if (b24->decoder) - arib_finalize_decoder(b24->decoder); - - if (b24->lib_instance) - arib_instance_destroy(b24->lib_instance); - - return ret_code; } static int libaribb24_close(AVCodecContext *avctx) @@ -227,7 +216,7 @@ static int libaribb24_handle_regions(AVCodecContext *avctx, AVSubtitle *sub) Libaribb24Context *b24 = avctx->priv_data; const arib_buf_region_t *region = arib_decoder_get_regions(b24->decoder); unsigned int profile_font_size = get_profile_font_size(avctx); - AVBPrint buf = { 0 }; + AVBPrint buf; int ret = 0; av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED); @@ -390,9 +379,9 @@ static const AVOption options[] = { { "aribb24-skip-ruby-text", "skip ruby text blocks during decoding", OFFSET(aribb24_skip_ruby), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, SD }, { "default_profile", "default profile to use if not specified in the stream parameters", - OFFSET(default_profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, FF_PROFILE_ARIB_PROFILE_C, SD, "profile" }, - {"a", "Profile A", 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_ARIB_PROFILE_A}, INT_MIN, INT_MAX, SD, "profile"}, - {"c", "Profile C", 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_ARIB_PROFILE_C}, INT_MIN, INT_MAX, SD, "profile"}, + OFFSET(default_profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, AV_PROFILE_ARIB_PROFILE_C, SD, "profile" }, + {"a", "Profile A", 0, AV_OPT_TYPE_CONST, {.i64 = AV_PROFILE_ARIB_PROFILE_A}, INT_MIN, INT_MAX, SD, "profile"}, + {"c", "Profile C", 0, AV_OPT_TYPE_CONST, {.i64 = AV_PROFILE_ARIB_PROFILE_C}, INT_MIN, INT_MAX, SD, "profile"}, { NULL } }; @@ -410,7 +399,7 @@ const FFCodec ff_libaribb24_decoder = { .p.id = AV_CODEC_ID_ARIB_CAPTION, .p.priv_class = &aribb24_class, .p.wrapper_name = "libaribb24", - .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_NOT_INIT_THREADSAFE, .priv_data_size = sizeof(Libaribb24Context), .init = libaribb24_init, .close = libaribb24_close, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/libaribcaption.c b/arm/raspi/third_party/ffmpeg/libavcodec/libaribcaption.c index 747ca8a2..8a8c8f8c 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/libaribcaption.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/libaribcaption.c @@ -452,7 +452,7 @@ static int aribcaption_trans_bitmap_subtitle(ARIBCaptionContext *ctx) goto fail; } - if (ctx->avctx->profile == FF_PROFILE_ARIB_PROFILE_C) { + if (ctx->avctx->profile == AV_PROFILE_ARIB_PROFILE_C) { /* ARIB TR-B14 version 3.8 Fascicle 1-(2/2) Volume 3 [Section 4] */ /* No position information is provided for profile C */ rect->x = (ctx->frame_width - rect->w) / 2; @@ -594,7 +594,7 @@ static int aribcaption_trans_ass_subtitle(ARIBCaptionContext *ctx) /* ARIB TR-B14 version 3.8 Fascicle 1-(2/2) Volume 3 [Section 4] */ /* No position information is provided for profile C */ - if (ctx->avctx->profile == FF_PROFILE_ARIB_PROFILE_C) + if (ctx->avctx->profile == AV_PROFILE_ARIB_PROFILE_C) single_rect = true; sub->format = 1; /* text */ @@ -606,7 +606,7 @@ static int aribcaption_trans_ass_subtitle(ARIBCaptionContext *ctx) av_bprint_init(&buf, ARIBC_BPRINT_SIZE_INIT, ARIBC_BPRINT_SIZE_MAX); - if (single_rect && ctx->avctx->profile != FF_PROFILE_ARIB_PROFILE_C) { + if (single_rect && ctx->avctx->profile != AV_PROFILE_ARIB_PROFILE_C) { int x, y, rx, ry; x = ctx->plane_width; y = ctx->plane_height; @@ -660,7 +660,7 @@ static int aribcaption_trans_ass_subtitle(ARIBCaptionContext *ctx) for (int j = 0; j < region->char_count; j++) { aribcc_caption_char_t *ch = ®ion->chars[j]; - if (ctx->avctx->profile != FF_PROFILE_ARIB_PROFILE_C) { + if (ctx->avctx->profile != AV_PROFILE_ARIB_PROFILE_C) { if (ch->char_horizontal_spacing != char_horizontal_spacing) { av_bprintf(&buf, "{\\fsp%d}", (region->is_ruby) ? ch->char_horizontal_spacing / 2 : @@ -960,14 +960,14 @@ static int aribcaption_init(AVCodecContext *avctx) ctx->avctx = avctx; switch (avctx->profile) { - case FF_PROFILE_ARIB_PROFILE_A: + case AV_PROFILE_ARIB_PROFILE_A: profile = ARIBCC_PROFILE_A; /* assume 960x540 at initial state */ ctx->plane_width = 960; ctx->plane_height = 540; ctx->font_size = 36; break; - case FF_PROFILE_ARIB_PROFILE_C: + case AV_PROFILE_ARIB_PROFILE_C: profile = ARIBCC_PROFILE_C; ctx->plane_width = 320; ctx->plane_height = 180; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/libfdk-aacenc.c b/arm/raspi/third_party/ffmpeg/libavcodec/libfdk-aacenc.c index e08c6a0c..d400ac2e 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/libfdk-aacenc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/libfdk-aacenc.c @@ -179,7 +179,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) AACENC_InfoStruct info = { 0 }; CHANNEL_MODE mode; AACENC_ERROR err; - int aot = FF_PROFILE_AAC_LOW + 1; + int aot = AV_PROFILE_AAC_LOW + 1; int sce = 0, cpe = 0; if ((err = aacEncOpen(&s->handle, 0, avctx->ch_layout.nb_channels)) != AACENC_OK) { @@ -188,7 +188,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) goto error; } - if (avctx->profile != FF_PROFILE_UNKNOWN) + if (avctx->profile != AV_PROFILE_UNKNOWN) aot = avctx->profile + 1; if ((err = aacEncoder_SetParam(s->handle, AACENC_AOT, aot)) != AACENC_OK) { @@ -197,7 +197,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) goto error; } - if (aot == FF_PROFILE_AAC_ELD + 1 && s->eld_sbr) { + if (aot == AV_PROFILE_AAC_ELD + 1 && s->eld_sbr) { if ((err = aacEncoder_SetParam(s->handle, AACENC_SBR_MODE, 1)) != AACENC_OK) { av_log(avctx, AV_LOG_ERROR, "Unable to enable SBR for ELD: %s\n", @@ -227,7 +227,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) case 2: #if FDKENC_VER_AT_LEAST(4, 0) // 4.0.0 // (profile + 1) to map from profile range to AOT range - if (aot == FF_PROFILE_AAC_ELD + 1 && s->eld_v2) { + if (aot == AV_PROFILE_AAC_ELD + 1 && s->eld_v2) { if ((err = aacEncoder_SetParam(s->handle, AACENC_CHANNELMODE, 128)) != AACENC_OK) { av_log(avctx, AV_LOG_ERROR, "Unable to enable ELDv2: %s\n", @@ -310,14 +310,14 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) } } else { if (avctx->bit_rate <= 0) { - if (avctx->profile == FF_PROFILE_AAC_HE_V2) { + if (avctx->profile == AV_PROFILE_AAC_HE_V2) { sce = 1; cpe = 0; } avctx->bit_rate = (96*sce + 128*cpe) * avctx->sample_rate / 44; - if (avctx->profile == FF_PROFILE_AAC_HE || - avctx->profile == FF_PROFILE_AAC_HE_V2 || - avctx->profile == FF_PROFILE_MPEG2_AAC_HE || + if (avctx->profile == AV_PROFILE_AAC_HE || + avctx->profile == AV_PROFILE_AAC_HE_V2 || + avctx->profile == AV_PROFILE_MPEG2_AAC_HE || s->eld_sbr) avctx->bit_rate /= 2; } @@ -544,12 +544,12 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, } static const AVProfile profiles[] = { - { FF_PROFILE_AAC_LOW, "LC" }, - { 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 }, + { AV_PROFILE_AAC_LOW, "LC" }, + { AV_PROFILE_AAC_HE, "HE-AAC" }, + { AV_PROFILE_AAC_HE_V2, "HE-AACv2" }, + { AV_PROFILE_AAC_LD, "LD" }, + { AV_PROFILE_AAC_ELD, "ELD" }, + { AV_PROFILE_UNKNOWN }, }; static const FFCodecDefault aac_encode_defaults[] = { diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/libjxldec.c b/arm/raspi/third_party/ffmpeg/libavcodec/libjxldec.c index e45ac02c..002740d9 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/libjxldec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/libjxldec.c @@ -58,6 +58,7 @@ typedef struct LibJxlDecodeContext { int64_t frame_duration; int prev_is_last; AVRational timebase; + AVFrame *frame; } LibJxlDecodeContext; static int libjxl_init_jxl_decoder(AVCodecContext *avctx) @@ -104,6 +105,9 @@ static av_cold int libjxl_decode_init(AVCodecContext *avctx) ctx->avpkt = avctx->internal->in_pkt; ctx->pts = 0; + ctx->frame = av_frame_alloc(); + if (!ctx->frame) + return AVERROR(ENOMEM); return libjxl_init_jxl_decoder(avctx); } @@ -298,7 +302,7 @@ static int libjxl_color_encoding_event(AVCodecContext *avctx, AVFrame *frame) } avctx->color_range = frame->color_range = AVCOL_RANGE_JPEG; - if (ctx->jxl_pixfmt.num_channels >= 3) + if (ctx->basic_info.num_color_channels > 1) avctx->colorspace = AVCOL_SPC_RGB; avctx->color_primaries = AVCOL_PRI_UNSPECIFIED; avctx->color_trc = AVCOL_TRC_UNSPECIFIED; @@ -334,7 +338,7 @@ static int libjxl_color_encoding_event(AVCodecContext *avctx, AVFrame *frame) } /* all colors will be in-gamut so we want accurate colors */ jxl_color.rendering_intent = JXL_RENDERING_INTENT_RELATIVE; - jxl_color.color_space = avctx->colorspace == AVCOL_SPC_RGB ? JXL_COLOR_SPACE_RGB : JXL_COLOR_SPACE_GRAY; + jxl_color.color_space = ctx->basic_info.num_color_channels > 1 ? JXL_COLOR_SPACE_RGB : JXL_COLOR_SPACE_GRAY; jret = JxlDecoderSetPreferredColorProfile(ctx->decoder, &jxl_color); if (jret != JXL_DEC_SUCCESS) { av_log(avctx, AV_LOG_WARNING, "Unable to set fallback color encoding\n"); @@ -406,10 +410,6 @@ static int libjxl_receive_frame(AVCodecContext *avctx, AVFrame *frame) return AVERROR_INVALIDDATA; case JXL_DEC_NEED_MORE_INPUT: av_log(avctx, AV_LOG_DEBUG, "NEED_MORE_INPUT event emitted\n"); - if (!pkt->size) { - av_packet_unref(pkt); - return AVERROR(EAGAIN); - } continue; case JXL_DEC_BASIC_INFO: av_log(avctx, AV_LOG_DEBUG, "BASIC_INFO event emitted\n"); @@ -438,16 +438,19 @@ static int libjxl_receive_frame(AVCodecContext *avctx, AVFrame *frame) continue; case JXL_DEC_COLOR_ENCODING: av_log(avctx, AV_LOG_DEBUG, "COLOR_ENCODING event emitted\n"); - if ((ret = libjxl_color_encoding_event(avctx, frame)) < 0) + ret = libjxl_color_encoding_event(avctx, ctx->frame); + if (ret < 0) return ret; continue; case JXL_DEC_NEED_IMAGE_OUT_BUFFER: av_log(avctx, AV_LOG_DEBUG, "NEED_IMAGE_OUT_BUFFER event emitted\n"); - if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) + ret = ff_get_buffer(avctx, ctx->frame, 0); + if (ret < 0) return ret; - ctx->jxl_pixfmt.align = frame->linesize[0]; - if (JxlDecoderSetImageOutBuffer(ctx->decoder, &ctx->jxl_pixfmt, frame->data[0], frame->buf[0]->size) - != JXL_DEC_SUCCESS) { + ctx->jxl_pixfmt.align = ctx->frame->linesize[0]; + if (JxlDecoderSetImageOutBuffer(ctx->decoder, &ctx->jxl_pixfmt, + ctx->frame->data[0], ctx->frame->buf[0]->size) + != JXL_DEC_SUCCESS) { av_log(avctx, AV_LOG_ERROR, "Bad libjxl dec need image out buffer event\n"); return AVERROR_EXTERNAL; } @@ -461,8 +464,8 @@ static int libjxl_receive_frame(AVCodecContext *avctx, AVFrame *frame) case JXL_DEC_FRAME: av_log(avctx, AV_LOG_DEBUG, "FRAME event emitted\n"); if (!ctx->basic_info.have_animation || ctx->prev_is_last) { - frame->pict_type = AV_PICTURE_TYPE_I; - frame->flags |= AV_FRAME_FLAG_KEY; + ctx->frame->pict_type = AV_PICTURE_TYPE_I; + ctx->frame->flags |= AV_FRAME_FLAG_KEY; } if (ctx->basic_info.have_animation) { JxlFrameHeader header; @@ -481,20 +484,21 @@ static int libjxl_receive_frame(AVCodecContext *avctx, AVFrame *frame) /* full image is one frame, even if animated */ av_log(avctx, AV_LOG_DEBUG, "FULL_IMAGE event emitted\n"); if (ctx->iccp) { - AVFrameSideData *sd = av_frame_new_side_data_from_buf(frame, AV_FRAME_DATA_ICC_PROFILE, ctx->iccp); + AVFrameSideData *sd = av_frame_new_side_data_from_buf(ctx->frame, AV_FRAME_DATA_ICC_PROFILE, ctx->iccp); if (!sd) return AVERROR(ENOMEM); /* ownership is transfered, and it is not ref-ed */ ctx->iccp = NULL; } if (avctx->pkt_timebase.num) { - frame->pts = av_rescale_q(ctx->pts, ctx->timebase, avctx->pkt_timebase); - frame->duration = av_rescale_q(ctx->frame_duration, ctx->timebase, avctx->pkt_timebase); + ctx->frame->pts = av_rescale_q(ctx->pts, ctx->timebase, avctx->pkt_timebase); + ctx->frame->duration = av_rescale_q(ctx->frame_duration, ctx->timebase, avctx->pkt_timebase); } else { - frame->pts = ctx->pts; - frame->duration = ctx->frame_duration; + ctx->frame->pts = ctx->pts; + ctx->frame->duration = ctx->frame_duration; } ctx->pts += ctx->frame_duration; + av_frame_move_ref(frame, ctx->frame); return 0; case JXL_DEC_SUCCESS: av_log(avctx, AV_LOG_DEBUG, "SUCCESS event emitted\n"); @@ -525,6 +529,7 @@ static av_cold int libjxl_decode_close(AVCodecContext *avctx) JxlDecoderDestroy(ctx->decoder); ctx->decoder = NULL; av_buffer_unref(&ctx->iccp); + av_frame_free(&ctx->frame); return 0; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/libkvazaar.c b/arm/raspi/third_party/ffmpeg/libavcodec/libkvazaar.c index 2ef34dd8..0ebf3760 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/libkvazaar.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/libkvazaar.c @@ -221,9 +221,9 @@ static int libkvazaar_encode(AVCodecContext *avctx, frame->width / 2, 0 }; - av_image_copy(dst, dst_linesizes, - (const uint8_t **)frame->data, frame->linesize, - frame->format, frame->width, frame->height); + av_image_copy2(dst, dst_linesizes, + frame->data, frame->linesize, + frame->format, frame->width, frame->height); } input_pic->pts = frame->pts; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/libopenh264dec.c b/arm/raspi/third_party/ffmpeg/libavcodec/libopenh264dec.c index af53219b..7d650ae0 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/libopenh264dec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/libopenh264dec.c @@ -141,7 +141,8 @@ static int svc_decode_frame(AVCodecContext *avctx, AVFrame *avframe, linesize[0] = info.UsrData.sSystemBuffer.iStride[0]; linesize[1] = linesize[2] = info.UsrData.sSystemBuffer.iStride[1]; linesize[3] = 0; - av_image_copy(avframe->data, avframe->linesize, (const uint8_t **) ptrs, linesize, avctx->pix_fmt, avctx->width, avctx->height); + av_image_copy2(avframe->data, avframe->linesize, ptrs, linesize, + avctx->pix_fmt, avctx->width, avctx->height); avframe->pts = info.uiOutYuvTimeStamp; avframe->pkt_dts = AV_NOPTS_VALUE; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/libopenh264enc.c b/arm/raspi/third_party/ffmpeg/libavcodec/libopenh264enc.c index 5b59af6f..f518d089 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/libopenh264enc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/libopenh264enc.c @@ -61,11 +61,11 @@ typedef struct SVCContext { #define DEPRECATED AV_OPT_FLAG_DEPRECATED static const AVOption options[] = { { "loopfilter", "enable loop filter", OFFSET(loopfilter), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE }, - { "profile", "set profile restrictions", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, 0xffff, VE, "profile" }, + { "profile", "set profile restrictions", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, 0xffff, VE, "profile" }, #define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, { .i64 = value }, 0, 0, VE, "profile" - { PROFILE("constrained_baseline", FF_PROFILE_H264_CONSTRAINED_BASELINE) }, - { PROFILE("main", FF_PROFILE_H264_MAIN) }, - { PROFILE("high", FF_PROFILE_H264_HIGH) }, + { PROFILE("constrained_baseline", AV_PROFILE_H264_CONSTRAINED_BASELINE) }, + { PROFILE("main", AV_PROFILE_H264_MAIN) }, + { PROFILE("high", AV_PROFILE_H264_HIGH) }, #undef PROFILE { "max_nal_size", "set maximum NAL size in bytes", OFFSET(max_nal_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE }, { "allow_skip_frames", "allow skipping frames to hit the target bitrate", OFFSET(skip_frames), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, @@ -177,12 +177,12 @@ FF_ENABLE_DEPRECATION_WARNINGS param.iMultipleThreadIdc = avctx->thread_count; /* Allow specifying the libopenh264 profile through AVCodecContext. */ - if (FF_PROFILE_UNKNOWN == s->profile && - FF_PROFILE_UNKNOWN != avctx->profile) + if (AV_PROFILE_UNKNOWN == s->profile && + AV_PROFILE_UNKNOWN != avctx->profile) switch (avctx->profile) { - case FF_PROFILE_H264_HIGH: - case FF_PROFILE_H264_MAIN: - case FF_PROFILE_H264_CONSTRAINED_BASELINE: + case AV_PROFILE_H264_HIGH: + case AV_PROFILE_H264_MAIN: + case AV_PROFILE_H264_CONSTRAINED_BASELINE: s->profile = avctx->profile; break; default: @@ -191,34 +191,34 @@ FF_ENABLE_DEPRECATION_WARNINGS break; } - if (s->profile == FF_PROFILE_UNKNOWN && s->coder >= 0) - s->profile = s->coder == 0 ? FF_PROFILE_H264_CONSTRAINED_BASELINE : + if (s->profile == AV_PROFILE_UNKNOWN && s->coder >= 0) + s->profile = s->coder == 0 ? AV_PROFILE_H264_CONSTRAINED_BASELINE : #if OPENH264_VER_AT_LEAST(1, 8) - FF_PROFILE_H264_HIGH; + AV_PROFILE_H264_HIGH; #else - FF_PROFILE_H264_MAIN; + AV_PROFILE_H264_MAIN; #endif switch (s->profile) { - case FF_PROFILE_H264_HIGH: + case AV_PROFILE_H264_HIGH: av_log(avctx, AV_LOG_VERBOSE, "Using %s, " "select EProfileIdc PRO_HIGH in libopenh264.\n", param.iEntropyCodingModeFlag ? "CABAC" : "CAVLC"); break; - case FF_PROFILE_H264_MAIN: + case AV_PROFILE_H264_MAIN: av_log(avctx, AV_LOG_VERBOSE, "Using %s, " "select EProfileIdc PRO_MAIN in libopenh264.\n", param.iEntropyCodingModeFlag ? "CABAC" : "CAVLC"); break; - case FF_PROFILE_H264_CONSTRAINED_BASELINE: - case FF_PROFILE_UNKNOWN: - s->profile = FF_PROFILE_H264_CONSTRAINED_BASELINE; + case AV_PROFILE_H264_CONSTRAINED_BASELINE: + case AV_PROFILE_UNKNOWN: + s->profile = AV_PROFILE_H264_CONSTRAINED_BASELINE; param.iEntropyCodingModeFlag = 0; av_log(avctx, AV_LOG_VERBOSE, "Using CAVLC, " "select EProfileIdc PRO_BASELINE in libopenh264.\n"); break; default: - s->profile = FF_PROFILE_H264_CONSTRAINED_BASELINE; + s->profile = AV_PROFILE_H264_CONSTRAINED_BASELINE; param.iEntropyCodingModeFlag = 0; av_log(avctx, AV_LOG_WARNING, "Unsupported profile, " "select EProfileIdc PRO_BASELINE in libopenh264.\n"); @@ -353,7 +353,7 @@ FF_ENABLE_DEPRECATION_WARNINGS memcpy(avctx->extradata, fbi.sLayerInfo[0].pBsBuf, size); } - props = ff_add_cpb_side_data(avctx); + props = ff_encode_add_cpb_side_data(avctx); if (!props) return AVERROR(ENOMEM); props->max_bitrate = param.iMaxBitrate; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/libsvtav1.c b/arm/raspi/third_party/ffmpeg/libavcodec/libsvtav1.c index f2b73361..50151692 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/libsvtav1.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/libsvtav1.c @@ -236,10 +236,10 @@ static int config_enc_params(EbSvtAv1EncConfiguration *param, } #endif - if (avctx->profile != FF_PROFILE_UNKNOWN) + if (avctx->profile != AV_PROFILE_UNKNOWN) param->profile = avctx->profile; - if (avctx->level != FF_LEVEL_UNKNOWN) + if (avctx->level != AV_LEVEL_UNKNOWN) param->level = avctx->level; // gop_size == 1 case is handled when encoding each frame by setting @@ -310,12 +310,12 @@ FF_ENABLE_DEPRECATION_WARNINGS } if ((param->encoder_color_format == EB_YUV422 || param->encoder_bit_depth > 10) - && param->profile != FF_PROFILE_AV1_PROFESSIONAL ) { + && param->profile != AV_PROFILE_AV1_PROFESSIONAL ) { av_log(avctx, AV_LOG_WARNING, "Forcing Professional profile\n"); - param->profile = FF_PROFILE_AV1_PROFESSIONAL; - } else if (param->encoder_color_format == EB_YUV444 && param->profile != FF_PROFILE_AV1_HIGH) { + param->profile = AV_PROFILE_AV1_PROFESSIONAL; + } else if (param->encoder_color_format == EB_YUV444 && param->profile != AV_PROFILE_AV1_HIGH) { av_log(avctx, AV_LOG_WARNING, "Forcing High profile\n"); - param->profile = FF_PROFILE_AV1_HIGH; + param->profile = AV_PROFILE_AV1_HIGH; } avctx->bit_rate = param->rate_control_mode > 0 ? @@ -325,7 +325,7 @@ FF_ENABLE_DEPRECATION_WARNINGS FFMAX(avctx->bit_rate, avctx->rc_max_rate) / 1000LL; if (avctx->bit_rate || avctx->rc_max_rate || avctx->rc_buffer_size) { - AVCPBProperties *cpb_props = ff_add_cpb_side_data(avctx); + AVCPBProperties *cpb_props = ff_encode_add_cpb_side_data(avctx); if (!cpb_props) return AVERROR(ENOMEM); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/libvpxdec.c b/arm/raspi/third_party/ffmpeg/libavcodec/libvpxdec.c index f480545a..c6187fd5 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/libvpxdec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/libvpxdec.c @@ -127,26 +127,26 @@ static int set_pix_fmt(AVCodecContext *avctx, struct vpx_image *img, switch (img->fmt) { case VPX_IMG_FMT_I420: if (avctx->codec_id == AV_CODEC_ID_VP9) - avctx->profile = FF_PROFILE_VP9_0; + avctx->profile = AV_PROFILE_VP9_0; avctx->pix_fmt = has_alpha_channel ? AV_PIX_FMT_YUVA420P : AV_PIX_FMT_YUV420P; return 0; #if CONFIG_LIBVPX_VP9_DECODER case VPX_IMG_FMT_I422: - avctx->profile = FF_PROFILE_VP9_1; + avctx->profile = AV_PROFILE_VP9_1; avctx->pix_fmt = AV_PIX_FMT_YUV422P; return 0; case VPX_IMG_FMT_I440: - avctx->profile = FF_PROFILE_VP9_1; + avctx->profile = AV_PROFILE_VP9_1; avctx->pix_fmt = AV_PIX_FMT_YUV440P; return 0; case VPX_IMG_FMT_I444: - avctx->profile = FF_PROFILE_VP9_1; + avctx->profile = AV_PROFILE_VP9_1; avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ? AV_PIX_FMT_GBRP : AV_PIX_FMT_YUV444P; return 0; case VPX_IMG_FMT_I42016: - avctx->profile = FF_PROFILE_VP9_2; + avctx->profile = AV_PROFILE_VP9_2; if (img->bit_depth == 10) { avctx->pix_fmt = AV_PIX_FMT_YUV420P10; return 0; @@ -157,7 +157,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; + avctx->profile = AV_PROFILE_VP9_3; if (img->bit_depth == 10) { avctx->pix_fmt = AV_PIX_FMT_YUV422P10; return 0; @@ -168,7 +168,7 @@ static int set_pix_fmt(AVCodecContext *avctx, struct vpx_image *img, return AVERROR_INVALIDDATA; } case VPX_IMG_FMT_I44016: - avctx->profile = FF_PROFILE_VP9_3; + avctx->profile = AV_PROFILE_VP9_3; if (img->bit_depth == 10) { avctx->pix_fmt = AV_PIX_FMT_YUV440P10; return 0; @@ -179,7 +179,7 @@ static int set_pix_fmt(AVCodecContext *avctx, struct vpx_image *img, return AVERROR_INVALIDDATA; } case VPX_IMG_FMT_I44416: - avctx->profile = FF_PROFILE_VP9_3; + avctx->profile = AV_PROFILE_VP9_3; if (img->bit_depth == 10) { avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ? AV_PIX_FMT_GBRP10 : AV_PIX_FMT_YUV444P10; @@ -317,10 +317,8 @@ static int vpx_decode(AVCodecContext *avctx, AVFrame *picture, return AVERROR(ENOMEM); if (ctx->has_alpha_channel) { picture->buf[1] = av_buffer_ref(img_alpha->fb_priv); - if (!picture->buf[1]) { - av_frame_unref(picture); + if (!picture->buf[1]) return AVERROR(ENOMEM); - } } for (int i = 0; i < 4; i++) { picture->data[i] = planes[i]; @@ -329,8 +327,8 @@ static int vpx_decode(AVCodecContext *avctx, AVFrame *picture, } else { if ((ret = ff_get_buffer(avctx, picture, 0)) < 0) return ret; - av_image_copy(picture->data, picture->linesize, (const uint8_t**)planes, - linesizes, avctx->pix_fmt, img->d_w, img->d_h); + av_image_copy2(picture->data, picture->linesize, planes, + linesizes, avctx->pix_fmt, img->d_w, img->d_h); } *got_frame = 1; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/libvpxenc.c b/arm/raspi/third_party/ffmpeg/libavcodec/libvpxenc.c index 549ac55a..80988a26 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/libvpxenc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/libvpxenc.c @@ -1145,7 +1145,7 @@ static av_cold int vpx_init(AVCodecContext *avctx, /* 0-3: For non-zero values the encoder increasingly optimizes for reduced complexity playback on low powered devices at the expense of encode quality. */ - if (avctx->profile != FF_PROFILE_UNKNOWN) + if (avctx->profile != AV_PROFILE_UNKNOWN) enccfg.g_profile = avctx->profile; enccfg.g_error_resilient = ctx->error_resilient || ctx->flags & VP8F_ERROR_RESILIENT; @@ -1273,7 +1273,7 @@ static av_cold int vpx_init(AVCodecContext *avctx, ctx->rawimg.bit_depth = enccfg.g_bit_depth; #endif - cpb_props = ff_add_cpb_side_data(avctx); + cpb_props = ff_encode_add_cpb_side_data(avctx); if (!cpb_props) return AVERROR(ENOMEM); @@ -1830,7 +1830,7 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket *pkt, duration = frame->duration; else if (avctx->framerate.num > 0 && avctx->framerate.den > 0) duration = av_rescale_q(1, av_inv_q(avctx->framerate), avctx->time_base); - else + else { FF_DISABLE_DEPRECATION_WARNINGS duration = #if FF_API_TICKS_PER_FRAME @@ -1838,6 +1838,7 @@ FF_DISABLE_DEPRECATION_WARNINGS #endif 1; FF_ENABLE_DEPRECATION_WARNINGS + } res = vpx_codec_encode(&ctx->encoder, rawimg, timestamp, duration, flags, ctx->deadline); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/libx264.c b/arm/raspi/third_party/ffmpeg/libavcodec/libx264.c index 774c23da..a505b7eb 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/libx264.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/libx264.c @@ -30,6 +30,7 @@ #include "libavutil/stereo3d.h" #include "libavutil/time.h" #include "libavutil/intreadwrite.h" +#include "libavutil/video_hint.h" #include "avcodec.h" #include "codec_internal.h" #include "encode.h" @@ -48,6 +49,9 @@ // from x264.h, for quant_offsets, Macroblocks are 16x16 // blocks of pixels (with respect to the luma plane) #define MB_SIZE 16 +#define MB_LSIZE 4 +#define MB_FLOOR(x) ((x) >> (MB_LSIZE)) +#define MB_CEIL(x) MB_FLOOR((x) + (MB_SIZE - 1)) typedef struct X264Opaque { #if FF_API_REORDERED_OPAQUE @@ -123,6 +127,8 @@ typedef struct X264Context { * encounter a frame with ROI side data. */ int roi_warned; + + int mb_info; } X264Context; static void X264_log(void *p, int level, const char *fmt, va_list args) @@ -295,6 +301,7 @@ static void free_picture(x264_picture_t *pic) av_free(pic->extra_sei.payloads[i].payload); av_freep(&pic->extra_sei.payloads); av_freep(&pic->prop.quant_offsets); + av_freep(&pic->prop.mb_info); pic->extra_sei.num_payloads = 0; } @@ -320,6 +327,74 @@ static enum AVPixelFormat csp_to_pixfmt(int csp) return AV_PIX_FMT_NONE; } +static void av_always_inline mbinfo_compute_changed_coords(const AVVideoRect *rect, + int *min_x, + int *max_x, + int *min_y, + int *max_y) +{ + *min_y = MB_FLOOR(rect->y); + *max_y = MB_CEIL(rect->y + rect->height); + *min_x = MB_FLOOR(rect->x); + *max_x = MB_CEIL(rect->x + rect->width); +} + +static void av_always_inline mbinfo_compute_constant_coords(const AVVideoRect *rect, + int *min_x, + int *max_x, + int *min_y, + int *max_y) +{ + *min_y = MB_CEIL(rect->y); + *max_y = MB_FLOOR(rect->y + rect->height); + *min_x = MB_CEIL(rect->x); + *max_x = MB_FLOOR(rect->x + rect->width); +} + +static int setup_mb_info(AVCodecContext *ctx, x264_picture_t *pic, + const AVFrame *frame, + const AVVideoHint *info) +{ + int mb_width = (frame->width + MB_SIZE - 1) / MB_SIZE; + int mb_height = (frame->height + MB_SIZE - 1) / MB_SIZE; + + const AVVideoRect *mbinfo_rects; + int nb_rects; + uint8_t *mbinfo; + + mbinfo_rects = (const AVVideoRect *)av_video_hint_rects(info); + nb_rects = info->nb_rects; + + mbinfo = av_calloc(mb_width * mb_height, sizeof(*mbinfo)); + if (!mbinfo) + return AVERROR(ENOMEM); + +#define COMPUTE_MBINFO(mbinfo_filler_, mbinfo_marker_, compute_coords_fn_) \ + memset(mbinfo, mbinfo_filler_, sizeof(*mbinfo) * mb_width * mb_height); \ + \ + for (int i = 0; i < nb_rects; i++) { \ + int min_x, max_x, min_y, max_y; \ + \ + compute_coords_fn_(mbinfo_rects, &min_x, &max_x, &min_y, &max_y); \ + for (int mb_y = min_y; mb_y < max_y; ++mb_y) { \ + memset(mbinfo + mb_y * mb_width + min_x, mbinfo_marker_, max_x - min_x); \ + } \ + \ + mbinfo_rects++; \ + } \ + + if (info->type == AV_VIDEO_HINT_TYPE_CHANGED) { + COMPUTE_MBINFO(X264_MBINFO_CONSTANT, 0, mbinfo_compute_changed_coords); + } else /* if (info->type == AV_VIDEO_HINT_TYPE_CHANGED) */ { + COMPUTE_MBINFO(0, X264_MBINFO_CONSTANT, mbinfo_compute_constant_coords); + } + + pic->prop.mb_info = mbinfo; + pic->prop.mb_info_free = av_free; + + return 0; +} + static int setup_roi(AVCodecContext *ctx, x264_picture_t *pic, int bit_depth, const AVFrame *frame, const uint8_t *data, size_t size) { @@ -404,6 +479,7 @@ static int setup_frame(AVCodecContext *ctx, const AVFrame *frame, int64_t wallclock = 0; int bit_depth, ret; AVFrameSideData *sd; + AVFrameSideData *mbinfo_sd; *ppic = NULL; if (!frame) @@ -495,7 +571,7 @@ FF_ENABLE_DEPRECATION_WARNINGS sei->payloads[0].payload_size = sei_size; sei->payloads[0].payload = sei_data; - sei->payloads[0].payload_type = 4; + sei->payloads[0].payload_type = SEI_TYPE_USER_DATA_REGISTERED_ITU_T_T35; sei->num_payloads = 1; } } @@ -507,6 +583,17 @@ FF_ENABLE_DEPRECATION_WARNINGS goto fail; } + mbinfo_sd = av_frame_get_side_data(frame, AV_FRAME_DATA_VIDEO_HINT); + if (mbinfo_sd) { + int ret = setup_mb_info(ctx, pic, frame, (const AVVideoHint *)mbinfo_sd->data); + if (ret < 0) { + /* No need to fail here, this is not fatal. We just proceed with no + * mb_info and log a message */ + + av_log(ctx, AV_LOG_WARNING, "setup_mb_info failed with error: %s\n", av_err2str(ret)); + } + } + if (x4->udu_sei) { for (int j = 0; j < frame->nb_side_data; j++) { AVFrameSideData *side_data = frame->side_data[j]; @@ -977,22 +1064,22 @@ static av_cold int X264_init(AVCodecContext *avctx) /* Allow specifying the x264 profile through AVCodecContext. */ if (!x4->profile) switch (avctx->profile) { - case FF_PROFILE_H264_BASELINE: + case AV_PROFILE_H264_BASELINE: x4->profile = "baseline"; break; - case FF_PROFILE_H264_HIGH: + case AV_PROFILE_H264_HIGH: x4->profile = "high"; break; - case FF_PROFILE_H264_HIGH_10: + case AV_PROFILE_H264_HIGH_10: x4->profile = "high10"; break; - case FF_PROFILE_H264_HIGH_422: + case AV_PROFILE_H264_HIGH_422: x4->profile = "high422"; break; - case FF_PROFILE_H264_HIGH_444: + case AV_PROFILE_H264_HIGH_444: x4->profile = "high444"; break; - case FF_PROFILE_H264_MAIN: + case AV_PROFILE_H264_MAIN: x4->profile = "main"; break; default: @@ -1118,6 +1205,8 @@ FF_ENABLE_DEPRECATION_WARNINGS } } + x4->params.analyse.b_mb_info = x4->mb_info; + // update AVCodecContext with x264 parameters avctx->has_b_frames = x4->params.i_bframe ? x4->params.i_bframe_pyramid ? 2 : 1 : 0; @@ -1157,7 +1246,7 @@ FF_ENABLE_DEPRECATION_WARNINGS avctx->extradata_size = p - avctx->extradata; } - cpb_props = ff_add_cpb_side_data(avctx); + cpb_props = ff_encode_add_cpb_side_data(avctx); if (!cpb_props) return AVERROR(ENOMEM); cpb_props->buffer_size = x4->params.rc.i_vbv_buffer_size * 1000; @@ -1327,6 +1416,7 @@ static const AVOption options[] = { { "noise_reduction", "Noise reduction", OFFSET(noise_reduction), AV_OPT_TYPE_INT, { .i64 = -1 }, INT_MIN, INT_MAX, VE }, { "udu_sei", "Use user data unregistered SEI if available", OFFSET(udu_sei), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, { "x264-params", "Override the x264 configuration using a :-separated list of key=value parameters", OFFSET(x264_params), AV_OPT_TYPE_DICT, { 0 }, 0, 0, VE }, + { "mb_info", "Set mb_info data through AVSideData, only useful when used from the API", OFFSET(mb_info), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, { NULL }, }; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/libx265.c b/arm/raspi/third_party/ffmpeg/libavcodec/libx265.c index 873b3021..447e6da2 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/libx265.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/libx265.c @@ -395,7 +395,7 @@ FF_ENABLE_DEPRECATION_WARNINGS ctx->params->rc.vbvBufferSize = avctx->rc_buffer_size / 1000; ctx->params->rc.vbvMaxBitrate = avctx->rc_max_rate / 1000; - cpb_props = ff_add_cpb_side_data(avctx); + cpb_props = ff_encode_add_cpb_side_data(avctx); if (!cpb_props) return AVERROR(ENOMEM); cpb_props->buffer_size = ctx->params->rc.vbvBufferSize * 1000; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/magicyuv.c b/arm/raspi/third_party/ffmpeg/libavcodec/magicyuv.c index 7898cd5b..3573db0f 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/magicyuv.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/magicyuv.c @@ -34,6 +34,8 @@ #include "lossless_videodsp.h" #include "thread.h" +#define VLC_BITS 12 + typedef struct Slice { uint32_t start; uint32_t size; @@ -67,15 +69,20 @@ typedef struct MagicYUVContext { Slice *slices[4]; // slice bitstream positions for each plane unsigned int slices_size[4]; // slice sizes for each plane VLC vlc[4]; // VLC for each plane + VLC_MULTI multi[4]; // Buffer for joint VLC data int (*magy_decode_slice)(AVCodecContext *avctx, void *tdata, int j, int threadnr); LLVidDSPContext llviddsp; + HuffEntry he[1 << 14]; + uint8_t len[1 << 14]; } MagicYUVContext; -static int huff_build(const uint8_t len[], uint16_t codes_pos[33], - VLC *vlc, int nb_elems, void *logctx) +static int huff_build(AVCodecContext *avctx, + const uint8_t len[], uint16_t codes_pos[33], + VLC *vlc, VLC_MULTI *multi, int nb_elems, void *logctx) { - HuffEntry he[4096]; + MagicYUVContext *s = avctx->priv_data; + HuffEntry *he = s->he; for (int i = 31; i > 0; i--) codes_pos[i] += codes_pos[i + 1]; @@ -83,8 +90,9 @@ static int huff_build(const uint8_t len[], uint16_t codes_pos[33], for (unsigned i = nb_elems; i-- > 0;) he[--codes_pos[len[i]]] = (HuffEntry){ len[i], i }; - ff_free_vlc(vlc); - return ff_init_vlc_from_lengths(vlc, FFMIN(he[0].len, 12), nb_elems, + ff_vlc_free(vlc); + ff_vlc_free_multi(multi); + return ff_vlc_init_multi_from_lengths(vlc, multi, FFMIN(he[0].len, VLC_BITS), nb_elems, nb_elems, &he[0].len, sizeof(he[0]), &he[0].sym, sizeof(he[0]), sizeof(he[0].sym), 0, 0, logctx); @@ -111,6 +119,22 @@ static void magicyuv_median_pred16(uint16_t *dst, const uint16_t *src1, *left_top = lt; } +#define READ_PLANE(dst, plane, b, c) \ +{ \ + x = 0; \ + for (; CACHED_BITSTREAM_READER && x < width-c && get_bits_left(&gb) > 0;) {\ + ret = get_vlc_multi(&gb, (uint8_t *)dst + x * b, multi, \ + vlc, vlc_bits, 3); \ + if (ret > 0) \ + x += ret; \ + if (ret <= 0) \ + return AVERROR_INVALIDDATA; \ + } \ + for (; x < width && get_bits_left(&gb) > 0; x++) \ + dst[x] = get_vlc2(&gb, vlc, vlc_bits, 3); \ + dst += stride; \ +} + static int magy_decode_slice10(AVCodecContext *avctx, void *tdata, int j, int threadnr) { @@ -130,6 +154,9 @@ static int magy_decode_slice10(AVCodecContext *avctx, void *tdata, int sheight = AV_CEIL_RSHIFT(s->slice_height, s->vshift[i]); ptrdiff_t fake_stride = (p->linesize[i] / 2) * (1 + interlaced); ptrdiff_t stride = p->linesize[i] / 2; + const VLC_MULTI_ELEM *const multi = s->multi[i].table; + const VLCElem *const vlc = s->vlc[i].table; + const int vlc_bits = s->vlc[i].bits; int flags, pred; int ret = init_get_bits8(&gb, s->buf + s->slices[i][j].start, s->slices[i][j].size); @@ -151,20 +178,8 @@ static int magy_decode_slice10(AVCodecContext *avctx, void *tdata, dst += stride; } } else { - for (k = 0; k < height; k++) { - for (x = 0; x < width; x++) { - int pix; - if (get_bits_left(&gb) <= 0) - return AVERROR_INVALIDDATA; - - pix = get_vlc2(&gb, s->vlc[i].table, s->vlc[i].bits, 3); - if (pix < 0) - return AVERROR_INVALIDDATA; - - dst[x] = pix; - } - dst += stride; - } + for (k = 0; k < height; k++) + READ_PLANE(dst, i, 2, 3) } switch (pred) { @@ -261,6 +276,9 @@ static int magy_decode_slice(AVCodecContext *avctx, void *tdata, ptrdiff_t fake_stride = p->linesize[i] * (1 + interlaced); ptrdiff_t stride = p->linesize[i]; const uint8_t *slice = s->buf + s->slices[i][j].start; + const VLC_MULTI_ELEM *const multi = s->multi[i].table; + const VLCElem *const vlc = s->vlc[i].table; + const int vlc_bits = s->vlc[i].bits; int flags, pred; flags = bytestream_get_byte(&slice); @@ -280,20 +298,8 @@ static int magy_decode_slice(AVCodecContext *avctx, void *tdata, if (ret < 0) return ret; - for (k = 0; k < height; k++) { - for (x = 0; x < width; x++) { - int pix; - if (get_bits_left(&gb) <= 0) - return AVERROR_INVALIDDATA; - - pix = get_vlc2(&gb, s->vlc[i].table, s->vlc[i].bits, 3); - if (pix < 0) - return AVERROR_INVALIDDATA; - - dst[x] = pix; - } - dst += stride; - } + for (k = 0; k < height; k++) + READ_PLANE(dst, i, 1, 5) } switch (pred) { @@ -379,7 +385,7 @@ static int build_huffman(AVCodecContext *avctx, const uint8_t *table, { MagicYUVContext *s = avctx->priv_data; GetByteContext gb; - uint8_t len[4096]; + uint8_t *len = s->len; uint16_t length_count[33] = { 0 }; int i = 0, j = 0, k; @@ -407,7 +413,7 @@ static int build_huffman(AVCodecContext *avctx, const uint8_t *table, if (j == max) { j = 0; - if (huff_build(len, length_count, &s->vlc[i], max, avctx)) { + if (huff_build(avctx, len, length_count, &s->vlc[i], &s->multi[i], max, avctx)) { av_log(avctx, AV_LOG_ERROR, "Cannot build Huffman codes\n"); return AVERROR_INVALIDDATA; } @@ -524,6 +530,16 @@ static int magy_decode_frame(AVCodecContext *avctx, AVFrame *p, s->decorrelate = 1; s->bps = 12; break; + case 0x71: + avctx->pix_fmt = AV_PIX_FMT_GBRP14; + s->decorrelate = 1; + s->bps = 14; + break; + case 0x72: + avctx->pix_fmt = AV_PIX_FMT_GBRAP14; + s->decorrelate = 1; + s->bps = 14; + break; case 0x73: avctx->pix_fmt = AV_PIX_FMT_GRAY10; s->bps = 10; @@ -651,7 +667,9 @@ static int magy_decode_frame(AVCodecContext *avctx, AVFrame *p, avctx->pix_fmt == AV_PIX_FMT_GBRP10 || avctx->pix_fmt == AV_PIX_FMT_GBRAP10|| avctx->pix_fmt == AV_PIX_FMT_GBRAP12|| - avctx->pix_fmt == AV_PIX_FMT_GBRP12) { + avctx->pix_fmt == AV_PIX_FMT_GBRAP14|| + avctx->pix_fmt == AV_PIX_FMT_GBRP12|| + avctx->pix_fmt == AV_PIX_FMT_GBRP14) { FFSWAP(uint8_t*, p->data[0], p->data[1]); FFSWAP(int, p->linesize[0], p->linesize[1]); } else { @@ -686,7 +704,8 @@ static av_cold int magy_decode_end(AVCodecContext *avctx) for (i = 0; i < FF_ARRAY_ELEMS(s->slices); i++) { av_freep(&s->slices[i]); s->slices_size[i] = 0; - ff_free_vlc(&s->vlc[i]); + ff_vlc_free(&s->vlc[i]); + ff_vlc_free_multi(&s->multi[i]); } return 0; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/magicyuvenc.c b/arm/raspi/third_party/ffmpeg/libavcodec/magicyuvenc.c index 082e2846..ccd6a549 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/magicyuvenc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/magicyuvenc.c @@ -53,10 +53,17 @@ typedef struct PTable { int64_t prob; ///< number of occurences of this value in input } PTable; +typedef struct Slice { + unsigned pos; + unsigned size; + uint8_t *slice; + uint8_t *bitslice; + PTable counts[256]; +} Slice; + typedef struct MagicYUVContext { const AVClass *class; int frame_pred; - PutBitContext pb; int planes; uint8_t format; int slice_height; @@ -64,14 +71,9 @@ typedef struct MagicYUVContext { int correlate; int hshift[4]; int vshift[4]; - uint8_t **slices; - uint8_t **bitslices; unsigned bitslice_size; - unsigned *slice_pos; - unsigned *slice_size; - unsigned tables_size; - PTable *counts; uint8_t *decorrelate_buf[2]; + Slice *slices; HuffEntry he[4][256]; LLVidEncDSPContext llvidencdsp; void (*predict)(struct MagicYUVContext *s, const uint8_t *src, uint8_t *dst, @@ -194,12 +196,6 @@ static av_cold int magy_encode_init(AVCodecContext *avctx) s->format = 0x6b; break; } - if (s->correlate) { - s->decorrelate_buf[0] = av_calloc(2U * avctx->height, FFALIGN(avctx->width, 16)); - if (!s->decorrelate_buf[0]) - return AVERROR(ENOMEM); - s->decorrelate_buf[1] = s->decorrelate_buf[0] + avctx->height * FFALIGN(avctx->width, 16); - } ff_llvidencdsp_init(&s->llvidencdsp); @@ -209,21 +205,27 @@ static av_cold int magy_encode_init(AVCodecContext *avctx) s->nb_slices = FFMIN(s->nb_slices, avctx->height >> s->vshift[1]); s->nb_slices = FFMAX(1, s->nb_slices); s->slice_height = FFALIGN((avctx->height + s->nb_slices - 1) / s->nb_slices, 1 << s->vshift[1]); - s->slice_pos = av_calloc(s->nb_slices * s->planes, sizeof(*s->slice_pos)); - s->slice_size = av_calloc(s->nb_slices * s->planes, sizeof(*s->slice_size)); + s->nb_slices = (avctx->height + s->slice_height - 1) / s->slice_height; s->slices = av_calloc(s->nb_slices * s->planes, sizeof(*s->slices)); - s->bitslices = av_calloc(s->nb_slices * s->planes, sizeof(*s->bitslices)); - s->counts = av_calloc(s->nb_slices * s->planes * 256, sizeof(*s->counts)); - if (!s->slices || !s->slice_pos || !s->counts || !s->slice_size) + if (!s->slices) return AVERROR(ENOMEM); - s->bitslice_size = avctx->width * (s->slice_height + 2) + AV_INPUT_BUFFER_PADDING_SIZE; + if (s->correlate) { + s->decorrelate_buf[0] = av_calloc(2U * (s->nb_slices * s->slice_height), FFALIGN(avctx->width, av_cpu_max_align())); + if (!s->decorrelate_buf[0]) + return AVERROR(ENOMEM); + s->decorrelate_buf[1] = s->decorrelate_buf[0] + (s->nb_slices * s->slice_height) * FFALIGN(avctx->width, av_cpu_max_align()); + } + + s->bitslice_size = avctx->width * s->slice_height + 2; for (int n = 0; n < s->nb_slices; n++) { for (int i = 0; i < s->planes; i++) { - s->bitslices[n * s->planes + i] = av_malloc(s->bitslice_size); - s->slices[n * s->planes + i] = av_malloc(avctx->width * (s->slice_height + 2) + + Slice *sl = &s->slices[n * s->planes + i]; + + sl->bitslice = av_malloc(s->bitslice_size + AV_INPUT_BUFFER_PADDING_SIZE); + sl->slice = av_malloc(avctx->width * (s->slice_height + 2) + AV_INPUT_BUFFER_PADDING_SIZE); - if (!s->slices[n * s->planes + i] || !s->bitslices[n * s->planes + i]) { + if (!sl->slice || !sl->bitslice) { av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer.\n"); return AVERROR(ENOMEM); } @@ -370,10 +372,11 @@ static void magy_huffman_compute_bits(PTable *prob_table, HuffEntry *distincts, static int count_plane_slice(AVCodecContext *avctx, int n, int plane) { MagicYUVContext *s = avctx->priv_data; - const uint8_t *dst = s->slices[n * s->planes + plane]; - PTable *counts = s->counts + 256 * (n * s->planes + plane); + Slice *sl = &s->slices[n * s->planes + plane]; + const uint8_t *dst = sl->slice; + PTable *counts = sl->counts; - memset(counts, 0, sizeof(*counts) * 256); + memset(counts, 0, sizeof(sl->counts)); count_usage(dst, AV_CEIL_RSHIFT(avctx->width, s->hshift[plane]), AV_CEIL_RSHIFT(s->slice_height, s->vshift[plane]), counts); @@ -389,7 +392,8 @@ static int encode_table(AVCodecContext *avctx, uint16_t codes_counts[33] = { 0 }; for (int n = 0; n < s->nb_slices; n++) { - PTable *slice_counts = s->counts + 256 * (n * s->planes + plane); + Slice *sl = &s->slices[n * s->planes + plane]; + PTable *slice_counts = sl->counts; for (int i = 0; i < 256; i++) counts[i].prob = slice_counts[i].prob; @@ -412,11 +416,28 @@ static int encode_table(AVCodecContext *avctx, return 0; } -static int encode_plane_slice(uint8_t *src, uint8_t *dst, int dst_size, +static int encode_plane_slice_raw(const uint8_t *src, uint8_t *dst, unsigned dst_size, + int width, int height, int prediction) +{ + unsigned count = width * height; + + dst[0] = 1; + dst[1] = prediction; + + memcpy(dst + 2, src, count); + count += 2; + AV_WN32(dst + count, 0); + if (count & 3) + count += 4 - (count & 3); + + return count; +} + +static int encode_plane_slice(const uint8_t *src, uint8_t *dst, unsigned dst_size, int width, int height, HuffEntry *he, int prediction) { + const uint8_t *osrc = src; PutBitContext pb; - int i, j; int count; init_put_bits(&pb, dst, dst_size); @@ -424,10 +445,13 @@ static int encode_plane_slice(uint8_t *src, uint8_t *dst, int dst_size, put_bits(&pb, 8, 0); put_bits(&pb, 8, prediction); - for (j = 0; j < height; j++) { - for (i = 0; i < width; i++) { + for (int j = 0; j < height; j++) { + for (int i = 0; i < width; i++) { const int idx = src[i]; - put_bits(&pb, he[idx].len, he[idx].code); + const int len = he[idx].len; + if (put_bits_left(&pb) < len + 32) + return encode_plane_slice_raw(osrc, dst, dst_size, width, height, prediction); + put_bits(&pb, len, he[idx].code); } src += width; @@ -450,16 +474,14 @@ static int encode_slice(AVCodecContext *avctx, void *tdata, const int slice_height = s->slice_height; const int last_height = FFMIN(slice_height, avctx->height - n * slice_height); const int height = (n < (s->nb_slices - 1)) ? slice_height : last_height; - PutByteContext pb; for (int i = 0; i < s->planes; i++) { - bytestream2_init_writer(&pb, s->bitslices[n + s->planes + i], - s->bitslice_size); + Slice *sl = &s->slices[n * s->planes + i]; - s->slice_size[n * s->planes + i] = - encode_plane_slice(s->slices[n * s->planes + i], - s->bitslices[n * s->planes + i], - bytestream2_get_bytes_left_p(&pb), + sl->size = + encode_plane_slice(sl->slice, + sl->bitslice, + s->bitslice_size, AV_CEIL_RSHIFT(avctx->width, s->hshift[i]), AV_CEIL_RSHIFT(height, s->vshift[i]), s->he[i], s->frame_pred); @@ -471,7 +493,7 @@ static int encode_slice(AVCodecContext *avctx, void *tdata, static int predict_slice(AVCodecContext *avctx, void *tdata, int n, int threadnr) { - const int aligned_width = FFALIGN(avctx->width, 16); + const int aligned_width = FFALIGN(avctx->width, av_cpu_max_align()); MagicYUVContext *s = avctx->priv_data; const int slice_height = s->slice_height; const int last_height = FFMIN(slice_height, avctx->height - n * slice_height); @@ -484,7 +506,7 @@ static int predict_slice(AVCodecContext *avctx, void *tdata, s->decorrelate_buf[1] + n * slice_height * aligned_width }; const int decorrelate_linesize = aligned_width; const uint8_t *const data[4] = { decorrelated[0], frame->data[0] + n * slice_height * frame->linesize[0], - decorrelated[1], frame->data[3] + n * slice_height * frame->linesize[3] }; + decorrelated[1], s->planes == 4 ? frame->data[3] + n * slice_height * frame->linesize[3] : NULL }; const uint8_t *r, *g, *b; const int linesize[4] = { decorrelate_linesize, frame->linesize[0], decorrelate_linesize, frame->linesize[3] }; @@ -493,7 +515,7 @@ static int predict_slice(AVCodecContext *avctx, void *tdata, b = frame->data[1] + n * slice_height * frame->linesize[1]; r = frame->data[2] + n * slice_height * frame->linesize[2]; - for (int i = 0; i < slice_height; i++) { + for (int i = 0; i < height; i++) { s->llvidencdsp.diff_bytes(decorrelated[0], b, g, width); s->llvidencdsp.diff_bytes(decorrelated[1], r, g, width); g += frame->linesize[0]; @@ -504,13 +526,17 @@ static int predict_slice(AVCodecContext *avctx, void *tdata, } for (int i = 0; i < s->planes; i++) { - s->predict(s, data[i], s->slices[n * s->planes + i], linesize[i], + Slice *sl = &s->slices[n * s->planes + i]; + + s->predict(s, data[i], sl->slice, linesize[i], frame->width, height); } } else { for (int i = 0; i < s->planes; i++) { + Slice *sl = &s->slices[n * s->planes + i]; + s->predict(s, frame->data[i] + n * (slice_height >> s->vshift[i]) * frame->linesize[i], - s->slices[n * s->planes + i], + sl->slice, frame->linesize[i], AV_CEIL_RSHIFT(frame->width, s->hshift[i]), AV_CEIL_RSHIFT(height, s->vshift[i])); @@ -527,9 +553,11 @@ static int magy_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet) { MagicYUVContext *s = avctx->priv_data; - PutByteContext pb; const int width = avctx->width, height = avctx->height; const int slice_height = s->slice_height; + unsigned tables_size; + PutBitContext pbit; + PutByteContext pb; int pos, ret = 0; ret = ff_alloc_packet(avctx, pkt, (256 + 4 * s->nb_slices + width * height) * @@ -571,31 +599,35 @@ static int magy_encode_frame(AVCodecContext *avctx, AVPacket *pkt, avctx->execute2(avctx, predict_slice, (void *)frame, NULL, s->nb_slices); - init_put_bits(&s->pb, pkt->data + bytestream2_tell_p(&pb), bytestream2_get_bytes_left_p(&pb)); + init_put_bits(&pbit, pkt->data + bytestream2_tell_p(&pb), bytestream2_get_bytes_left_p(&pb)); for (int i = 0; i < s->planes; i++) - encode_table(avctx, &s->pb, s->he[i], i); + encode_table(avctx, &pbit, s->he[i], i); - s->tables_size = put_bytes_count(&s->pb, 1); - bytestream2_skip_p(&pb, s->tables_size); + tables_size = put_bytes_count(&pbit, 1); + bytestream2_skip_p(&pb, tables_size); avctx->execute2(avctx, encode_slice, NULL, NULL, s->nb_slices); for (int n = 0; n < s->nb_slices; n++) { for (int i = 0; i < s->planes; i++) { - s->slice_pos[n * s->planes + i] = bytestream2_tell_p(&pb); + Slice *sl = &s->slices[n * s->planes + i]; - bytestream2_put_buffer(&pb, s->bitslices[n * s->planes + i], - s->slice_size[n * s->planes + i]); + sl->pos = bytestream2_tell_p(&pb); + + bytestream2_put_buffer(&pb, sl->bitslice, sl->size); } } pos = bytestream2_tell_p(&pb); bytestream2_seek_p(&pb, 32, SEEK_SET); - bytestream2_put_le32(&pb, s->slice_pos[0] - 32); + bytestream2_put_le32(&pb, s->slices[0].pos - 32); for (int i = 0; i < s->planes; i++) { - for (int n = 0; n < s->nb_slices; n++) - bytestream2_put_le32(&pb, s->slice_pos[n * s->planes + i] - 32); + for (int n = 0; n < s->nb_slices; n++) { + Slice *sl = &s->slices[n * s->planes + i]; + + bytestream2_put_le32(&pb, sl->pos - 32); + } } bytestream2_seek_p(&pb, pos, SEEK_SET); @@ -610,15 +642,13 @@ static av_cold int magy_encode_close(AVCodecContext *avctx) { MagicYUVContext *s = avctx->priv_data; - av_freep(&s->slice_pos); - av_freep(&s->slice_size); - for (int i = 0; i < s->planes * s->nb_slices && s->slices; i++) - av_freep(&s->slices[i]); - for (int i = 0; i < s->planes * s->nb_slices && s->bitslices; i++) - av_freep(&s->bitslices[i]); - av_freep(&s->counts); + for (int i = 0; i < s->planes * s->nb_slices && s->slices; i++) { + Slice *sl = &s->slices[i]; + + av_freep(&sl->slice); + av_freep(&sl->bitslice); + } av_freep(&s->slices); - av_freep(&s->bitslices); av_freep(&s->decorrelate_buf); return 0; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/mediacodec_wrapper.c b/arm/raspi/third_party/ffmpeg/libavcodec/mediacodec_wrapper.c index eb69ad7e..0880ddd3 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/mediacodec_wrapper.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/mediacodec_wrapper.c @@ -365,82 +365,82 @@ int ff_AMediaCodecProfile_getProfileFromAVCodecContext(AVCodecContext *avctx) if (avctx->codec_id == AV_CODEC_ID_H264) { switch(avctx->profile) { - case FF_PROFILE_H264_BASELINE: + case AV_PROFILE_H264_BASELINE: return AVCProfileBaseline; - case FF_PROFILE_H264_CONSTRAINED_BASELINE: + case AV_PROFILE_H264_CONSTRAINED_BASELINE: return AVCProfileConstrainedBaseline; - case FF_PROFILE_H264_MAIN: + case AV_PROFILE_H264_MAIN: return AVCProfileMain; break; - case FF_PROFILE_H264_EXTENDED: + case AV_PROFILE_H264_EXTENDED: return AVCProfileExtended; - case FF_PROFILE_H264_HIGH: + case AV_PROFILE_H264_HIGH: return AVCProfileHigh; - case FF_PROFILE_H264_HIGH_10: - case FF_PROFILE_H264_HIGH_10_INTRA: + case AV_PROFILE_H264_HIGH_10: + case AV_PROFILE_H264_HIGH_10_INTRA: return AVCProfileHigh10; - case FF_PROFILE_H264_HIGH_422: - case FF_PROFILE_H264_HIGH_422_INTRA: + case AV_PROFILE_H264_HIGH_422: + case AV_PROFILE_H264_HIGH_422_INTRA: return AVCProfileHigh422; - case FF_PROFILE_H264_HIGH_444: - case FF_PROFILE_H264_HIGH_444_INTRA: - case FF_PROFILE_H264_HIGH_444_PREDICTIVE: + case AV_PROFILE_H264_HIGH_444: + case AV_PROFILE_H264_HIGH_444_INTRA: + case AV_PROFILE_H264_HIGH_444_PREDICTIVE: return AVCProfileHigh444; } } else if (avctx->codec_id == AV_CODEC_ID_HEVC) { switch (avctx->profile) { - case FF_PROFILE_HEVC_MAIN: + case AV_PROFILE_HEVC_MAIN: return HEVCProfileMain; - case FF_PROFILE_HEVC_MAIN_STILL_PICTURE: + case AV_PROFILE_HEVC_MAIN_STILL_PICTURE: return HEVCProfileMainStill; - case FF_PROFILE_HEVC_MAIN_10: + case AV_PROFILE_HEVC_MAIN_10: return HEVCProfileMain10; } } else if (avctx->codec_id == AV_CODEC_ID_VP9) { switch (avctx->profile) { - case FF_PROFILE_VP9_0: + case AV_PROFILE_VP9_0: return VP9Profile0; - case FF_PROFILE_VP9_1: + case AV_PROFILE_VP9_1: return VP9Profile1; - case FF_PROFILE_VP9_2: + case AV_PROFILE_VP9_2: return VP9Profile2; - case FF_PROFILE_VP9_3: + case AV_PROFILE_VP9_3: return VP9Profile3; } } else if(avctx->codec_id == AV_CODEC_ID_MPEG4) { switch (avctx->profile) { - case FF_PROFILE_MPEG4_SIMPLE: + case AV_PROFILE_MPEG4_SIMPLE: return MPEG4ProfileSimple; - case FF_PROFILE_MPEG4_SIMPLE_SCALABLE: + case AV_PROFILE_MPEG4_SIMPLE_SCALABLE: return MPEG4ProfileSimpleScalable; - case FF_PROFILE_MPEG4_CORE: + case AV_PROFILE_MPEG4_CORE: return MPEG4ProfileCore; - case FF_PROFILE_MPEG4_MAIN: + case AV_PROFILE_MPEG4_MAIN: return MPEG4ProfileMain; - case FF_PROFILE_MPEG4_N_BIT: + case AV_PROFILE_MPEG4_N_BIT: return MPEG4ProfileNbit; - case FF_PROFILE_MPEG4_SCALABLE_TEXTURE: + case AV_PROFILE_MPEG4_SCALABLE_TEXTURE: return MPEG4ProfileScalableTexture; - case FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION: + case AV_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION: return MPEG4ProfileSimpleFBA; - case FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE: + case AV_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE: return MPEG4ProfileBasicAnimated; - case FF_PROFILE_MPEG4_HYBRID: + case AV_PROFILE_MPEG4_HYBRID: return MPEG4ProfileHybrid; - case FF_PROFILE_MPEG4_ADVANCED_REAL_TIME: + case AV_PROFILE_MPEG4_ADVANCED_REAL_TIME: return MPEG4ProfileAdvancedRealTime; - case FF_PROFILE_MPEG4_CORE_SCALABLE: + case AV_PROFILE_MPEG4_CORE_SCALABLE: return MPEG4ProfileCoreScalable; - case FF_PROFILE_MPEG4_ADVANCED_CODING: + case AV_PROFILE_MPEG4_ADVANCED_CODING: return MPEG4ProfileAdvancedCoding; - case FF_PROFILE_MPEG4_ADVANCED_CORE: + case AV_PROFILE_MPEG4_ADVANCED_CORE: return MPEG4ProfileAdvancedCore; - case FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE: + case AV_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE: return MPEG4ProfileAdvancedScalable; - case FF_PROFILE_MPEG4_ADVANCED_SIMPLE: + case AV_PROFILE_MPEG4_ADVANCED_SIMPLE: return MPEG4ProfileAdvancedSimple; - case FF_PROFILE_MPEG4_SIMPLE_STUDIO: + case AV_PROFILE_MPEG4_SIMPLE_STUDIO: // Studio profiles are not supported by mediacodec. default: break; @@ -448,10 +448,10 @@ int ff_AMediaCodecProfile_getProfileFromAVCodecContext(AVCodecContext *avctx) } else if(avctx->codec_id == AV_CODEC_ID_AV1) { switch (avctx->profile) { - case FF_PROFILE_AV1_MAIN: + case AV_PROFILE_AV1_MAIN: return AV1ProfileMain8; - case FF_PROFILE_AV1_HIGH: - case FF_PROFILE_AV1_PROFESSIONAL: + case AV_PROFILE_AV1_HIGH: + case AV_PROFILE_AV1_PROFESSIONAL: default: break; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/mediacodecenc.c b/arm/raspi/third_party/ffmpeg/libavcodec/mediacodecenc.c index 1da705d1..a1ae5d5e 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/mediacodecenc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/mediacodecenc.c @@ -428,9 +428,6 @@ static void copy_frame_to_buffer(AVCodecContext *avctx, const AVFrame *frame, ui MediaCodecEncContext *s = avctx->priv_data; uint8_t *dst_data[4] = {}; int dst_linesize[4] = {}; - const uint8_t *src_data[4] = { - frame->data[0], frame->data[1], frame->data[2], frame->data[3] - }; if (avctx->pix_fmt == AV_PIX_FMT_YUV420P) { dst_data[0] = dst; @@ -449,8 +446,8 @@ static void copy_frame_to_buffer(AVCodecContext *avctx, const AVFrame *frame, ui av_assert0(0); } - av_image_copy(dst_data, dst_linesize, src_data, frame->linesize, - avctx->pix_fmt, avctx->width, avctx->height); + av_image_copy2(dst_data, dst_linesize, frame->data, frame->linesize, + avctx->pix_fmt, avctx->width, avctx->height); } static int mediacodec_send(AVCodecContext *avctx, @@ -660,14 +657,14 @@ enum MediaCodecAvcLevel { static const AVOption h264_options[] = { COMMON_OPTION - FF_AVCTX_PROFILE_OPTION("baseline", NULL, VIDEO, FF_PROFILE_H264_BASELINE) - FF_AVCTX_PROFILE_OPTION("constrained_baseline", NULL, VIDEO, FF_PROFILE_H264_CONSTRAINED_BASELINE) - FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, FF_PROFILE_H264_MAIN) - FF_AVCTX_PROFILE_OPTION("extended", NULL, VIDEO, FF_PROFILE_H264_EXTENDED) - FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, FF_PROFILE_H264_HIGH) - FF_AVCTX_PROFILE_OPTION("high10", NULL, VIDEO, FF_PROFILE_H264_HIGH_10) - FF_AVCTX_PROFILE_OPTION("high422", NULL, VIDEO, FF_PROFILE_H264_HIGH_422) - FF_AVCTX_PROFILE_OPTION("high444", NULL, VIDEO, FF_PROFILE_H264_HIGH_444) + FF_AVCTX_PROFILE_OPTION("baseline", NULL, VIDEO, AV_PROFILE_H264_BASELINE) + FF_AVCTX_PROFILE_OPTION("constrained_baseline", NULL, VIDEO, AV_PROFILE_H264_CONSTRAINED_BASELINE) + FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, AV_PROFILE_H264_MAIN) + FF_AVCTX_PROFILE_OPTION("extended", NULL, VIDEO, AV_PROFILE_H264_EXTENDED) + FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, AV_PROFILE_H264_HIGH) + FF_AVCTX_PROFILE_OPTION("high10", NULL, VIDEO, AV_PROFILE_H264_HIGH_10) + FF_AVCTX_PROFILE_OPTION("high422", NULL, VIDEO, AV_PROFILE_H264_HIGH_422) + FF_AVCTX_PROFILE_OPTION("high444", NULL, VIDEO, AV_PROFILE_H264_HIGH_444) { "level", "Specify level", OFFSET(level), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, VE, "level" }, @@ -732,8 +729,8 @@ enum MediaCodecHevcLevel { static const AVOption hevc_options[] = { COMMON_OPTION - FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, FF_PROFILE_HEVC_MAIN) - FF_AVCTX_PROFILE_OPTION("main10", NULL, VIDEO, FF_PROFILE_HEVC_MAIN_10) + FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, AV_PROFILE_HEVC_MAIN) + FF_AVCTX_PROFILE_OPTION("main10", NULL, VIDEO, AV_PROFILE_HEVC_MAIN_10) { "level", "Specify tier and level", OFFSET(level), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, VE, "level" }, @@ -846,10 +843,10 @@ enum MediaCodecVP9Level { static const AVOption vp9_options[] = { COMMON_OPTION - FF_AVCTX_PROFILE_OPTION("profile0", NULL, VIDEO, FF_PROFILE_VP9_0) - FF_AVCTX_PROFILE_OPTION("profile1", NULL, VIDEO, FF_PROFILE_VP9_1) - FF_AVCTX_PROFILE_OPTION("profile2", NULL, VIDEO, FF_PROFILE_VP9_2) - FF_AVCTX_PROFILE_OPTION("profile3", NULL, VIDEO, FF_PROFILE_VP9_3) + FF_AVCTX_PROFILE_OPTION("profile0", NULL, VIDEO, AV_PROFILE_VP9_0) + FF_AVCTX_PROFILE_OPTION("profile1", NULL, VIDEO, AV_PROFILE_VP9_1) + FF_AVCTX_PROFILE_OPTION("profile2", NULL, VIDEO, AV_PROFILE_VP9_2) + FF_AVCTX_PROFILE_OPTION("profile3", NULL, VIDEO, AV_PROFILE_VP9_3) { "level", "Specify tier and level", OFFSET(level), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, VE, "level" }, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/mfenc.c b/arm/raspi/third_party/ffmpeg/libavcodec/mfenc.c index 8d950a31..3c50a6c0 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/mfenc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/mfenc.c @@ -672,10 +672,10 @@ FF_ENABLE_DEPRECATION_WARNINGS if (avctx->codec_id == AV_CODEC_ID_H264) { UINT32 profile = ff_eAVEncH264VProfile_Base; switch (avctx->profile) { - case FF_PROFILE_H264_MAIN: + case AV_PROFILE_H264_MAIN: profile = ff_eAVEncH264VProfile_Main; break; - case FF_PROFILE_H264_HIGH: + case AV_PROFILE_H264_HIGH: profile = ff_eAVEncH264VProfile_High; break; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/mimic.c b/arm/raspi/third_party/ffmpeg/libavcodec/mimic.c index 891471b3..a846a07a 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/mimic.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/mimic.c @@ -120,7 +120,7 @@ static av_cold int mimic_decode_end(AVCodecContext *avctx) static av_cold void mimic_init_static(void) { - INIT_VLC_STATIC_FROM_LENGTHS(&block_vlc, MIMIC_VLC_BITS, FF_ARRAY_ELEMS(huffbits), + VLC_INIT_STATIC_FROM_LENGTHS(&block_vlc, MIMIC_VLC_BITS, FF_ARRAY_ELEMS(huffbits), huffbits, 1, huffsyms, 1, 1, 0, 0, 4368); } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/mips/Makefile b/arm/raspi/third_party/ffmpeg/libavcodec/mips/Makefile index 05ed63bf..45c56e8a 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/mips/Makefile +++ b/arm/raspi/third_party/ffmpeg/libavcodec/mips/Makefile @@ -13,7 +13,6 @@ MIPSFPU-OBJS-$(CONFIG_AMRWB_DECODER) += mips/acelp_filters_mips.o \ mips/acelp_vectors_mips.o MIPSFPU-OBJS-$(CONFIG_MPEGAUDIODSP) += mips/mpegaudiodsp_mips_float.o MIPSDSP-OBJS-$(CONFIG_MPEGAUDIODSP) += mips/mpegaudiodsp_mips_fixed.o -MIPSFPU-OBJS-$(CONFIG_FFT) += mips/fft_mips.o MIPSFPU-OBJS-$(CONFIG_FMTCONVERT) += mips/fmtconvert_mips.o OBJS-$(CONFIG_AC3DSP) += mips/ac3dsp_mips.o OBJS-$(CONFIG_AAC_DECODER) += mips/aacdec_mips.o \ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/mjpegdec.c b/arm/raspi/third_party/ffmpeg/libavcodec/mjpegdec.c index b42e75bc..8676155e 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/mjpegdec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/mjpegdec.c @@ -33,6 +33,7 @@ #include "config_components.h" #include "libavutil/display.h" +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/avassert.h" #include "libavutil/opt.h" @@ -41,6 +42,7 @@ #include "codec_internal.h" #include "copy_block.h" #include "decode.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "idctdsp.h" #include "internal.h" @@ -81,7 +83,7 @@ static int init_default_huffman_tables(MJpegDecodeContext *s) int i, ret; for (i = 0; i < FF_ARRAY_ELEMS(ht); i++) { - ff_free_vlc(&s->vlcs[ht[i].class][ht[i].index]); + ff_vlc_free(&s->vlcs[ht[i].class][ht[i].index]); ret = ff_mjpeg_build_vlc(&s->vlcs[ht[i].class][ht[i].index], ht[i].bits, ht[i].values, ht[i].class == 1, s->avctx); @@ -275,7 +277,7 @@ int ff_mjpeg_decode_dht(MJpegDecodeContext *s) len -= n; /* build VLC and flush previous vlc if present */ - ff_free_vlc(&s->vlcs[class][index]); + ff_vlc_free(&s->vlcs[class][index]); av_log(s->avctx, AV_LOG_DEBUG, "class=%d index=%d nb_codes=%d\n", class, index, n); if ((ret = ff_mjpeg_build_vlc(&s->vlcs[class][index], bits_table, @@ -283,7 +285,7 @@ int ff_mjpeg_decode_dht(MJpegDecodeContext *s) return ret; if (class > 0) { - ff_free_vlc(&s->vlcs[2][index]); + ff_vlc_free(&s->vlcs[2][index]); if ((ret = ff_mjpeg_build_vlc(&s->vlcs[2][index], bits_table, val_table, 0, s->avctx)) < 0) return ret; @@ -796,13 +798,14 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) } if (s->avctx->hwaccel) { + const FFHWAccel *hwaccel = ffhwaccel(s->avctx->hwaccel); s->hwaccel_picture_private = - av_mallocz(s->avctx->hwaccel->frame_priv_data_size); + av_mallocz(hwaccel->frame_priv_data_size); if (!s->hwaccel_picture_private) return AVERROR(ENOMEM); - ret = s->avctx->hwaccel->start_frame(s->avctx, s->raw_image_buffer, - s->raw_image_buffer_size); + ret = hwaccel->start_frame(s->avctx, s->raw_image_buffer, + s->raw_image_buffer_size); if (ret < 0) return ret; } @@ -1774,9 +1777,9 @@ next_field: av_assert0(bytes_to_start >= 0 && s->raw_scan_buffer_size >= bytes_to_start); - ret = s->avctx->hwaccel->decode_slice(s->avctx, - s->raw_scan_buffer + bytes_to_start, - s->raw_scan_buffer_size - bytes_to_start); + ret = FF_HW_CALL(s->avctx, decode_slice, + s->raw_scan_buffer + bytes_to_start, + s->raw_scan_buffer_size - bytes_to_start); if (ret < 0) return ret; @@ -2483,9 +2486,9 @@ redo_for_pal8: case SOF0: case SOF1: if (start_code == SOF0) - s->avctx->profile = FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT; + s->avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT; else - s->avctx->profile = FF_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT; + s->avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT; s->lossless = 0; s->ls = 0; s->progressive = 0; @@ -2493,7 +2496,7 @@ redo_for_pal8: goto fail; break; case SOF2: - s->avctx->profile = FF_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT; + s->avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT; s->lossless = 0; s->ls = 0; s->progressive = 1; @@ -2501,7 +2504,7 @@ redo_for_pal8: goto fail; break; case SOF3: - s->avctx->profile = FF_PROFILE_MJPEG_HUFFMAN_LOSSLESS; + s->avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_LOSSLESS; s->avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS; s->lossless = 1; s->ls = 0; @@ -2510,7 +2513,7 @@ redo_for_pal8: goto fail; break; case SOF48: - s->avctx->profile = FF_PROFILE_MJPEG_JPEG_LS; + s->avctx->profile = AV_PROFILE_MJPEG_JPEG_LS; s->avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS; s->lossless = 1; s->ls = 1; @@ -2547,7 +2550,7 @@ eoi_parser: goto the_end_no_picture; } if (s->avctx->hwaccel) { - ret = s->avctx->hwaccel->end_frame(s->avctx); + ret = FF_HW_SIMPLE_CALL(s->avctx, end_frame); if (ret < 0) return ret; @@ -2952,7 +2955,7 @@ av_cold int ff_mjpeg_decode_end(AVCodecContext *avctx) for (i = 0; i < 3; i++) { for (j = 0; j < 4; j++) - ff_free_vlc(&s->vlcs[i][j]); + ff_vlc_free(&s->vlcs[i][j]); } for (i = 0; i < MAX_COMPONENTS; i++) { av_freep(&s->blocks[i]); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/mjpegdec_common.c b/arm/raspi/third_party/ffmpeg/libavcodec/mjpegdec_common.c index 701ddfec..ef2a0ad5 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/mjpegdec_common.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/mjpegdec_common.c @@ -52,6 +52,6 @@ int ff_mjpeg_build_vlc(VLC *vlc, const uint8_t *bits_table, huff_sym[i] = 16 * 256; } - return ff_init_vlc_from_lengths(vlc, 9, nb_codes, huff_size, 1, + return ff_vlc_init_from_lengths(vlc, 9, nb_codes, huff_size, 1, huff_sym, 2, 2, 0, 0, logctx); } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/mlpdec.c b/arm/raspi/third_party/ffmpeg/libavcodec/mlpdec.c index 966ee0f0..a24ae0be 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/mlpdec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/mlpdec.c @@ -230,9 +230,9 @@ static av_cold void init_static(void) static VLCElem vlc_buf[3 * VLC_STATIC_SIZE]; huff_vlc[i].table = &vlc_buf[i * VLC_STATIC_SIZE]; huff_vlc[i].table_allocated = VLC_STATIC_SIZE; - init_vlc(&huff_vlc[i], VLC_BITS, 18, + vlc_init(&huff_vlc[i], VLC_BITS, 18, &ff_mlp_huffman_tables[i][0][1], 2, 1, - &ff_mlp_huffman_tables[i][0][0], 2, 1, INIT_VLC_USE_NEW_STATIC); + &ff_mlp_huffman_tables[i][0][0], 2, 1, VLC_INIT_USE_STATIC); } ff_mlp_init_crc(); @@ -398,7 +398,7 @@ static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb) */ if (m->avctx->codec_id == AV_CODEC_ID_TRUEHD && m->num_substreams == 4 && m->substream_info >> 7 == 1) { - m->avctx->profile = FF_PROFILE_TRUEHD_ATMOS; + m->avctx->profile = AV_PROFILE_TRUEHD_ATMOS; } /* limit to decoding 3 substreams, as the 4th is used by Dolby Atmos for non-audio data */ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/mlpenc.c b/arm/raspi/third_party/ffmpeg/libavcodec/mlpenc.c index 5995a6b5..89b55750 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/mlpenc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/mlpenc.c @@ -32,6 +32,7 @@ #include "libavutil/crc.h" #include "libavutil/avstring.h" #include "libavutil/intmath.h" +#include "libavutil/opt.h" #include "libavutil/samplefmt.h" #include "libavutil/thread.h" #include "mlp.h" @@ -41,7 +42,7 @@ #define MLP_MIN_LPC_ORDER 1 #define MLP_MAX_LPC_ORDER 8 -#define MLP_MIN_LPC_SHIFT 8 +#define MLP_MIN_LPC_SHIFT 0 #define MLP_MAX_LPC_SHIFT 15 typedef struct { @@ -108,8 +109,13 @@ typedef struct BestOffset { #define NUM_CODEBOOKS 4 typedef struct MLPEncodeContext { + AVClass *class; AVCodecContext *avctx; + int lpc_type; + int lpc_passes; + int prediction_order; + int num_substreams; ///< Number of substreams contained within this stream. int num_channels; /**< Number of channels in major_scratch_buffer. @@ -573,8 +579,6 @@ static av_cold int mlp_encode_init(AVCodecContext *avctx) ctx->min_restart_interval = MAJOR_HEADER_INTERVAL; ctx->restart_intervals = ctx->max_restart_interval / ctx->min_restart_interval; - /* TODO Let user pass parameters for LPC filter. */ - size = avctx->frame_size * ctx->max_restart_interval; ctx->lpc_sample_buffer = av_calloc(size, sizeof(*ctx->lpc_sample_buffer)); if (!ctx->lpc_sample_buffer) @@ -682,7 +686,7 @@ static av_cold int mlp_encode_init(AVCodecContext *avctx) rh->max_matrix_channel = rh->max_channel; if ((ret = ff_lpc_init(&ctx->lpc_ctx, ctx->number_of_samples, - MLP_MAX_LPC_ORDER, FF_LPC_TYPE_LEVINSON)) < 0) + MLP_MAX_LPC_ORDER, ctx->lpc_type)) < 0) return ret; for (int i = 0; i < NUM_FILTERS; i++) { @@ -1086,7 +1090,7 @@ static uint8_t *write_substr(MLPEncodeContext *ctx, uint8_t *buf, int buf_size, put_bits(&pb, 16, END_OF_STREAM & 0xFFFF); put_bits(&pb, 16, (ctx->shorten_by & 0x1FFF) | 0x2000); } else { - put_bits(&pb, 32, END_OF_STREAM); + put_bits32(&pb, END_OF_STREAM); } } @@ -1261,14 +1265,7 @@ static void input_to_sample_buffer(MLPEncodeContext *ctx) /** Counts the number of trailing zeroes in a value */ static int number_trailing_zeroes(int32_t sample) { - int bits = ff_ctz(sample); - - /* All samples are 0. TODO Return previous quant_step_size to avoid - * writing a new header. */ - if (bits >= 24) - return 0; - - return bits; + return FFMIN(15, ff_ctz(sample)); } /** Determines how many bits are zero at the end of all samples so they can be @@ -1341,13 +1338,12 @@ static void set_filter_params(MLPEncodeContext *ctx, } else if (filter == IIR) { fp->order = 0; } else if (filter == FIR) { - const int max_order = (ctx->substream_info & SUBSTREAM_INFO_HIGH_RATE) - ? 4 : MLP_MAX_LPC_ORDER; + const int max_order = MAX_FIR_ORDER; int32_t *sample_buffer = ctx->sample_buffer + channel; int32_t coefs[MAX_LPC_ORDER][MAX_LPC_ORDER]; int32_t *lpc_samples = ctx->lpc_sample_buffer; int32_t *fcoeff = ctx->cur_channel_params[channel].coeff[filter]; - int shift[MLP_MAX_LPC_ORDER]; + int shift[MAX_LPC_ORDER]; int order; for (unsigned int i = 0; i < ctx->number_of_samples; i++) { @@ -1357,8 +1353,8 @@ static void set_filter_params(MLPEncodeContext *ctx, order = ff_lpc_calc_coefs(&ctx->lpc_ctx, ctx->lpc_sample_buffer, ctx->number_of_samples, MLP_MIN_LPC_ORDER, - max_order, 11, coefs, shift, FF_LPC_TYPE_LEVINSON, 0, - ORDER_METHOD_EST, MLP_MIN_LPC_SHIFT, + max_order, 11, coefs, shift, ctx->lpc_type, ctx->lpc_passes, + ctx->prediction_order, MLP_MIN_LPC_SHIFT, MLP_MAX_LPC_SHIFT, MLP_MIN_LPC_SHIFT); fp->order = order; @@ -2238,6 +2234,26 @@ static av_cold int mlp_encode_close(AVCodecContext *avctx) return 0; } +#define FLAGS AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM +#define OFFSET(x) offsetof(MLPEncodeContext, x) +static const AVOption mlp_options[] = { +{ "lpc_type", "LPC algorithm", OFFSET(lpc_type), AV_OPT_TYPE_INT, {.i64 = FF_LPC_TYPE_LEVINSON }, FF_LPC_TYPE_LEVINSON, FF_LPC_TYPE_CHOLESKY, FLAGS, "lpc_type" }, +{ "levinson", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_LPC_TYPE_LEVINSON }, 0, 0, FLAGS, "lpc_type" }, +{ "cholesky", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_LPC_TYPE_CHOLESKY }, 0, 0, FLAGS, "lpc_type" }, +{ "lpc_passes", "Number of passes to use for Cholesky factorization during LPC analysis", OFFSET(lpc_passes), AV_OPT_TYPE_INT, {.i64 = 2 }, 1, INT_MAX, FLAGS }, +{ "prediction_order", "Search method for selecting prediction order", OFFSET(prediction_order), AV_OPT_TYPE_INT, {.i64 = ORDER_METHOD_EST }, ORDER_METHOD_EST, ORDER_METHOD_SEARCH, FLAGS, "predm" }, +{ "estimation", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = ORDER_METHOD_EST }, 0, 0, FLAGS, "predm" }, +{ "search", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = ORDER_METHOD_SEARCH }, 0, 0, FLAGS, "predm" }, +{ NULL }, +}; + +static const AVClass mlp_class = { + .class_name = "mlpenc", + .item_name = av_default_item_name, + .option = mlp_options, + .version = LIBAVUTIL_VERSION_INT, +}; + #if CONFIG_MLP_ENCODER const FFCodec ff_mlp_encoder = { .p.name ="mlp", @@ -2250,6 +2266,7 @@ const FFCodec ff_mlp_encoder = { .init = mlp_encode_init, FF_CODEC_ENCODE_CB(mlp_encode_frame), .close = mlp_encode_close, + .p.priv_class = &mlp_class, .p.sample_fmts = (const enum AVSampleFormat[]) {AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE}, .p.supported_samplerates = (const int[]) {44100, 48000, 88200, 96000, 176400, 192000, 0}, CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(ff_mlp_channel_layouts) @@ -2270,6 +2287,7 @@ const FFCodec ff_truehd_encoder = { .init = mlp_encode_init, FF_CODEC_ENCODE_CB(mlp_encode_frame), .close = mlp_encode_close, + .p.priv_class = &mlp_class, .p.sample_fmts = (const enum AVSampleFormat[]) {AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE}, .p.supported_samplerates = (const int[]) {44100, 48000, 88200, 96000, 176400, 192000, 0}, CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_5POINT0, AV_CH_LAYOUT_5POINT1) diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/mmaldec.c b/arm/raspi/third_party/ffmpeg/libavcodec/mmaldec.c index 8d67d10c..4bb3eb22 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/mmaldec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/mmaldec.c @@ -648,8 +648,8 @@ static int ffmal_copy_frame(AVCodecContext *avctx, AVFrame *frame, av_image_fill_arrays(src, linesize, buffer->data + buffer->type->video.offset[0], avctx->pix_fmt, w, h, 1); - av_image_copy(frame->data, frame->linesize, (const uint8_t **)src, linesize, - avctx->pix_fmt, avctx->width, avctx->height); + av_image_copy2(frame->data, frame->linesize, src, linesize, + avctx->pix_fmt, avctx->width, avctx->height); } frame->sample_aspect_ratio = avctx->sample_aspect_ratio; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/mobiclip.c b/arm/raspi/third_party/ffmpeg/libavcodec/mobiclip.c index 381b492d..98c0f55a 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/mobiclip.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/mobiclip.c @@ -279,11 +279,11 @@ static VLC mv_vlc[2][16]; static av_cold void mobiclip_init_static(void) { - INIT_VLC_STATIC_FROM_LENGTHS(&rl_vlc[0], MOBI_RL_VLC_BITS, 104, + VLC_INIT_STATIC_FROM_LENGTHS(&rl_vlc[0], MOBI_RL_VLC_BITS, 104, bits0, sizeof(*bits0), syms0, sizeof(*syms0), sizeof(*syms0), 0, 0, 1 << MOBI_RL_VLC_BITS); - INIT_VLC_STATIC_FROM_LENGTHS(&rl_vlc[1], MOBI_RL_VLC_BITS, 104, + VLC_INIT_STATIC_FROM_LENGTHS(&rl_vlc[1], MOBI_RL_VLC_BITS, 104, bits0, sizeof(*bits0), syms1, sizeof(*syms1), sizeof(*syms1), 0, 0, 1 << MOBI_RL_VLC_BITS); @@ -292,10 +292,10 @@ static av_cold void mobiclip_init_static(void) for (int j = 0; j < 16; j++) { mv_vlc[i][j].table = &vlc_buf[(16 * i + j) << MOBI_MV_VLC_BITS]; mv_vlc[i][j].table_allocated = 1 << MOBI_MV_VLC_BITS; - ff_init_vlc_from_lengths(&mv_vlc[i][j], MOBI_MV_VLC_BITS, mv_len[j], + ff_vlc_init_from_lengths(&mv_vlc[i][j], MOBI_MV_VLC_BITS, mv_len[j], mv_bits[i][j], sizeof(*mv_bits[i][j]), mv_syms[i][j], sizeof(*mv_syms[i][j]), sizeof(*mv_syms[i][j]), - 0, INIT_VLC_USE_NEW_STATIC, NULL); + 0, VLC_INIT_USE_STATIC, NULL); } } } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/motionpixels.c b/arm/raspi/third_party/ffmpeg/libavcodec/motionpixels.c index a947ca05..9df0b206 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/motionpixels.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/motionpixels.c @@ -328,7 +328,7 @@ static int mp_decode_frame(AVCodecContext *avctx, AVFrame *rframe, if (mp->codes_count > 1) { /* The entries of the mp->codes array are sorted from right to left * in the Huffman tree, hence -(int)sizeof(HuffCode). */ - ret = ff_init_vlc_from_lengths(&mp->vlc, mp->max_codes_bits, mp->codes_count, + ret = ff_vlc_init_from_lengths(&mp->vlc, mp->max_codes_bits, mp->codes_count, &mp->codes[mp->codes_count - 1].size, -(int)sizeof(HuffCode), &mp->codes[mp->codes_count - 1].delta, -(int)sizeof(HuffCode), 1, 0, 0, avctx); @@ -336,7 +336,7 @@ static int mp_decode_frame(AVCodecContext *avctx, AVFrame *rframe, goto end; } mp_decode_frame_helper(mp, &gb); - ff_free_vlc(&mp->vlc); + ff_vlc_free(&mp->vlc); end: if ((ret = av_frame_ref(rframe, mp->frame)) < 0) diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/mpc.c b/arm/raspi/third_party/ffmpeg/libavcodec/mpc.c index 6aa3e809..46cb967c 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/mpc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/mpc.c @@ -27,7 +27,7 @@ */ #include -#include "libavutil/intmath.h" +#include "libavutil/common.h" #include "mpegaudiodsp.h" #include "mpc.h" diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/mpc7.c b/arm/raspi/third_party/ffmpeg/libavcodec/mpc7.c index d2745366..59782c67 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/mpc7.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/mpc7.c @@ -47,24 +47,24 @@ static av_cold void mpc7_init_static(void) static VLCElem quant_tables[7224]; const uint8_t *raw_quant_table = mpc7_quant_vlcs; - INIT_VLC_STATIC_FROM_LENGTHS(&scfi_vlc, MPC7_SCFI_BITS, MPC7_SCFI_SIZE, + VLC_INIT_STATIC_FROM_LENGTHS(&scfi_vlc, MPC7_SCFI_BITS, MPC7_SCFI_SIZE, &mpc7_scfi[1], 2, &mpc7_scfi[0], 2, 1, 0, 0, 1 << MPC7_SCFI_BITS); - INIT_VLC_STATIC_FROM_LENGTHS(&dscf_vlc, MPC7_DSCF_BITS, MPC7_DSCF_SIZE, + VLC_INIT_STATIC_FROM_LENGTHS(&dscf_vlc, MPC7_DSCF_BITS, MPC7_DSCF_SIZE, &mpc7_dscf[1], 2, &mpc7_dscf[0], 2, 1, -7, 0, 1 << MPC7_DSCF_BITS); - INIT_VLC_STATIC_FROM_LENGTHS(&hdr_vlc, MPC7_HDR_BITS, MPC7_HDR_SIZE, + VLC_INIT_STATIC_FROM_LENGTHS(&hdr_vlc, MPC7_HDR_BITS, MPC7_HDR_SIZE, &mpc7_hdr[1], 2, &mpc7_hdr[0], 2, 1, -5, 0, 1 << MPC7_HDR_BITS); for (unsigned i = 0, offset = 0; i < MPC7_QUANT_VLC_TABLES; i++){ for (int j = 0; j < 2; j++) { quant_vlc[i][j].table = &quant_tables[offset]; quant_vlc[i][j].table_allocated = FF_ARRAY_ELEMS(quant_tables) - offset; - ff_init_vlc_from_lengths(&quant_vlc[i][j], 9, mpc7_quant_vlc_sizes[i], + ff_vlc_init_from_lengths(&quant_vlc[i][j], 9, mpc7_quant_vlc_sizes[i], &raw_quant_table[1], 2, &raw_quant_table[0], 2, 1, mpc7_quant_vlc_off[i], - INIT_VLC_STATIC_OVERLONG, NULL); + VLC_INIT_STATIC_OVERLONG, NULL); raw_quant_table += 2 * mpc7_quant_vlc_sizes[i]; offset += quant_vlc[i][j].table_size; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/mpc8.c b/arm/raspi/third_party/ffmpeg/libavcodec/mpc8.c index c1b787c3..27852591 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/mpc8.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/mpc8.c @@ -103,8 +103,8 @@ static av_cold void build_vlc(VLC *vlc, unsigned *buf_offset, for (unsigned tmp = num + codes_counts[i - 1]; num < tmp; num++) len[num] = i; - ff_init_vlc_from_lengths(vlc, FFMIN(len[0], 9), num, len, 1, - *syms, 1, 1, offset, INIT_VLC_STATIC_OVERLONG, NULL); + ff_vlc_init_from_lengths(vlc, FFMIN(len[0], 9), num, len, 1, + *syms, 1, 1, offset, VLC_INIT_STATIC_OVERLONG, NULL); *buf_offset += vlc->table_size; *syms += num; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/mpeg12.c b/arm/raspi/third_party/ffmpeg/libavcodec/mpeg12.c index 305876dd..80b3a1ad 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/mpeg12.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/mpeg12.c @@ -72,7 +72,7 @@ av_cold void ff_init_2d_vlc_rl(const uint16_t table_vlc[][2], RL_VLC_ELEM rl_vlc VLCElem table[680] = { 0 }; VLC vlc = { .table = table, .table_allocated = static_size }; av_assert0(static_size <= FF_ARRAY_ELEMS(table)); - init_vlc(&vlc, TEX_VLC_BITS, n + 2, &table_vlc[0][1], 4, 2, &table_vlc[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC | flags); + vlc_init(&vlc, TEX_VLC_BITS, n + 2, &table_vlc[0][1], 4, 2, &table_vlc[0][0], 4, 2, VLC_INIT_USE_STATIC | flags); for (i = 0; i < vlc.table_size; i++) { int code = vlc.table[i].sym; @@ -130,26 +130,26 @@ RL_VLC_ELEM ff_mpeg2_rl_vlc[674]; static av_cold void mpeg12_init_vlcs(void) { - INIT_VLC_STATIC(&ff_dc_lum_vlc, DC_VLC_BITS, 12, + VLC_INIT_STATIC(&ff_dc_lum_vlc, DC_VLC_BITS, 12, ff_mpeg12_vlc_dc_lum_bits, 1, 1, ff_mpeg12_vlc_dc_lum_code, 2, 2, 512); - INIT_VLC_STATIC(&ff_dc_chroma_vlc, DC_VLC_BITS, 12, + VLC_INIT_STATIC(&ff_dc_chroma_vlc, DC_VLC_BITS, 12, ff_mpeg12_vlc_dc_chroma_bits, 1, 1, ff_mpeg12_vlc_dc_chroma_code, 2, 2, 514); - INIT_VLC_STATIC(&ff_mv_vlc, MV_VLC_BITS, 17, + VLC_INIT_STATIC(&ff_mv_vlc, MV_VLC_BITS, 17, &ff_mpeg12_mbMotionVectorTable[0][1], 2, 1, &ff_mpeg12_mbMotionVectorTable[0][0], 2, 1, 266); - INIT_VLC_STATIC(&ff_mbincr_vlc, MBINCR_VLC_BITS, 36, + VLC_INIT_STATIC(&ff_mbincr_vlc, MBINCR_VLC_BITS, 36, &ff_mpeg12_mbAddrIncrTable[0][1], 2, 1, &ff_mpeg12_mbAddrIncrTable[0][0], 2, 1, 538); - INIT_VLC_STATIC(&ff_mb_pat_vlc, MB_PAT_VLC_BITS, 64, + VLC_INIT_STATIC(&ff_mb_pat_vlc, MB_PAT_VLC_BITS, 64, &ff_mpeg12_mbPatTable[0][1], 2, 1, &ff_mpeg12_mbPatTable[0][0], 2, 1, 512); - INIT_VLC_STATIC(&ff_mb_ptype_vlc, MB_PTYPE_VLC_BITS, 7, + VLC_INIT_STATIC(&ff_mb_ptype_vlc, MB_PTYPE_VLC_BITS, 7, &table_mb_ptype[0][1], 2, 1, &table_mb_ptype[0][0], 2, 1, 64); - INIT_VLC_STATIC(&ff_mb_btype_vlc, MB_BTYPE_VLC_BITS, 11, + VLC_INIT_STATIC(&ff_mb_btype_vlc, MB_BTYPE_VLC_BITS, 11, &table_mb_btype[0][1], 2, 1, &table_mb_btype[0][0], 2, 1, 64); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/mpeg12dec.c b/arm/raspi/third_party/ffmpeg/libavcodec/mpeg12dec.c index 736a1754..5a1cae99 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/mpeg12dec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/mpeg12dec.c @@ -31,6 +31,7 @@ #include #include "libavutil/attributes.h" +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/internal.h" #include "libavutil/mem_internal.h" @@ -42,6 +43,7 @@ #include "codec_internal.h" #include "decode.h" #include "error_resilience.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "idctdsp.h" #include "internal.h" @@ -74,7 +76,6 @@ typedef struct Mpeg1Context { unsigned aspect_ratio_info; AVRational save_aspect; int save_width, save_height, save_progressive_seq; - int rc_buffer_size; AVRational frame_rate_ext; /* MPEG-2 specific framerate modificator */ unsigned frame_rate_index; int sync; /* Did we reach a sync point like a GOP/SEQ/KEYFrame? */ @@ -1167,7 +1168,7 @@ static enum AVPixelFormat mpeg_get_pixelformat(AVCodecContext *avctx) else pix_fmts = mpeg12_pixfmt_list_444; - return ff_thread_get_format(avctx, pix_fmts); + return ff_get_format(avctx, pix_fmts); } /* Call this function when we know all parameters. @@ -1247,7 +1248,8 @@ static int mpeg_decode_postinit(AVCodecContext *avctx) if (ret < 0) return ret; - if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO && s->bit_rate) { + if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO && s->bit_rate && + (s->bit_rate != 0x3FFFF*400)) { avctx->rc_max_rate = s->bit_rate; } else if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO && s->bit_rate && (s->bit_rate != 0x3FFFF*400 || s->vbv_delay != 0xFFFF)) { @@ -1370,7 +1372,6 @@ static void mpeg_decode_sequence_extension(Mpeg1Context *s1) MpegEncContext *s = &s1->mpeg_enc_ctx; int horiz_size_ext, vert_size_ext; int bit_rate_ext; - AVCPBProperties *cpb_props; skip_bits(&s->gb, 1); /* profile and level esc*/ s->avctx->profile = get_bits(&s->gb, 3); @@ -1390,7 +1391,7 @@ static void mpeg_decode_sequence_extension(Mpeg1Context *s1) bit_rate_ext = get_bits(&s->gb, 12); /* XXX: handle it */ s->bit_rate += (bit_rate_ext << 18) * 400LL; check_marker(s->avctx, &s->gb, "after bit rate extension"); - s1->rc_buffer_size += get_bits(&s->gb, 8) * 1024 * 16 << 10; + s->avctx->rc_buffer_size += get_bits(&s->gb, 8) * 1024 * 16 << 10; s->low_delay = get_bits1(&s->gb); if (s->avctx->flags & AV_CODEC_FLAG_LOW_DELAY) @@ -1402,17 +1403,11 @@ static void mpeg_decode_sequence_extension(Mpeg1Context *s1) ff_dlog(s->avctx, "sequence extension\n"); s->codec_id = s->avctx->codec_id = AV_CODEC_ID_MPEG2VIDEO; - if (cpb_props = ff_add_cpb_side_data(s->avctx)) { - cpb_props->buffer_size = s1->rc_buffer_size; - if (s->bit_rate != 0x3FFFF*400) - cpb_props->max_bitrate = s->bit_rate; - } - 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:%"PRId64"\n", s->avctx->profile, s->avctx->level, s->progressive_sequence, s->chroma_format, - s1->rc_buffer_size, s->bit_rate); + s->avctx->rc_buffer_size, s->bit_rate); } static void mpeg_decode_sequence_display_extension(Mpeg1Context *s1) @@ -1656,7 +1651,7 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) } if (s->avctx->hwaccel) { - if ((ret = s->avctx->hwaccel->end_frame(s->avctx)) < 0) { + if ((ret = FF_HW_SIMPLE_CALL(s->avctx, end_frame)) < 0) { av_log(avctx, AV_LOG_ERROR, "hardware accelerator failed to decode first field\n"); return ret; @@ -1672,7 +1667,7 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) } if (avctx->hwaccel) { - if ((ret = avctx->hwaccel->start_frame(avctx, buf, buf_size)) < 0) + if ((ret = FF_HW_CALL(avctx, start_frame, buf, buf_size)) < 0) return ret; } @@ -1750,14 +1745,14 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y, return AVERROR_INVALIDDATA; } - if (avctx->hwaccel && avctx->hwaccel->decode_slice) { + if (avctx->hwaccel) { const uint8_t *buf_end, *buf_start = *buf - 4; /* include start_code */ int start_code = -1; buf_end = avpriv_find_start_code(buf_start + 2, *buf + buf_size, &start_code); if (buf_end < *buf + buf_size) buf_end -= 4; s->mb_y = mb_y; - if (avctx->hwaccel->decode_slice(avctx, buf_start, buf_end - buf_start) < 0) + if (FF_HW_CALL(avctx, decode_slice, buf_start, buf_end - buf_start) < 0) return DECODE_SLICE_ERROR; *buf = buf_end; return DECODE_SLICE_OK; @@ -2026,7 +2021,7 @@ static int slice_end(AVCodecContext *avctx, AVFrame *pict) return 0; if (s->avctx->hwaccel) { - int ret = s->avctx->hwaccel->end_frame(s->avctx); + int ret = FF_HW_SIMPLE_CALL(s->avctx, end_frame); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "hardware accelerator failed to decode picture\n"); @@ -2038,7 +2033,7 @@ static int slice_end(AVCodecContext *avctx, AVFrame *pict) if (/* s->mb_y << field_pic == s->mb_height && */ !s->first_field && !s1->first_slice) { /* end of image */ - ff_er_frame_end(&s->er); + ff_er_frame_end(&s->er, NULL); ff_mpv_frame_end(s); @@ -2102,7 +2097,7 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx, return AVERROR_INVALIDDATA; } - s1->rc_buffer_size = get_bits(&s->gb, 10) * 1024 * 16; + s->avctx->rc_buffer_size = get_bits(&s->gb, 10) * 1024 * 16; skip_bits(&s->gb, 1); /* get matrix */ @@ -2150,7 +2145,7 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx, if (s->avctx->debug & FF_DEBUG_PICT_INFO) av_log(s->avctx, AV_LOG_DEBUG, "vbv buffer: %d, bitrate:%"PRId64", aspect_ratio_info: %d \n", - s1->rc_buffer_size, s->bit_rate, s1->aspect_ratio_info); + s->avctx->rc_buffer_size, s->bit_rate, s1->aspect_ratio_info); return 0; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/mpeg12enc.c b/arm/raspi/third_party/ffmpeg/libavcodec/mpeg12enc.c index 4aa45e9e..0135623c 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/mpeg12enc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/mpeg12enc.c @@ -203,23 +203,23 @@ static av_cold int encode_init(AVCodecContext *avctx) } } - if (avctx->profile == FF_PROFILE_UNKNOWN) { - if (avctx->level != FF_LEVEL_UNKNOWN) { + if (avctx->profile == AV_PROFILE_UNKNOWN) { + if (avctx->level != AV_LEVEL_UNKNOWN) { av_log(avctx, AV_LOG_ERROR, "Set profile and level\n"); return AVERROR(EINVAL); } /* Main or 4:2:2 */ - avctx->profile = avctx->pix_fmt == AV_PIX_FMT_YUV420P ? FF_PROFILE_MPEG2_MAIN - : FF_PROFILE_MPEG2_422; + avctx->profile = avctx->pix_fmt == AV_PIX_FMT_YUV420P ? AV_PROFILE_MPEG2_MAIN + : AV_PROFILE_MPEG2_422; } - if (avctx->level == FF_LEVEL_UNKNOWN) { - if (avctx->profile == FF_PROFILE_MPEG2_422) { /* 4:2:2 */ + if (avctx->level == AV_LEVEL_UNKNOWN) { + if (avctx->profile == AV_PROFILE_MPEG2_422) { /* 4:2:2 */ if (avctx->width <= 720 && avctx->height <= 608) avctx->level = 5; /* Main */ else avctx->level = 2; /* High */ } else { - if (avctx->profile != FF_PROFILE_MPEG2_HIGH && + if (avctx->profile != AV_PROFILE_MPEG2_HIGH && avctx->pix_fmt != AV_PIX_FMT_YUV420P) { av_log(avctx, AV_LOG_ERROR, "Only High(1) and 4:2:2(0) profiles support 4:2:2 color sampling\n"); @@ -366,7 +366,7 @@ static void mpeg1_encode_sequence_header(MpegEncContext *s) put_header(s, EXT_START_CODE); put_bits(&s->pb, 4, 1); // seq ext - put_bits(&s->pb, 1, s->avctx->profile == FF_PROFILE_MPEG2_422); // escx 1 for 4:2:2 profile + put_bits(&s->pb, 1, s->avctx->profile == AV_PROFILE_MPEG2_422); // escx 1 for 4:2:2 profile put_bits(&s->pb, 3, s->avctx->profile); // profile put_bits(&s->pb, 4, s->avctx->level); // level diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/mpeg4videodec.c b/arm/raspi/third_party/ffmpeg/libavcodec/mpeg4videodec.c index 5ce244d0..c946b127 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/mpeg4videodec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/mpeg4videodec.c @@ -295,7 +295,7 @@ void ff_mpeg4_decode_studio(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb int hsub = i ? s->chroma_x_shift : 0; int lowres = s->avctx->lowres; int step = 1 << lowres; - dest_pcm[i] += (linesize[i] / 2) * ((16 >> vsub) - 1); + dest_pcm[i] += (linesize[i] / 2) * ((16 >> vsub + lowres) - 1); for (int h = (16 >> (vsub + lowres)) - 1; h >= 0; h--){ for (int w = (16 >> (hsub + lowres)) - 1, idx = 0; w >= 0; w--, idx += step) dest_pcm[i][w] = src[idx]; @@ -861,7 +861,7 @@ static inline int get_amv(Mpeg4DecContext *ctx, int n) for (y = 0; y < 16; y++) { int v; - v = mb_v + dy * y; + v = mb_v + (unsigned)dy * y; // FIXME optimize for (x = 0; x < 16; x++) { sum += v >> shift; @@ -2564,10 +2564,10 @@ static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb) */ if (ctx->vo_type == CORE_STUDIO_VO_TYPE || ctx->vo_type == SIMPLE_STUDIO_VO_TYPE) { - if (s->avctx->profile != FF_PROFILE_UNKNOWN && s->avctx->profile != FF_PROFILE_MPEG4_SIMPLE_STUDIO) + if (s->avctx->profile != AV_PROFILE_UNKNOWN && s->avctx->profile != AV_PROFILE_MPEG4_SIMPLE_STUDIO) return AVERROR_INVALIDDATA; s->studio_profile = 1; - s->avctx->profile = FF_PROFILE_MPEG4_SIMPLE_STUDIO; + s->avctx->profile = AV_PROFILE_MPEG4_SIMPLE_STUDIO; return decode_studio_vol_header(ctx, gb); } else if (s->studio_profile) { return AVERROR_PATCHWELCOME; @@ -3141,9 +3141,6 @@ static int decode_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb, av_log(s->avctx, AV_LOG_WARNING, "time_increment_bits set to %d bits, based on bitstream analysis\n", ctx->time_increment_bits); - if (s->avctx->framerate.num && 4*s->avctx->framerate.num < 1<time_increment_bits) { - s->avctx->framerate.num = 1<time_increment_bits; - } } if (IS_3IV1) @@ -3605,7 +3602,7 @@ int ff_mpeg4_decode_picture_header(Mpeg4DecContext *ctx, GetBitContext *gb, } else if (startcode == VOS_STARTCODE) { int profile, level; mpeg4_decode_profile_level(s, gb, &profile, &level); - if (profile == FF_PROFILE_MPEG4_SIMPLE_STUDIO && + if (profile == AV_PROFILE_MPEG4_SIMPLE_STUDIO && (level > 0 && level < 9)) { s->studio_profile = 1; next_start_code_studio(gb); @@ -3761,12 +3758,12 @@ static av_cold void mpeg4_init_static(void) { static uint8_t mpeg4_rvlc_rl_tables[2][2][2 * MAX_RUN + MAX_LEVEL + 3]; - INIT_VLC_STATIC_FROM_LENGTHS(&studio_luma_dc, STUDIO_INTRA_BITS, 19, + VLC_INIT_STATIC_FROM_LENGTHS(&studio_luma_dc, STUDIO_INTRA_BITS, 19, &ff_mpeg4_studio_dc_luma[0][1], 2, &ff_mpeg4_studio_dc_luma[0][0], 2, 1, 0, 0, 528); - INIT_VLC_STATIC_FROM_LENGTHS(&studio_chroma_dc, STUDIO_INTRA_BITS, 19, + VLC_INIT_STATIC_FROM_LENGTHS(&studio_chroma_dc, STUDIO_INTRA_BITS, 19, &ff_mpeg4_studio_dc_chroma[0][1], 2, &ff_mpeg4_studio_dc_chroma[0][0], 2, 1, 0, 0, 528); @@ -3776,11 +3773,11 @@ static av_cold void mpeg4_init_static(void) studio_intra_tab[i].table = &vlc_buf[offset]; studio_intra_tab[i].table_allocated = FF_ARRAY_ELEMS(vlc_buf) - offset; - ff_init_vlc_from_lengths(&studio_intra_tab[i], + ff_vlc_init_from_lengths(&studio_intra_tab[i], STUDIO_INTRA_BITS, 24, &ff_mpeg4_studio_intra[i][0][1], 2, &ff_mpeg4_studio_intra[i][0][0], 2, 1, - 0, INIT_VLC_STATIC_OVERLONG, NULL); + 0, VLC_INIT_STATIC_OVERLONG, NULL); offset += studio_intra_tab[i].table_size; } @@ -3788,18 +3785,18 @@ static av_cold void mpeg4_init_static(void) ff_rl_init(&ff_rvlc_rl_inter, mpeg4_rvlc_rl_tables[0]); ff_rl_init(&ff_rvlc_rl_intra, mpeg4_rvlc_rl_tables[1]); INIT_FIRST_VLC_RL(ff_mpeg4_rl_intra, 554); - INIT_VLC_RL(ff_rvlc_rl_inter, 1072); + VLC_INIT_RL(ff_rvlc_rl_inter, 1072); INIT_FIRST_VLC_RL(ff_rvlc_rl_intra, 1072); - INIT_VLC_STATIC(&dc_lum, DC_VLC_BITS, 10 /* 13 */, + VLC_INIT_STATIC(&dc_lum, DC_VLC_BITS, 10 /* 13 */, &ff_mpeg4_DCtab_lum[0][1], 2, 1, &ff_mpeg4_DCtab_lum[0][0], 2, 1, 512); - INIT_VLC_STATIC(&dc_chrom, DC_VLC_BITS, 10 /* 13 */, + VLC_INIT_STATIC(&dc_chrom, DC_VLC_BITS, 10 /* 13 */, &ff_mpeg4_DCtab_chrom[0][1], 2, 1, &ff_mpeg4_DCtab_chrom[0][0], 2, 1, 512); - INIT_VLC_STATIC_FROM_LENGTHS(&sprite_trajectory, SPRITE_TRAJ_VLC_BITS, 15, + VLC_INIT_STATIC_FROM_LENGTHS(&sprite_trajectory, SPRITE_TRAJ_VLC_BITS, 15, ff_sprite_trajectory_lens, 1, NULL, 0, 0, 0, 0, 128); - INIT_VLC_STATIC(&mb_type_b_vlc, MB_TYPE_B_VLC_BITS, 4, + VLC_INIT_STATIC(&mb_type_b_vlc, MB_TYPE_B_VLC_BITS, 4, &ff_mb_type_b_tab[0][1], 2, 1, &ff_mb_type_b_tab[0][0], 2, 1, 16); } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/mpeg4videoenc.c b/arm/raspi/third_party/ffmpeg/libavcodec/mpeg4videoenc.c index 777635c4..d1e50612 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/mpeg4videoenc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/mpeg4videoenc.c @@ -916,7 +916,7 @@ static void mpeg4_encode_visual_object_header(MpegEncContext *s) int profile_and_level_indication; int vo_ver_id; - if (s->avctx->profile != FF_PROFILE_UNKNOWN) { + if (s->avctx->profile != AV_PROFILE_UNKNOWN) { profile_and_level_indication = s->avctx->profile << 4; } else if (s->max_b_frames || s->quarter_sample) { profile_and_level_indication = 0xF0; // adv simple @@ -924,7 +924,7 @@ static void mpeg4_encode_visual_object_header(MpegEncContext *s) profile_and_level_indication = 0x00; // simple } - if (s->avctx->level != FF_LEVEL_UNKNOWN) + if (s->avctx->level != AV_LEVEL_UNKNOWN) profile_and_level_indication |= s->avctx->level; else profile_and_level_indication |= 1; // level 1 diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/mpegaudiodec_common.c b/arm/raspi/third_party/ffmpeg/libavcodec/mpegaudiodec_common.c index 5fcb39b3..3a60b03e 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/mpegaudiodec_common.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/mpegaudiodec_common.c @@ -428,9 +428,9 @@ static av_cold void mpegaudiodec_common_init_static(void) ff_huff_vlc[++i].table = huff_vlc_tables + offset; ff_huff_vlc[i].table_allocated = FF_ARRAY_ELEMS(huff_vlc_tables) - offset; - ff_init_vlc_from_lengths(&ff_huff_vlc[i], 7, j, + ff_vlc_init_from_lengths(&ff_huff_vlc[i], 7, j, huff_lens, 1, tmp_symbols, 2, 2, - 0, INIT_VLC_STATIC_OVERLONG, NULL); + 0, VLC_INIT_STATIC_OVERLONG, NULL); offset += ff_huff_vlc[i].table_size; huff_lens += j; huff_sym += j; @@ -443,9 +443,9 @@ static av_cold void mpegaudiodec_common_init_static(void) ff_huff_quad_vlc[i].table = huff_quad_vlc_tables + offset; ff_huff_quad_vlc[i].table_allocated = 1 << bits; offset += 1 << bits; - init_vlc(&ff_huff_quad_vlc[i], bits, 16, + vlc_init(&ff_huff_quad_vlc[i], bits, 16, mpa_quad_bits[i], 1, 1, mpa_quad_codes[i], 1, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); } av_assert0(offset == FF_ARRAY_ELEMS(huff_quad_vlc_tables)); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/mpegaudiodsp.c b/arm/raspi/third_party/ffmpeg/libavcodec/mpegaudiodsp.c index 5a5a679d..0971c287 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/mpegaudiodsp.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/mpegaudiodsp.c @@ -23,7 +23,6 @@ #include "libavutil/thread.h" #include "mpegaudio.h" #include "mpegaudiodsp.h" -#include "dct.h" #include "dct32.h" static AVOnce mpadsp_table_init = AV_ONCE_INIT; @@ -81,15 +80,12 @@ static av_cold void mpadsp_init_tabs(void) av_cold void ff_mpadsp_init(MPADSPContext *s) { - DCTContext dct; - - ff_dct_init(&dct, 5, DCT_II); ff_thread_once(&mpadsp_table_init, &mpadsp_init_tabs); s->apply_window_float = ff_mpadsp_apply_window_float; s->apply_window_fixed = ff_mpadsp_apply_window_fixed; - s->dct32_float = dct.dct32; + s->dct32_float = ff_dct32_float; s->dct32_fixed = ff_dct32_fixed; s->imdct36_blocks_float = ff_imdct36_blocks_float; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/mpegpicture.c b/arm/raspi/third_party/ffmpeg/libavcodec/mpegpicture.c index 71c7a3fd..b7c804c8 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/mpegpicture.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/mpegpicture.c @@ -171,17 +171,10 @@ static int alloc_frame_buffer(AVCodecContext *avctx, Picture *pic, pic->f->height = avctx->height; } - if (avctx->hwaccel) { - assert(!pic->hwaccel_picture_private); - if (avctx->hwaccel->frame_priv_data_size) { - pic->hwaccel_priv_buf = ff_hwaccel_frame_priv_alloc(avctx, avctx->hwaccel); - if (!pic->hwaccel_priv_buf) { - av_log(avctx, AV_LOG_ERROR, "alloc_frame_buffer() failed (hwaccel private data allocation)\n"); - return -1; - } - pic->hwaccel_picture_private = pic->hwaccel_priv_buf->data; - } - } + ret = ff_hwaccel_frame_priv_alloc(avctx, &pic->hwaccel_picture_private, + &pic->hwaccel_priv_buf); + if (ret < 0) + return ret; if ((linesize && linesize != pic->f->linesize[0]) || (uvlinesize && uvlinesize != pic->f->linesize[1])) { diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/mpegutils.c b/arm/raspi/third_party/ffmpeg/libavcodec/mpegutils.c index 2d812a25..5e76d7ac 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/mpegutils.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/mpegutils.c @@ -21,6 +21,7 @@ #include #include "libavutil/common.h" +#include "libavutil/emms.h" #include "libavutil/frame.h" #include "libavutil/pixdesc.h" #include "libavutil/motion_vector.h" diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/mpegvideo_dec.c b/arm/raspi/third_party/ffmpeg/libavcodec/mpegvideo_dec.c index 670b0912..f9fccff5 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/mpegvideo_dec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/mpegvideo_dec.c @@ -25,6 +25,7 @@ #include "config_components.h" #include "libavutil/avassert.h" +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/internal.h" #include "libavutil/video_enc_params.h" @@ -36,6 +37,7 @@ #include "mpegvideo.h" #include "mpegvideodec.h" #include "mpeg4videodec.h" +#include "thread.h" #include "threadframe.h" #include "wmv2dec.h" @@ -154,21 +156,16 @@ do {\ s->divx_packed = s1->divx_packed; if (s1->bitstream_buffer) { - if (s1->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); - if (!s->bitstream_buffer) { - s->bitstream_buffer_size = 0; - return AVERROR(ENOMEM); - } + av_fast_padded_malloc(&s->bitstream_buffer, + &s->allocated_bitstream_buffer_size, + s1->bitstream_buffer_size); + if (!s->bitstream_buffer) { + s->bitstream_buffer_size = 0; + return AVERROR(ENOMEM); } s->bitstream_buffer_size = s1->bitstream_buffer_size; memcpy(s->bitstream_buffer, s1->bitstream_buffer, s1->bitstream_buffer_size); - memset(s->bitstream_buffer + s->bitstream_buffer_size, 0, - AV_INPUT_BUFFER_PADDING_SIZE); } // linesize-dependent scratch buffer allocation @@ -248,14 +245,16 @@ static int alloc_picture(MpegEncContext *s, Picture *pic) &s->linesize, &s->uvlinesize); } -static void gray_frame(AVFrame *frame) +static void color_frame(AVFrame *frame, int luma) { int h_chroma_shift, v_chroma_shift; - av_pix_fmt_get_chroma_sub_sample(frame->format, &h_chroma_shift, &v_chroma_shift); - for (int i = 0; i < frame->height; i++) - memset(frame->data[0] + frame->linesize[0] * i, 0x80, frame->width); + memset(frame->data[0] + frame->linesize[0] * i, luma, frame->width); + + if (!frame->data[1]) + return; + av_pix_fmt_get_chroma_sub_sample(frame->format, &h_chroma_shift, &v_chroma_shift); for (int i = 0; i < AV_CEIL_RSHIFT(frame->height, v_chroma_shift); i++) { memset(frame->data[1] + frame->linesize[1] * i, 0x80, AV_CEIL_RSHIFT(frame->width, h_chroma_shift)); @@ -366,9 +365,6 @@ FF_ENABLE_DEPRECATION_WARNINGS if ((!s->last_picture_ptr || !s->last_picture_ptr->f->buf[0]) && (s->pict_type != AV_PICTURE_TYPE_I)) { - int h_chroma_shift, v_chroma_shift; - av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, - &h_chroma_shift, &v_chroma_shift); if (s->pict_type == AV_PICTURE_TYPE_B && s->next_picture_ptr && s->next_picture_ptr->f->buf[0]) av_log(avctx, AV_LOG_DEBUG, "allocating dummy last picture for B frame\n"); @@ -394,23 +390,8 @@ FF_ENABLE_DEPRECATION_WARNINGS } if (!avctx->hwaccel) { - for (int 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); - if (s->last_picture_ptr->f->data[2]) { - for (int i = 0; i < AV_CEIL_RSHIFT(avctx->height, v_chroma_shift); i++) { - memset(s->last_picture_ptr->f->data[1] + s->last_picture_ptr->f->linesize[1]*i, - 0x80, AV_CEIL_RSHIFT(avctx->width, h_chroma_shift)); - memset(s->last_picture_ptr->f->data[2] + s->last_picture_ptr->f->linesize[2]*i, - 0x80, AV_CEIL_RSHIFT(avctx->width, h_chroma_shift)); - } - } - - if (s->codec_id == AV_CODEC_ID_FLV1 || s->codec_id == AV_CODEC_ID_H263) { - for (int i = 0; i < avctx->height; i++) - memset(s->last_picture_ptr->f->data[0] + s->last_picture_ptr->f->linesize[0] * i, - 16, avctx->width); - } + int luma_val = s->codec_id == AV_CODEC_ID_FLV1 || s->codec_id == AV_CODEC_ID_H263 ? 16 : 0x80; + color_frame(s->last_picture_ptr->f, luma_val); } ff_thread_report_progress(&s->last_picture_ptr->tf, INT_MAX, 0); @@ -438,10 +419,6 @@ FF_ENABLE_DEPRECATION_WARNINGS ff_thread_report_progress(&s->next_picture_ptr->tf, INT_MAX, 1); } -#if 0 // BUFREF-FIXME - memset(s->last_picture.f->data, 0, sizeof(s->last_picture.f->data)); - memset(s->next_picture.f->data, 0, sizeof(s->next_picture.f->data)); -#endif if (s->last_picture_ptr) { if (s->last_picture_ptr->f->buf[0] && (ret = ff_mpeg_ref_picture(s->avctx, &s->last_picture, @@ -485,7 +462,7 @@ FF_ENABLE_DEPRECATION_WARNINGS } if (s->avctx->debug & FF_DEBUG_NOMC) - gray_frame(s->current_picture_ptr->f); + color_frame(s->current_picture_ptr->f, 0x80); return 0; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/mpegvideo_enc.c b/arm/raspi/third_party/ffmpeg/libavcodec/mpegvideo_enc.c index 9bdf5dbe..5bf4b06a 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/mpegvideo_enc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/mpegvideo_enc.c @@ -35,6 +35,7 @@ #include +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "libavutil/intmath.h" #include "libavutil/mathematics.h" @@ -43,7 +44,6 @@ #include "libavutil/opt.h" #include "libavutil/thread.h" #include "avcodec.h" -#include "dct.h" #include "encode.h" #include "idctdsp.h" #include "mpeg12codecs.h" @@ -973,7 +973,7 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx) } } - cpb_props = ff_add_cpb_side_data(avctx); + cpb_props = ff_encode_add_cpb_side_data(avctx); if (!cpb_props) return AVERROR(ENOMEM); cpb_props->max_bitrate = avctx->rc_max_rate; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/mpegvideo_parser.c b/arm/raspi/third_party/ffmpeg/libavcodec/mpegvideo_parser.c index 1204789c..2cd03483 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/mpegvideo_parser.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/mpegvideo_parser.c @@ -105,22 +105,23 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s, { struct MpvParseContext *pc = s->priv_data; const uint8_t *buf_end = buf + buf_size; - uint32_t start_code; - int frame_rate_index, ext_type, bytes_left; - int frame_rate_ext_n, frame_rate_ext_d; - int top_field_first, repeat_first_field, progressive_frame; - int horiz_size_ext, vert_size_ext, bit_rate_ext; + int bytes_left; int did_set_size=0; 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; + // number of picture coding extensions (i.e. MPEG2 pictures) + // in this packet - should be 1 or 2 + int nb_pic_ext = 0; + // when there are two pictures in the packet this indicates + // which field is in the first of them + int first_field = AV_FIELD_UNKNOWN; + +//FIXME replace the crap with get_bits() while (buf < buf_end) { - start_code= -1; + uint32_t start_code = -1; buf= avpriv_find_start_code(buf, buf_end, &start_code); bytes_left = buf_end - buf; switch(start_code) { @@ -129,11 +130,12 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s, s->pict_type = (buf[1] >> 3) & 7; if (bytes_left >= 4) vbv_delay = ((buf[1] & 0x07) << 13) | (buf[2] << 5) | (buf[3] >> 3); - s->repeat_pict = 1; } break; case SEQ_START_CODE: if (bytes_left >= 7) { + int frame_rate_index; + pc->width = (buf[0] << 4) | (buf[1] >> 4); pc->height = ((buf[1] & 0x0f) << 8) | buf[2]; if(!avctx->width || !avctx->height || !avctx->coded_width || !avctx->coded_height){ @@ -154,20 +156,18 @@ FF_ENABLE_DEPRECATION_WARNINGS break; case EXT_START_CODE: if (bytes_left >= 1) { - ext_type = (buf[0] >> 4); - switch(ext_type) { + switch (buf[0] >> 4) { // ext_type case 0x1: /* sequence extension */ if (bytes_left >= 6) { - horiz_size_ext = ((buf[1] & 1) << 1) | (buf[2] >> 7); - vert_size_ext = (buf[2] >> 5) & 3; - bit_rate_ext = ((buf[2] & 0x1F)<<7) | (buf[3]>>1); - frame_rate_ext_n = (buf[5] >> 5) & 3; - frame_rate_ext_d = (buf[5] & 0x1f); + int horiz_size_ext = ((buf[1] & 1) << 1) | (buf[2] >> 7); + int vert_size_ext = (buf[2] >> 5) & 3; + int bit_rate_ext = ((buf[2] & 0x1F)<<7) | (buf[3]>>1); + int frame_rate_ext_n = (buf[5] >> 5) & 3; + int frame_rate_ext_d = (buf[5] & 0x1f); pc->progressive_sequence = buf[1] & (1 << 3); avctx->has_b_frames= !(buf[5] >> 7); - chroma_format = (buf[1] >> 1) & 3; - switch (chroma_format) { + switch ((buf[1] >> 1) & 3) { // 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; @@ -190,11 +190,12 @@ FF_ENABLE_DEPRECATION_WARNINGS break; case 0x8: /* picture coding extension */ if (bytes_left >= 5) { - top_field_first = buf[3] & (1 << 7); - repeat_first_field = buf[3] & (1 << 1); - progressive_frame = buf[4] & (1 << 7); + int top_field_first = buf[3] & (1 << 7); + int repeat_first_field = buf[3] & (1 << 1); + int progressive_frame = buf[4] & (1 << 7); /* check if we must repeat the frame */ + s->repeat_pict = 1; if (repeat_first_field) { if (pc->progressive_sequence) { if (top_field_first) @@ -213,6 +214,19 @@ FF_ENABLE_DEPRECATION_WARNINGS s->field_order = AV_FIELD_BB; } else s->field_order = AV_FIELD_PROGRESSIVE; + + s->picture_structure = buf[2] & 3; + + if (!nb_pic_ext) { + // remember parity of the first field for the case + // when there are 2 fields in packet + switch (s->picture_structure) { + case AV_PICTURE_STRUCTURE_BOTTOM_FIELD: first_field = AV_FIELD_BB; break; + case AV_PICTURE_STRUCTURE_TOP_FIELD: first_field = AV_FIELD_TT; break; + } + } + + nb_pic_ext++; } break; } @@ -233,7 +247,7 @@ FF_ENABLE_DEPRECATION_WARNINGS if (set_dim_ret < 0) av_log(avctx, AV_LOG_ERROR, "Failed to set dimensions\n"); - if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO && bit_rate) { + if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO && bit_rate && bit_rate != 0x3FFFF) { avctx->rc_max_rate = 400LL*bit_rate; } if (bit_rate && @@ -248,6 +262,12 @@ FF_ENABLE_DEPRECATION_WARNINGS s->coded_width = FFALIGN(pc->width, 16); s->coded_height = FFALIGN(pc->height, 16); } + + if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO || nb_pic_ext > 1) { + s->repeat_pict = 1; + s->picture_structure = AV_PICTURE_STRUCTURE_FRAME; + s->field_order = nb_pic_ext > 1 ? first_field : AV_FIELD_PROGRESSIVE; + } } static int mpegvideo_parse(AVCodecParserContext *s, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/msmpeg4_vc1_data.c b/arm/raspi/third_party/ffmpeg/libavcodec/msmpeg4_vc1_data.c index 059c6f32..e6436687 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/msmpeg4_vc1_data.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/msmpeg4_vc1_data.c @@ -38,20 +38,20 @@ VLC ff_msmp4_dc_chroma_vlc[2]; static av_cold void msmp4_vc1_vlcs_init(void) { - INIT_VLC_STATIC(&ff_msmp4_dc_luma_vlc[0], MSMP4_DC_VLC_BITS, 120, + VLC_INIT_STATIC(&ff_msmp4_dc_luma_vlc[0], MSMP4_DC_VLC_BITS, 120, &ff_table0_dc_lum[0][1], 8, 4, &ff_table0_dc_lum[0][0], 8, 4, 1158); - INIT_VLC_STATIC(&ff_msmp4_dc_chroma_vlc[0], MSMP4_DC_VLC_BITS, 120, + VLC_INIT_STATIC(&ff_msmp4_dc_chroma_vlc[0], MSMP4_DC_VLC_BITS, 120, &ff_table0_dc_chroma[0][1], 8, 4, &ff_table0_dc_chroma[0][0], 8, 4, 1118); - INIT_VLC_STATIC(&ff_msmp4_dc_luma_vlc[1], MSMP4_DC_VLC_BITS, 120, + VLC_INIT_STATIC(&ff_msmp4_dc_luma_vlc[1], MSMP4_DC_VLC_BITS, 120, &ff_table1_dc_lum[0][1], 8, 4, &ff_table1_dc_lum[0][0], 8, 4, 1476); - INIT_VLC_STATIC(&ff_msmp4_dc_chroma_vlc[1], MSMP4_DC_VLC_BITS, 120, + VLC_INIT_STATIC(&ff_msmp4_dc_chroma_vlc[1], MSMP4_DC_VLC_BITS, 120, &ff_table1_dc_chroma[0][1], 8, 4, &ff_table1_dc_chroma[0][0], 8, 4, 1216); - INIT_VLC_STATIC(&ff_msmp4_mb_i_vlc, MSMP4_MB_INTRA_VLC_BITS, 64, + VLC_INIT_STATIC(&ff_msmp4_mb_i_vlc, MSMP4_MB_INTRA_VLC_BITS, 64, &ff_msmp4_mb_i_table[0][1], 4, 2, &ff_msmp4_mb_i_table[0][0], 4, 2, 536); } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/msmpeg4dec.c b/arm/raspi/third_party/ffmpeg/libavcodec/msmpeg4dec.c index 26a196a3..a81241b1 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/msmpeg4dec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/msmpeg4dec.c @@ -301,33 +301,33 @@ static av_cold void msmpeg4_decode_init_static(void) INIT_FIRST_VLC_RL(ff_rl_table[0], 642); INIT_FIRST_VLC_RL(ff_rl_table[1], 1104); INIT_FIRST_VLC_RL(ff_rl_table[2], 554); - INIT_VLC_RL(ff_rl_table[3], 940); - INIT_VLC_RL(ff_rl_table[4], 962); + VLC_INIT_RL(ff_rl_table[3], 940); + VLC_INIT_RL(ff_rl_table[4], 962); /* ff_rl_table[5] coincides with ff_h263_rl_inter which has just been * initialized in ff_h263_decode_init() earlier. So just copy the VLCs. */ av_assert1(ff_h263_rl_inter.rl_vlc[0]); memcpy(ff_rl_table[5].rl_vlc, ff_h263_rl_inter.rl_vlc, sizeof(ff_rl_table[5].rl_vlc)); mv = &ff_mv_tables[0]; - INIT_VLC_STATIC(&mv->vlc, MV_VLC_BITS, MSMPEG4_MV_TABLES_NB_ELEMS + 1, + VLC_INIT_STATIC(&mv->vlc, MV_VLC_BITS, MSMPEG4_MV_TABLES_NB_ELEMS + 1, mv->table_mv_bits, 1, 1, mv->table_mv_code, 2, 2, 3714); mv = &ff_mv_tables[1]; - INIT_VLC_STATIC(&mv->vlc, MV_VLC_BITS, MSMPEG4_MV_TABLES_NB_ELEMS + 1, + VLC_INIT_STATIC(&mv->vlc, MV_VLC_BITS, MSMPEG4_MV_TABLES_NB_ELEMS + 1, mv->table_mv_bits, 1, 1, mv->table_mv_code, 2, 2, 2694); - INIT_VLC_STATIC(&v2_dc_lum_vlc, MSMP4_DC_VLC_BITS, 512, + VLC_INIT_STATIC(&v2_dc_lum_vlc, MSMP4_DC_VLC_BITS, 512, &ff_v2_dc_lum_table[0][1], 8, 4, &ff_v2_dc_lum_table[0][0], 8, 4, 1472); - INIT_VLC_STATIC(&v2_dc_chroma_vlc, MSMP4_DC_VLC_BITS, 512, + VLC_INIT_STATIC(&v2_dc_chroma_vlc, MSMP4_DC_VLC_BITS, 512, &ff_v2_dc_chroma_table[0][1], 8, 4, &ff_v2_dc_chroma_table[0][0], 8, 4, 1506); - INIT_VLC_STATIC(&v2_intra_cbpc_vlc, V2_INTRA_CBPC_VLC_BITS, 4, + VLC_INIT_STATIC(&v2_intra_cbpc_vlc, V2_INTRA_CBPC_VLC_BITS, 4, &ff_v2_intra_cbpc[0][1], 2, 1, &ff_v2_intra_cbpc[0][0], 2, 1, 8); - INIT_VLC_STATIC(&v2_mb_type_vlc, V2_MB_TYPE_VLC_BITS, 8, + VLC_INIT_STATIC(&v2_mb_type_vlc, V2_MB_TYPE_VLC_BITS, 8, &ff_v2_mb_type[0][1], 2, 1, &ff_v2_mb_type[0][0], 2, 1, 128); @@ -335,14 +335,14 @@ static av_cold void msmpeg4_decode_init_static(void) static VLCElem vlc_buf[1636 + 2648 + 1532 + 2488]; ff_mb_non_intra_vlc[i].table = &vlc_buf[offset]; ff_mb_non_intra_vlc[i].table_allocated = FF_ARRAY_ELEMS(vlc_buf) - offset; - init_vlc(&ff_mb_non_intra_vlc[i], MB_NON_INTRA_VLC_BITS, 128, + vlc_init(&ff_mb_non_intra_vlc[i], MB_NON_INTRA_VLC_BITS, 128, &ff_wmv2_inter_table[i][0][1], 8, 4, &ff_wmv2_inter_table[i][0][0], 8, 4, - INIT_VLC_STATIC_OVERLONG); + VLC_INIT_STATIC_OVERLONG); offset += ff_mb_non_intra_vlc[i].table_size; } - INIT_VLC_STATIC(&ff_inter_intra_vlc, INTER_INTRA_VLC_BITS, 4, + VLC_INIT_STATIC(&ff_inter_intra_vlc, INTER_INTRA_VLC_BITS, 4, &ff_table_inter_intra[0][1], 2, 1, &ff_table_inter_intra[0][0], 2, 1, 8); ff_msmp4_vc1_vlcs_init_once(); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/msmpeg4enc.c b/arm/raspi/third_party/ffmpeg/libavcodec/msmpeg4enc.c index 9828901b..a8ddb8d8 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/msmpeg4enc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/msmpeg4enc.c @@ -284,7 +284,7 @@ void ff_msmpeg4_encode_ext_header(MpegEncContext * s) if (s->avctx->framerate.num > 0 && s->avctx->framerate.den > 0) fps = s->avctx->framerate.num / s->avctx->framerate.den; - else + else { FF_DISABLE_DEPRECATION_WARNINGS fps = s->avctx->time_base.den / s->avctx->time_base.num #if FF_API_TICKS_PER_FRAME @@ -292,6 +292,7 @@ FF_DISABLE_DEPRECATION_WARNINGS #endif ; FF_ENABLE_DEPRECATION_WARNINGS + } put_bits(&s->pb, 5, FFMIN(fps, 31)); //yes 29.97 -> 29 diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/mss2.c b/arm/raspi/third_party/ffmpeg/libavcodec/mss2.c index 98103f7f..2237cc8b 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/mss2.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/mss2.c @@ -324,7 +324,7 @@ static int decode_rle(GetBitContext *gb, uint8_t *pal_dst, ptrdiff_t pal_stride, if (next_code != 1 << current_length) return AVERROR_INVALIDDATA; - if ((i = init_vlc(&vlc, 9, alphabet_size, bits, 1, 1, codes, 4, 4, 0)) < 0) + if ((i = vlc_init(&vlc, 9, alphabet_size, bits, 1, 1, codes, 4, 4, 0)) < 0) return i; /* frame decode */ @@ -371,7 +371,7 @@ static int decode_rle(GetBitContext *gb, uint8_t *pal_dst, ptrdiff_t pal_stride, prev_avail = 1; } while (--h); - ff_free_vlc(&vlc); + ff_vlc_free(&vlc); return 0; } @@ -422,7 +422,7 @@ static int decode_wmv9(AVCodecContext *avctx, const uint8_t *buf, int buf_size, ff_vc1_decode_blocks(v); if (v->end_mb_x == s->mb_width && s->end_mb_y == s->mb_height) { - ff_er_frame_end(&s->er); + ff_er_frame_end(&s->er, NULL); } else { av_log(v->s.avctx, AV_LOG_WARNING, "disabling error correction due to block count mismatch %dx%d != %dx%d\n", @@ -797,8 +797,7 @@ static int mss2_decode_frame(AVCodecContext *avctx, AVFrame *frame, av_log(avctx, AV_LOG_WARNING, "buffer not fully consumed\n"); if (c->mvX < 0 || c->mvY < 0) { - av_frame_unref(ctx->last_pic); - ret = av_frame_ref(ctx->last_pic, frame); + ret = av_frame_replace(ctx->last_pic, frame); if (ret < 0) return ret; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/mss4.c b/arm/raspi/third_party/ffmpeg/libavcodec/mss4.c index 75f31bed..0e7cc3e1 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/mss4.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/mss4.c @@ -115,9 +115,9 @@ static av_cold void mss4_init_vlc(VLC *vlc, unsigned *offset, vlc->table = &vlc_buf[*offset]; vlc->table_allocated = FF_ARRAY_ELEMS(vlc_buf) - *offset; - ff_init_vlc_from_lengths(vlc, FFMIN(bits[idx - 1], 9), idx, + ff_vlc_init_from_lengths(vlc, FFMIN(bits[idx - 1], 9), idx, bits, 1, syms, 1, 1, - 0, INIT_VLC_STATIC_OVERLONG, NULL); + 0, VLC_INIT_STATIC_OVERLONG, NULL); *offset += vlc->table_size; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/mv30.c b/arm/raspi/third_party/ffmpeg/libavcodec/mv30.c index c2d05470..9c72c008 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/mv30.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/mv30.c @@ -643,8 +643,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, return ret; } - av_frame_unref(s->prev_frame); - if ((ret = av_frame_ref(s->prev_frame, frame)) < 0) + if ((ret = av_frame_replace(s->prev_frame, frame)) < 0) return ret; *got_frame = 1; @@ -658,7 +657,7 @@ static const uint8_t cbp_bits[] = { static av_cold void init_static_data(void) { - INIT_VLC_STATIC_FROM_LENGTHS(&cbp_tab, CBP_VLC_BITS, FF_ARRAY_ELEMS(cbp_bits), + VLC_INIT_STATIC_FROM_LENGTHS(&cbp_tab, CBP_VLC_BITS, FF_ARRAY_ELEMS(cbp_bits), cbp_bits, 1, NULL, 0, 0, 0, 0, 1 << CBP_VLC_BITS); } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/mvha.c b/arm/raspi/third_party/ffmpeg/libavcodec/mvha.c index 8fb4a69e..356cebc6 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/mvha.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/mvha.c @@ -83,7 +83,7 @@ static int build_vlc(AVCodecContext *avctx, VLC *vlc) uint8_t xlat[256]; int cur_node, i, j, pos = 0; - ff_free_vlc(vlc); + ff_vlc_free(vlc); for (i = 0; i < s->nb_symbols; i++) { nodes[i].count = s->prob[i]; @@ -140,7 +140,7 @@ static int build_vlc(AVCodecContext *avctx, VLC *vlc) get_tree_codes(bits, lens, xlat, nodes, cur_node - 1, 0, 0, &pos); - return ff_init_vlc_sparse(vlc, 12, pos, lens, 2, 2, bits, 4, 4, xlat, 1, 1, 0); + return ff_vlc_init_sparse(vlc, 12, pos, lens, 2, 2, bits, 4, 4, xlat, 1, 1, 0); } static int decode_frame(AVCodecContext *avctx, AVFrame *frame, @@ -294,7 +294,7 @@ static av_cold int decode_close(AVCodecContext *avctx) MVHAContext *s = avctx->priv_data; ff_inflate_end(&s->zstream); - ff_free_vlc(&s->vlc); + ff_vlc_free(&s->vlc); return 0; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/mwsc.c b/arm/raspi/third_party/ffmpeg/libavcodec/mwsc.c index c7045ac7..f8c53c33 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/mwsc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/mwsc.c @@ -127,8 +127,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, frame->pict_type = (frame->flags & AV_FRAME_FLAG_KEY) ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P; - av_frame_unref(s->prev_frame); - if ((ret = av_frame_ref(s->prev_frame, frame)) < 0) + if ((ret = av_frame_replace(s->prev_frame, frame)) < 0) return ret; *got_frame = 1; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/notchlc.c b/arm/raspi/third_party/ffmpeg/libavcodec/notchlc.c index d973c83a..0feb0918 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/notchlc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/notchlc.c @@ -76,12 +76,13 @@ static int lz4_decompress(AVCodecContext *avctx, GetByteContext *gb, PutByteContext *pb) { - unsigned reference_pos, match_length, delta, pos = 0; + unsigned reference_pos, delta, pos = 0; uint8_t history[64 * 1024]; + int match_length; while (bytestream2_get_bytes_left(gb) > 0) { uint8_t token = bytestream2_get_byte(gb); - unsigned num_literals = token >> 4; + int num_literals = token >> 4; if (num_literals == 15) { unsigned char current; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/nuv.c b/arm/raspi/third_party/ffmpeg/libavcodec/nuv.c index 82048e93..1dda770c 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/nuv.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/nuv.c @@ -56,8 +56,8 @@ static void copy_frame(AVFrame *f, const uint8_t *src, int width, int height) int src_linesize[4]; av_image_fill_arrays(src_data, src_linesize, src, f->format, width, height, 1); - av_image_copy(f->data, f->linesize, (const uint8_t **)src_data, src_linesize, - f->format, width, height); + av_image_copy2(f->data, f->linesize, src_data, src_linesize, + f->format, width, height); } /** diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_av1.c b/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_av1.c index 3bbcd761..74b04421 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_av1.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_av1.c @@ -23,6 +23,7 @@ #include "avcodec.h" #include "nvdec.h" #include "decode.h" +#include "hwaccel_internal.h" #include "internal.h" #include "av1dec.h" @@ -337,11 +338,11 @@ static int nvdec_av1_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ return ff_nvdec_frame_params(avctx, hw_frames_ctx, 8 * 2, 0); } -const AVHWAccel ff_av1_nvdec_hwaccel = { - .name = "av1_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AV1, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_av1_nvdec_hwaccel = { + .p.name = "av1_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_av1_start_frame, .end_frame = ff_nvdec_simple_end_frame, .decode_slice = nvdec_av1_decode_slice, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_h264.c b/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_h264.c index 116bd4fb..f022619b 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_h264.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_h264.c @@ -28,6 +28,7 @@ #include "decode.h" #include "internal.h" #include "h264dec.h" +#include "hwaccel_internal.h" static void dpb_add(const H264Context *h, CUVIDH264DPBENTRY *dst, const H264Picture *src, int frame_idx) @@ -169,11 +170,11 @@ static int nvdec_h264_frame_params(AVCodecContext *avctx, return ff_nvdec_frame_params(avctx, hw_frames_ctx, sps->ref_frame_count + sps->num_reorder_frames, 0); } -const AVHWAccel ff_h264_nvdec_hwaccel = { - .name = "h264_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_h264_nvdec_hwaccel = { + .p.name = "h264_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_h264_start_frame, .end_frame = ff_nvdec_end_frame, .decode_slice = nvdec_h264_decode_slice, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_hevc.c b/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_hevc.c index cd549d2e..91fb9f53 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_hevc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_hevc.c @@ -29,6 +29,7 @@ #include "internal.h" #include "hevcdec.h" #include "hevc_data.h" +#include "hwaccel_internal.h" static void dpb_add(CUVIDHEVCPICPARAMS *pp, int idx, const HEVCFrame *src) { @@ -308,11 +309,11 @@ static int nvdec_hevc_decode_init(AVCodecContext *avctx) { return ff_nvdec_decode_init(avctx); } -const AVHWAccel ff_hevc_nvdec_hwaccel = { - .name = "hevc_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_hevc_nvdec_hwaccel = { + .p.name = "hevc_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_hevc_start_frame, .end_frame = ff_nvdec_end_frame, .decode_slice = nvdec_hevc_decode_slice, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_mjpeg.c b/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_mjpeg.c index fce464c1..850634bf 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_mjpeg.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_mjpeg.c @@ -25,6 +25,7 @@ #include "mjpegdec.h" #include "nvdec.h" #include "decode.h" +#include "hwaccel_internal.h" static int nvdec_mjpeg_start_frame(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size) { @@ -69,11 +70,11 @@ static int nvdec_mjpeg_frame_params(AVCodecContext *avctx, return ff_nvdec_frame_params(avctx, hw_frames_ctx, 1, 0); } -AVHWAccel ff_mjpeg_nvdec_hwaccel = { - .name = "mjpeg_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MJPEG, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_mjpeg_nvdec_hwaccel = { + .p.name = "mjpeg_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MJPEG, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_mjpeg_start_frame, .end_frame = ff_nvdec_simple_end_frame, .decode_slice = nvdec_mjpeg_decode_slice, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_mpeg12.c b/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_mpeg12.c index 3b9ff607..a4603c7e 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_mpeg12.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_mpeg12.c @@ -23,6 +23,7 @@ #include "config_components.h" #include "avcodec.h" +#include "hwaccel_internal.h" #include "internal.h" #include "mpegvideo.h" #include "nvdec.h" @@ -99,11 +100,11 @@ static int nvdec_mpeg12_frame_params(AVCodecContext *avctx, } #if CONFIG_MPEG2_NVDEC_HWACCEL -const AVHWAccel ff_mpeg2_nvdec_hwaccel = { - .name = "mpeg2_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG2VIDEO, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_mpeg2_nvdec_hwaccel = { + .p.name = "mpeg2_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG2VIDEO, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_mpeg12_start_frame, .end_frame = ff_nvdec_simple_end_frame, .decode_slice = ff_nvdec_simple_decode_slice, @@ -115,11 +116,11 @@ const AVHWAccel ff_mpeg2_nvdec_hwaccel = { #endif #if CONFIG_MPEG1_NVDEC_HWACCEL -const AVHWAccel ff_mpeg1_nvdec_hwaccel = { - .name = "mpeg1_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG1VIDEO, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_mpeg1_nvdec_hwaccel = { + .p.name = "mpeg1_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG1VIDEO, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_mpeg12_start_frame, .end_frame = ff_nvdec_simple_end_frame, .decode_slice = ff_nvdec_simple_decode_slice, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_mpeg4.c b/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_mpeg4.c index c193f6b6..20a04994 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_mpeg4.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_mpeg4.c @@ -26,6 +26,7 @@ #include "mpeg4videodefs.h" #include "nvdec.h" #include "decode.h" +#include "hwaccel_internal.h" static int nvdec_mpeg4_start_frame(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size) { @@ -109,11 +110,11 @@ static int nvdec_mpeg4_frame_params(AVCodecContext *avctx, return ff_nvdec_frame_params(avctx, hw_frames_ctx, 2, 0); } -const AVHWAccel ff_mpeg4_nvdec_hwaccel = { - .name = "mpeg4_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG4, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_mpeg4_nvdec_hwaccel = { + .p.name = "mpeg4_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG4, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_mpeg4_start_frame, .end_frame = ff_nvdec_simple_end_frame, .decode_slice = nvdec_mpeg4_decode_slice, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_vc1.c b/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_vc1.c index fae1cb0a..5096d784 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_vc1.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_vc1.c @@ -23,6 +23,7 @@ #include "config_components.h" #include "avcodec.h" +#include "hwaccel_internal.h" #include "internal.h" #include "nvdec.h" #include "decode.h" @@ -113,11 +114,11 @@ static int nvdec_vc1_frame_params(AVCodecContext *avctx, return ff_nvdec_frame_params(avctx, hw_frames_ctx, 2, 0); } -const AVHWAccel ff_vc1_nvdec_hwaccel = { - .name = "vc1_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VC1, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_vc1_nvdec_hwaccel = { + .p.name = "vc1_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VC1, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_vc1_start_frame, .end_frame = ff_nvdec_simple_end_frame, .decode_slice = ff_nvdec_simple_decode_slice, @@ -128,11 +129,11 @@ const AVHWAccel ff_vc1_nvdec_hwaccel = { }; #if CONFIG_WMV3_NVDEC_HWACCEL -const AVHWAccel ff_wmv3_nvdec_hwaccel = { - .name = "wmv3_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WMV3, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_wmv3_nvdec_hwaccel = { + .p.name = "wmv3_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WMV3, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_vc1_start_frame, .end_frame = ff_nvdec_simple_end_frame, .decode_slice = ff_nvdec_simple_decode_slice, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_vp8.c b/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_vp8.c index f174ca43..ff3b3f25 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_vp8.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_vp8.c @@ -23,6 +23,7 @@ #include "avcodec.h" #include "nvdec.h" #include "decode.h" +#include "hwaccel_internal.h" #include "internal.h" #include "vp8.h" @@ -90,11 +91,11 @@ static int nvdec_vp8_frame_params(AVCodecContext *avctx, return ff_nvdec_frame_params(avctx, hw_frames_ctx, 3, 0); } -AVHWAccel ff_vp8_nvdec_hwaccel = { - .name = "vp8_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP8, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_vp8_nvdec_hwaccel = { + .p.name = "vp8_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP8, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_vp8_start_frame, .end_frame = ff_nvdec_simple_end_frame, .decode_slice = ff_nvdec_simple_decode_slice, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_vp9.c b/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_vp9.c index a76bcf99..e196391c 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_vp9.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/nvdec_vp9.c @@ -25,6 +25,7 @@ #include "avcodec.h" #include "nvdec.h" #include "decode.h" +#include "hwaccel_internal.h" #include "internal.h" #include "vp9shared.h" @@ -169,11 +170,11 @@ static int nvdec_vp9_frame_params(AVCodecContext *avctx, return ff_nvdec_frame_params(avctx, hw_frames_ctx, 8, 0); } -const AVHWAccel ff_vp9_nvdec_hwaccel = { - .name = "vp9_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP9, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_vp9_nvdec_hwaccel = { + .p.name = "vp9_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP9, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_vp9_start_frame, .end_frame = ff_nvdec_simple_end_frame, .decode_slice = ff_nvdec_simple_decode_slice, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/nvenc.c b/arm/raspi/third_party/ffmpeg/libavcodec/nvenc.c index 0b641767..02486c20 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/nvenc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/nvenc.c @@ -36,6 +36,7 @@ #include "libavutil/pixdesc.h" #include "libavutil/mathematics.h" #include "atsc_a53.h" +#include "codec_desc.h" #include "encode.h" #include "internal.h" #include "packet_internal.h" @@ -1166,8 +1167,13 @@ static av_cold int nvenc_setup_h264_config(AVCodecContext *avctx) || vui->videoFormat != 5 || vui->videoFullRangeFlag != 0); - h264->sliceMode = 3; - h264->sliceModeData = avctx->slices > 0 ? avctx->slices : 1; + if (ctx->max_slice_size > 0) { + h264->sliceMode = 1; + h264->sliceModeData = ctx->max_slice_size; + } else { + h264->sliceMode = 3; + h264->sliceModeData = avctx->slices > 0 ? avctx->slices : 1; + } if (ctx->intra_refresh) { h264->enableIntraRefresh = 1; @@ -1214,19 +1220,19 @@ static av_cold int nvenc_setup_h264_config(AVCodecContext *avctx) switch(ctx->profile) { case NV_ENC_H264_PROFILE_BASELINE: cc->profileGUID = NV_ENC_H264_PROFILE_BASELINE_GUID; - avctx->profile = FF_PROFILE_H264_BASELINE; + avctx->profile = AV_PROFILE_H264_BASELINE; break; case NV_ENC_H264_PROFILE_MAIN: cc->profileGUID = NV_ENC_H264_PROFILE_MAIN_GUID; - avctx->profile = FF_PROFILE_H264_MAIN; + avctx->profile = AV_PROFILE_H264_MAIN; break; case NV_ENC_H264_PROFILE_HIGH: cc->profileGUID = NV_ENC_H264_PROFILE_HIGH_GUID; - avctx->profile = FF_PROFILE_H264_HIGH; + avctx->profile = AV_PROFILE_H264_HIGH; break; case NV_ENC_H264_PROFILE_HIGH_444P: cc->profileGUID = NV_ENC_H264_PROFILE_HIGH_444_GUID; - avctx->profile = FF_PROFILE_H264_HIGH_444_PREDICTIVE; + avctx->profile = AV_PROFILE_H264_HIGH_444_PREDICTIVE; break; } } @@ -1234,10 +1240,10 @@ static av_cold int nvenc_setup_h264_config(AVCodecContext *avctx) // force setting profile as high444p if input is AV_PIX_FMT_YUV444P if (IS_YUV444(ctx->data_pix_fmt)) { cc->profileGUID = NV_ENC_H264_PROFILE_HIGH_444_GUID; - avctx->profile = FF_PROFILE_H264_HIGH_444_PREDICTIVE; + avctx->profile = AV_PROFILE_H264_HIGH_444_PREDICTIVE; } - h264->chromaFormatIDC = avctx->profile == FF_PROFILE_H264_HIGH_444_PREDICTIVE ? 3 : 1; + h264->chromaFormatIDC = avctx->profile == AV_PROFILE_H264_HIGH_444_PREDICTIVE ? 3 : 1; h264->level = ctx->level; @@ -1287,8 +1293,13 @@ static av_cold int nvenc_setup_hevc_config(AVCodecContext *avctx) || vui->videoFormat != 5 || vui->videoFullRangeFlag != 0); - hevc->sliceMode = 3; - hevc->sliceModeData = avctx->slices > 0 ? avctx->slices : 1; + if (ctx->max_slice_size > 0) { + hevc->sliceMode = 1; + hevc->sliceModeData = ctx->max_slice_size; + } else { + hevc->sliceMode = 3; + hevc->sliceModeData = avctx->slices > 0 ? avctx->slices : 1; + } if (ctx->intra_refresh) { hevc->enableIntraRefresh = 1; @@ -1325,28 +1336,28 @@ static av_cold int nvenc_setup_hevc_config(AVCodecContext *avctx) switch (ctx->profile) { case NV_ENC_HEVC_PROFILE_MAIN: cc->profileGUID = NV_ENC_HEVC_PROFILE_MAIN_GUID; - avctx->profile = FF_PROFILE_HEVC_MAIN; + avctx->profile = AV_PROFILE_HEVC_MAIN; break; case NV_ENC_HEVC_PROFILE_MAIN_10: cc->profileGUID = NV_ENC_HEVC_PROFILE_MAIN10_GUID; - avctx->profile = FF_PROFILE_HEVC_MAIN_10; + avctx->profile = AV_PROFILE_HEVC_MAIN_10; break; case NV_ENC_HEVC_PROFILE_REXT: cc->profileGUID = NV_ENC_HEVC_PROFILE_FREXT_GUID; - avctx->profile = FF_PROFILE_HEVC_REXT; + avctx->profile = AV_PROFILE_HEVC_REXT; break; } // force setting profile as main10 if input is 10 bit if (IS_10BIT(ctx->data_pix_fmt)) { cc->profileGUID = NV_ENC_HEVC_PROFILE_MAIN10_GUID; - avctx->profile = FF_PROFILE_HEVC_MAIN_10; + avctx->profile = AV_PROFILE_HEVC_MAIN_10; } // force setting profile as rext if input is yuv444 if (IS_YUV444(ctx->data_pix_fmt)) { cc->profileGUID = NV_ENC_HEVC_PROFILE_FREXT_GUID; - avctx->profile = FF_PROFILE_HEVC_REXT; + avctx->profile = AV_PROFILE_HEVC_REXT; } hevc->chromaFormatIDC = IS_YUV444(ctx->data_pix_fmt) ? 3 : 1; @@ -1397,7 +1408,7 @@ static av_cold int nvenc_setup_av1_config(AVCodecContext *avctx) return AVERROR(ENOTSUP); } else { cc->profileGUID = NV_ENC_AV1_PROFILE_MAIN_GUID; - avctx->profile = FF_PROFILE_AV1_MAIN; + avctx->profile = AV_PROFILE_AV1_MAIN; } if (ctx->dpb_size >= 0) { @@ -1656,7 +1667,7 @@ FF_ENABLE_DEPRECATION_WARNINGS if (ctx->encode_config.rcParams.averageBitRate > 0) avctx->bit_rate = ctx->encode_config.rcParams.averageBitRate; - cpb_props = ff_add_cpb_side_data(avctx); + cpb_props = ff_encode_add_cpb_side_data(avctx); if (!cpb_props) return AVERROR(ENOMEM); cpb_props->max_bitrate = ctx->encode_config.rcParams.maxBitRate; @@ -1998,9 +2009,9 @@ static int nvenc_copy_frame(AVCodecContext *avctx, NvencSurface *nv_surface, if (frame->format == AV_PIX_FMT_YUV420P) FFSWAP(uint8_t*, dst_data[1], dst_data[2]); - av_image_copy(dst_data, dst_linesize, - (const uint8_t**)frame->data, frame->linesize, frame->format, - avctx->width, avctx->height); + av_image_copy2(dst_data, dst_linesize, + frame->data, frame->linesize, frame->format, + avctx->width, avctx->height); return 0; } @@ -2249,7 +2260,7 @@ static int nvenc_store_frame_data(AVCodecContext *avctx, NV_ENC_PIC_PARAMS *pic_ // in case the encoder got reconfigured, there might be leftovers av_buffer_unref(&frame_data->frame_opaque_ref); - if (frame && frame->opaque_ref && avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { + if (frame->opaque_ref && avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { frame_data->frame_opaque_ref = av_buffer_ref(frame->opaque_ref); if (!frame_data->frame_opaque_ref) return AVERROR(ENOMEM); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/nvenc.h b/arm/raspi/third_party/ffmpeg/libavcodec/nvenc.h index 3a4b456a..cf0e8e59 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/nvenc.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/nvenc.h @@ -262,6 +262,7 @@ typedef struct NvencContext int udu_sei; int timing_info; int highbitdepth; + int max_slice_size; } NvencContext; int ff_nvenc_encode_init(AVCodecContext *avctx); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/nvenc_h264.c b/arm/raspi/third_party/ffmpeg/libavcodec/nvenc_h264.c index a9986099..4440e49b 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/nvenc_h264.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/nvenc_h264.c @@ -206,6 +206,8 @@ static const AVOption options[] = { OFFSET(intra_refresh),AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, { "single-slice-intra-refresh", "Use single slice intra refresh", OFFSET(single_slice_intra_refresh), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, + { "max_slice_size", "Maximum encoded slice size in bytes", + OFFSET(max_slice_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE }, { "constrained-encoding", "Enable constrainedFrame encoding where each slice in the constrained picture is independent of other slices", OFFSET(constrained_encoding), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, { NULL } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/nvenc_hevc.c b/arm/raspi/third_party/ffmpeg/libavcodec/nvenc_hevc.c index a02f2778..e88f7e97 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/nvenc_hevc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/nvenc_hevc.c @@ -57,7 +57,7 @@ static const AVOption options[] = { { "ull", "Ultra low latency", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_TUNING_INFO_ULTRA_LOW_LATENCY }, 0, 0, VE, "tune" }, { "lossless", "Lossless", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_TUNING_INFO_LOSSLESS }, 0, 0, VE, "tune" }, #endif - { "profile", "Set the encoding profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = NV_ENC_HEVC_PROFILE_MAIN }, NV_ENC_HEVC_PROFILE_MAIN, FF_PROFILE_HEVC_REXT, VE, "profile" }, + { "profile", "Set the encoding profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = NV_ENC_HEVC_PROFILE_MAIN }, NV_ENC_HEVC_PROFILE_MAIN, AV_PROFILE_HEVC_REXT, VE, "profile" }, { "main", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_HEVC_PROFILE_MAIN }, 0, 0, VE, "profile" }, { "main10", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_HEVC_PROFILE_MAIN_10 }, 0, 0, VE, "profile" }, { "rext", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_HEVC_PROFILE_REXT }, 0, 0, VE, "profile" }, @@ -187,6 +187,8 @@ static const AVOption options[] = { OFFSET(intra_refresh),AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, { "single-slice-intra-refresh", "Use single slice intra refresh", OFFSET(single_slice_intra_refresh), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, + { "max_slice_size", "Maximum encoded slice size in bytes", + OFFSET(max_slice_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE }, { "constrained-encoding", "Enable constrainedFrame encoding where each slice in the constrained picture is independent of other slices", OFFSET(constrained_encoding), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, { NULL } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/omx.c b/arm/raspi/third_party/ffmpeg/libavcodec/omx.c index 6e667971..82fd4920 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/omx.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/omx.c @@ -531,14 +531,14 @@ static av_cold int omx_component_init(AVCodecContext *avctx, const char *role) CHECK(err); avc.nBFrames = 0; avc.nPFrames = avctx->gop_size - 1; - switch (s->profile == FF_PROFILE_UNKNOWN ? avctx->profile : s->profile) { - case FF_PROFILE_H264_BASELINE: + switch (s->profile == AV_PROFILE_UNKNOWN ? avctx->profile : s->profile) { + case AV_PROFILE_H264_BASELINE: avc.eProfile = OMX_VIDEO_AVCProfileBaseline; break; - case FF_PROFILE_H264_MAIN: + case AV_PROFILE_H264_MAIN: avc.eProfile = OMX_VIDEO_AVCProfileMain; break; - case FF_PROFILE_H264_HIGH: + case AV_PROFILE_H264_HIGH: avc.eProfile = OMX_VIDEO_AVCProfileHigh; break; default: @@ -793,7 +793,8 @@ static int omx_encode_frame(AVCodecContext *avctx, AVPacket *pkt, need_copy = 1; } if (need_copy) - av_image_copy(dst, linesize, (const uint8_t**) frame->data, frame->linesize, avctx->pix_fmt, avctx->width, avctx->height); + av_image_copy2(dst, linesize, frame->data, frame->linesize, + avctx->pix_fmt, avctx->width, avctx->height); buffer->nFlags = OMX_BUFFERFLAG_ENDOFFRAME; buffer->nOffset = 0; // Convert the timestamps to microseconds; some encoders can ignore @@ -919,10 +920,10 @@ static const AVOption options[] = { { "omx_libname", "OpenMAX library name", OFFSET(libname), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VDE }, { "omx_libprefix", "OpenMAX library prefix", OFFSET(libprefix), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VDE }, { "zerocopy", "Try to avoid copying input frames if possible", OFFSET(input_zerocopy), AV_OPT_TYPE_INT, { .i64 = CONFIG_OMX_RPI }, 0, 1, VE }, - { "profile", "Set the encoding profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, FF_PROFILE_H264_HIGH, VE, "profile" }, - { "baseline", "", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_BASELINE }, 0, 0, VE, "profile" }, - { "main", "", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_MAIN }, 0, 0, VE, "profile" }, - { "high", "", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_HIGH }, 0, 0, VE, "profile" }, + { "profile", "Set the encoding profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, AV_PROFILE_H264_HIGH, VE, "profile" }, + { "baseline", "", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_BASELINE }, 0, 0, VE, "profile" }, + { "main", "", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_MAIN }, 0, 0, VE, "profile" }, + { "high", "", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_HIGH }, 0, 0, VE, "profile" }, { NULL } }; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/on2avc.c b/arm/raspi/third_party/ffmpeg/libavcodec/on2avc.c index 74be1dcb..8d0c8812 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/on2avc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/on2avc.c @@ -51,9 +51,9 @@ typedef struct On2AVCContext { AVCodecContext *avctx; AVFloatDSPContext *fdsp; AVTXContext *mdct, *mdct_half, *mdct_small; - AVTXContext *fft128, *fft256, *fft512, *fft1024; + AVTXContext *fft64, *fft128, *fft256, *fft512; av_tx_fn mdct_fn, mdct_half_fn, mdct_small_fn; - av_tx_fn fft128_fn, fft256_fn, fft512_fn, fft1024_fn; + av_tx_fn fft64_fn, fft128_fn, fft256_fn, fft512_fn; void (*wtf)(struct On2AVCContext *ctx, float *out, float *in, int size); int is_av500; @@ -475,16 +475,16 @@ static void wtf_end_512(On2AVCContext *c, float *out, float *src, zero_head_and_tail(tmp1 + 256, 128, 13, 7); zero_head_and_tail(tmp1 + 384, 128, 15, 5); - c->fft128_fn(c->fft128, src + 0, tmp1 + 0, sizeof(float)); - c->fft128_fn(c->fft128, src + 128, tmp1 + 128, sizeof(float)); - c->fft128_fn(c->fft128, src + 256, tmp1 + 256, sizeof(float)); - c->fft128_fn(c->fft128, src + 384, tmp1 + 384, sizeof(float)); + c->fft64_fn(c->fft64, src + 0, tmp1 + 0, sizeof(float)); + c->fft64_fn(c->fft64, src + 128, tmp1 + 128, sizeof(float)); + c->fft64_fn(c->fft64, src + 256, tmp1 + 256, sizeof(float)); + c->fft64_fn(c->fft64, src + 384, tmp1 + 384, sizeof(float)); combine_fft(src, src + 128, src + 256, src + 384, tmp1, ff_on2avc_ctab_1, ff_on2avc_ctab_2, ff_on2avc_ctab_3, ff_on2avc_ctab_4, 512, 2); - c->fft512_fn(c->fft512, src, tmp1, sizeof(float)); + c->fft256_fn(c->fft256, src, tmp1, sizeof(float)); pretwiddle(&tmp0[ 0], src, 512, 84, 4, 16, 4, ff_on2avc_tabs_20_84_1); pretwiddle(&tmp0[128], src, 512, 84, 4, 16, 4, ff_on2avc_tabs_20_84_2); @@ -503,16 +503,16 @@ static void wtf_end_1024(On2AVCContext *c, float *out, float *src, zero_head_and_tail(tmp1 + 512, 256, 13, 7); zero_head_and_tail(tmp1 + 768, 256, 15, 5); - c->fft256_fn(c->fft256, src + 0, tmp1 + 0, sizeof(float)); - c->fft256_fn(c->fft256, src + 256, tmp1 + 256, sizeof(float)); - c->fft256_fn(c->fft256, src + 512, tmp1 + 512, sizeof(float)); - c->fft256_fn(c->fft256, src + 768, tmp1 + 768, sizeof(float)); + c->fft128_fn(c->fft128, src + 0, tmp1 + 0, sizeof(float)); + c->fft128_fn(c->fft128, src + 256, tmp1 + 256, sizeof(float)); + c->fft128_fn(c->fft128, src + 512, tmp1 + 512, sizeof(float)); + c->fft128_fn(c->fft128, src + 768, tmp1 + 768, sizeof(float)); combine_fft(src, src + 256, src + 512, src + 768, tmp1, ff_on2avc_ctab_1, ff_on2avc_ctab_2, ff_on2avc_ctab_3, ff_on2avc_ctab_4, 1024, 1); - c->fft1024_fn(c->fft1024, src, tmp1, sizeof(float)); + c->fft512_fn(c->fft512, src, tmp1, sizeof(float)); pretwiddle(&tmp0[ 0], src, 1024, 84, 4, 16, 4, ff_on2avc_tabs_20_84_1); pretwiddle(&tmp0[256], src, 1024, 84, 4, 16, 4, ff_on2avc_tabs_20_84_2); @@ -700,7 +700,7 @@ static int on2avc_reconstruct_channel_ext(On2AVCContext *c, AVFrame *dst, int of break; case WINDOW_TYPE_EXT5: c->wtf(c, buf, in, 512); - c->mdct_half_fn(c->mdct, buf + 512, in + 512, sizeof(float)); + c->mdct_half_fn(c->mdct_half, buf + 512, in + 512, sizeof(float)); for (i = 0; i < 256; i++) { FFSWAP(float, buf[i + 512], buf[1023 - i]); } @@ -892,9 +892,9 @@ static av_cold void on2avc_free_vlcs(On2AVCContext *c) { int i; - ff_free_vlc(&c->scale_diff); + ff_vlc_free(&c->scale_diff); for (i = 1; i < 16; i++) - ff_free_vlc(&c->cb_vlc[i]); + ff_vlc_free(&c->cb_vlc[i]); } static av_cold int on2avc_decode_init(AVCodecContext *avctx) @@ -956,27 +956,27 @@ static av_cold int on2avc_decode_init(AVCodecContext *avctx) if ((ret = av_tx_init(&c->mdct_small, &c->mdct_small_fn, AV_TX_FLOAT_MDCT, 1, 128, &scale, 0)) < 0) return ret; - if ((ret = av_tx_init(&c->fft1024, &c->fft1024_fn, AV_TX_FLOAT_FFT, 1, 1024, NULL, 0)) < 0) - return ret; if ((ret = av_tx_init(&c->fft512, &c->fft512_fn, AV_TX_FLOAT_FFT, 1, 512, NULL, 0)) < 0) return ret; - if ((ret = av_tx_init(&c->fft256, &c->fft256_fn, AV_TX_FLOAT_FFT, 0, 256, NULL, 0)) < 0) + if ((ret = av_tx_init(&c->fft256, &c->fft256_fn, AV_TX_FLOAT_FFT, 1, 256, NULL, 0)) < 0) return ret; if ((ret = av_tx_init(&c->fft128, &c->fft128_fn, AV_TX_FLOAT_FFT, 0, 128, NULL, 0)) < 0) return ret; + if ((ret = av_tx_init(&c->fft64, &c->fft64_fn, AV_TX_FLOAT_FFT, 0, 64, NULL, 0)) < 0) + return ret; c->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT); if (!c->fdsp) return AVERROR(ENOMEM); - ret = ff_init_vlc_from_lengths(&c->scale_diff, 9, ON2AVC_SCALE_DIFFS, + ret = ff_vlc_init_from_lengths(&c->scale_diff, 9, ON2AVC_SCALE_DIFFS, ff_on2avc_scale_diff_bits, 1, ff_on2avc_scale_diff_syms, 1, 1, -60, 0, avctx); if (ret < 0) goto vlc_fail; for (i = 1; i < 16; i++) { int idx = i - 1; - ret = ff_init_vlc_from_lengths(&c->cb_vlc[i], 9, ff_on2avc_cb_elems[idx], + ret = ff_vlc_init_from_lengths(&c->cb_vlc[i], 9, ff_on2avc_cb_elems[idx], lens, 1, syms, 2, 2, 0, 0, avctx); if (ret < 0) @@ -998,10 +998,10 @@ static av_cold int on2avc_decode_close(AVCodecContext *avctx) av_tx_uninit(&c->mdct); av_tx_uninit(&c->mdct_half); av_tx_uninit(&c->mdct_small); + av_tx_uninit(&c->fft64); av_tx_uninit(&c->fft128); av_tx_uninit(&c->fft256); av_tx_uninit(&c->fft512); - av_tx_uninit(&c->fft1024); av_freep(&c->fdsp); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/options_table.h b/arm/raspi/third_party/ffmpeg/libavcodec/options_table.h index bb4b894b..f2155232 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/options_table.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/options_table.h @@ -223,9 +223,9 @@ static const AVOption avcodec_options[] = { {"nssew", "nsse weight", OFFSET(nsse_weight), AV_OPT_TYPE_INT, {.i64 = 8 }, INT_MIN, INT_MAX, V|E}, {"skip_top", "number of macroblock rows at the top which are skipped", OFFSET(skip_top), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|D}, {"skip_bottom", "number of macroblock rows at the bottom which are skipped", OFFSET(skip_bottom), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|D}, -{"profile", NULL, OFFSET(profile), AV_OPT_TYPE_INT, {.i64 = FF_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, V|A|E|CC, "avctx.profile"}, -{"unknown", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, "avctx.profile"}, -{"main10", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_HEVC_MAIN_10 }, INT_MIN, INT_MAX, V|E, "avctx.profile"}, +{"profile", NULL, OFFSET(profile), AV_OPT_TYPE_INT, {.i64 = AV_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, V|A|E|CC, "avctx.profile"}, +{"unknown", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AV_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, "avctx.profile"}, +{"main10", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AV_PROFILE_HEVC_MAIN_10 }, INT_MIN, INT_MAX, V|E, "avctx.profile"}, {"level", NULL, OFFSET(level), AV_OPT_TYPE_INT, {.i64 = FF_LEVEL_UNKNOWN }, INT_MIN, INT_MAX, V|A|E|CC, "avctx.level"}, {"unknown", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_LEVEL_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, "avctx.level"}, {"lowres", "decode at 1= 1/2, 2=1/4, 3=1/8 resolutions", OFFSET(lowres), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, V|A|D}, @@ -350,6 +350,8 @@ static const AVOption avcodec_options[] = { {"unspecified", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, "color_range_type"}, {"mpeg", "MPEG (219*2^(n-8))", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_MPEG }, INT_MIN, INT_MAX, V|E|D, "color_range_type"}, {"jpeg", "JPEG (2^n-1)", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_JPEG }, INT_MIN, INT_MAX, V|E|D, "color_range_type"}, +{"limited", "MPEG (219*2^(n-8))", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_MPEG }, INT_MIN, INT_MAX, V|E|D, "color_range_type"}, +{"full", "JPEG (2^n-1)", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_JPEG }, INT_MIN, INT_MAX, V|E|D, "color_range_type"}, {"chroma_sample_location", "chroma sample location", OFFSET(chroma_sample_location), AV_OPT_TYPE_INT, {.i64 = AVCHROMA_LOC_UNSPECIFIED }, 0, INT_MAX, V|E|D, "chroma_sample_location_type"}, {"unknown", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = AVCHROMA_LOC_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, "chroma_sample_location_type"}, {"left", "Left", 0, AV_OPT_TYPE_CONST, {.i64 = AVCHROMA_LOC_LEFT }, INT_MIN, INT_MAX, V|E|D, "chroma_sample_location_type"}, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/opus_silk.c b/arm/raspi/third_party/ffmpeg/libavcodec/opus_silk.c index cf8b16ac..27671516 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/opus_silk.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/opus_silk.c @@ -48,7 +48,7 @@ typedef struct SilkFrame { } SilkFrame; struct SilkContext { - AVCodecContext *avctx; + void *logctx; int output_channels; int midonly; @@ -799,7 +799,7 @@ int ff_silk_decode_superframe(SilkContext *s, OpusRangeCoder *rc, if (bandwidth > OPUS_BANDWIDTH_WIDEBAND || coded_channels > 2 || duration_ms > 60) { - av_log(s->avctx, AV_LOG_ERROR, "Invalid parameters passed " + av_log(s->logctx, AV_LOG_ERROR, "Invalid parameters passed " "to the SILK decoder.\n"); return AVERROR(EINVAL); } @@ -879,12 +879,12 @@ void ff_silk_flush(SilkContext *s) memset(s->prev_stereo_weights, 0, sizeof(s->prev_stereo_weights)); } -int ff_silk_init(AVCodecContext *avctx, SilkContext **ps, int output_channels) +int ff_silk_init(void *logctx, SilkContext **ps, int output_channels) { SilkContext *s; if (output_channels != 1 && output_channels != 2) { - av_log(avctx, AV_LOG_ERROR, "Invalid number of output channels: %d\n", + av_log(logctx, AV_LOG_ERROR, "Invalid number of output channels: %d\n", output_channels); return AVERROR(EINVAL); } @@ -893,7 +893,7 @@ int ff_silk_init(AVCodecContext *avctx, SilkContext **ps, int output_channels) if (!s) return AVERROR(ENOMEM); - s->avctx = avctx; + s->logctx = logctx; s->output_channels = output_channels; ff_silk_flush(s); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/opus_silk.h b/arm/raspi/third_party/ffmpeg/libavcodec/opus_silk.h index 6552c166..4b595da2 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/opus_silk.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/opus_silk.h @@ -23,7 +23,6 @@ #ifndef AVCODEC_OPUS_SILK_H #define AVCODEC_OPUS_SILK_H -#include "avcodec.h" #include "opus.h" #include "opus_rc.h" @@ -32,7 +31,7 @@ typedef struct SilkContext SilkContext; -int ff_silk_init(AVCodecContext *avctx, SilkContext **ps, int output_channels); +int ff_silk_init(void *logctx, SilkContext **ps, int output_channels); void ff_silk_free(SilkContext **ps); void ff_silk_flush(SilkContext *s); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/osq.c b/arm/raspi/third_party/ffmpeg/libavcodec/osq.c new file mode 100644 index 00000000..435f3ea7 --- /dev/null +++ b/arm/raspi/third_party/ffmpeg/libavcodec/osq.c @@ -0,0 +1,481 @@ +/* + * OSQ audio decoder + * Copyright (c) 2023 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/internal.h" +#include "libavutil/intreadwrite.h" +#include "avcodec.h" +#include "codec_internal.h" +#include "decode.h" +#include "internal.h" +#define BITSTREAM_READER_LE +#include "get_bits.h" +#include "unary.h" + +#define OFFSET 5 + +typedef struct OSQChannel { + unsigned prediction; + unsigned coding_mode; + unsigned residue_parameter; + unsigned residue_bits; + unsigned history[3]; + unsigned pos, count; + double sum; + int32_t prev; +} OSQChannel; + +typedef struct OSQContext { + GetBitContext gb; + OSQChannel ch[2]; + + uint8_t *bitstream; + size_t max_framesize; + size_t bitstream_size; + + int factor; + int decorrelate; + int frame_samples; + uint64_t nb_samples; + + int32_t *decode_buffer[2]; + + AVPacket *pkt; + int pkt_offset; +} OSQContext; + +static av_cold int osq_close(AVCodecContext *avctx) +{ + OSQContext *s = avctx->priv_data; + + av_freep(&s->bitstream); + s->bitstream_size = 0; + + for (int ch = 0; ch < FF_ARRAY_ELEMS(s->decode_buffer); ch++) + av_freep(&s->decode_buffer[ch]); + + return 0; +} + +static av_cold int osq_init(AVCodecContext *avctx) +{ + OSQContext *s = avctx->priv_data; + + if (avctx->extradata_size < 48) + return AVERROR(EINVAL); + + if (avctx->extradata[0] != 1) { + av_log(avctx, AV_LOG_ERROR, "Unsupported version.\n"); + return AVERROR_INVALIDDATA; + } + + avctx->sample_rate = AV_RL32(avctx->extradata + 4); + if (avctx->sample_rate < 1) + return AVERROR_INVALIDDATA; + + av_channel_layout_uninit(&avctx->ch_layout); + avctx->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; + avctx->ch_layout.nb_channels = avctx->extradata[3]; + if (avctx->ch_layout.nb_channels < 1) + return AVERROR_INVALIDDATA; + if (avctx->ch_layout.nb_channels > FF_ARRAY_ELEMS(s->decode_buffer)) + return AVERROR_INVALIDDATA; + + s->factor = 1; + switch (avctx->extradata[2]) { + case 8: avctx->sample_fmt = AV_SAMPLE_FMT_U8P; break; + case 16: avctx->sample_fmt = AV_SAMPLE_FMT_S16P; break; + case 20: + case 24: s->factor = 256; + avctx->sample_fmt = AV_SAMPLE_FMT_S32P; break; + default: return AVERROR_INVALIDDATA; + } + + avctx->bits_per_raw_sample = avctx->extradata[2]; + s->nb_samples = AV_RL64(avctx->extradata + 16); + s->frame_samples = AV_RL16(avctx->extradata + 8); + s->max_framesize = (s->frame_samples * 16 + 1024) * avctx->ch_layout.nb_channels; + + s->bitstream = av_calloc(s->max_framesize + AV_INPUT_BUFFER_PADDING_SIZE, sizeof(*s->bitstream)); + if (!s->bitstream) + return AVERROR(ENOMEM); + + for (int ch = 0; ch < avctx->ch_layout.nb_channels; ch++) { + s->decode_buffer[ch] = av_calloc(s->frame_samples + OFFSET, + sizeof(*s->decode_buffer[ch])); + if (!s->decode_buffer[ch]) + return AVERROR(ENOMEM); + } + + s->pkt = avctx->internal->in_pkt; + + return 0; +} + +static void reset_stats(OSQChannel *cb) +{ + memset(cb->history, 0, sizeof(cb->history)); + cb->pos = cb->count = cb->sum = 0; +} + +static void update_stats(OSQChannel *cb, int val) +{ + cb->sum += FFABS(val) - cb->history[cb->pos]; + cb->history[cb->pos] = FFABS(val); + cb->pos++; + cb->count++; + if (cb->pos >= FF_ARRAY_ELEMS(cb->history)) + cb->pos = 0; +} + +static int update_residue_parameter(OSQChannel *cb) +{ + double sum, x; + int rice_k; + + sum = cb->sum; + x = sum / cb->count; + rice_k = av_ceil_log2(x); + if (rice_k >= 30) { + rice_k = floor(sum / 1.4426952 + 0.5); + if (rice_k < 1) + rice_k = 1; + } + + return rice_k; +} + +static uint32_t get_urice(GetBitContext *gb, int k) +{ + uint32_t z, x, b; + + x = get_unary(gb, 1, 512); + b = get_bits_long(gb, k); + z = b | x << k; + + return z; +} + +static int32_t get_srice(GetBitContext *gb, int x) +{ + int32_t y = get_urice(gb, x); + return get_bits1(gb) ? -y : y; +} + +static int osq_channel_parameters(AVCodecContext *avctx, int ch) +{ + OSQContext *s = avctx->priv_data; + OSQChannel *cb = &s->ch[ch]; + GetBitContext *gb = &s->gb; + + cb->prev = 0; + cb->prediction = get_urice(gb, 5); + cb->coding_mode = get_urice(gb, 3); + if (cb->prediction >= 15) + return AVERROR_INVALIDDATA; + if (cb->coding_mode > 0 && cb->coding_mode < 3) { + cb->residue_parameter = get_urice(gb, 4); + if (!cb->residue_parameter || cb->residue_parameter >= 31) + return AVERROR_INVALIDDATA; + } else if (cb->coding_mode == 3) { + cb->residue_bits = get_urice(gb, 4); + if (!cb->residue_bits || cb->residue_bits >= 31) + return AVERROR_INVALIDDATA; + } else if (cb->coding_mode) { + return AVERROR_INVALIDDATA; + } + + if (cb->coding_mode == 2) + reset_stats(cb); + + return 0; +} + +#define A (-1) +#define B (-2) +#define C (-3) +#define D (-4) +#define E (-5) +#define P2 ((dst[A] + dst[A]) - dst[B]) +#define P3 ((dst[A] - dst[B]) * 3 + dst[C]) + +static int do_decode(AVCodecContext *avctx, AVFrame *frame, int decorrelate, int downsample) +{ + OSQContext *s = avctx->priv_data; + const int nb_channels = avctx->ch_layout.nb_channels; + const int nb_samples = frame->nb_samples; + GetBitContext *gb = &s->gb; + + for (int n = 0; n < nb_samples; n++) { + for (int ch = 0; ch < nb_channels; ch++) { + OSQChannel *cb = &s->ch[ch]; + int32_t *dst = s->decode_buffer[ch] + OFFSET; + int32_t p, prev = cb->prev; + + if (nb_channels == 2 && ch == 1 && decorrelate != s->decorrelate) { + if (!decorrelate) { + s->decode_buffer[1][OFFSET+A] += s->decode_buffer[0][OFFSET+B]; + s->decode_buffer[1][OFFSET+B] += s->decode_buffer[0][OFFSET+C]; + s->decode_buffer[1][OFFSET+C] += s->decode_buffer[0][OFFSET+D]; + s->decode_buffer[1][OFFSET+D] += s->decode_buffer[0][OFFSET+E]; + } else { + s->decode_buffer[1][OFFSET+A] -= s->decode_buffer[0][OFFSET+B]; + s->decode_buffer[1][OFFSET+B] -= s->decode_buffer[0][OFFSET+C]; + s->decode_buffer[1][OFFSET+C] -= s->decode_buffer[0][OFFSET+D]; + s->decode_buffer[1][OFFSET+D] -= s->decode_buffer[0][OFFSET+E]; + } + s->decorrelate = decorrelate; + } + + if (!cb->coding_mode) { + dst[n] = 0; + } else if (cb->coding_mode == 3) { + dst[n] = get_sbits_long(gb, cb->residue_bits); + } else { + dst[n] = get_srice(gb, cb->residue_parameter); + } + + if (get_bits_left(gb) < 0) { + av_log(avctx, AV_LOG_ERROR, "overread!\n"); + return AVERROR_INVALIDDATA; + } + + p = prev / 2; + prev = dst[n]; + + switch (cb->prediction) { + case 0: + break; + case 1: + dst[n] += dst[A]; + break; + case 2: + dst[n] += dst[A] + p; + break; + case 3: + dst[n] += P2; + break; + case 4: + dst[n] += P2 + p; + break; + case 5: + dst[n] += P3; + break; + case 6: + dst[n] += P3 + p; + break; + case 7: + dst[n] += (P2 + P3) / 2 + p; + break; + case 8: + dst[n] += (P2 + P3) / 2; + break; + case 9: + dst[n] += (P2 * 2 + P3) / 3 + p; + break; + case 10: + dst[n] += (P2 + P3 * 2) / 3 + p; + break; + case 11: + dst[n] += (dst[A] + dst[B]) / 2; + break; + case 12: + dst[n] += dst[B]; + break; + case 13: + dst[n] += (dst[D] + dst[B]) / 2; + break; + case 14: + dst[n] += (P2 + dst[A]) / 2 + p; + break; + default: + return AVERROR_INVALIDDATA; + } + + cb->prev = prev; + + if (downsample) + dst[n] *= 256; + + dst[E] = dst[D]; + dst[D] = dst[C]; + dst[C] = dst[B]; + dst[B] = dst[A]; + dst[A] = dst[n]; + + if (cb->coding_mode == 2) { + update_stats(cb, dst[n]); + cb->residue_parameter = update_residue_parameter(cb); + } + + if (nb_channels == 2 && ch == 1) { + if (decorrelate) + dst[n] += s->decode_buffer[0][OFFSET+n]; + } + + if (downsample) + dst[A] /= 256; + } + } + + return 0; +} + +static int osq_decode_block(AVCodecContext *avctx, AVFrame *frame) +{ + const int nb_channels = avctx->ch_layout.nb_channels; + const int nb_samples = frame->nb_samples; + OSQContext *s = avctx->priv_data; + const int factor = s->factor; + int ret, decorrelate, downsample; + GetBitContext *gb = &s->gb; + + skip_bits1(gb); + decorrelate = get_bits1(gb); + downsample = get_bits1(gb); + + for (int ch = 0; ch < nb_channels; ch++) { + if ((ret = osq_channel_parameters(avctx, ch)) < 0) { + av_log(avctx, AV_LOG_ERROR, "invalid channel parameters\n"); + return ret; + } + } + + if ((ret = do_decode(avctx, frame, decorrelate, downsample)) < 0) + return ret; + + align_get_bits(gb); + + switch (avctx->sample_fmt) { + case AV_SAMPLE_FMT_U8P: + for (int ch = 0; ch < nb_channels; ch++) { + uint8_t *dst = (uint8_t *)frame->extended_data[ch]; + int32_t *src = s->decode_buffer[ch] + OFFSET; + + for (int n = 0; n < nb_samples; n++) + dst[n] = av_clip_uint8(src[n] + 0x80); + } + break; + case AV_SAMPLE_FMT_S16P: + for (int ch = 0; ch < nb_channels; ch++) { + int16_t *dst = (int16_t *)frame->extended_data[ch]; + int32_t *src = s->decode_buffer[ch] + OFFSET; + + for (int n = 0; n < nb_samples; n++) + dst[n] = (int16_t)src[n]; + } + break; + case AV_SAMPLE_FMT_S32P: + for (int ch = 0; ch < nb_channels; ch++) { + int32_t *dst = (int32_t *)frame->extended_data[ch]; + int32_t *src = s->decode_buffer[ch] + OFFSET; + + for (int n = 0; n < nb_samples; n++) + dst[n] = src[n] * factor; + } + break; + default: + return AVERROR_BUG; + } + + return 0; +} + +static int osq_receive_frame(AVCodecContext *avctx, AVFrame *frame) +{ + OSQContext *s = avctx->priv_data; + GetBitContext *gb = &s->gb; + int ret, n; + + while (s->bitstream_size < s->max_framesize) { + int size; + + if (!s->pkt->data) { + ret = ff_decode_get_packet(avctx, s->pkt); + if (ret == AVERROR_EOF && s->bitstream_size > 0) + break; + if (ret == AVERROR_EOF || ret == AVERROR(EAGAIN)) + return ret; + if (ret < 0) + goto fail; + } + + size = FFMIN(s->pkt->size - s->pkt_offset, s->max_framesize - s->bitstream_size); + memcpy(s->bitstream + s->bitstream_size, s->pkt->data + s->pkt_offset, size); + s->bitstream_size += size; + s->pkt_offset += size; + + if (s->pkt_offset == s->pkt->size) { + av_packet_unref(s->pkt); + s->pkt_offset = 0; + } + } + + frame->nb_samples = FFMIN(s->frame_samples, s->nb_samples); + if (frame->nb_samples <= 0) + return AVERROR_EOF; + + if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) + goto fail; + + if ((ret = init_get_bits8(gb, s->bitstream, s->bitstream_size)) < 0) + goto fail; + + if ((ret = osq_decode_block(avctx, frame)) < 0) + goto fail; + + s->nb_samples -= frame->nb_samples; + + n = get_bits_count(gb) / 8; + if (n > s->bitstream_size) { + ret = AVERROR_INVALIDDATA; + goto fail; + } + + memmove(s->bitstream, &s->bitstream[n], s->bitstream_size - n); + s->bitstream_size -= n; + + return 0; + +fail: + s->bitstream_size = 0; + s->pkt_offset = 0; + av_packet_unref(s->pkt); + + return ret; +} + +const FFCodec ff_osq_decoder = { + .p.name = "osq", + CODEC_LONG_NAME("OSQ (Original Sound Quality)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_OSQ, + .priv_data_size = sizeof(OSQContext), + .init = osq_init, + FF_CODEC_RECEIVE_FRAME_CB(osq_receive_frame), + .close = osq_close, + .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | + AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P, + AV_SAMPLE_FMT_S16P, + AV_SAMPLE_FMT_S32P, + AV_SAMPLE_FMT_NONE }, +}; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/parsers.c b/arm/raspi/third_party/ffmpeg/libavcodec/parsers.c index 285f81a9..5128009c 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/parsers.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/parsers.c @@ -55,6 +55,7 @@ extern const AVCodecParser ff_hevc_parser; extern const AVCodecParser ff_hdr_parser; extern const AVCodecParser ff_ipu_parser; extern const AVCodecParser ff_jpeg2000_parser; +extern const AVCodecParser ff_jpegxl_parser; extern const AVCodecParser ff_misc4_parser; extern const AVCodecParser ff_mjpeg_parser; extern const AVCodecParser ff_mlp_parser; @@ -65,8 +66,7 @@ extern const AVCodecParser ff_opus_parser; extern const AVCodecParser ff_png_parser; extern const AVCodecParser ff_pnm_parser; extern const AVCodecParser ff_qoi_parser; -extern const AVCodecParser ff_rv30_parser; -extern const AVCodecParser ff_rv40_parser; +extern const AVCodecParser ff_rv34_parser; extern const AVCodecParser ff_sbc_parser; extern const AVCodecParser ff_sipr_parser; extern const AVCodecParser ff_tak_parser; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/pcm.c b/arm/raspi/third_party/ffmpeg/libavcodec/pcm.c index 23955ba2..4abca7cc 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/pcm.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/pcm.c @@ -538,7 +538,6 @@ static int pcm_decode_frame(AVCodecContext *avctx, AVFrame *frame, s->vector_fmul_scalar((float *)frame->extended_data[0], (const float *)frame->extended_data[0], s->scale, FFALIGN(frame->nb_samples * avctx->ch_layout.nb_channels, 4)); - emms_c(); } *got_frame_ptr = 1; @@ -578,7 +577,7 @@ const FFCodec ff_ ## name_ ## _decoder = { \ .priv_data_size = sizeof(PCMDecode), \ .init = pcm_decode_init, \ FF_CODEC_DECODE_CB(pcm_decode_frame), \ - .p.capabilities = AV_CODEC_CAP_DR1, \ + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_PARAM_CHANGE, \ .p.sample_fmts = (const enum AVSampleFormat[]){ sample_fmt_, \ AV_SAMPLE_FMT_NONE }, \ } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/pcx.c b/arm/raspi/third_party/ffmpeg/libavcodec/pcx.c index 4cca4972..8e2aae7b 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/pcx.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/pcx.c @@ -75,9 +75,10 @@ static int pcx_decode_frame(AVCodecContext *avctx, AVFrame *p, GetByteContext gb; int compressed, xmin, ymin, xmax, ymax; int ret; - unsigned int w, h, bits_per_pixel, bytes_per_line, nplanes, stride, y, x, + unsigned int w, h, bits_per_pixel, bytes_per_line, nplanes, y, x, bytes_per_scanline; uint8_t *ptr, *scanline; + ptrdiff_t stride; if (avpkt->size < PCX_HEADER_SIZE) { av_log(avctx, AV_LOG_ERROR, "Packet too small\n"); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/pdvdec.c b/arm/raspi/third_party/ffmpeg/libavcodec/pdvdec.c index d50c4e72..e2c03e7e 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/pdvdec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/pdvdec.c @@ -102,8 +102,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, dst += frame->linesize[0]; } - av_frame_unref(s->previous_frame); - if ((ret = av_frame_ref(s->previous_frame, frame)) < 0) + if ((ret = av_frame_replace(s->previous_frame, frame)) < 0) return ret; if (avpkt->flags & AV_PKT_FLAG_KEY) { diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/photocd.c b/arm/raspi/third_party/ffmpeg/libavcodec/photocd.c index 3a09b819..07e8d460 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/photocd.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/photocd.c @@ -210,8 +210,8 @@ static av_noinline int read_hufftable(AVCodecContext *avctx, VLC *vlc) s->syms[j] = sym; } - ff_free_vlc(vlc); - ret = ff_init_vlc_sparse(vlc, 12, count, + ff_vlc_free(vlc); + ret = ff_vlc_init_sparse(vlc, 12, count, s->bits, sizeof(*s->bits), sizeof(*s->bits), s->codes, sizeof(*s->codes), sizeof(*s->codes), s->syms, sizeof(*s->syms), sizeof(*s->syms), 0); @@ -438,7 +438,7 @@ static av_cold int photocd_decode_close(AVCodecContext *avctx) PhotoCDContext *s = avctx->priv_data; for (int i = 0; i < 3; i++) - ff_free_vlc(&s->vlc[i]); + ff_vlc_free(&s->vlc[i]); return 0; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/pngenc.c b/arm/raspi/third_party/ffmpeg/libavcodec/pngenc.c index 21b033ea..f0650962 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/pngenc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/pngenc.c @@ -1059,8 +1059,7 @@ static int encode_apng(AVCodecContext *avctx, AVPacket *pkt, } } - av_frame_unref(s->last_frame); - ret = av_frame_ref(s->last_frame, pict); + ret = av_frame_replace(s->last_frame, pict); if (ret < 0) return ret; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/pnmdec.c b/arm/raspi/third_party/ffmpeg/libavcodec/pnmdec.c index 72bc83b2..acd77ea8 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/pnmdec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/pnmdec.c @@ -137,7 +137,7 @@ static int pnm_decode_frame(AVCodecContext *avctx, AVFrame *p, if(s->type < 4 || (is_mono && s->type==7)){ for (i=0; iheight; i++) { PutBitContext pb; - init_put_bits(&pb, ptr, linesize); + init_put_bits(&pb, ptr, FFABS(linesize)); for(j=0; jwidth * components; j++){ unsigned int c=0; unsigned v=0; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/ppc/Makefile b/arm/raspi/third_party/ffmpeg/libavcodec/ppc/Makefile index bc13d8a0..10b9ca60 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/ppc/Makefile +++ b/arm/raspi/third_party/ffmpeg/libavcodec/ppc/Makefile @@ -1,9 +1,6 @@ # subsystems OBJS-$(CONFIG_AUDIODSP) += ppc/audiodsp.o OBJS-$(CONFIG_BLOCKDSP) += ppc/blockdsp.o -OBJS-$(CONFIG_FFT) += ppc/fft_init.o \ - ppc/fft_altivec.o \ - ppc/fft_vsx.o OBJS-$(CONFIG_FDCTDSP) += ppc/fdctdsp.o OBJS-$(CONFIG_FMTCONVERT) += ppc/fmtconvert_altivec.o OBJS-$(CONFIG_H264CHROMA) += ppc/h264chroma_init.o diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/ppc/fdctdsp.c b/arm/raspi/third_party/ffmpeg/libavcodec/ppc/fdctdsp.c index 4ab516c6..ae3c1b18 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/ppc/fdctdsp.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/ppc/fdctdsp.c @@ -25,6 +25,7 @@ #include "libavutil/ppc/cpu.h" #include "libavutil/ppc/util_altivec.h" +#include "libavcodec/avcodec.h" #include "libavcodec/fdctdsp.h" #include "fdct.h" diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/ppc/idctdsp.c b/arm/raspi/third_party/ffmpeg/libavcodec/ppc/idctdsp.c index 29f625a0..a7acbc5e 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/ppc/idctdsp.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/ppc/idctdsp.c @@ -40,6 +40,7 @@ #include "libavutil/ppc/cpu.h" #include "libavutil/ppc/util_altivec.h" +#include "libavcodec/avcodec.h" #include "libavcodec/idctdsp.h" #if HAVE_ALTIVEC diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/ppc/mpegaudiodsp_altivec.c b/arm/raspi/third_party/ffmpeg/libavcodec/ppc/mpegaudiodsp_altivec.c index 6794ed09..b065203c 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/ppc/mpegaudiodsp_altivec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/ppc/mpegaudiodsp_altivec.c @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + #include "config.h" #include "libavutil/attributes.h" #include "libavutil/cpu.h" diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/profiles.c b/arm/raspi/third_party/ffmpeg/libavcodec/profiles.c index c646a3f5..5bb8f150 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/profiles.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/profiles.c @@ -24,180 +24,180 @@ #if !CONFIG_SMALL const AVProfile ff_aac_profiles[] = { - { FF_PROFILE_AAC_LOW, "LC" }, - { 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_AAC_MAIN, "Main" }, - { FF_PROFILE_AAC_SSR, "SSR" }, - { FF_PROFILE_AAC_LTP, "LTP" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_AAC_LOW, "LC" }, + { AV_PROFILE_AAC_HE, "HE-AAC" }, + { AV_PROFILE_AAC_HE_V2, "HE-AACv2" }, + { AV_PROFILE_AAC_LD, "LD" }, + { AV_PROFILE_AAC_ELD, "ELD" }, + { AV_PROFILE_AAC_MAIN, "Main" }, + { AV_PROFILE_AAC_SSR, "SSR" }, + { AV_PROFILE_AAC_LTP, "LTP" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_dca_profiles[] = { - { FF_PROFILE_DTS, "DTS" }, - { FF_PROFILE_DTS_ES, "DTS-ES" }, - { FF_PROFILE_DTS_96_24, "DTS 96/24" }, - { FF_PROFILE_DTS_HD_HRA, "DTS-HD HRA" }, - { FF_PROFILE_DTS_HD_MA, "DTS-HD MA" }, - { FF_PROFILE_DTS_HD_MA_X, "DTS-HD MA + DTS:X" }, - { FF_PROFILE_DTS_HD_MA_X_IMAX, "DTS-HD MA + DTS:X IMAX" }, - { FF_PROFILE_DTS_EXPRESS, "DTS Express" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_DTS, "DTS" }, + { AV_PROFILE_DTS_ES, "DTS-ES" }, + { AV_PROFILE_DTS_96_24, "DTS 96/24" }, + { AV_PROFILE_DTS_HD_HRA, "DTS-HD HRA" }, + { AV_PROFILE_DTS_HD_MA, "DTS-HD MA" }, + { AV_PROFILE_DTS_HD_MA_X, "DTS-HD MA + DTS:X" }, + { AV_PROFILE_DTS_HD_MA_X_IMAX, "DTS-HD MA + DTS:X IMAX" }, + { AV_PROFILE_DTS_EXPRESS, "DTS Express" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_eac3_profiles[] = { - { FF_PROFILE_EAC3_DDP_ATMOS, "Dolby Digital Plus + Dolby Atmos"}, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_EAC3_DDP_ATMOS, "Dolby Digital Plus + Dolby Atmos"}, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_truehd_profiles[] = { - { FF_PROFILE_TRUEHD_ATMOS, "Dolby TrueHD + Dolby Atmos"}, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_TRUEHD_ATMOS, "Dolby TrueHD + Dolby Atmos"}, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_dnxhd_profiles[] = { - { FF_PROFILE_DNXHD, "DNXHD"}, - { FF_PROFILE_DNXHR_LB, "DNXHR LB"}, - { FF_PROFILE_DNXHR_SQ, "DNXHR SQ"}, - { FF_PROFILE_DNXHR_HQ, "DNXHR HQ" }, - { FF_PROFILE_DNXHR_HQX, "DNXHR HQX"}, - { FF_PROFILE_DNXHR_444, "DNXHR 444"}, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_DNXHD, "DNXHD"}, + { AV_PROFILE_DNXHR_LB, "DNXHR LB"}, + { AV_PROFILE_DNXHR_SQ, "DNXHR SQ"}, + { AV_PROFILE_DNXHR_HQ, "DNXHR HQ" }, + { AV_PROFILE_DNXHR_HQX, "DNXHR HQX"}, + { AV_PROFILE_DNXHR_444, "DNXHR 444"}, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_h264_profiles[] = { - { FF_PROFILE_H264_BASELINE, "Baseline" }, - { FF_PROFILE_H264_CONSTRAINED_BASELINE, "Constrained Baseline" }, - { FF_PROFILE_H264_MAIN, "Main" }, - { FF_PROFILE_H264_EXTENDED, "Extended" }, - { FF_PROFILE_H264_HIGH, "High" }, - { FF_PROFILE_H264_HIGH_10, "High 10" }, - { FF_PROFILE_H264_HIGH_10_INTRA, "High 10 Intra" }, - { FF_PROFILE_H264_HIGH_422, "High 4:2:2" }, - { FF_PROFILE_H264_HIGH_422_INTRA, "High 4:2:2 Intra" }, - { FF_PROFILE_H264_HIGH_444, "High 4:4:4" }, - { FF_PROFILE_H264_HIGH_444_PREDICTIVE, "High 4:4:4 Predictive" }, - { FF_PROFILE_H264_HIGH_444_INTRA, "High 4:4:4 Intra" }, - { FF_PROFILE_H264_CAVLC_444, "CAVLC 4:4:4" }, - { FF_PROFILE_H264_MULTIVIEW_HIGH, "Multiview High" }, - { FF_PROFILE_H264_STEREO_HIGH, "Stereo High" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_H264_BASELINE, "Baseline" }, + { AV_PROFILE_H264_CONSTRAINED_BASELINE, "Constrained Baseline" }, + { AV_PROFILE_H264_MAIN, "Main" }, + { AV_PROFILE_H264_EXTENDED, "Extended" }, + { AV_PROFILE_H264_HIGH, "High" }, + { AV_PROFILE_H264_HIGH_10, "High 10" }, + { AV_PROFILE_H264_HIGH_10_INTRA, "High 10 Intra" }, + { AV_PROFILE_H264_HIGH_422, "High 4:2:2" }, + { AV_PROFILE_H264_HIGH_422_INTRA, "High 4:2:2 Intra" }, + { AV_PROFILE_H264_HIGH_444, "High 4:4:4" }, + { AV_PROFILE_H264_HIGH_444_PREDICTIVE, "High 4:4:4 Predictive" }, + { AV_PROFILE_H264_HIGH_444_INTRA, "High 4:4:4 Intra" }, + { AV_PROFILE_H264_CAVLC_444, "CAVLC 4:4:4" }, + { AV_PROFILE_H264_MULTIVIEW_HIGH, "Multiview High" }, + { AV_PROFILE_H264_STEREO_HIGH, "Stereo High" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_vvc_profiles[] = { - { FF_PROFILE_VVC_MAIN_10, "Main 10" }, - { FF_PROFILE_VVC_MAIN_10_444, "Main 10 4:4:4" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_VVC_MAIN_10, "Main 10" }, + { AV_PROFILE_VVC_MAIN_10_444, "Main 10 4:4:4" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_hevc_profiles[] = { - { FF_PROFILE_HEVC_MAIN, "Main" }, - { FF_PROFILE_HEVC_MAIN_10, "Main 10" }, - { FF_PROFILE_HEVC_MAIN_STILL_PICTURE, "Main Still Picture" }, - { FF_PROFILE_HEVC_REXT, "Rext" }, - { FF_PROFILE_HEVC_SCC, "Scc" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_HEVC_MAIN, "Main" }, + { AV_PROFILE_HEVC_MAIN_10, "Main 10" }, + { AV_PROFILE_HEVC_MAIN_STILL_PICTURE, "Main Still Picture" }, + { AV_PROFILE_HEVC_REXT, "Rext" }, + { AV_PROFILE_HEVC_SCC, "Scc" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_jpeg2000_profiles[] = { - { FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0, "JPEG 2000 codestream restriction 0" }, - { FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1, "JPEG 2000 codestream restriction 1" }, - { FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION, "JPEG 2000 no codestream restrictions" }, - { FF_PROFILE_JPEG2000_DCINEMA_2K, "JPEG 2000 digital cinema 2K" }, - { FF_PROFILE_JPEG2000_DCINEMA_4K, "JPEG 2000 digital cinema 4K" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0, "JPEG 2000 codestream restriction 0" }, + { AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1, "JPEG 2000 codestream restriction 1" }, + { AV_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION, "JPEG 2000 no codestream restrictions" }, + { AV_PROFILE_JPEG2000_DCINEMA_2K, "JPEG 2000 digital cinema 2K" }, + { AV_PROFILE_JPEG2000_DCINEMA_4K, "JPEG 2000 digital cinema 4K" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_mpeg2_video_profiles[] = { - { FF_PROFILE_MPEG2_422, "4:2:2" }, - { FF_PROFILE_MPEG2_HIGH, "High" }, - { FF_PROFILE_MPEG2_SS, "Spatially Scalable" }, - { FF_PROFILE_MPEG2_SNR_SCALABLE, "SNR Scalable" }, - { FF_PROFILE_MPEG2_MAIN, "Main" }, - { FF_PROFILE_MPEG2_SIMPLE, "Simple" }, - { FF_PROFILE_RESERVED, "Reserved" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_MPEG2_422, "4:2:2" }, + { AV_PROFILE_MPEG2_HIGH, "High" }, + { AV_PROFILE_MPEG2_SS, "Spatially Scalable" }, + { AV_PROFILE_MPEG2_SNR_SCALABLE, "SNR Scalable" }, + { AV_PROFILE_MPEG2_MAIN, "Main" }, + { AV_PROFILE_MPEG2_SIMPLE, "Simple" }, + { AV_PROFILE_RESERVED, "Reserved" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_mpeg4_video_profiles[] = { - { FF_PROFILE_MPEG4_SIMPLE, "Simple Profile" }, - { FF_PROFILE_MPEG4_SIMPLE_SCALABLE, "Simple Scalable Profile" }, - { FF_PROFILE_MPEG4_CORE, "Core Profile" }, - { FF_PROFILE_MPEG4_MAIN, "Main Profile" }, - { FF_PROFILE_MPEG4_N_BIT, "N-bit Profile" }, - { FF_PROFILE_MPEG4_SCALABLE_TEXTURE, "Scalable Texture Profile" }, - { FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION, "Simple Face Animation Profile" }, - { FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE, "Basic Animated Texture Profile" }, - { FF_PROFILE_MPEG4_HYBRID, "Hybrid Profile" }, - { FF_PROFILE_MPEG4_ADVANCED_REAL_TIME, "Advanced Real Time Simple Profile" }, - { FF_PROFILE_MPEG4_CORE_SCALABLE, "Code Scalable Profile" }, - { FF_PROFILE_MPEG4_ADVANCED_CODING, "Advanced Coding Profile" }, - { FF_PROFILE_MPEG4_ADVANCED_CORE, "Advanced Core Profile" }, - { FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE, "Advanced Scalable Texture Profile" }, - { FF_PROFILE_MPEG4_SIMPLE_STUDIO, "Simple Studio Profile" }, - { FF_PROFILE_MPEG4_ADVANCED_SIMPLE, "Advanced Simple Profile" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_MPEG4_SIMPLE, "Simple Profile" }, + { AV_PROFILE_MPEG4_SIMPLE_SCALABLE, "Simple Scalable Profile" }, + { AV_PROFILE_MPEG4_CORE, "Core Profile" }, + { AV_PROFILE_MPEG4_MAIN, "Main Profile" }, + { AV_PROFILE_MPEG4_N_BIT, "N-bit Profile" }, + { AV_PROFILE_MPEG4_SCALABLE_TEXTURE, "Scalable Texture Profile" }, + { AV_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION, "Simple Face Animation Profile" }, + { AV_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE, "Basic Animated Texture Profile" }, + { AV_PROFILE_MPEG4_HYBRID, "Hybrid Profile" }, + { AV_PROFILE_MPEG4_ADVANCED_REAL_TIME, "Advanced Real Time Simple Profile" }, + { AV_PROFILE_MPEG4_CORE_SCALABLE, "Code Scalable Profile" }, + { AV_PROFILE_MPEG4_ADVANCED_CODING, "Advanced Coding Profile" }, + { AV_PROFILE_MPEG4_ADVANCED_CORE, "Advanced Core Profile" }, + { AV_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE, "Advanced Scalable Texture Profile" }, + { AV_PROFILE_MPEG4_SIMPLE_STUDIO, "Simple Studio Profile" }, + { AV_PROFILE_MPEG4_ADVANCED_SIMPLE, "Advanced Simple Profile" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_vc1_profiles[] = { - { FF_PROFILE_VC1_SIMPLE, "Simple" }, - { FF_PROFILE_VC1_MAIN, "Main" }, - { FF_PROFILE_VC1_COMPLEX, "Complex" }, - { FF_PROFILE_VC1_ADVANCED, "Advanced" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_VC1_SIMPLE, "Simple" }, + { AV_PROFILE_VC1_MAIN, "Main" }, + { AV_PROFILE_VC1_COMPLEX, "Complex" }, + { AV_PROFILE_VC1_ADVANCED, "Advanced" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_vp9_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 }, + { AV_PROFILE_VP9_0, "Profile 0" }, + { AV_PROFILE_VP9_1, "Profile 1" }, + { AV_PROFILE_VP9_2, "Profile 2" }, + { AV_PROFILE_VP9_3, "Profile 3" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_av1_profiles[] = { - { FF_PROFILE_AV1_MAIN, "Main" }, - { FF_PROFILE_AV1_HIGH, "High" }, - { FF_PROFILE_AV1_PROFESSIONAL, "Professional" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_AV1_MAIN, "Main" }, + { AV_PROFILE_AV1_HIGH, "High" }, + { AV_PROFILE_AV1_PROFESSIONAL, "Professional" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_sbc_profiles[] = { - { FF_PROFILE_SBC_MSBC, "mSBC" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_SBC_MSBC, "mSBC" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_prores_profiles[] = { - { FF_PROFILE_PRORES_PROXY, "Proxy" }, - { FF_PROFILE_PRORES_LT, "LT" }, - { FF_PROFILE_PRORES_STANDARD, "Standard" }, - { FF_PROFILE_PRORES_HQ, "HQ" }, - { FF_PROFILE_PRORES_4444, "4444" }, - { FF_PROFILE_PRORES_XQ, "XQ" }, - { FF_PROFILE_UNKNOWN } + { AV_PROFILE_PRORES_PROXY, "Proxy" }, + { AV_PROFILE_PRORES_LT, "LT" }, + { AV_PROFILE_PRORES_STANDARD, "Standard" }, + { AV_PROFILE_PRORES_HQ, "HQ" }, + { AV_PROFILE_PRORES_4444, "4444" }, + { AV_PROFILE_PRORES_XQ, "XQ" }, + { AV_PROFILE_UNKNOWN } }; const AVProfile ff_mjpeg_profiles[] = { - { FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, "Baseline" }, - { FF_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT, "Sequential" }, - { FF_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT, "Progressive" }, - { FF_PROFILE_MJPEG_HUFFMAN_LOSSLESS, "Lossless" }, - { FF_PROFILE_MJPEG_JPEG_LS, "JPEG LS" }, - { FF_PROFILE_UNKNOWN } + { AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, "Baseline" }, + { AV_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT, "Sequential" }, + { AV_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT, "Progressive" }, + { AV_PROFILE_MJPEG_HUFFMAN_LOSSLESS, "Lossless" }, + { AV_PROFILE_MJPEG_JPEG_LS, "JPEG LS" }, + { AV_PROFILE_UNKNOWN } }; const AVProfile ff_arib_caption_profiles[] = { - { FF_PROFILE_ARIB_PROFILE_A, "Profile A" }, - { FF_PROFILE_ARIB_PROFILE_C, "Profile C" }, - { FF_PROFILE_UNKNOWN } + { AV_PROFILE_ARIB_PROFILE_A, "Profile A" }, + { AV_PROFILE_ARIB_PROFILE_C, "Profile C" }, + { AV_PROFILE_UNKNOWN } }; const AVProfile ff_evc_profiles[] = { - { FF_PROFILE_EVC_BASELINE, "Baseline" }, - { FF_PROFILE_EVC_MAIN, "Main" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_EVC_BASELINE, "Baseline" }, + { AV_PROFILE_EVC_MAIN, "Main" }, + { AV_PROFILE_UNKNOWN }, }; #endif /* !CONFIG_SMALL */ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/profiles.h b/arm/raspi/third_party/ffmpeg/libavcodec/profiles.h index c0eacae5..270430a4 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/profiles.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/profiles.h @@ -26,35 +26,35 @@ {name, description, 0, AV_OPT_TYPE_CONST, {.i64 = value }, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_## type ##_PARAM, "avctx.profile"}, #define FF_AAC_PROFILE_OPTS \ - FF_AVCTX_PROFILE_OPTION("aac_main", NULL, AUDIO, FF_PROFILE_AAC_MAIN)\ - FF_AVCTX_PROFILE_OPTION("aac_low", NULL, AUDIO, FF_PROFILE_AAC_LOW)\ - FF_AVCTX_PROFILE_OPTION("aac_ssr", NULL, AUDIO, FF_PROFILE_AAC_SSR)\ - FF_AVCTX_PROFILE_OPTION("aac_ltp", NULL, AUDIO, FF_PROFILE_AAC_LTP)\ - FF_AVCTX_PROFILE_OPTION("aac_he", NULL, AUDIO, FF_PROFILE_AAC_HE)\ - FF_AVCTX_PROFILE_OPTION("aac_he_v2", NULL, AUDIO, FF_PROFILE_AAC_HE_V2)\ - FF_AVCTX_PROFILE_OPTION("aac_ld", NULL, AUDIO, FF_PROFILE_AAC_LD)\ - FF_AVCTX_PROFILE_OPTION("aac_eld", NULL, AUDIO, FF_PROFILE_AAC_ELD)\ - FF_AVCTX_PROFILE_OPTION("mpeg2_aac_low", NULL, AUDIO, FF_PROFILE_MPEG2_AAC_LOW)\ - FF_AVCTX_PROFILE_OPTION("mpeg2_aac_he", NULL, AUDIO, FF_PROFILE_MPEG2_AAC_HE)\ + FF_AVCTX_PROFILE_OPTION("aac_main", NULL, AUDIO, AV_PROFILE_AAC_MAIN)\ + FF_AVCTX_PROFILE_OPTION("aac_low", NULL, AUDIO, AV_PROFILE_AAC_LOW)\ + FF_AVCTX_PROFILE_OPTION("aac_ssr", NULL, AUDIO, AV_PROFILE_AAC_SSR)\ + FF_AVCTX_PROFILE_OPTION("aac_ltp", NULL, AUDIO, AV_PROFILE_AAC_LTP)\ + FF_AVCTX_PROFILE_OPTION("aac_he", NULL, AUDIO, AV_PROFILE_AAC_HE)\ + FF_AVCTX_PROFILE_OPTION("aac_he_v2", NULL, AUDIO, AV_PROFILE_AAC_HE_V2)\ + FF_AVCTX_PROFILE_OPTION("aac_ld", NULL, AUDIO, AV_PROFILE_AAC_LD)\ + FF_AVCTX_PROFILE_OPTION("aac_eld", NULL, AUDIO, AV_PROFILE_AAC_ELD)\ + FF_AVCTX_PROFILE_OPTION("mpeg2_aac_low", NULL, AUDIO, AV_PROFILE_MPEG2_AAC_LOW)\ + FF_AVCTX_PROFILE_OPTION("mpeg2_aac_he", NULL, AUDIO, AV_PROFILE_MPEG2_AAC_HE)\ #define FF_MPEG4_PROFILE_OPTS \ - FF_AVCTX_PROFILE_OPTION("mpeg4_sp", NULL, VIDEO, FF_PROFILE_MPEG4_SIMPLE)\ - FF_AVCTX_PROFILE_OPTION("mpeg4_core", NULL, VIDEO, FF_PROFILE_MPEG4_CORE)\ - FF_AVCTX_PROFILE_OPTION("mpeg4_main", NULL, VIDEO, FF_PROFILE_MPEG4_MAIN)\ - FF_AVCTX_PROFILE_OPTION("mpeg4_asp", NULL, VIDEO, FF_PROFILE_MPEG4_ADVANCED_SIMPLE)\ + FF_AVCTX_PROFILE_OPTION("mpeg4_sp", NULL, VIDEO, AV_PROFILE_MPEG4_SIMPLE)\ + FF_AVCTX_PROFILE_OPTION("mpeg4_core", NULL, VIDEO, AV_PROFILE_MPEG4_CORE)\ + FF_AVCTX_PROFILE_OPTION("mpeg4_main", NULL, VIDEO, AV_PROFILE_MPEG4_MAIN)\ + FF_AVCTX_PROFILE_OPTION("mpeg4_asp", NULL, VIDEO, AV_PROFILE_MPEG4_ADVANCED_SIMPLE)\ #define FF_MPEG2_PROFILE_OPTS \ - FF_AVCTX_PROFILE_OPTION("422", NULL, VIDEO, FF_PROFILE_MPEG2_422)\ - FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, FF_PROFILE_MPEG2_HIGH)\ - FF_AVCTX_PROFILE_OPTION("ss", NULL, VIDEO, FF_PROFILE_MPEG2_SS)\ - FF_AVCTX_PROFILE_OPTION("snr", NULL, VIDEO, FF_PROFILE_MPEG2_SNR_SCALABLE)\ - FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, FF_PROFILE_MPEG2_MAIN)\ - FF_AVCTX_PROFILE_OPTION("simple", NULL, VIDEO, FF_PROFILE_MPEG2_SIMPLE)\ + FF_AVCTX_PROFILE_OPTION("422", NULL, VIDEO, AV_PROFILE_MPEG2_422)\ + FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, AV_PROFILE_MPEG2_HIGH)\ + FF_AVCTX_PROFILE_OPTION("ss", NULL, VIDEO, AV_PROFILE_MPEG2_SS)\ + FF_AVCTX_PROFILE_OPTION("snr", NULL, VIDEO, AV_PROFILE_MPEG2_SNR_SCALABLE)\ + FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, AV_PROFILE_MPEG2_MAIN)\ + FF_AVCTX_PROFILE_OPTION("simple", NULL, VIDEO, AV_PROFILE_MPEG2_SIMPLE)\ #define FF_AV1_PROFILE_OPTS \ - FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, FF_PROFILE_AV1_MAIN)\ - FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, FF_PROFILE_AV1_HIGH)\ - FF_AVCTX_PROFILE_OPTION("professional", NULL, VIDEO, FF_PROFILE_AV1_PROFESSIONAL)\ + FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, AV_PROFILE_AV1_MAIN)\ + FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, AV_PROFILE_AV1_HIGH)\ + FF_AVCTX_PROFILE_OPTION("professional", NULL, VIDEO, AV_PROFILE_AV1_PROFESSIONAL)\ extern const AVProfile ff_aac_profiles[]; extern const AVProfile ff_dca_profiles[]; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/proresdec.h b/arm/raspi/third_party/ffmpeg/libavcodec/proresdec.h index 1e48752e..230fca41 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/proresdec.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/proresdec.h @@ -22,10 +22,15 @@ #ifndef AVCODEC_PRORESDEC_H #define AVCODEC_PRORESDEC_H +#include + #include "get_bits.h" #include "blockdsp.h" #include "proresdsp.h" +#include "libavutil/frame.h" +#include "libavutil/pixfmt.h" + typedef struct { const uint8_t *data; unsigned mb_x; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/proresdec2.c b/arm/raspi/third_party/ffmpeg/libavcodec/proresdec2.c index b86614ad..3a5b7534 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/proresdec2.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/proresdec2.c @@ -37,6 +37,7 @@ #include "codec_internal.h" #include "decode.h" #include "get_bits.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "idctdsp.h" #include "profiles.h" @@ -140,27 +141,27 @@ static av_cold int decode_init(AVCodecContext *avctx) switch (avctx->codec_tag) { case MKTAG('a','p','c','o'): - avctx->profile = FF_PROFILE_PRORES_PROXY; + avctx->profile = AV_PROFILE_PRORES_PROXY; break; case MKTAG('a','p','c','s'): - avctx->profile = FF_PROFILE_PRORES_LT; + avctx->profile = AV_PROFILE_PRORES_LT; break; case MKTAG('a','p','c','n'): - avctx->profile = FF_PROFILE_PRORES_STANDARD; + avctx->profile = AV_PROFILE_PRORES_STANDARD; break; case MKTAG('a','p','c','h'): - avctx->profile = FF_PROFILE_PRORES_HQ; + avctx->profile = AV_PROFILE_PRORES_HQ; break; case MKTAG('a','p','4','h'): - avctx->profile = FF_PROFILE_PRORES_4444; + avctx->profile = AV_PROFILE_PRORES_4444; avctx->bits_per_raw_sample = 12; break; case MKTAG('a','p','4','x'): - avctx->profile = FF_PROFILE_PRORES_XQ; + avctx->profile = AV_PROFILE_PRORES_XQ; avctx->bits_per_raw_sample = 12; break; default: - avctx->profile = FF_PROFILE_UNKNOWN; + avctx->profile = AV_PROFILE_UNKNOWN; av_log(avctx, AV_LOG_WARNING, "Unknown prores profile %d\n", avctx->codec_tag); } @@ -171,7 +172,7 @@ static av_cold int decode_init(AVCodecContext *avctx) } ff_blockdsp_init(&ctx->bdsp); - ret = ff_proresdsp_init(&ctx->prodsp, avctx); + ret = ff_proresdsp_init(&ctx->prodsp, avctx->bits_per_raw_sample); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "Fail to init proresdsp for bits per raw sample %d\n", avctx->bits_per_raw_sample); return ret; @@ -277,7 +278,7 @@ static int decode_frame_header(ProresContext *ctx, const uint8_t *buf, *fmtp++ = ctx->pix_fmt; *fmtp = AV_PIX_FMT_NONE; - if ((ret = ff_thread_get_format(avctx, pix_fmts)) < 0) + if ((ret = ff_get_format(avctx, pix_fmts)) < 0) return ret; avctx->pix_fmt = ret; @@ -804,13 +805,14 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, ff_thread_finish_setup(avctx); if (avctx->hwaccel) { - ret = avctx->hwaccel->start_frame(avctx, NULL, 0); + const FFHWAccel *hwaccel = ffhwaccel(avctx->hwaccel); + ret = hwaccel->start_frame(avctx, NULL, 0); if (ret < 0) return ret; - ret = avctx->hwaccel->decode_slice(avctx, avpkt->data, avpkt->size); + ret = hwaccel->decode_slice(avctx, avpkt->data, avpkt->size); if (ret < 0) return ret; - ret = avctx->hwaccel->end_frame(avctx); + ret = hwaccel->end_frame(avctx); if (ret < 0) return ret; goto finish; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/proresdsp.c b/arm/raspi/third_party/ffmpeg/libavcodec/proresdsp.c index 6ed01179..bc253e55 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/proresdsp.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/proresdsp.c @@ -76,12 +76,12 @@ static void prores_idct_put_12_c(uint16_t *out, ptrdiff_t linesize, int16_t *blo put_pixels_12(out, linesize >> 1, block); } -av_cold int ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx) +av_cold int ff_proresdsp_init(ProresDSPContext *dsp, int bits_per_raw_sample) { - if (avctx->bits_per_raw_sample == 10) { + if (bits_per_raw_sample == 10) { dsp->idct_put = prores_idct_put_10_c; dsp->idct_permutation_type = FF_IDCT_PERM_NONE; - } else if (avctx->bits_per_raw_sample == 12) { + } else if (bits_per_raw_sample == 12) { dsp->idct_put = prores_idct_put_12_c; dsp->idct_permutation_type = FF_IDCT_PERM_NONE; } else { @@ -89,7 +89,7 @@ av_cold int ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx) } #if ARCH_X86 - ff_proresdsp_init_x86(dsp, avctx); + ff_proresdsp_init_x86(dsp, bits_per_raw_sample); #endif ff_init_scantable_permutation(dsp->idct_permutation, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/proresdsp.h b/arm/raspi/third_party/ffmpeg/libavcodec/proresdsp.h index 37ba76b8..966ba3d7 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/proresdsp.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/proresdsp.h @@ -25,7 +25,6 @@ #include #include -#include "avcodec.h" typedef struct ProresDSPContext { int idct_permutation_type; @@ -33,8 +32,8 @@ typedef struct ProresDSPContext { void (*idct_put)(uint16_t *out, ptrdiff_t linesize, int16_t *block, const int16_t *qmat); } ProresDSPContext; -int ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx); +int ff_proresdsp_init(ProresDSPContext *dsp, int bits_per_raw_sample); -void ff_proresdsp_init_x86(ProresDSPContext *dsp, AVCodecContext *avctx); +void ff_proresdsp_init_x86(ProresDSPContext *dsp, int bits_per_raw_sample); #endif /* AVCODEC_PRORESDSP_H */ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/proresenc_anatoliy.c b/arm/raspi/third_party/ffmpeg/libavcodec/proresenc_anatoliy.c index fc48c97d..e7114f16 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/proresenc_anatoliy.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/proresenc_anatoliy.c @@ -32,7 +32,6 @@ #include "avcodec.h" #include "codec_internal.h" #include "encode.h" -#include "internal.h" #include "profiles.h" #include "proresdata.h" #include "put_bits.h" @@ -42,13 +41,13 @@ #define DEFAULT_SLICE_MB_WIDTH 8 static const AVProfile profiles[] = { - { FF_PROFILE_PRORES_PROXY, "apco"}, - { FF_PROFILE_PRORES_LT, "apcs"}, - { FF_PROFILE_PRORES_STANDARD, "apcn"}, - { FF_PROFILE_PRORES_HQ, "apch"}, - { FF_PROFILE_PRORES_4444, "ap4h"}, - { FF_PROFILE_PRORES_XQ, "ap4x"}, - { FF_PROFILE_UNKNOWN } + { AV_PROFILE_PRORES_PROXY, "apco"}, + { AV_PROFILE_PRORES_LT, "apcs"}, + { AV_PROFILE_PRORES_STANDARD, "apcn"}, + { AV_PROFILE_PRORES_HQ, "apch"}, + { AV_PROFILE_PRORES_4444, "ap4h"}, + { AV_PROFILE_PRORES_XQ, "ap4x"}, + { AV_PROFILE_UNKNOWN } }; static const int qp_start_table[] = { 8, 3, 2, 1, 1, 1}; @@ -198,6 +197,35 @@ typedef struct { char *vendor; } ProresContext; +/** + * Check if a value is in the list. If not, return the default value + * + * @param ctx Context for the log msg + * @param val_name Name of the checked value, for log msg + * @param array_valid_values Array of valid int, ended with INT_MAX + * @param default_value Value return if checked value is not in the array + * @return Value or default_value. + */ +static int int_from_list_or_default(void *ctx, const char *val_name, int val, + const int *array_valid_values, int default_value) +{ + int i = 0; + + while (1) { + int ref_val = array_valid_values[i]; + if (ref_val == INT_MAX) + break; + if (val == ref_val) + return val; + i++; + } + /* val is not a valid value */ + av_log(ctx, AV_LOG_DEBUG, + "%s %d are not supported. Set to default value : %d\n", + val_name, val, default_value); + return default_value; +} + static void encode_codeword(PutBitContext *pb, int val, int codebook) { unsigned int rice_order, exp_order, switch_bits, first_exp, exp, zeros; @@ -743,7 +771,7 @@ static int prores_encode_frame(AVCodecContext *avctx, AVPacket *pkt, bytestream_put_be16(&buf, avctx->width); bytestream_put_be16(&buf, avctx->height); frame_flags = 0x82; /* 422 not interlaced */ - if (avctx->profile >= FF_PROFILE_PRORES_4444) /* 4444 or 4444 Xq */ + if (avctx->profile >= AV_PROFILE_PRORES_4444) /* 4444 or 4444 Xq */ frame_flags |= 0x40; /* 444 chroma */ if (ctx->is_interlaced) { if ((pict->flags & AV_FRAME_FLAG_TOP_FIELD_FIRST) || !(pict->flags & AV_FRAME_FLAG_INTERLACED)) { @@ -761,10 +789,13 @@ static int prores_encode_frame(AVCodecContext *avctx, AVPacket *pkt, *buf++ = frame_flags; *buf++ = 0; /* reserved */ /* only write color properties, if valid value. set to unspecified otherwise */ - *buf++ = ff_int_from_list_or_default(avctx, "frame color primaries", pict->color_primaries, valid_primaries, 0); - *buf++ = ff_int_from_list_or_default(avctx, "frame color trc", pict->color_trc, valid_trc, 0); - *buf++ = ff_int_from_list_or_default(avctx, "frame colorspace", pict->colorspace, valid_colorspace, 0); - if (avctx->profile >= FF_PROFILE_PRORES_4444) { + *buf++ = int_from_list_or_default(avctx, "frame color primaries", + pict->color_primaries, valid_primaries, 0); + *buf++ = int_from_list_or_default(avctx, "frame color trc", + pict->color_trc, valid_trc, 0); + *buf++ = int_from_list_or_default(avctx, "frame colorspace", + pict->colorspace, valid_colorspace, 0); + if (avctx->profile >= AV_PROFILE_PRORES_4444) { if (avctx->pix_fmt == AV_PIX_FMT_YUV444P10) { *buf++ = 0xA0;/* src b64a and no alpha */ } else { @@ -840,40 +871,40 @@ static av_cold int prores_encode_init(AVCodecContext *avctx) return AVERROR(EINVAL); } - if (avctx->profile == FF_PROFILE_UNKNOWN) { + if (avctx->profile == AV_PROFILE_UNKNOWN) { if (avctx->pix_fmt == AV_PIX_FMT_YUV422P10) { - avctx->profile = FF_PROFILE_PRORES_STANDARD; + avctx->profile = AV_PROFILE_PRORES_STANDARD; av_log(avctx, AV_LOG_INFO, "encoding with ProRes standard (apcn) profile\n"); } else if (avctx->pix_fmt == AV_PIX_FMT_YUV444P10) { - avctx->profile = FF_PROFILE_PRORES_4444; + avctx->profile = AV_PROFILE_PRORES_4444; av_log(avctx, AV_LOG_INFO, "encoding with ProRes 4444 (ap4h) profile\n"); } else if (avctx->pix_fmt == AV_PIX_FMT_YUVA444P10) { - avctx->profile = FF_PROFILE_PRORES_4444; + avctx->profile = AV_PROFILE_PRORES_4444; av_log(avctx, AV_LOG_INFO, "encoding with ProRes 4444+ (ap4h) profile\n"); } - } else if (avctx->profile < FF_PROFILE_PRORES_PROXY - || avctx->profile > FF_PROFILE_PRORES_XQ) { + } else if (avctx->profile < AV_PROFILE_PRORES_PROXY + || avctx->profile > AV_PROFILE_PRORES_XQ) { av_log( avctx, AV_LOG_ERROR, "unknown profile %d, use [0 - apco, 1 - apcs, 2 - apcn (default), 3 - apch, 4 - ap4h, 5 - ap4x]\n", avctx->profile); return AVERROR(EINVAL); - } else if ((avctx->pix_fmt == AV_PIX_FMT_YUV422P10) && (avctx->profile > FF_PROFILE_PRORES_HQ)){ + } else if ((avctx->pix_fmt == AV_PIX_FMT_YUV422P10) && (avctx->profile > AV_PROFILE_PRORES_HQ)){ av_log(avctx, AV_LOG_ERROR, "encoding with ProRes 444/Xq (ap4h/ap4x) profile, need YUV444P10 input\n"); return AVERROR(EINVAL); } else if ((avctx->pix_fmt == AV_PIX_FMT_YUV444P10 || avctx->pix_fmt == AV_PIX_FMT_YUVA444P10) - && (avctx->profile < FF_PROFILE_PRORES_4444)){ + && (avctx->profile < AV_PROFILE_PRORES_4444)){ av_log(avctx, AV_LOG_ERROR, "encoding with ProRes Proxy/LT/422/422 HQ (apco, apcs, apcn, ap4h) profile, need YUV422P10 input\n"); return AVERROR(EINVAL); } - if (avctx->profile < FF_PROFILE_PRORES_4444) { /* 422 versions */ + if (avctx->profile < AV_PROFILE_PRORES_4444) { /* 422 versions */ ctx->is_422 = 1; if ((avctx->height & 0xf) || (avctx->width & 0xf)) { ctx->fill_y = av_malloc(4 * (DEFAULT_SLICE_MB_WIDTH << 8)); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/pthread_frame.c b/arm/raspi/third_party/ffmpeg/libavcodec/pthread_frame.c index bc305f56..13857677 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/pthread_frame.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/pthread_frame.c @@ -31,6 +31,7 @@ #include "avcodec_internal.h" #include "codec_internal.h" #include "decode.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "internal.h" #include "pthread_internal.h" @@ -50,21 +51,11 @@ #include "libavutil/thread.h" enum { - ///< Set when the thread is awaiting a packet. + /// Set when the thread is awaiting a packet. STATE_INPUT_READY, - ///< Set before the codec has called ff_thread_finish_setup(). + /// Set before the codec has called ff_thread_finish_setup(). STATE_SETTING_UP, - /** - * Set when the codec calls get_buffer(). - * State is returned to STATE_SETTING_UP afterwards. - */ - STATE_GET_BUFFER, - /** - * Set when the codec calls get_format(). - * State is returned to STATE_SETTING_UP afterwards. - */ - STATE_GET_FORMAT, - ///< Set after the codec has called ff_thread_finish_setup(). + /// Set after the codec has called ff_thread_finish_setup(). STATE_SETUP_FINISHED, }; @@ -150,7 +141,7 @@ typedef struct FrameThreadContext { static int hwaccel_serial(const AVCodecContext *avctx) { - return avctx->hwaccel && !(avctx->hwaccel->caps_internal & HWACCEL_CAP_THREAD_SAFE); + return avctx->hwaccel && !(ffhwaccel(avctx->hwaccel)->caps_internal & HWACCEL_CAP_THREAD_SAFE); } static void async_lock(FrameThreadContext *fctx) @@ -245,7 +236,7 @@ static attribute_align_arg void *frame_worker_thread(void *arg) pthread_mutex_unlock(&p->parent->hwaccel_mutex); } av_assert0(!avctx->hwaccel || - (avctx->hwaccel->caps_internal & HWACCEL_CAP_THREAD_SAFE)); + (ffhwaccel(avctx->hwaccel)->caps_internal & HWACCEL_CAP_THREAD_SAFE)); if (p->async_serializing) { p->async_serializing = 0; @@ -274,7 +265,7 @@ static attribute_align_arg void *frame_worker_thread(void *arg) * @param for_user 0 if the destination is a codec thread, 1 if the destination is the user's thread * @return 0 on success, negative error code on failure */ -static int update_context_from_thread(AVCodecContext *dst, AVCodecContext *src, int for_user) +static int update_context_from_thread(AVCodecContext *dst, const AVCodecContext *src, int for_user) { const FFCodec *const codec = ffcodec(dst->codec); int err = 0; @@ -367,12 +358,13 @@ FF_ENABLE_DEPRECATION_WARNINGS // propagate hwaccel state for threadsafe hwaccels if (p_src->hwaccel_threadsafe) { + const FFHWAccel *hwaccel = ffhwaccel(src->hwaccel); if (!dst->hwaccel) { - if (src->hwaccel->priv_data_size) { - av_assert0(src->hwaccel->update_thread_context); + if (hwaccel->priv_data_size) { + av_assert0(hwaccel->update_thread_context); dst->internal->hwaccel_priv_data = - av_mallocz(src->hwaccel->priv_data_size); + av_mallocz(hwaccel->priv_data_size); if (!dst->internal->hwaccel_priv_data) return AVERROR(ENOMEM); } @@ -380,8 +372,8 @@ FF_ENABLE_DEPRECATION_WARNINGS } av_assert0(dst->hwaccel == src->hwaccel); - if (src->hwaccel->update_thread_context) { - err = src->hwaccel->update_thread_context(dst, src); + if (hwaccel->update_thread_context) { + err = hwaccel->update_thread_context(dst, src); if (err < 0) { av_log(dst, AV_LOG_ERROR, "Error propagating hwaccel state\n"); ff_hwaccel_uninit(dst); @@ -402,7 +394,7 @@ FF_ENABLE_DEPRECATION_WARNINGS * @param src The source context. * @return 0 on success, negative error code on failure */ -static int update_context_from_user(AVCodecContext *dst, AVCodecContext *src) +static int update_context_from_user(AVCodecContext *dst, const AVCodecContext *src) { int err; @@ -432,22 +424,6 @@ FF_ENABLE_DEPRECATION_WARNINGS FF_DISABLE_DEPRECATION_WARNINGS dst->reordered_opaque = src->reordered_opaque; FF_ENABLE_DEPRECATION_WARNINGS -#endif - -#if FF_API_SLICE_OFFSET -FF_DISABLE_DEPRECATION_WARNINGS - if (src->slice_count && src->slice_offset) { - if (dst->slice_count < src->slice_count) { - int err = av_reallocp_array(&dst->slice_offset, src->slice_count, - sizeof(*dst->slice_offset)); - if (err < 0) - return err; - } - memcpy(dst->slice_offset, src->slice_offset, - src->slice_count * sizeof(*dst->slice_offset)); - } - dst->slice_count = src->slice_count; -FF_ENABLE_DEPRECATION_WARNINGS #endif av_packet_unref(dst->internal->last_pkt_props); @@ -652,12 +628,14 @@ void ff_thread_await_progress(const ThreadFrame *f, int n, int field) } void ff_thread_finish_setup(AVCodecContext *avctx) { - PerThreadContext *p = avctx->internal->thread_ctx; + PerThreadContext *p; if (!(avctx->active_thread_type&FF_THREAD_FRAME)) return; + p = avctx->internal->thread_ctx; + p->hwaccel_threadsafe = avctx->hwaccel && - (avctx->hwaccel->caps_internal & HWACCEL_CAP_THREAD_SAFE); + (ffhwaccel(avctx->hwaccel)->caps_internal & HWACCEL_CAP_THREAD_SAFE); if (hwaccel_serial(avctx) && !p->hwaccel_serializing) { pthread_mutex_lock(&p->parent->hwaccel_mutex); @@ -666,7 +644,7 @@ void ff_thread_finish_setup(AVCodecContext *avctx) { /* this assumes that no hwaccel calls happen before ff_thread_finish_setup() */ if (avctx->hwaccel && - !(avctx->hwaccel->caps_internal & HWACCEL_CAP_ASYNC_SAFE)) { + !(ffhwaccel(avctx->hwaccel)->caps_internal & HWACCEL_CAP_ASYNC_SAFE)) { p->async_serializing = 1; async_lock(p->parent); @@ -762,12 +740,6 @@ void ff_frame_thread_free(AVCodecContext *avctx, int thread_count) av_freep(&ctx->priv_data); } -#if FF_API_SLICE_OFFSET -FF_DISABLE_DEPRECATION_WARNINGS - av_freep(&ctx->slice_offset); -FF_ENABLE_DEPRECATION_WARNINGS -#endif - av_buffer_unref(&ctx->internal->pool); av_packet_free(&ctx->internal->last_pkt_props); av_freep(&ctx->internal); @@ -964,11 +936,12 @@ void ff_thread_flush(AVCodecContext *avctx) int ff_thread_can_start_frame(AVCodecContext *avctx) { - PerThreadContext *p = avctx->internal->thread_ctx; - - if ((avctx->active_thread_type&FF_THREAD_FRAME) && atomic_load(&p->state) != STATE_SETTING_UP && + if ((avctx->active_thread_type & FF_THREAD_FRAME) && ffcodec(avctx->codec)->update_thread_context) { - return 0; + PerThreadContext *p = avctx->internal->thread_ctx; + + if (atomic_load(&p->state) != STATE_SETTING_UP) + return 0; } return 1; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/qdm2_tablegen.h b/arm/raspi/third_party/ffmpeg/libavcodec/qdm2_tablegen.h index a68ea859..6e174a78 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/qdm2_tablegen.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/qdm2_tablegen.h @@ -116,9 +116,9 @@ static av_cold void build_vlc(VLC *vlc, int nb_bits, int nb_codes, { vlc->table = &qdm2_table[*offset]; vlc->table_allocated = FF_ARRAY_ELEMS(qdm2_table) - *offset; - ff_init_vlc_from_lengths(vlc, nb_bits, nb_codes, + ff_vlc_init_from_lengths(vlc, nb_bits, nb_codes, &tab[0][1], 2, &tab[0][0], 2, 1, - -1, INIT_VLC_STATIC_OVERLONG | INIT_VLC_LE, NULL); + -1, VLC_INIT_STATIC_OVERLONG | VLC_INIT_LE, NULL); *offset += vlc->table_size; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/qdmc.c b/arm/raspi/third_party/ffmpeg/libavcodec/qdmc.c index 081c4dd4..474e5ef8 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/qdmc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/qdmc.c @@ -172,9 +172,9 @@ static av_cold void qdmc_init_static_data(void) static VLCElem vlc_buffer[13698]; vtable[i].table = &vlc_buffer[offset]; vtable[i].table_allocated = FF_ARRAY_ELEMS(vlc_buffer) - offset; - ff_init_vlc_from_lengths(&vtable[i], huff_bits[i], huff_sizes[i], + ff_vlc_init_from_lengths(&vtable[i], huff_bits[i], huff_sizes[i], &hufftab[0][1], 2, &hufftab[0][0], 2, 1, -1, - INIT_VLC_LE | INIT_VLC_STATIC_OVERLONG, NULL); + VLC_INIT_LE | VLC_INIT_STATIC_OVERLONG, NULL); hufftab += huff_sizes[i]; offset += vtable[i].table_size; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/qpeg.c b/arm/raspi/third_party/ffmpeg/libavcodec/qpeg.c index 1f76ebc5..9b4ad8e2 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/qpeg.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/qpeg.c @@ -307,8 +307,7 @@ FF_ENABLE_DEPRECATION_WARNINGS #endif memcpy(p->data[1], a->pal, AVPALETTE_SIZE); - av_frame_unref(ref); - if ((ret = av_frame_ref(ref, p)) < 0) + if ((ret = av_frame_replace(ref, p)) < 0) return ret; if (intra) diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/qsvenc.c b/arm/raspi/third_party/ffmpeg/libavcodec/qsvenc.c index df63c182..a0144b07 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/qsvenc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/qsvenc.c @@ -21,12 +21,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "config_components.h" - #include #include #include +#include "libavutil/avassert.h" #include "libavutil/common.h" #include "libavutil/hwcontext.h" #include "libavutil/hwcontext_qsv.h" @@ -34,9 +33,9 @@ #include "libavutil/log.h" #include "libavutil/time.h" #include "libavutil/imgutils.h" -#include "libavcodec/bytestream.h" #include "avcodec.h" +#include "encode.h" #include "internal.h" #include "packet_internal.h" #include "qsv.h" @@ -1506,7 +1505,7 @@ static int qsv_retrieve_enc_params(AVCodecContext *avctx, QSVEncContext *q) } memset(avctx->extradata + avctx->extradata_size, 0, AV_INPUT_BUFFER_PADDING_SIZE); - cpb_props = ff_add_cpb_side_data(avctx); + cpb_props = ff_encode_add_cpb_side_data(avctx); if (!cpb_props) return AVERROR(ENOMEM); cpb_props->max_bitrate = avctx->rc_max_rate; @@ -1997,8 +1996,7 @@ static int submit_frame(QSVEncContext *q, const AVFrame *frame, return ret; } } else { - av_frame_unref(qf->frame); - ret = av_frame_ref(qf->frame, frame); + ret = av_frame_replace(qf->frame, frame); if (ret < 0) return ret; } @@ -2586,7 +2584,7 @@ int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext *q, pict_type = AV_PICTURE_TYPE_P; else if (qpkt.bs->FrameType & MFX_FRAMETYPE_B || qpkt.bs->FrameType & MFX_FRAMETYPE_xB) pict_type = AV_PICTURE_TYPE_B; - else if (qpkt.bs->FrameType == MFX_FRAMETYPE_UNKNOWN) { + else if (qpkt.bs->FrameType == MFX_FRAMETYPE_UNKNOWN && qpkt.bs->DataLength) { pict_type = AV_PICTURE_TYPE_NONE; av_log(avctx, AV_LOG_WARNING, "Unknown FrameType, set pict_type to AV_PICTURE_TYPE_NONE.\n"); } else { diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/qsvenc_hevc.c b/arm/raspi/third_party/ffmpeg/libavcodec/qsvenc_hevc.c index 5e23ca96..c5b7ac7c 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/qsvenc_hevc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/qsvenc_hevc.c @@ -376,7 +376,7 @@ static const AVClass class = { static const FFCodecDefault qsv_enc_defaults[] = { { "b", "1M" }, { "refs", "0" }, - { "g", "-1" }, + { "g", "248" }, { "bf", "-1" }, { "qmin", "-1" }, { "qmax", "-1" }, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/qtrleenc.c b/arm/raspi/third_party/ffmpeg/libavcodec/qtrleenc.c index 38467627..92e6e843 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/qtrleenc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/qtrleenc.c @@ -385,8 +385,7 @@ static int qtrle_encode_frame(AVCodecContext *avctx, AVPacket *pkt, pkt->size = encode_frame(s, pict, pkt->data); /* save the current frame */ - av_frame_unref(s->previous_frame); - ret = av_frame_ref(s->previous_frame, pict); + ret = av_frame_replace(s->previous_frame, pict); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "cannot add reference\n"); return ret; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/ralf.c b/arm/raspi/third_party/ffmpeg/libavcodec/ralf.c index 591598d8..8f7fac79 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/ralf.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/ralf.c @@ -99,7 +99,7 @@ static av_cold int init_ralf_vlc(VLC *vlc, const uint8_t *data, int elems) for (i = 0; i < elems; i++) codes[i] = prefixes[lens[i]]++; - return ff_init_vlc_sparse(vlc, FFMIN(max_bits, 9), elems, + return ff_vlc_init_sparse(vlc, FFMIN(max_bits, 9), elems, lens, 1, 1, codes, 2, 2, NULL, 0, 0, 0); } @@ -109,16 +109,16 @@ static av_cold int decode_close(AVCodecContext *avctx) int i, j, k; for (i = 0; i < 3; i++) { - ff_free_vlc(&ctx->sets[i].filter_params); - ff_free_vlc(&ctx->sets[i].bias); - ff_free_vlc(&ctx->sets[i].coding_mode); + ff_vlc_free(&ctx->sets[i].filter_params); + ff_vlc_free(&ctx->sets[i].bias); + ff_vlc_free(&ctx->sets[i].coding_mode); for (j = 0; j < 10; j++) for (k = 0; k < 11; k++) - ff_free_vlc(&ctx->sets[i].filter_coeffs[j][k]); + ff_vlc_free(&ctx->sets[i].filter_coeffs[j][k]); for (j = 0; j < 15; j++) - ff_free_vlc(&ctx->sets[i].short_codes[j]); + ff_vlc_free(&ctx->sets[i].short_codes[j]); for (j = 0; j < 125; j++) - ff_free_vlc(&ctx->sets[i].long_codes[j]); + ff_vlc_free(&ctx->sets[i].long_codes[j]); } return 0; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/rasc.c b/arm/raspi/third_party/ffmpeg/libavcodec/rasc.c index 4d057e80..21c1829f 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/rasc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/rasc.c @@ -379,8 +379,8 @@ static int decode_dlta(AVCodecContext *avctx, if (!s->frame2->data[0] || !s->frame1->data[0]) return AVERROR_INVALIDDATA; - b1 = s->frame1->data[0] + s->frame1->linesize[0] * (y + h - 1) + x * s->bpp; - b2 = s->frame2->data[0] + s->frame2->linesize[0] * (y + h - 1) + x * s->bpp; + b1 = s->frame1->data[0] + s->frame1->linesize[0] * (int)(y + h - 1) + ((int)x) * s->bpp; + b2 = s->frame2->data[0] + s->frame2->linesize[0] * (int)(y + h - 1) + ((int)x) * s->bpp; cx = 0, cy = h; while (bytestream2_get_bytes_left(&dc) > 0) { int type = bytestream2_get_byte(&dc); @@ -620,7 +620,7 @@ static void draw_cursor(AVCodecContext *avctx) if (cr == s->cursor[0] && cg == s->cursor[1] && cb == s->cursor[2]) continue; - dst = s->frame->data[0] + s->frame->linesize[0] * (s->cursor_y + i) + (s->cursor_x + j); + dst = s->frame->data[0] + s->frame->linesize[0] * (int)(s->cursor_y + i) + (int)(s->cursor_x + j); for (int k = 0; k < 256; k++) { int pr = pal[k * 4 + 0]; int pg = pal[k * 4 + 1]; @@ -646,7 +646,7 @@ static void draw_cursor(AVCodecContext *avctx) continue; cr >>= 3; cg >>=3; cb >>= 3; - dst = s->frame->data[0] + s->frame->linesize[0] * (s->cursor_y + i) + 2 * (s->cursor_x + j); + dst = s->frame->data[0] + s->frame->linesize[0] * (int)(s->cursor_y + i) + 2 * (s->cursor_x + j); AV_WL16(dst, cr | cg << 5 | cb << 10); } } @@ -660,7 +660,7 @@ static void draw_cursor(AVCodecContext *avctx) if (cr == s->cursor[0] && cg == s->cursor[1] && cb == s->cursor[2]) continue; - dst = s->frame->data[0] + s->frame->linesize[0] * (s->cursor_y + i) + 4 * (s->cursor_x + j); + dst = s->frame->data[0] + s->frame->linesize[0] * (int)(s->cursor_y + i) + 4 * (s->cursor_x + j); dst[0] = cb; dst[1] = cg; dst[2] = cr; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/ratecontrol.c b/arm/raspi/third_party/ffmpeg/libavcodec/ratecontrol.c index 649f570c..55ce0547 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/ratecontrol.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/ratecontrol.c @@ -26,6 +26,7 @@ */ #include "libavutil/attributes.h" +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "avcodec.h" diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/raw.c b/arm/raspi/third_party/ffmpeg/libavcodec/raw.c index 1e5b48d1..b73b80e5 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/raw.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/raw.c @@ -206,6 +206,8 @@ static const PixelFormatTag raw_pix_fmt_tags[] = { { AV_PIX_FMT_GBRAP10BE, MKTAG(10 , 00 , '4', 'G') }, { AV_PIX_FMT_GBRAP12LE, MKTAG('G', '4', 00 , 12 ) }, { AV_PIX_FMT_GBRAP12BE, MKTAG(12 , 00 , '4', 'G') }, + { AV_PIX_FMT_GBRAP14LE, MKTAG('G', '4', 00 , 14 ) }, + { AV_PIX_FMT_GBRAP14BE, MKTAG(14 , 00 , '4', 'G') }, { AV_PIX_FMT_GBRAP16LE, MKTAG('G', '4', 00 , 16 ) }, { AV_PIX_FMT_GBRAP16BE, MKTAG(16 , 00 , '4', 'G') }, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/riscv/Makefile b/arm/raspi/third_party/ffmpeg/libavcodec/riscv/Makefile index ee17a521..77bba7f7 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/riscv/Makefile +++ b/arm/raspi/third_party/ffmpeg/libavcodec/riscv/Makefile @@ -10,6 +10,8 @@ OBJS-$(CONFIG_BSWAPDSP) += riscv/bswapdsp_init.o \ RVV-OBJS-$(CONFIG_BSWAPDSP) += riscv/bswapdsp_rvv.o OBJS-$(CONFIG_FMTCONVERT) += riscv/fmtconvert_init.o RVV-OBJS-$(CONFIG_FMTCONVERT) += riscv/fmtconvert_rvv.o +OBJS-$(CONFIG_G722DSP) += riscv/g722dsp_init.o +RVV-OBJS-$(CONFIG_G722DSP) += riscv/g722dsp_rvv.o OBJS-$(CONFIG_H264CHROMA) += riscv/h264_chroma_init_riscv.o RVV-OBJS-$(CONFIG_H264CHROMA) += riscv/h264_mc_chroma.o OBJS-$(CONFIG_IDCTDSP) += riscv/idctdsp_init.o diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/riscv/aacpsdsp_rvv.S b/arm/raspi/third_party/ffmpeg/libavcodec/riscv/aacpsdsp_rvv.S index b581383f..fe250cd8 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/riscv/aacpsdsp_rvv.S +++ b/arm/raspi/third_party/ffmpeg/libavcodec/riscv/aacpsdsp_rvv.S @@ -38,14 +38,14 @@ endfunc func ff_ps_mul_pair_single_rvv, zve32f 1: - vsetvli t0, a3, e32, m1, ta, ma + vsetvli t0, a3, e32, m4, ta, ma vlseg2e32.v v24, (a1) sub a3, a3, t0 vle32.v v16, (a2) sh3add a1, t0, a1 vfmul.vv v24, v24, v16 sh2add a2, t0, a2 - vfmul.vv v25, v25, v16 + vfmul.vv v28, v28, v16 vsseg2e32.v v24, (a0) sh3add a0, t0, a0 bnez a3, 1b @@ -168,10 +168,10 @@ func ff_ps_hybrid_analysis_ileave_rvv, zve32x /* no needs for zve32f here */ mv t4, a4 addi a2, a2, 1 2: - vsetvli t5, t3, e32, m1, ta, ma + vsetvli t5, t3, e32, m4, ta, ma vlse32.v v16, (t1), t6 sub t3, t3, t5 - vlse32.v v17, (t4), t6 + vlse32.v v20, (t4), t6 mul t2, t5, t6 vsseg2e32.v v16, (t0) sh3add t0, t5, t0 @@ -203,12 +203,12 @@ func ff_ps_hybrid_synthesis_deint_rvv, zve32x mv t4, a4 addi a2, a2, 1 2: - vsetvli t5, t3, e32, m1, ta, ma + vsetvli t5, t3, e32, m4, ta, ma vlseg2e32.v v16, (t1) sub t3, t3, t5 vsse32.v v16, (t0), t6 mul t2, t5, t6 - vsse32.v v17, (t4), t6 + vsse32.v v20, (t4), t6 sh3add t1, t5, t1 add t0, t0, t2 add t4, t4, t2 @@ -223,7 +223,7 @@ func ff_ps_hybrid_synthesis_deint_rvv, zve32x endfunc func ff_ps_stereo_interpolate_rvv, zve32f - vsetvli t0, zero, e32, m1, ta, ma + vsetvli t0, zero, e32, m2, ta, ma vid.v v24 flw ft0, (a2) vadd.vi v24, v24, 1 // v24[i] = i + 1 @@ -232,47 +232,43 @@ func ff_ps_stereo_interpolate_rvv, zve32f flw ft2, 8(a2) vfmv.v.f v16, ft0 flw ft3, 12(a2) - vfmv.v.f v17, ft1 + vfmv.v.f v18, ft1 flw ft0, (a3) - vfmv.v.f v18, ft2 + vfmv.v.f v20, ft2 flw ft1, 4(a3) - vfmv.v.f v19, ft3 + vfmv.v.f v22, ft3 flw ft2, 8(a3) - vfmv.v.f v20, ft0 flw ft3, 12(a3) - vfmv.v.f v21, ft1 fcvt.s.wu ft4, t0 // (float)(vlenb / sizeof (float)) - vfmv.v.f v22, ft2 + vfmacc.vf v16, ft0, v24 // h0 += (i + 1) * h0_step fmul.s ft0, ft0, ft4 - vfmv.v.f v23, ft3 + vfmacc.vf v18, ft1, v24 fmul.s ft1, ft1, ft4 - vfmacc.vv v16, v24, v20 // h0 += (i + 1) * h0_step + vfmacc.vf v20, ft2, v24 fmul.s ft2, ft2, ft4 - vfmacc.vv v17, v24, v21 + vfmacc.vf v22, ft3, v24 fmul.s ft3, ft3, ft4 - vfmacc.vv v18, v24, v22 - vfmacc.vv v19, v24, v23 1: - vsetvli t0, a4, e32, m1, ta, ma - vlseg2e32.v v8, (a0) // v8:l_re, v9:l_im + vsetvli t0, a4, e32, m2, ta, ma + vlseg2e32.v v0, (a0) // v0:l_re, v2:l_im sub a4, a4, t0 - vlseg2e32.v v10, (a1) // v10:r_re, v11:r_im - vfmul.vv v12, v8, v16 - vfmul.vv v13, v9, v16 - vfmul.vv v14, v8, v17 - vfmul.vv v15, v9, v17 - vfmacc.vv v12, v10, v18 - vfmacc.vv v13, v11, v18 - vfmacc.vv v14, v10, v19 - vfmacc.vv v15, v11, v19 - vsseg2e32.v v12, (a0) + vlseg2e32.v v4, (a1) // v4:r_re, v6:r_im + vfmul.vv v8, v0, v16 + vfmul.vv v10, v2, v16 + vfmul.vv v12, v0, v18 + vfmul.vv v14, v2, v18 + vfmacc.vv v8, v4, v20 + vfmacc.vv v10, v6, v20 + vfmacc.vv v12, v4, v22 + vfmacc.vv v14, v6, v22 + vsseg2e32.v v8, (a0) sh3add a0, t0, a0 - vsseg2e32.v v14, (a1) + vsseg2e32.v v12, (a1) sh3add a1, t0, a1 vfadd.vf v16, v16, ft0 // h0 += (vlenb / sizeof (float)) * h0_step - vfadd.vf v17, v17, ft1 - vfadd.vf v18, v18, ft2 - vfadd.vf v19, v19, ft3 + vfadd.vf v18, v18, ft1 + vfadd.vf v20, v20, ft2 + vfadd.vf v22, v22, ft3 bnez a4, 1b ret diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/riscv/audiodsp_rvv.S b/arm/raspi/third_party/ffmpeg/libavcodec/riscv/audiodsp_rvv.S index f7eba211..f0b23bab 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/riscv/audiodsp_rvv.S +++ b/arm/raspi/third_party/ffmpeg/libavcodec/riscv/audiodsp_rvv.S @@ -42,7 +42,7 @@ endfunc func ff_vector_clip_int32_rvv, zve32x 1: - vsetvli t0, a4, e32, m1, ta, ma + vsetvli t0, a4, e32, m8, ta, ma vle32.v v8, (a1) sub a4, a4, t0 vmax.vx v8, v8, a2 @@ -59,7 +59,7 @@ func ff_vector_clipf_rvv, zve32f NOHWF fmv.w.x fa0, a3 NOHWF fmv.w.x fa1, a4 1: - vsetvli t0, a2, e32, m1, ta, ma + vsetvli t0, a2, e32, m8, ta, ma vle32.v v8, (a1) sub a2, a2, t0 vfmax.vf v8, v8, fa0 diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/riscv/bswapdsp_rvb.S b/arm/raspi/third_party/ffmpeg/libavcodec/riscv/bswapdsp_rvb.S index 91b47bf8..0786bd3f 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/riscv/bswapdsp_rvb.S +++ b/arm/raspi/third_party/ffmpeg/libavcodec/riscv/bswapdsp_rvb.S @@ -20,49 +20,10 @@ #include "config.h" #include "libavutil/riscv/asm.S" +#include "libavutil/riscv/bswap_rvb.S" #if (__riscv_xlen >= 64) func ff_bswap32_buf_rvb, zbb - andi t0, a1, 4 - beqz t0, 1f - /* Align a1 (input) to 64-bit */ - lwu t0, (a1) - addi a0, a0, 4 - rev8 t0, t0 - addi a2, a2, -1 - srli t0, t0, __riscv_xlen - 32 - addi a1, a1, 4 - sw t0, -4(a0) -1: - andi a3, a2, -2 - sh2add a2, a2, a0 - beqz a3, 3f - sh2add a3, a3, a0 -2: /* 2 elements (64 bits) at a time on a 64-bit boundary */ - ld t0, (a1) - addi a0, a0, 8 - rev8 t0, t0 -#if (__riscv_xlen == 64) - srli t2, t0, 32 - sw t0, -4(a0) -#else - srli t1, t0, __riscv_xlen - 64 - srli t2, t0, __riscv_xlen - 32 - sw t1, -4(a0) -#endif - addi a1, a1, 8 - sw t2, -8(a0) - bne a0, a3, 2b -3: - beq a0, a2, 5f -4: /* Process last element */ - lwu t0, (a1) - addi a0, a0, 4 - rev8 t0, t0 - addi a1, a1, 4 - srli t0, t0, __riscv_xlen - 32 - sw t0, -4(a0) -5: - ret + bswap32_rvb a0, a1, a2 endfunc #endif diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/riscv/fmtconvert_rvv.S b/arm/raspi/third_party/ffmpeg/libavcodec/riscv/fmtconvert_rvv.S index 51365753..d0e2f106 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/riscv/fmtconvert_rvv.S +++ b/arm/raspi/third_party/ffmpeg/libavcodec/riscv/fmtconvert_rvv.S @@ -24,7 +24,7 @@ func ff_int32_to_float_fmul_scalar_rvv, zve32f NOHWF fmv.w.x fa0, a2 NOHWF mv a2, a3 1: - vsetvli t0, a2, e32, m1, ta, ma + vsetvli t0, a2, e32, m8, ta, ma vle32.v v24, (a1) sub a2, a2, t0 vfcvt.f.x.v v24, v24 diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/riscv/g722dsp_init.c b/arm/raspi/third_party/ffmpeg/libavcodec/riscv/g722dsp_init.c new file mode 100644 index 00000000..77e29bfb --- /dev/null +++ b/arm/raspi/third_party/ffmpeg/libavcodec/riscv/g722dsp_init.c @@ -0,0 +1,40 @@ +/* + * Copyright © 2023 Rémi Denis-Courmont. + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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 + +#include "libavutil/attributes.h" +#include "libavutil/cpu.h" +#include "libavutil/riscv/cpu.h" +#include "libavcodec/g722dsp.h" + +extern void ff_g722_apply_qmf_rvv(const int16_t *prev_samples, int xout[2]); + +av_cold void ff_g722dsp_init_riscv(G722DSPContext *dsp) +{ +#if HAVE_RVV + int flags = av_get_cpu_flags(); + + if ((flags & AV_CPU_FLAG_RVV_I32) && ff_get_rv_vlenb() >= 16) + dsp->apply_qmf = ff_g722_apply_qmf_rvv; +#endif +} diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/riscv/g722dsp_rvv.S b/arm/raspi/third_party/ffmpeg/libavcodec/riscv/g722dsp_rvv.S new file mode 100644 index 00000000..350be8dc --- /dev/null +++ b/arm/raspi/third_party/ffmpeg/libavcodec/riscv/g722dsp_rvv.S @@ -0,0 +1,66 @@ +/* + * Copyright © 2023 Rémi Denis-Courmont. + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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/riscv/asm.S" + +func ff_g722_apply_qmf_rvv, zve32x + lla t0, qmf_coeffs + vsetivli zero, 12, e16, m2, ta, ma + vlseg2e16.v v28, (a0) + vlseg2e16.v v24, (t0) + vwmul.vv v16, v28, v24 + vwmul.vv v20, v30, v26 + vsetivli zero, 12, e32, m4, ta, ma + vmv.s.x v10, zero + vredsum.vs v8, v16, v10 + vredsum.vs v9, v20, v10 + vmv.x.s t0, v8 + vmv.x.s t1, v9 + sw t0, 4(a1) + sw t1, 0(a1) + ret +endfunc + +const qmf_coeffs, align=2 + .short 3 + .short -11 + .short -11 + .short 53 + .short 12 + .short -156 + .short 32 + .short 362 + .short -210 + .short -805 + .short 951 + .short 3876 + .short 3876 + .short 951 + .short -805 + .short -210 + .short 362 + .short 32 + .short -156 + .short 12 + .short 53 + .short -11 + .short -11 + .short 3 +endconst diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/riscv/h264_chroma_init_riscv.c b/arm/raspi/third_party/ffmpeg/libavcodec/riscv/h264_chroma_init_riscv.c index f3e91282..e6fe5f6e 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/riscv/h264_chroma_init_riscv.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/riscv/h264_chroma_init_riscv.c @@ -27,6 +27,10 @@ void h264_put_chroma_mc8_rvv(uint8_t *p_dst, const uint8_t *p_src, ptrdiff_t stride, int h, int x, int y); void h264_avg_chroma_mc8_rvv(uint8_t *p_dst, const uint8_t *p_src, ptrdiff_t stride, int h, int x, int y); +void h264_put_chroma_mc4_rvv(uint8_t *p_dst, const uint8_t *p_src, ptrdiff_t stride, int h, int x, int y); +void h264_avg_chroma_mc4_rvv(uint8_t *p_dst, const uint8_t *p_src, ptrdiff_t stride, int h, int x, int y); +void h264_put_chroma_mc2_rvv(uint8_t *p_dst, const uint8_t *p_src, ptrdiff_t stride, int h, int x, int y); +void h264_avg_chroma_mc2_rvv(uint8_t *p_dst, const uint8_t *p_src, ptrdiff_t stride, int h, int x, int y); av_cold void ff_h264chroma_init_riscv(H264ChromaContext *c, int bit_depth) { @@ -37,6 +41,10 @@ av_cold void ff_h264chroma_init_riscv(H264ChromaContext *c, int bit_depth) (flags & AV_CPU_FLAG_RVB_ADDR) && ff_get_rv_vlenb() >= 16) { c->put_h264_chroma_pixels_tab[0] = h264_put_chroma_mc8_rvv; c->avg_h264_chroma_pixels_tab[0] = h264_avg_chroma_mc8_rvv; + c->put_h264_chroma_pixels_tab[1] = h264_put_chroma_mc4_rvv; + c->avg_h264_chroma_pixels_tab[1] = h264_avg_chroma_mc4_rvv; + c->put_h264_chroma_pixels_tab[2] = h264_put_chroma_mc2_rvv; + c->avg_h264_chroma_pixels_tab[2] = h264_avg_chroma_mc2_rvv; } #endif } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/riscv/h264_mc_chroma.S b/arm/raspi/third_party/ffmpeg/libavcodec/riscv/h264_mc_chroma.S index 364bc315..ce99bda4 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/riscv/h264_mc_chroma.S +++ b/arm/raspi/third_party/ffmpeg/libavcodec/riscv/h264_mc_chroma.S @@ -19,8 +19,7 @@ */ #include "libavutil/riscv/asm.S" -.macro h264_chroma_mc8 type -func h264_\type\()_chroma_mc8_rvv, zve32x +.macro do_chroma_mc type unroll csrw vxrm, zero slli t2, a5, 3 mul t1, a5, a4 @@ -30,94 +29,100 @@ func h264_\type\()_chroma_mc8_rvv, zve32x sub a7, a4, t1 addi a6, a5, 64 sub t0, t2, t1 - vsetivli t3, 8, e8, m1, ta, mu + vsetvli t3, t6, e8, m1, ta, mu beqz t1, 2f blez a3, 8f li t4, 0 li t2, 0 li t5, 1 addi a5, t3, 1 - slli t3, a2, 2 + slli t3, a2, (1 + \unroll) 1: # if (xy != 0) add a4, a1, t4 vsetvli zero, a5, e8, m1, ta, ma + .ifc \unroll,1 addi t2, t2, 4 + .else + addi t2, t2, 2 + .endif vle8.v v10, (a4) add a4, a4, a2 vslide1down.vx v11, v10, t5 - vsetivli zero, 8, e8, m1, ta, ma + vsetvli zero, t6, e8, m1, ta, ma vwmulu.vx v8, v10, a6 vwmaccu.vx v8, a7, v11 vsetvli zero, a5, e8, m1, ta, ma vle8.v v12, (a4) - vsetivli zero, 8, e8, m1, ta, ma + vsetvli zero, t6, e8, m1, ta, ma add a4, a4, a2 vwmaccu.vx v8, t0, v12 vsetvli zero, a5, e8, m1, ta, ma vslide1down.vx v13, v12, t5 - vsetivli zero, 8, e8, m1, ta, ma + vsetvli zero, t6, e8, m1, ta, ma vwmulu.vx v10, v12, a6 vwmaccu.vx v8, t1, v13 vwmaccu.vx v10, a7, v13 vsetvli zero, a5, e8, m1, ta, ma vle8.v v14, (a4) - vsetivli zero, 8, e8, m1, ta, ma + vsetvli zero, t6, e8, m1, ta, ma add a4, a4, a2 vwmaccu.vx v10, t0, v14 vsetvli zero, a5, e8, m1, ta, ma vslide1down.vx v15, v14, t5 - vsetivli zero, 8, e8, m1, ta, ma + vsetvli zero, t6, e8, m1, ta, ma vwmulu.vx v12, v14, a6 vwmaccu.vx v10, t1, v15 vwmaccu.vx v12, a7, v15 + vnclipu.wi v15, v8, 6 + .ifc \type,avg + vle8.v v9, (a0) + vaaddu.vv v15, v15, v9 + .endif + vse8.v v15, (a0) + add a0, a0, a2 + vnclipu.wi v8, v10, 6 + .ifc \type,avg + vle8.v v9, (a0) + vaaddu.vv v8, v8, v9 + .endif + add t4, t4, t3 + vse8.v v8, (a0) + add a0, a0, a2 + .ifc \unroll,1 vsetvli zero, a5, e8, m1, ta, ma vle8.v v14, (a4) - vsetivli zero, 8, e8, m1, ta, ma + vsetvli zero, t6, e8, m1, ta, ma add a4, a4, a2 vwmaccu.vx v12, t0, v14 vsetvli zero, a5, e8, m1, ta, ma vslide1down.vx v15, v14, t5 - vsetivli zero, 8, e8, m1, ta, ma + vsetvli zero, t6, e8, m1, ta, ma vwmulu.vx v16, v14, a6 vwmaccu.vx v12, t1, v15 vwmaccu.vx v16, a7, v15 vsetvli zero, a5, e8, m1, ta, ma vle8.v v14, (a4) - vsetivli zero, 8, e8, m1, ta, ma - add a4, a0, t4 - add t4, t4, t3 + vsetvli zero, t6, e8, m1, ta, ma vwmaccu.vx v16, t0, v14 vsetvli zero, a5, e8, m1, ta, ma vslide1down.vx v14, v14, t5 - vsetivli zero, 8, e8, m1, ta, ma - vnclipu.wi v15, v8, 6 + vsetvli zero, t6, e8, m1, ta, ma vwmaccu.vx v16, t1, v14 - .ifc \type,avg - vle8.v v9, (a4) - vaaddu.vv v15, v15, v9 - .endif - vse8.v v15, (a4) - add a4, a4, a2 - vnclipu.wi v8, v10, 6 - .ifc \type,avg - vle8.v v9, (a4) - vaaddu.vv v8, v8, v9 - .endif - vse8.v v8, (a4) - add a4, a4, a2 vnclipu.wi v8, v12, 6 .ifc \type,avg - vle8.v v9, (a4) + vle8.v v9, (a0) vaaddu.vv v8, v8, v9 .endif - vse8.v v8, (a4) - add a4, a4, a2 + vse8.v v8, (a0) + add a0, a0, a2 vnclipu.wi v8, v16, 6 .ifc \type,avg - vle8.v v9, (a4) + vle8.v v9, (a0) vaaddu.vv v8, v8, v9 .endif - vse8.v v8, (a4) + vse8.v v8, (a0) + add a0, a0, a2 + .endif blt t2, a3, 1b j 8f 2: @@ -126,11 +131,15 @@ func h264_\type\()_chroma_mc8_rvv, zve32x blez a3, 8f li a4, 0 li t1, 0 - slli a7, a2, 2 + slli a7, a2, (1 + \unroll) 3: # if ((x8 - xy) == 0 && (y8 -xy) != 0) add a5, a1, a4 vsetvli zero, zero, e8, m1, ta, ma + .ifc \unroll,1 addi t1, t1, 4 + .else + addi t1, t1, 2 + .endif vle8.v v8, (a5) add a5, a5, a2 add t2, a5, a2 @@ -141,42 +150,44 @@ func h264_\type\()_chroma_mc8_rvv, zve32x add t2, t2, a2 add a5, t2, a2 vwmaccu.vx v10, t0, v8 - vle8.v v8, (t2) - vle8.v v14, (a5) - add a5, a0, a4 add a4, a4, a7 vwmaccu.vx v12, t0, v9 vnclipu.wi v15, v10, 6 vwmulu.vx v10, v9, a6 + vnclipu.wi v9, v12, 6 .ifc \type,avg - vle8.v v16, (a5) + vle8.v v16, (a0) vaaddu.vv v15, v15, v16 .endif - vse8.v v15, (a5) - add a5, a5, a2 - vnclipu.wi v9, v12, 6 - vwmaccu.vx v10, t0, v8 - vwmulu.vx v12, v8, a6 + vse8.v v15, (a0) + add a0, a0, a2 .ifc \type,avg - vle8.v v16, (a5) + vle8.v v16, (a0) vaaddu.vv v9, v9, v16 .endif - vse8.v v9, (a5) - add a5, a5, a2 + vse8.v v9, (a0) + add a0, a0, a2 + .ifc \unroll,1 + vle8.v v8, (t2) + vle8.v v14, (a5) + vwmaccu.vx v10, t0, v8 + vwmulu.vx v12, v8, a6 vnclipu.wi v8, v10, 6 vwmaccu.vx v12, t0, v14 .ifc \type,avg - vle8.v v16, (a5) + vle8.v v16, (a0) vaaddu.vv v8, v8, v16 .endif - vse8.v v8, (a5) - add a5, a5, a2 + vse8.v v8, (a0) + add a0, a0, a2 vnclipu.wi v8, v12, 6 .ifc \type,avg - vle8.v v16, (a5) + vle8.v v16, (a0) vaaddu.vv v8, v8, v16 .endif - vse8.v v8, (a5) + vse8.v v8, (a0) + add a0, a0, a2 + .endif blt t1, a3, 3b j 8f 4: @@ -186,87 +197,95 @@ func h264_\type\()_chroma_mc8_rvv, zve32x li a4, 0 li t2, 0 addi t0, t3, 1 - slli t1, a2, 2 + slli t1, a2, (1 + \unroll) 5: # if ((x8 - xy) != 0 && (y8 -xy) == 0) add a5, a1, a4 vsetvli zero, t0, e8, m1, ta, ma + .ifc \unroll,1 addi t2, t2, 4 + .else + addi t2, t2, 2 + .endif vle8.v v8, (a5) add a5, a5, a2 vslide1down.vx v9, v8, t5 - vsetivli zero, 8, e8, m1, ta, ma + vsetvli zero, t6, e8, m1, ta, ma vwmulu.vx v10, v8, a6 vwmaccu.vx v10, a7, v9 vsetvli zero, t0, e8, m1, ta, ma vle8.v v8, (a5) add a5, a5, a2 vslide1down.vx v9, v8, t5 - vsetivli zero, 8, e8, m1, ta, ma + vsetvli zero, t6, e8, m1, ta, ma vwmulu.vx v12, v8, a6 vwmaccu.vx v12, a7, v9 + vnclipu.wi v16, v10, 6 + .ifc \type,avg + vle8.v v18, (a0) + vaaddu.vv v16, v16, v18 + .endif + vse8.v v16, (a0) + add a0, a0, a2 + vnclipu.wi v10, v12, 6 + .ifc \type,avg + vle8.v v18, (a0) + vaaddu.vv v10, v10, v18 + .endif + add a4, a4, t1 + vse8.v v10, (a0) + add a0, a0, a2 + .ifc \unroll,1 vsetvli zero, t0, e8, m1, ta, ma vle8.v v8, (a5) add a5, a5, a2 vslide1down.vx v9, v8, t5 - vsetivli zero, 8, e8, m1, ta, ma + vsetvli zero, t6, e8, m1, ta, ma vwmulu.vx v14, v8, a6 vwmaccu.vx v14, a7, v9 vsetvli zero, t0, e8, m1, ta, ma vle8.v v8, (a5) - add a5, a0, a4 - add a4, a4, t1 vslide1down.vx v9, v8, t5 - vsetivli zero, 8, e8, m1, ta, ma - vnclipu.wi v16, v10, 6 - .ifc \type,avg - vle8.v v18, (a5) - vaaddu.vv v16, v16, v18 - .endif - vse8.v v16, (a5) - add a5, a5, a2 - vnclipu.wi v10, v12, 6 + vsetvli zero, t6, e8, m1, ta, ma vwmulu.vx v12, v8, a6 - .ifc \type,avg - vle8.v v18, (a5) - vaaddu.vv v10, v10, v18 - .endif - vse8.v v10, (a5) - add a5, a5, a2 vnclipu.wi v8, v14, 6 vwmaccu.vx v12, a7, v9 .ifc \type,avg - vle8.v v18, (a5) + vle8.v v18, (a0) vaaddu.vv v8, v8, v18 .endif - vse8.v v8, (a5) - add a5, a5, a2 + vse8.v v8, (a0) + add a0, a0, a2 vnclipu.wi v8, v12, 6 .ifc \type,avg - vle8.v v18, (a5) + vle8.v v18, (a0) vaaddu.vv v8, v8, v18 .endif - vse8.v v8, (a5) + vse8.v v8, (a0) + add a0, a0, a2 + .endif blt t2, a3, 5b j 8f 6: blez a3, 8f li a4, 0 li t2, 0 - slli a7, a2, 2 + slli a7, a2, (1 + \unroll) 7: # the final else, none of the above conditions are met add t0, a1, a4 vsetvli zero, zero, e8, m1, ta, ma add a5, a0, a4 add a4, a4, a7 + .ifc \unroll,1 addi t2, t2, 4 + .else + addi t2, t2, 2 + .endif vle8.v v8, (t0) add t0, t0, a2 add t1, t0, a2 vwmulu.vx v10, v8, a6 vle8.v v8, (t0) add t0, t1, a2 - vle8.v v9, (t1) - vle8.v v12, (t0) vnclipu.wi v13, v10, 6 vwmulu.vx v10, v8, a6 .ifc \type,avg @@ -276,13 +295,16 @@ func h264_\type\()_chroma_mc8_rvv, zve32x vse8.v v13, (a5) add a5, a5, a2 vnclipu.wi v8, v10, 6 - vwmulu.vx v10, v9, a6 .ifc \type,avg vle8.v v18, (a5) vaaddu.vv v8, v8, v18 .endif vse8.v v8, (a5) add a5, a5, a2 + .ifc \unroll,1 + vle8.v v9, (t1) + vle8.v v12, (t0) + vwmulu.vx v10, v9, a6 vnclipu.wi v8, v10, 6 vwmulu.vx v10, v12, a6 .ifc \type,avg @@ -297,11 +319,56 @@ func h264_\type\()_chroma_mc8_rvv, zve32x vaaddu.vv v8, v8, v18 .endif vse8.v v8, (a5) + .endif blt t2, a3, 7b 8: ret -endfunc .endm -h264_chroma_mc8 put -h264_chroma_mc8 avg +func h264_put_chroma_mc_rvv, zve32x +11: + li a7, 3 + blt a3, a7, 12f + do_chroma_mc put 1 +12: + do_chroma_mc put 0 +endfunc + +func h264_avg_chroma_mc_rvv, zve32x +21: + li a7, 3 + blt a3, a7, 22f + do_chroma_mc avg 1 +22: + do_chroma_mc avg 0 +endfunc + +func h264_put_chroma_mc8_rvv, zve32x + li t6, 8 + j 11b +endfunc + +func h264_put_chroma_mc4_rvv, zve32x + li t6, 4 + j 11b +endfunc + +func h264_put_chroma_mc2_rvv, zve32x + li t6, 2 + j 11b +endfunc + +func h264_avg_chroma_mc8_rvv, zve32x + li t6, 8 + j 21b +endfunc + +func h264_avg_chroma_mc4_rvv, zve32x + li t6, 4 + j 21b +endfunc + +func h264_avg_chroma_mc2_rvv, zve32x + li t6, 2 + j 21b +endfunc diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/rka.c b/arm/raspi/third_party/ffmpeg/libavcodec/rka.c index d56f4fae..724107f3 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/rka.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/rka.c @@ -59,8 +59,8 @@ typedef struct AdaptiveModel { } AdaptiveModel; typedef struct ChContext { - int cmode; - int cmode2; + int qfactor; + int vrq; int last_nb_decoded; unsigned srate_pad; unsigned pos_idx; @@ -131,7 +131,7 @@ static void adaptive_model_free(AdaptiveModel *am) static av_cold int rka_decode_init(AVCodecContext *avctx) { RKAContext *s = avctx->priv_data; - int cmode; + int qfactor; if (avctx->extradata_size < 16) return AVERROR_INVALIDDATA; @@ -160,14 +160,18 @@ static av_cold int rka_decode_init(AVCodecContext *avctx) s->last_nb_samples = s->total_nb_samples % s->frame_samples; s->correlated = avctx->extradata[15] & 1; - cmode = avctx->extradata[14] & 0xf; + qfactor = avctx->extradata[14] & 0xf; if ((avctx->extradata[15] & 4) != 0) - cmode = -cmode; + qfactor = -qfactor; - s->ch[0].cmode = s->ch[1].cmode = cmode < 0 ? 2 : cmode; - s->ch[0].cmode2 = cmode < 0 ? FFABS(cmode) : 0; - s->ch[1].cmode2 = cmode < 0 ? FFABS(cmode) : 0; - av_log(avctx, AV_LOG_DEBUG, "cmode: %d\n", cmode); + s->ch[0].qfactor = s->ch[1].qfactor = qfactor < 0 ? 2 : qfactor; + s->ch[0].vrq = qfactor < 0 ? -qfactor : 0; + s->ch[1].vrq = qfactor < 0 ? -qfactor : 0; + if (qfactor < 0) { + s->ch[0].vrq = av_clip(s->ch[0].vrq, 1, 8); + s->ch[1].vrq = av_clip(s->ch[1].vrq, 1, 8); + } + av_log(avctx, AV_LOG_DEBUG, "qfactor: %d\n", qfactor); return 0; } @@ -665,18 +669,16 @@ static int mdl64_decode(ACoder *ac, Model64 *ctx, int *dst) return 0; } -static const uint8_t tab[16] = { - 0, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 -}; +static const uint8_t vrq_qfactors[8] = { 3, 3, 2, 2, 1, 1, 1, 1 }; static int decode_filter(RKAContext *s, ChContext *ctx, ACoder *ac, int off, unsigned size) { FiltCoeffs filt; Model64 *mdl64; - int m = 0, split, val, last_val = 0, ret; - unsigned idx = 3, bits = 0; + int split, val, last_val = 0, ret; + unsigned rsize, idx = 3, bits = 0, m = 0; - if (ctx->cmode == 0) { + if (ctx->qfactor == 0) { if (amdl_decode_int(&ctx->fshift, ac, &bits, 15) < 0) return -1; bits &= 31U; @@ -698,10 +700,12 @@ static int decode_filter(RKAContext *s, ChContext *ctx, ACoder *ac, int off, uns if (amdl_decode_int(&ctx->position, ac, &idx, 10) < 0) return -1; + m = 0; idx = (ctx->pos_idx + idx) % 11; ctx->pos_idx = idx; - for (int y = 0; y < FFMIN(split, size - x); y++, off++) { + rsize = FFMIN(split, size - x); + for (int y = 0; y < rsize; y++, off++) { int midx, shift = idx, *src, sum = 16; if (off >= FF_ARRAY_ELEMS(ctx->buf0)) @@ -728,7 +732,7 @@ static int decode_filter(RKAContext *s, ChContext *ctx, ACoder *ac, int off, uns for (int i = 15; i < filt.size; i++) sum += filt.coeffs[i] * (unsigned)src[-i]; sum = sum >> 6; - if (ctx->cmode == 0) { + if (ctx->qfactor == 0) { if (bits == 0) { ctx->buf1[off] = sum + val; } else { @@ -737,7 +741,7 @@ static int decode_filter(RKAContext *s, ChContext *ctx, ACoder *ac, int off, uns } ctx->buf0[off] = ctx->buf1[off] + (unsigned)ctx->buf0[off + -1]; } else { - val *= 1U << ctx->cmode; + val *= 1U << ctx->qfactor; sum += ctx->buf0[off + -1] + (unsigned)val; switch (s->bps) { case 16: sum = av_clip_int16(sum); break; @@ -745,15 +749,15 @@ static int decode_filter(RKAContext *s, ChContext *ctx, ACoder *ac, int off, uns } ctx->buf1[off] = sum - ctx->buf0[off + -1]; ctx->buf0[off] = sum; - m += FFABS(ctx->buf1[off]); + m += (unsigned)FFABS(ctx->buf1[off]); } } - if (ctx->cmode2 != 0) { + if (ctx->vrq != 0) { int sum = 0; - for (int i = (signed)((unsigned)m << 6) / split; i > 0; i = i >> 1) + for (unsigned i = (m << 6) / rsize; i > 0; i = i >> 1) sum++; - sum = sum - (ctx->cmode2 + 7); - ctx->cmode = FFMAX(sum, tab[ctx->cmode2]); + sum -= (ctx->vrq + 7); + ctx->qfactor = FFMAX(sum, vrq_qfactors[ctx->vrq - 1]); } x += split; @@ -949,6 +953,10 @@ static int rka_decode_frame(AVCodecContext *avctx, AVFrame *frame, } } + if (frame->nb_samples < s->frame_samples && + frame->nb_samples > s->last_nb_samples) + frame->nb_samples = s->last_nb_samples; + *got_frame_ptr = 1; return avpkt->size; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/rl.c b/arm/raspi/third_party/ffmpeg/libavcodec/rl.c index 3f8271d3..a78242d4 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/rl.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/rl.c @@ -82,7 +82,9 @@ av_cold void ff_rl_init_vlc(RLTable *rl, unsigned static_size) VLCElem table[1500] = { 0 }; VLC vlc = { .table = table, .table_allocated = static_size }; av_assert0(static_size <= FF_ARRAY_ELEMS(table)); - init_vlc(&vlc, 9, rl->n + 1, &rl->table_vlc[0][1], 4, 2, &rl->table_vlc[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC); + vlc_init(&vlc, 9, rl->n + 1, + &rl->table_vlc[0][1], 4, 2, + &rl->table_vlc[0][0], 4, 2, VLC_INIT_USE_STATIC); for (q = 0; q < 32; q++) { int qmul = q * 2; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/rl.h b/arm/raspi/third_party/ffmpeg/libavcodec/rl.h index 4380fda2..c45d8659 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/rl.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/rl.h @@ -80,7 +80,7 @@ void ff_rl_init(RLTable *rl, uint8_t static_store[2][2*MAX_RUN + MAX_LEVEL + 3]) */ void ff_rl_init_vlc(RLTable *rl, unsigned static_size); -#define INIT_VLC_RL(rl, static_size)\ +#define VLC_INIT_RL(rl, static_size)\ {\ static RL_VLC_ELEM rl_vlc_table[32][static_size];\ \ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/roqvideo.c b/arm/raspi/third_party/ffmpeg/libavcodec/roqvideo.c index f9a3c8e0..ca8c8de9 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/roqvideo.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/roqvideo.c @@ -111,13 +111,13 @@ static inline void apply_motion_generic(RoqContext *ri, int x, int y, int deltax /* check MV against frame boundaries */ if ((mx < 0) || (mx > ri->width - sz) || (my < 0) || (my > ri->height - sz)) { - av_log(ri->avctx, AV_LOG_ERROR, "motion vector out of bounds: MV = (%d, %d), boundaries = (0, 0, %d, %d)\n", + av_log(ri->logctx, AV_LOG_ERROR, "motion vector out of bounds: MV = (%d, %d), boundaries = (0, 0, %d, %d)\n", mx, my, ri->width, ri->height); return; } if (!ri->last_frame->data[0]) { - av_log(ri->avctx, AV_LOG_ERROR, "Invalid decode type. Invalid header?\n"); + av_log(ri->logctx, AV_LOG_ERROR, "Invalid decode type. Invalid header?\n"); return; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/roqvideo.h b/arm/raspi/third_party/ffmpeg/libavcodec/roqvideo.h index 8318b6e5..2c2e4288 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/roqvideo.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/roqvideo.h @@ -22,7 +22,7 @@ #ifndef AVCODEC_ROQVIDEO_H #define AVCODEC_ROQVIDEO_H -#include "avcodec.h" +#include "libavutil/frame.h" typedef struct roq_cell { unsigned char y[4]; @@ -39,7 +39,7 @@ typedef struct motion_vect { typedef struct RoqContext { const AVClass *class; - AVCodecContext *avctx; + void *logctx; AVFrame *last_frame; AVFrame *current_frame; int width, height; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/roqvideodec.c b/arm/raspi/third_party/ffmpeg/libavcodec/roqvideodec.c index 6f2e48d2..bfc69a65 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/roqvideodec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/roqvideodec.c @@ -72,7 +72,7 @@ static void roqvideo_decode_frame(RoqContext *ri, GetByteContext *gb) xpos = ypos = 0; if (chunk_size > bytestream2_get_bytes_left(gb)) { - av_log(ri->avctx, AV_LOG_ERROR, "Chunk does not fit in input buffer\n"); + av_log(ri->logctx, AV_LOG_ERROR, "Chunk does not fit in input buffer\n"); chunk_size = bytestream2_get_bytes_left(gb); } @@ -80,7 +80,7 @@ static void roqvideo_decode_frame(RoqContext *ri, GetByteContext *gb) for (yp = ypos; yp < ypos + 16; yp += 8) for (xp = xpos; xp < xpos + 16; xp += 8) { if (bytestream2_tell(gb) >= chunk_start + chunk_size) { - av_log(ri->avctx, AV_LOG_VERBOSE, "Chunk is too short\n"); + av_log(ri->logctx, AV_LOG_VERBOSE, "Chunk is too short\n"); return; } if (vqflg_pos < 0) { @@ -114,7 +114,7 @@ static void roqvideo_decode_frame(RoqContext *ri, GetByteContext *gb) if(k & 0x02) y += 4; if (bytestream2_tell(gb) >= chunk_start + chunk_size) { - av_log(ri->avctx, AV_LOG_VERBOSE, "Chunk is too short\n"); + av_log(ri->logctx, AV_LOG_VERBOSE, "Chunk is too short\n"); return; } if (vqflg_pos < 0) { @@ -169,7 +169,7 @@ static av_cold int roq_decode_init(AVCodecContext *avctx) { RoqContext *s = avctx->priv_data; - s->avctx = avctx; + s->logctx = avctx; if (avctx->width % 16 || avctx->height % 16) { avpriv_request_sample(avctx, "Dimensions not being a multiple of 16"); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/roqvideoenc.c b/arm/raspi/third_party/ffmpeg/libavcodec/roqvideoenc.c index c25aa39b..0933abf4 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/roqvideoenc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/roqvideoenc.c @@ -911,10 +911,10 @@ static int roq_encode_video(RoqEncContext *enc) /* Quake 3 can't handle chunks bigger than 65535 bytes */ if (tempData->mainChunkSize/8 > 65535 && enc->quake3_compat) { if (enc->lambda > 100000) { - av_log(roq->avctx, AV_LOG_ERROR, "Cannot encode video in Quake compatible form\n"); + av_log(roq->logctx, AV_LOG_ERROR, "Cannot encode video in Quake compatible form\n"); return AVERROR(EINVAL); } - av_log(roq->avctx, AV_LOG_ERROR, + av_log(roq->logctx, AV_LOG_ERROR, "Warning, generated a frame too big for Quake (%d > 65535), " "now switching to a bigger qscale value.\n", tempData->mainChunkSize/8); @@ -972,7 +972,7 @@ static av_cold int roq_encode_init(AVCodecContext *avctx) av_lfg_init(&enc->randctx, 1); - roq->avctx = avctx; + roq->logctx = avctx; enc->framesSinceKeyframe = 0; if ((avctx->width & 0xf) || (avctx->height & 0xf)) { @@ -1057,8 +1057,6 @@ static int roq_encode_frame(AVCodecContext *avctx, AVPacket *pkt, RoqContext *const roq = &enc->common; int size, ret; - roq->avctx = avctx; - enc->frame_to_enc = frame; if (frame->quality) diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/rpzaenc.c b/arm/raspi/third_party/ffmpeg/libavcodec/rpzaenc.c index da9500e4..d84555d6 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/rpzaenc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/rpzaenc.c @@ -30,6 +30,7 @@ #include "avcodec.h" #include "codec_internal.h" #include "encode.h" +#include "mathops.h" #include "put_bits.h" typedef struct RpzaContext { @@ -65,7 +66,7 @@ typedef struct rgb { #define SQR(x) ((x) * (x)) /* 15 bit components */ -#define GET_CHAN(color, chan) (((color) >> ((chan) * 5) & 0x1F) * 8) +#define GET_CHAN(color, chan) (((color) >> ((chan) * 5) & 0x1F)) #define R(color) GET_CHAN(color, RED) #define G(color) GET_CHAN(color, GREEN) #define B(color) GET_CHAN(color, BLUE) @@ -141,9 +142,9 @@ static uint16_t rgb24_to_rgb555(const uint8_t *rgb24) uint16_t rgb555 = 0; uint32_t r, g, b; - r = rgb24[0] >> 3; - g = rgb24[1] >> 3; - b = rgb24[2] >> 3; + r = rgb24[0]; + g = rgb24[1]; + b = rgb24[2]; rgb555 |= (r << 10); rgb555 |= (g << 5); @@ -185,7 +186,7 @@ static int max_component_diff(const uint16_t *colorA, const uint16_t *colorB) if (diff > max) { max = diff; } - return max * 8; + return max; } /* @@ -266,9 +267,9 @@ static int compare_blocks(const uint16_t *block1, const uint16_t *block2, */ static int leastsquares(const uint16_t *block_ptr, const BlockInfo *bi, channel_offset xchannel, channel_offset ychannel, - double *slope, double *y_intercept, double *correlation_coef) + int *slope, int *y_intercept, int *correlation_coef) { - double sumx = 0, sumy = 0, sumx2 = 0, sumy2 = 0, sumxy = 0, + int sumx = 0, sumy = 0, sumx2 = 0, sumy2 = 0, sumxy = 0, sumx_sq = 0, sumy_sq = 0, tmp, tmp2; int i, j, count; uint8_t x, y; @@ -305,10 +306,10 @@ static int leastsquares(const uint16_t *block_ptr, const BlockInfo *bi, tmp2 = count * sumy2 - sumy_sq; if (tmp2 == 0) { - *correlation_coef = 0.0; + *correlation_coef = 0; } else { *correlation_coef = (count * sumxy - sumx * sumy) / - sqrt(tmp * tmp2); + ff_sqrt((unsigned)tmp * tmp2); } return 0; // success @@ -332,18 +333,18 @@ static int calc_lsq_max_fit_error(const uint16_t *block_ptr, const BlockInfo *bi y = GET_CHAN(block_ptr[j], ychannel); /* calculate x_inc as the 4-color index (0..3) */ - x_inc = floor( (x - min) * 3.0 / (max - min) + 0.5); + x_inc = (x - min) * 3 / (max - min) + 1; x_inc = FFMAX(FFMIN(3, x_inc), 0); /* calculate lin_y corresponding to x_inc */ - lin_y = (int)(tmp_min + (tmp_max - tmp_min) * x_inc / 3.0 + 0.5); + lin_y = tmp_min + (tmp_max - tmp_min) * x_inc / 3 + 1; err = FFABS(lin_y - y); if (err > max_err) max_err = err; /* calculate lin_x corresponding to x_inc */ - lin_x = (int)(min + (max - min) * x_inc / 3.0 + 0.5); + lin_x = min + (max - min) * x_inc / 3 + 1; err = FFABS(lin_x - x); if (err > max_err) @@ -577,7 +578,7 @@ static void rpza_encode_stream(RpzaContext *s, const AVFrame *pict) uint8_t avg_color[3]; int pixel_count; uint8_t min_color[3], max_color[3]; - double slope, y_intercept, correlation_coef; + int slope, y_intercept, correlation_coef; const uint16_t *src_pixels = (const uint16_t *)pict->data[0]; uint16_t *prev_pixels = (uint16_t *)s->prev_frame->data[0]; @@ -730,8 +731,8 @@ post_skip : min_color[i] = GET_CHAN(src_pixels[block_offset], i); max_color[i] = GET_CHAN(src_pixels[block_offset], i); } else { - tmp_min = (int)(0.5 + min * slope + y_intercept); - tmp_max = (int)(0.5 + max * slope + y_intercept); + tmp_min = 1 + min * slope + y_intercept; + tmp_max = 1 + max * slope + y_intercept; av_assert0(tmp_min <= tmp_max); // clamp min and max color values @@ -802,7 +803,7 @@ static int rpza_encode_frame(AVCodecContext *avctx, AVPacket *pkt, { RpzaContext *s = avctx->priv_data; uint8_t *buf; - int ret = ff_alloc_packet(avctx, pkt, 4LL + 6LL * avctx->height * avctx->width); + int ret = ff_alloc_packet(avctx, pkt, 4LL + 6LL * FFMAX(avctx->height, 4) * FFMAX(avctx->width, 4)); if (ret < 0) return ret; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/rtjpeg.c b/arm/raspi/third_party/ffmpeg/libavcodec/rtjpeg.c index 8e02bce2..734e3875 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/rtjpeg.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/rtjpeg.c @@ -167,7 +167,7 @@ void ff_rtjpeg_decode_init(RTJpegContext *c, int width, int height, c->h = height; } -void ff_rtjpeg_init(RTJpegContext *c, AVCodecContext *avctx) +void ff_rtjpeg_init(RTJpegContext *c, struct AVCodecContext *avctx) { int i; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/rtjpeg.h b/arm/raspi/third_party/ffmpeg/libavcodec/rtjpeg.h index d4dc0744..14befb54 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/rtjpeg.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/rtjpeg.h @@ -24,6 +24,7 @@ #include +#include "libavutil/frame.h" #include "libavutil/mem_internal.h" #include "idctdsp.h" @@ -39,7 +40,8 @@ typedef struct RTJpegContext { DECLARE_ALIGNED(16, int16_t, block)[64]; } RTJpegContext; -void ff_rtjpeg_init(RTJpegContext *c, AVCodecContext *avctx); +struct AVCodecContext; +void ff_rtjpeg_init(RTJpegContext *c, struct AVCodecContext *avctx); void ff_rtjpeg_decode_init(RTJpegContext *c, int width, int height, const uint32_t *lquant, const uint32_t *cquant); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/rtv1.c b/arm/raspi/third_party/ffmpeg/libavcodec/rtv1.c index 4b202e6a..06afe9e8 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/rtv1.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/rtv1.c @@ -54,7 +54,7 @@ static int decode_rtv1(GetByteContext *gb, uint8_t *dst, ptrdiff_t linesize, int a, b; if (bytestream2_get_bytes_left(gb) < 4) - break; + return AVERROR_INVALIDDATA; a = bytestream2_get_le16u(gb); b = bytestream2_get_le16u(gb); @@ -77,7 +77,7 @@ static int decode_rtv1(GetByteContext *gb, uint8_t *dst, ptrdiff_t linesize, dxt1_block(dst + x, linesize, block); } else { if (bytestream2_get_bytes_left(gb) < 12 * 4) - break; + return AVERROR_INVALIDDATA; for (int by = 0; by < 4; by++) { for (int bx = 0; bx < 4; bx++) @@ -126,7 +126,9 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *p, dst = p->data[0] + p->linesize[0] * (avctx->coded_height - 1); linesize = -p->linesize[0]; - decode_rtv1(&gb, dst, linesize, width, height, flags, dsp->dxt1_block); + ret = decode_rtv1(&gb, dst, linesize, width, height, flags, dsp->dxt1_block); + if (ret < 0) + return ret; p->pict_type = AV_PICTURE_TYPE_I; p->flags |= AV_FRAME_FLAG_KEY; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/rv10.c b/arm/raspi/third_party/ffmpeg/libavcodec/rv10.c index bb1ead50..6abceade 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/rv10.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/rv10.c @@ -334,8 +334,8 @@ static av_cold void rv10_build_vlc(VLC *vlc, const uint16_t len_count[15], for (unsigned tmp = nb_lens + len_count[i]; nb_lens < tmp; nb_lens++) lens[nb_lens] = i + 2; av_assert1(nb_lens == nb_syms); - ff_init_vlc_from_lengths(vlc, DC_VLC_BITS, nb_lens, lens, 1, - syms, 2, 2, 0, INIT_VLC_STATIC_OVERLONG, NULL); + ff_vlc_init_from_lengths(vlc, DC_VLC_BITS, nb_lens, lens, 1, + syms, 2, 2, 0, VLC_INIT_STATIC_OVERLONG, NULL); } static av_cold void rv10_init_static(void) @@ -477,7 +477,7 @@ static int rv10_decode_packet(AVCodecContext *avctx, const uint8_t *buf, if ((s->mb_x == 0 && s->mb_y == 0) || !s->current_picture_ptr) { // FIXME write parser so we always have complete frames? if (s->current_picture_ptr) { - ff_er_frame_end(&s->er); + ff_er_frame_end(&s->er, NULL); ff_mpv_frame_end(s); s->mb_x = s->mb_y = s->resync_mb_x = s->resync_mb_y = 0; } @@ -649,7 +649,7 @@ static int rv10_decode_frame(AVCodecContext *avctx, AVFrame *pict, } if (s->current_picture_ptr && s->mb_y >= s->mb_height) { - ff_er_frame_end(&s->er); + ff_er_frame_end(&s->er, NULL); ff_mpv_frame_end(s); if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) { diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/rv34.c b/arm/raspi/third_party/ffmpeg/libavcodec/rv34.c index 51f18147..e9660bb4 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/rv34.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/rv34.c @@ -113,10 +113,10 @@ static void rv34_gen_vlc(const uint8_t *bits, int size, VLC *vlc, const uint8_t vlc->table = &table_data[*offset]; vlc->table_allocated = FF_ARRAY_ELEMS(table_data) - *offset; - ff_init_vlc_sparse(vlc, FFMIN(maxbits, 9), size, + ff_vlc_init_sparse(vlc, FFMIN(maxbits, 9), size, bits, 1, 1, cw, 2, 2, - syms, !!syms, !!syms, INIT_VLC_STATIC_OVERLONG); + syms, !!syms, !!syms, VLC_INIT_STATIC_OVERLONG); *offset += vlc->table_size; } @@ -1560,7 +1560,7 @@ static int finish_frame(AVCodecContext *avctx, AVFrame *pict) MpegEncContext *s = &r->s; int got_picture = 0, ret; - ff_er_frame_end(&s->er); + ff_er_frame_end(&s->er, NULL); ff_mpv_frame_end(s); s->mb_num_left = 0; @@ -1655,7 +1655,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx, AVFrame *pict, av_log(avctx, AV_LOG_ERROR, "New frame but still %d MB left.\n", s->mb_num_left); if (!s->context_reinit) - ff_er_frame_end(&s->er); + ff_er_frame_end(&s->er, NULL); ff_mpv_frame_end(s); } @@ -1790,7 +1790,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx, AVFrame *pict, av_log(avctx, AV_LOG_INFO, "marking unfished frame as finished\n"); /* always mark the current frame as finished, frame-mt supports * only complete frames */ - ff_er_frame_end(&s->er); + ff_er_frame_end(&s->er, NULL); ff_mpv_frame_end(s); s->mb_num_left = 0; ff_thread_report_progress(&s->current_picture_ptr->tf, INT_MAX, 0); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/rv34_parser.c b/arm/raspi/third_party/ffmpeg/libavcodec/rv34_parser.c index e17bc856..2997a4db 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/rv34_parser.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/rv34_parser.c @@ -24,13 +24,10 @@ * RV30/40 parser */ -#include "config_components.h" - -#include "parser.h" +#include "avcodec.h" #include "libavutil/intreadwrite.h" typedef struct RV34ParseContext { - ParseContext pc; int64_t key_dts; int key_pts; } RV34ParseContext; @@ -78,18 +75,8 @@ static int rv34_parse(AVCodecParserContext *s, return buf_size; } -#if CONFIG_RV30_PARSER -const AVCodecParser ff_rv30_parser = { - .codec_ids = { AV_CODEC_ID_RV30 }, +const AVCodecParser ff_rv34_parser = { + .codec_ids = { AV_CODEC_ID_RV30, AV_CODEC_ID_RV40 }, .priv_data_size = sizeof(RV34ParseContext), .parser_parse = rv34_parse, }; -#endif - -#if CONFIG_RV40_PARSER -const AVCodecParser ff_rv40_parser = { - .codec_ids = { AV_CODEC_ID_RV40 }, - .priv_data_size = sizeof(RV34ParseContext), - .parser_parse = rv34_parse, -}; -#endif diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/rv40.c b/arm/raspi/third_party/ffmpeg/libavcodec/rv40.c index 75849b17..d2f8ef9f 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/rv40.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/rv40.c @@ -53,9 +53,9 @@ static av_cold void rv40_init_table(VLC *vlc, unsigned *offset, int nb_bits, vlc->table_allocated = 1 << nb_bits; *offset += 1 << nb_bits; - ff_init_vlc_from_lengths(vlc, nb_bits, nb_codes, + ff_vlc_init_from_lengths(vlc, nb_bits, nb_codes, &tab[0][1], 2, &tab[0][0], 2, 1, - 0, INIT_VLC_USE_NEW_STATIC, NULL); + 0, VLC_INIT_USE_STATIC, NULL); } /** @@ -87,9 +87,9 @@ static av_cold void rv40_init_tables(void) } aic_mode2_vlc[i].table = &aic_mode2_table[offset]; aic_mode2_vlc[i].table_allocated = FF_ARRAY_ELEMS(aic_mode2_table) - offset; - ff_init_vlc_from_lengths(&aic_mode2_vlc[i], AIC_MODE2_BITS, AIC_MODE2_SIZE, + ff_vlc_init_from_lengths(&aic_mode2_vlc[i], AIC_MODE2_BITS, AIC_MODE2_SIZE, aic_mode2_vlc_bits[i], 1, - syms, 2, 2, 0, INIT_VLC_STATIC_OVERLONG, NULL); + syms, 2, 2, 0, VLC_INIT_STATIC_OVERLONG, NULL); offset += aic_mode2_vlc[i].table_size; } for(i = 0; i < NUM_PTYPE_VLCS; i++){ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/sbcenc.c b/arm/raspi/third_party/ffmpeg/libavcodec/sbcenc.c index fccb0e3e..6e1dd88c 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/sbcenc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/sbcenc.c @@ -31,6 +31,7 @@ */ #include "libavutil/channel_layout.h" +#include "libavutil/emms.h" #include "libavutil/opt.h" #include "avcodec.h" #include "codec_internal.h" @@ -198,7 +199,7 @@ static int sbc_encode_init(AVCodecContext *avctx) SBCEncContext *sbc = avctx->priv_data; struct sbc_frame *frame = &sbc->frame; - if (avctx->profile == FF_PROFILE_SBC_MSBC) + if (avctx->profile == AV_PROFILE_SBC_MSBC) sbc->msbc = 1; if (sbc->msbc) { @@ -332,7 +333,7 @@ static const AVOption options[] = { OFFSET(max_delay), AV_OPT_TYPE_DURATION, {.i64 = 13000}, 1000,13000, AE }, { "msbc", "use mSBC mode (wideband speech mono SBC)", OFFSET(msbc), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AE }, - FF_AVCTX_PROFILE_OPTION("msbc", NULL, AUDIO, FF_PROFILE_SBC_MSBC) + FF_AVCTX_PROFILE_OPTION("msbc", NULL, AUDIO, AV_PROFILE_SBC_MSBC) { NULL }, }; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/sbrdsp_template.c b/arm/raspi/third_party/ffmpeg/libavcodec/sbrdsp_template.c index b3737c0f..89e389d9 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/sbrdsp_template.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/sbrdsp_template.c @@ -20,6 +20,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/attributes_internal.h" + static void sbr_sum64x5_c(INTFLOAT *z) { int k; @@ -103,3 +105,268 @@ av_cold void AAC_RENAME(ff_sbrdsp_init)(SBRDSPContext *s) #endif #endif /* !USE_FIXED */ } + +/* First eight entries repeated at end to simplify SIMD implementations. */ +const attribute_visibility_hidden 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 +{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)}, +}; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/sga.c b/arm/raspi/third_party/ffmpeg/libavcodec/sga.c index eae691ad..4ced6e98 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/sga.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/sga.c @@ -127,19 +127,18 @@ static int decode_index_palmap(SGAVideoContext *s, AVFrame *frame) static int decode_index_tilemap(SGAVideoContext *s, AVFrame *frame) { - GetByteContext *gb = &s->gb; - GetBitContext pm; + GetByteContext *gb = &s->gb, gb2; bytestream2_seek(gb, s->tilemapdata_offset, SEEK_SET); if (bytestream2_get_bytes_left(gb) < s->tilemapdata_size) return AVERROR_INVALIDDATA; - init_get_bits8(&pm, gb->buffer, s->tilemapdata_size); + gb2 = *gb; for (int y = 0; y < s->tiles_h; y++) { for (int x = 0; x < s->tiles_w; x++) { uint8_t tile[64]; - int tilemap = get_bits(&pm, 16); + int tilemap = bytestream2_get_be16u(&gb2); int flip_x = (tilemap >> 11) & 1; int flip_y = (tilemap >> 12) & 1; int tindex = av_clip((tilemap & 511) - 1, 0, s->nb_tiles - 1); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/sheervideo.c b/arm/raspi/third_party/ffmpeg/libavcodec/sheervideo.c index d9c94ea9..660e2661 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/sheervideo.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/sheervideo.c @@ -1796,8 +1796,8 @@ static av_cold int build_vlc(VLC *vlc, const SheerTable *table) lens[count] = len; } - ff_free_vlc(vlc); - return ff_init_vlc_from_lengths(vlc, SHEER_VLC_BITS, count, + ff_vlc_free(vlc); + return ff_vlc_init_from_lengths(vlc, SHEER_VLC_BITS, count, lens, sizeof(*lens), NULL, 0, 0, 0, 0, NULL); } @@ -1992,8 +1992,8 @@ static av_cold int decode_end(AVCodecContext *avctx) { SheerVideoContext *s = avctx->priv_data; - ff_free_vlc(&s->vlc[0]); - ff_free_vlc(&s->vlc[1]); + ff_vlc_free(&s->vlc[0]); + ff_vlc_free(&s->vlc[1]); return 0; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/shorten.c b/arm/raspi/third_party/ffmpeg/libavcodec/shorten.c index eca0c4e8..0ad95bf9 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/shorten.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/shorten.c @@ -280,7 +280,7 @@ static int decode_wave_header(AVCodecContext *avctx, const uint8_t *header, int header_size) { int len, bps; - short wave_format; + uint16_t wave_format; GetByteContext gb; bytestream2_init(&gb, header, header_size); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/sipr.c b/arm/raspi/third_party/ffmpeg/libavcodec/sipr.c index 692b59b3..3ddc579f 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/sipr.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/sipr.c @@ -532,7 +532,6 @@ static int sipr_decode_frame(AVCodecContext *avctx, AVFrame *frame, int subframe_size = ctx->mode == MODE_16k ? L_SUBFR_16k : SUBFR_SIZE; int i, ret; - ctx->avctx = avctx; if (avpkt->size < (mode_par->bits_per_frame >> 3)) { av_log(avctx, AV_LOG_ERROR, "Error processing packet: packet size (%d) too small\n", diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/sipr.h b/arm/raspi/third_party/ffmpeg/libavcodec/sipr.h index e1ef35d6..e7073987 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/sipr.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/sipr.h @@ -24,7 +24,6 @@ #ifndef AVCODEC_SIPR_H #define AVCODEC_SIPR_H -#include "avcodec.h" #include "acelp_pitch_delay.h" #include "libavutil/mem_internal.h" @@ -63,8 +62,6 @@ typedef struct SiprParameters { } SiprParameters; typedef struct SiprContext { - AVCodecContext *avctx; - SiprMode mode; float past_pitch_gain; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/smacker.c b/arm/raspi/third_party/ffmpeg/libavcodec/smacker.c index 7ee9fe85..3f2f83ad 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/smacker.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/smacker.c @@ -220,10 +220,10 @@ static int smacker_decode_header_tree(SmackVContext *smk, GetBitContext *gb, int goto error; skip_bits1(gb); if (h.current > 1) { - err = ff_init_vlc_from_lengths(&vlc[i], SMKTREE_BITS, h.current, + err = ff_vlc_init_from_lengths(&vlc[i], SMKTREE_BITS, h.current, &h.entries[0].length, sizeof(*h.entries), &h.entries[0].value, sizeof(*h.entries), 1, - 0, INIT_VLC_OUTPUT_LE, smk->avctx); + 0, VLC_INIT_OUTPUT_LE, smk->avctx); if (err < 0) { av_log(smk->avctx, AV_LOG_ERROR, "Cannot build VLC table\n"); goto error; @@ -264,7 +264,7 @@ static int smacker_decode_header_tree(SmackVContext *smk, GetBitContext *gb, int err = 0; error: for (int i = 0; i < 2; i++) { - ff_free_vlc(&vlc[i]); + ff_vlc_free(&vlc[i]); } return err; @@ -659,10 +659,10 @@ static int smka_decode_frame(AVCodecContext *avctx, AVFrame *frame, goto error; skip_bits1(&gb); if (h.current > 1) { - ret = ff_init_vlc_from_lengths(&vlc[i], SMKTREE_BITS, h.current, + ret = ff_vlc_init_from_lengths(&vlc[i], SMKTREE_BITS, h.current, &h.entries[0].length, sizeof(*h.entries), &h.entries[0].value, sizeof(*h.entries), 1, - 0, INIT_VLC_OUTPUT_LE, avctx); + 0, VLC_INIT_OUTPUT_LE, avctx); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "Cannot build VLC table\n"); goto error; @@ -740,7 +740,7 @@ static int smka_decode_frame(AVCodecContext *avctx, AVFrame *frame, error: for(i = 0; i < 4; i++) { - ff_free_vlc(&vlc[i]); + ff_vlc_free(&vlc[i]); } return ret; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/smcenc.c b/arm/raspi/third_party/ffmpeg/libavcodec/smcenc.c index 40b53c40..789aef4f 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/smcenc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/smcenc.c @@ -566,8 +566,7 @@ static int smc_encode_frame(AVCodecContext *avctx, AVPacket *pkt, // write chunk length AV_WB24(pkt->data + 1, pkt->size); - av_frame_unref(s->prev_frame); - ret = av_frame_ref(s->prev_frame, frame); + ret = av_frame_replace(s->prev_frame, frame); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "cannot add reference\n"); return ret; @@ -583,7 +582,7 @@ static int smc_encode_frame(AVCodecContext *avctx, AVPacket *pkt, static int smc_encode_end(AVCodecContext *avctx) { - SMCContext *s = (SMCContext *)avctx->priv_data; + SMCContext *s = avctx->priv_data; av_frame_free(&s->prev_frame); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/snow.c b/arm/raspi/third_party/ffmpeg/libavcodec/snow.c index 5eb3ee1e..59815d00 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/snow.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/snow.c @@ -21,8 +21,6 @@ #include "libavutil/log.h" #include "libavutil/thread.h" #include "avcodec.h" -#include "decode.h" -#include "encode.h" #include "snow_dwt.h" #include "snow.h" #include "snowdata.h" @@ -61,36 +59,6 @@ void ff_snow_inner_add_yblock(const uint8_t *obmc, const int obmc_stride, uint8_ } } -int ff_snow_get_buffer(SnowContext *s, AVFrame *frame) -{ - int ret, i; - int edges_needed = av_codec_is_encoder(s->avctx->codec); - - frame->width = s->avctx->width ; - frame->height = s->avctx->height; - if (edges_needed) { - frame->width += 2 * EDGE_WIDTH; - frame->height += 2 * EDGE_WIDTH; - - ret = ff_encode_alloc_frame(s->avctx, frame); - } else - ret = ff_get_buffer(s->avctx, frame, AV_GET_BUFFER_FLAG_REF); - if (ret < 0) - return ret; - if (edges_needed) { - for (i = 0; frame->data[i]; i++) { - int offset = (EDGE_WIDTH >> (i ? s->chroma_v_shift : 0)) * - frame->linesize[i] + - (EDGE_WIDTH >> (i ? s->chroma_h_shift : 0)); - frame->data[i] += offset; - } - frame->width = s->avctx->width; - frame->height = s->avctx->height; - } - - return 0; -} - void ff_snow_reset_contexts(SnowContext *s){ //FIXME better initial contexts int plane_index, level, orientation; @@ -433,36 +401,10 @@ av_cold int ff_snow_common_init(AVCodecContext *avctx){ s->max_ref_frames=1; //just make sure it's not an invalid value in case of no initial keyframe s->spatial_decomposition_count = 1; - ff_hpeldsp_init(&s->hdsp, avctx->flags); ff_videodsp_init(&s->vdsp, 8); ff_dwt_init(&s->dwt); ff_h264qpel_init(&s->h264qpel, 8); -#define mcf(dx,dy)\ - s->qdsp.put_qpel_pixels_tab [0][dy+dx/4]=\ - s->qdsp.put_no_rnd_qpel_pixels_tab[0][dy+dx/4]=\ - s->h264qpel.put_h264_qpel_pixels_tab[0][dy+dx/4];\ - s->qdsp.put_qpel_pixels_tab [1][dy+dx/4]=\ - s->qdsp.put_no_rnd_qpel_pixels_tab[1][dy+dx/4]=\ - s->h264qpel.put_h264_qpel_pixels_tab[1][dy+dx/4]; - - mcf( 0, 0) - mcf( 4, 0) - mcf( 8, 0) - mcf(12, 0) - mcf( 0, 4) - mcf( 4, 4) - mcf( 8, 4) - mcf(12, 4) - mcf( 0, 8) - mcf( 4, 8) - mcf( 8, 8) - mcf(12, 8) - mcf( 0,12) - mcf( 4,12) - mcf( 8,12) - mcf(12,12) - #define mcfh(dx,dy)\ s->hdsp.put_pixels_tab [0][dy/4+dx/8]=\ s->hdsp.put_no_rnd_pixels_tab[0][dy/4+dx/8]=\ @@ -507,27 +449,15 @@ av_cold int ff_snow_common_init(AVCodecContext *avctx){ int ff_snow_common_init_after_header(AVCodecContext *avctx) { SnowContext *s = avctx->priv_data; int plane_index, level, orientation; - int ret, emu_buf_size; if(!s->scratchbuf) { - if (av_codec_is_decoder(avctx->codec)) { - if ((ret = ff_get_buffer(s->avctx, s->mconly_picture, - AV_GET_BUFFER_FLAG_REF)) < 0) - return ret; - } - + int emu_buf_size; emu_buf_size = FFMAX(s->mconly_picture->linesize[0], 2*avctx->width+256) * (2 * MB_SIZE + HTAPS_MAX - 1); if (!FF_ALLOCZ_TYPED_ARRAY(s->scratchbuf, FFMAX(s->mconly_picture->linesize[0], 2*avctx->width+256) * 7 * MB_SIZE) || !FF_ALLOCZ_TYPED_ARRAY(s->emu_edge_buffer, emu_buf_size)) return AVERROR(ENOMEM); } - if (av_codec_is_decoder(avctx->codec) && - s->mconly_picture->format != avctx->pix_fmt) { - av_log(avctx, AV_LOG_ERROR, "pixel format changed\n"); - return AVERROR_INVALIDDATA; - } - for(plane_index=0; plane_index < s->nb_planes; plane_index++){ int w= s->avctx->width; int h= s->avctx->height; @@ -589,20 +519,21 @@ void ff_snow_release_buffer(AVCodecContext *avctx) } } -int ff_snow_frame_start(SnowContext *s){ +int ff_snow_frames_prepare(SnowContext *s) +{ AVFrame *tmp; - int i, ret; ff_snow_release_buffer(s->avctx); tmp= s->last_picture[s->max_ref_frames-1]; - for(i=s->max_ref_frames-1; i>0; i--) + for (int i = s->max_ref_frames - 1; i > 0; i--) s->last_picture[i] = s->last_picture[i-1]; s->last_picture[0] = s->current_picture; s->current_picture = tmp; if(s->keyframe){ s->ref_frames= 0; + s->current_picture->flags |= AV_FRAME_FLAG_KEY; }else{ int i; for(i=0; imax_ref_frames && s->last_picture[i]->data[0]; i++) @@ -613,14 +544,8 @@ int ff_snow_frame_start(SnowContext *s){ av_log(s->avctx,AV_LOG_ERROR, "No reference frames\n"); return AVERROR_INVALIDDATA; } - } - if ((ret = ff_snow_get_buffer(s, s->current_picture)) < 0) - return ret; - - if (s->keyframe) - s->current_picture->flags |= AV_FRAME_FLAG_KEY; - else s->current_picture->flags &= ~AV_FRAME_FLAG_KEY; + } return 0; } @@ -635,18 +560,11 @@ av_cold void ff_snow_common_end(SnowContext *s) av_freep(&s->temp_idwt_buffer); av_freep(&s->run_buffer); - s->m.me.temp= NULL; - av_freep(&s->m.me.scratchpad); - av_freep(&s->m.me.map); - av_freep(&s->m.sc.obmc_scratchpad); - av_freep(&s->block); av_freep(&s->scratchbuf); av_freep(&s->emu_edge_buffer); for(i=0; iref_mvs[i]); - av_freep(&s->ref_scores[i]); if(s->last_picture[i] && s->last_picture[i]->data[0]) { av_assert0(s->last_picture[i]->data[0] != s->current_picture->data[0]); } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/snow.h b/arm/raspi/third_party/ffmpeg/libavcodec/snow.h index ed0f9abb..a5e2c138 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/snow.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/snow.h @@ -24,21 +24,18 @@ #include "libavutil/motion_vector.h" +#include "avcodec.h" #include "hpeldsp.h" -#include "me_cmp.h" -#include "qpeldsp.h" #include "snow_dwt.h" #include "rangecoder.h" #include "mathops.h" -#include "mpegvideo.h" #include "h264qpel.h" +#include "videodsp.h" #define SNOW_MAX_PLANES 4 -#define FF_ME_ITER 3 - #define MID_STATE 128 #define MAX_PLANES 4 @@ -117,12 +114,9 @@ typedef struct SnowContext{ AVClass *class; AVCodecContext *avctx; RangeCoder c; - MECmpContext mecc; HpelDSPContext hdsp; - QpelDSPContext qdsp; VideoDSPContext vdsp; H264QpelContext h264qpel; - MpegvideoEncDSPContext mpvencdsp; SnowDWTContext dwt; AVFrame *input_picture; ///< new_picture with the internal linesizes AVFrame *current_picture; @@ -155,9 +149,6 @@ typedef struct SnowContext{ int spatial_scalability; int qlog; int last_qlog; - int lambda; - int lambda2; - int pass1_rc; int mv_scale; int last_mv_scale; int qbias; @@ -170,18 +161,7 @@ typedef struct SnowContext{ int nb_planes; Plane plane[MAX_PLANES]; BlockNode *block; -#define ME_CACHE_SIZE 1024 - unsigned me_cache[ME_CACHE_SIZE]; - unsigned me_cache_generation; slice_buffer sb; - int memc_only; - int no_bitstream; - int intra_penalty; - int motion_est; - int iterative_dia_size; - int scenechange_threshold; - - 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) uint8_t *scratchbuf; uint8_t *emu_edge_buffer; @@ -189,9 +169,6 @@ typedef struct SnowContext{ AVMotionVector *avmv; unsigned avmv_size; int avmv_index; - uint64_t encoding_error[SNOW_MAX_PLANES]; - - int pred; }SnowContext; /* Tables */ @@ -199,44 +176,6 @@ extern const uint8_t * const ff_obmc_tab[4]; extern const uint8_t ff_qexp[QROOT]; extern int ff_scale_mv_ref[MAX_REF_FRAMES][MAX_REF_FRAMES]; -/* C bits used by mmx/sse2/altivec */ - -static av_always_inline void snow_interleave_line_header(int * i, int width, IDWTELEM * low, IDWTELEM * high){ - (*i) = (width) - 2; - - if (width & 1){ - low[(*i)+1] = low[((*i)+1)>>1]; - (*i)--; - } -} - -static av_always_inline void snow_interleave_line_footer(int * i, IDWTELEM * low, IDWTELEM * high){ - for (; (*i)>=0; (*i)-=2){ - low[(*i)+1] = high[(*i)>>1]; - low[*i] = low[(*i)>>1]; - } -} - -static av_always_inline void snow_horizontal_compose_lift_lead_out(int i, IDWTELEM * dst, IDWTELEM * src, IDWTELEM * ref, int width, int w, int lift_high, int mul, int add, int shift){ - for(; i> shift); - } - - if((width^lift_high)&1){ - dst[w] = src[w] - ((mul * 2 * ref[w] + add) >> shift); - } -} - -static av_always_inline void snow_horizontal_compose_liftS_lead_out(int i, IDWTELEM * dst, IDWTELEM * src, IDWTELEM * ref, int width, int w){ - for(; i> W_BS); - } - - if(width&1){ - dst[w] = src[w] + ((2 * ref[w] + W_BO + 4 * src[w]) >> W_BS); - } -} - /* common code */ int ff_snow_common_init(AVCodecContext *avctx); @@ -245,11 +184,10 @@ void ff_snow_common_end(SnowContext *s); void ff_snow_release_buffer(AVCodecContext *avctx); void ff_snow_reset_contexts(SnowContext *s); int ff_snow_alloc_blocks(SnowContext *s); -int ff_snow_frame_start(SnowContext *s); +int ff_snow_frames_prepare(SnowContext *s); void ff_snow_pred_block(SnowContext *s, uint8_t *dst, uint8_t *tmp, ptrdiff_t stride, int sx, int sy, int b_w, int b_h, const BlockNode *block, int plane_index, int w, int h); -int ff_snow_get_buffer(SnowContext *s, AVFrame *frame); /* common inline functions */ //XXX doublecheck all of them should stay inlined @@ -486,227 +424,8 @@ static inline void set_blocks(SnowContext *s, int level, int x, int y, int l, in } } -static inline void init_ref(MotionEstContext *c, const uint8_t *const src[3], uint8_t *const ref[3], uint8_t *const ref2[3], int x, int y, int ref_index){ - SnowContext *s = c->avctx->priv_data; - const int offset[3]= { - y*c-> stride + x, - ((y*c->uvstride + x)>>s->chroma_h_shift), - ((y*c->uvstride + x)>>s->chroma_h_shift), - }; - int i; - for(i=0; i<3; i++){ - c->src[0][i]= src [i]; - c->ref[0][i]= ref [i] + offset[i]; - } - av_assert2(!ref_index); -} - - -/* bitstream functions */ - extern const int8_t ff_quant3bA[256]; #define QEXPSHIFT (7-FRAC_BITS+8) //FIXME try to change this to 0 -static inline void put_symbol(RangeCoder *c, uint8_t *state, int v, int is_signed){ - int i; - - if(v){ - const int a= FFABS(v); - const int e= av_log2(a); - const int el= FFMIN(e, 10); - put_rac(c, state+0, 0); - - for(i=0; i=el; i--){ - put_rac(c, state+22+9, (a>>i)&1); //22..31 - } - for(; i>=0; i--){ - put_rac(c, state+22+i, (a>>i)&1); //22..31 - } - - if(is_signed) - put_rac(c, state+11 + el, v < 0); //11..21 - }else{ - put_rac(c, state+0, 1); - } -} - -static inline int get_symbol(RangeCoder *c, uint8_t *state, int is_signed){ - if(get_rac(c, state+0)) - return 0; - else{ - int i, e; - unsigned a; - e= 0; - while(get_rac(c, state+1 + FFMIN(e,9))){ //1..10 - e++; - if (e > 31) - return AVERROR_INVALIDDATA; - } - - a= 1; - for(i=e-1; i>=0; i--){ - a += a + get_rac(c, state+22 + FFMIN(i,9)); //22..31 - } - - e= -(is_signed && get_rac(c, state+11 + FFMIN(e,10))); //11..21 - return (a^e)-e; - } -} - -static inline void put_symbol2(RangeCoder *c, uint8_t *state, int v, int log2){ - int i; - int r= log2>=0 ? 1<=0); - av_assert2(log2>=-4); - - while(v >= r){ - put_rac(c, state+4+log2, 1); - v -= r; - log2++; - if(log2>0) r+=r; - } - put_rac(c, state+4+log2, 0); - - for(i=log2-1; i>=0; i--){ - put_rac(c, state+31-i, (v>>i)&1); - } -} - -static inline int get_symbol2(RangeCoder *c, uint8_t *state, int log2){ - int i; - int r= log2>=0 ? 1<=-4); - - while(log2<28 && get_rac(c, state+4+log2)){ - v+= r; - log2++; - if(log2>0) r+=r; - } - - for(i=log2-1; i>=0; i--){ - v+= get_rac(c, state+31-i)<width; - const int h= b->height; - int x,y; - - int run, runs; - x_and_coeff *xc= b->x_coeff; - x_and_coeff *prev_xc= NULL; - x_and_coeff *prev2_xc= xc; - x_and_coeff *parent_xc= parent ? parent->x_coeff : NULL; - x_and_coeff *prev_parent_xc= parent_xc; - - runs= get_symbol2(&s->c, b->state[30], 0); - if(runs-- > 0) run= get_symbol2(&s->c, b->state[1], 3); - else run= INT_MAX; - - for(y=0; yx == 0){ - rt= prev_xc->coeff; - } - for(x=0; xx <= x) - prev_xc++; - if(prev_xc->x == x + 1) - rt= prev_xc->coeff; - else - rt=0; - } - if(parent_xc){ - if(x>>1 > parent_xc->x){ - parent_xc++; - } - if(x>>1 == parent_xc->x){ - p= parent_xc->coeff; - } - } - if(/*ll|*/l|lt|t|rt|p){ - int context= av_log2(/*FFABS(ll) + */3*(l>>1) + (lt>>1) + (t&~1) + (rt>>1) + (p>>1)); - - v=get_rac(&s->c, &b->state[0][context]); - if(v){ - v= 2*(get_symbol2(&s->c, b->state[context + 2], context-4) + 1); - v+=get_rac(&s->c, &b->state[0][16 + 1 + 3 + ff_quant3bA[l&0xFF] + 3*ff_quant3bA[t&0xFF]]); - if ((uint16_t)v != v) { - av_log(s->avctx, AV_LOG_ERROR, "Coefficient damaged\n"); - v = 1; - } - xc->x=x; - (xc++)->coeff= v; - } - }else{ - if(!run){ - if(runs-- > 0) run= get_symbol2(&s->c, b->state[1], 3); - else run= INT_MAX; - v= 2*(get_symbol2(&s->c, b->state[0 + 2], 0-4) + 1); - v+=get_rac(&s->c, &b->state[0][16 + 1 + 3]); - if ((uint16_t)v != v) { - av_log(s->avctx, AV_LOG_ERROR, "Coefficient damaged\n"); - v = 1; - } - - xc->x=x; - (xc++)->coeff= v; - }else{ - int max_run; - run--; - v=0; - av_assert2(run >= 0); - if(y) max_run= FFMIN(run, prev_xc->x - x - 2); - else max_run= FFMIN(run, w-x-1); - if(parent_xc) - max_run= FFMIN(max_run, 2*parent_xc->x - x - 1); - av_assert2(max_run >= 0 && max_run <= run); - - x+= max_run; - run-= max_run; - } - } - } - (xc++)->x= w+1; //end marker - prev_xc= prev2_xc; - prev2_xc= xc; - - if(parent_xc){ - if(y&1){ - while(parent_xc->x != parent->width+1) - parent_xc++; - parent_xc++; - prev_parent_xc= parent_xc; - }else{ - parent_xc= prev_parent_xc; - } - } - } - - (xc++)->x= w+1; //end marker -} - #endif /* AVCODEC_SNOW_H */ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/snow_dwt.h b/arm/raspi/third_party/ffmpeg/libavcodec/snow_dwt.h index 15b8a300..6e7d22c7 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/snow_dwt.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/snow_dwt.h @@ -24,6 +24,8 @@ #include #include +#include "libavutil/attributes.h" + struct MpegEncContext; typedef int DWTELEM; @@ -91,6 +93,44 @@ typedef struct SnowDWTContext { : ff_slice_buffer_load_line((slice_buf), \ (line_num))) +/* C bits used by mmx/sse2/altivec */ + +static av_always_inline void snow_interleave_line_header(int *i, int width, IDWTELEM *low, IDWTELEM *high) +{ + *i = width - 2; + + if (width & 1) { + low[*i + 1] = low[(*i + 1)>>1]; + (*i)--; + } +} + +static av_always_inline void snow_interleave_line_footer(int *i, IDWTELEM *low, const IDWTELEM *high) +{ + for (; *i >= 0; *i -= 2) { + low[*i + 1] = high[*i >> 1]; + low[*i] = low[*i >> 1]; + } +} + +static av_always_inline void snow_horizontal_compose_lift_lead_out(int i, IDWTELEM *dst, const IDWTELEM *src, const IDWTELEM *ref, int width, int w, int lift_high, int mul, int add, int shift) +{ + for (; i < w; i++) + dst[i] = src[i] - ((mul * (ref[i] + ref[i + 1]) + add) >> shift); + + if ((width ^ lift_high) & 1) + dst[w] = src[w] - ((mul * 2 * ref[w] + add) >> shift); +} + +static av_always_inline void snow_horizontal_compose_liftS_lead_out(int i, IDWTELEM *dst, const IDWTELEM *src, const IDWTELEM *ref, int width, int w) +{ + for (; i < w; i++) + dst[i] = src[i] + ((ref[i] + ref[(i+1)]+W_BO + 4 * src[i]) >> W_BS); + + if (width & 1) + dst[w] = src[w] + ((2 * ref[w] + W_BO + 4 * src[w]) >> W_BS); +} + int ff_slice_buffer_init(slice_buffer *buf, int line_count, int max_allocated_lines, int line_width, IDWTELEM *base_buffer); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/snowdec.c b/arm/raspi/third_party/ffmpeg/libavcodec/snowdec.c index bed29d33..70fbab9a 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/snowdec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/snowdec.c @@ -18,17 +18,166 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/emms.h" #include "libavutil/intmath.h" #include "libavutil/log.h" #include "libavutil/opt.h" #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "snow_dwt.h" #include "snow.h" #include "rangecoder.h" #include "mathops.h" +static inline int get_symbol(RangeCoder *c, uint8_t *state, int is_signed) +{ + if (get_rac(c, state + 0)) + return 0; + else { + int e; + unsigned a; + e = 0; + while (get_rac(c, state + 1 + FFMIN(e, 9))) { //1..10 + e++; + if (e > 31) + return AVERROR_INVALIDDATA; + } + + a = 1; + for (int i = e - 1; i >= 0; i--) + a += a + get_rac(c, state + 22 + FFMIN(i, 9)); //22..31 + + e = -(is_signed && get_rac(c, state + 11 + FFMIN(e, 10))); //11..21 + return (a ^ e) - e; + } +} + +static inline int get_symbol2(RangeCoder *c, uint8_t *state, int log2) +{ + int r = log2 >= 0 ? 1 << log2 : 1; + int v = 0; + + av_assert2(log2 >= -4); + + while (log2 < 28 && get_rac(c, state + 4 + log2)) { + v += r; + log2++; + if (log2 > 0) r += r; + } + + for (int i = log2 - 1; i >= 0; i--) + v += get_rac(c, state + 31 - i) << i; + + return v; +} + +static void unpack_coeffs(SnowContext *s, SubBand *b, SubBand * parent, int orientation) +{ + const int w = b->width; + const int h = b->height; + + int run, runs; + x_and_coeff *xc = b->x_coeff; + x_and_coeff *prev_xc = NULL; + x_and_coeff *prev2_xc = xc; + x_and_coeff *parent_xc = parent ? parent->x_coeff : NULL; + x_and_coeff *prev_parent_xc = parent_xc; + + runs = get_symbol2(&s->c, b->state[30], 0); + if (runs-- > 0) run = get_symbol2(&s->c, b->state[1], 3); + else run = INT_MAX; + + for (int y = 0; y < h; y++) { + int v = 0; + int lt = 0, t = 0, rt = 0; + + if (y && prev_xc->x == 0) + rt = prev_xc->coeff; + + for (int x = 0; x < w; x++) { + int p = 0; + const int l = v; + + lt= t; t= rt; + + if (y) { + if (prev_xc->x <= x) + prev_xc++; + if (prev_xc->x == x + 1) + rt = prev_xc->coeff; + else + rt = 0; + } + if (parent_xc) { + if (x>>1 > parent_xc->x) + parent_xc++; + if (x>>1 == parent_xc->x) + p = parent_xc->coeff; + } + if (/*ll|*/l|lt|t|rt|p) { + int context = av_log2(/*FFABS(ll) + */3*(l>>1) + (lt>>1) + (t&~1) + (rt>>1) + (p>>1)); + + v = get_rac(&s->c, &b->state[0][context]); + if (v) { + v = 2*(get_symbol2(&s->c, b->state[context + 2], context-4) + 1); + v += get_rac(&s->c, &b->state[0][16 + 1 + 3 + ff_quant3bA[l&0xFF] + 3 * ff_quant3bA[t&0xFF]]); + if ((uint16_t)v != v) { + av_log(s->avctx, AV_LOG_ERROR, "Coefficient damaged\n"); + v = 1; + } + xc->x = x; + (xc++)->coeff = v; + } + } else { + if (!run) { + if (runs-- > 0) run = get_symbol2(&s->c, b->state[1], 3); + else run = INT_MAX; + v = 2 * (get_symbol2(&s->c, b->state[0 + 2], 0-4) + 1); + v += get_rac(&s->c, &b->state[0][16 + 1 + 3]); + if ((uint16_t)v != v) { + av_log(s->avctx, AV_LOG_ERROR, "Coefficient damaged\n"); + v = 1; + } + + xc->x = x; + (xc++)->coeff = v; + } else { + int max_run; + run--; + v = 0; + av_assert2(run >= 0); + if (y) max_run = FFMIN(run, prev_xc->x - x - 2); + else max_run = FFMIN(run, w-x-1); + if (parent_xc) + max_run = FFMIN(max_run, 2*parent_xc->x - x - 1); + av_assert2(max_run >= 0 && max_run <= run); + + x += max_run; + run -= max_run; + } + } + } + (xc++)->x = w+1; //end marker + prev_xc = prev2_xc; + prev2_xc = xc; + + if (parent_xc) { + if (y & 1) { + while (parent_xc->x != parent->width+1) + parent_xc++; + parent_xc++; + prev_parent_xc= parent_xc; + } else { + parent_xc= prev_parent_xc; + } + } + } + + (xc++)->x = w + 1; //end marker +} + static av_always_inline void predict_slice_buffered(SnowContext *s, slice_buffer * sb, IDWTELEM * old_buffer, int plane_index, int add, int mb_y){ Plane *p= &s->plane[plane_index]; const int mb_w= s->b_width << s->block_max_depth; @@ -453,6 +602,17 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture, s->current_picture->pict_type= AV_PICTURE_TYPE_I; //FIXME I vs. P if ((res = decode_header(s)) < 0) return res; + + if (!s->mconly_picture->data[0]) { + res = ff_get_buffer(avctx, s->mconly_picture, AV_GET_BUFFER_FLAG_REF); + if (res < 0) + return res; + } + if (s->mconly_picture->format != avctx->pix_fmt) { + av_log(avctx, AV_LOG_ERROR, "pixel format changed\n"); + return AVERROR_INVALIDDATA; + } + if ((res=ff_snow_common_init_after_header(avctx)) < 0) return res; @@ -474,7 +634,13 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture, ff_snow_alloc_blocks(s); - if((res = ff_snow_frame_start(s)) < 0) + if ((res = ff_snow_frames_prepare(s)) < 0) + return res; + + s->current_picture->width = s->avctx->width; + s->current_picture->height = s->avctx->height; + res = ff_get_buffer(s->avctx, s->current_picture, AV_GET_BUFFER_FLAG_REF); + if (res < 0) return res; s->current_picture->pict_type = s->keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/snowenc.c b/arm/raspi/third_party/ffmpeg/libavcodec/snowenc.c index 1360343a..c2152153 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/snowenc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/snowenc.c @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/emms.h" #include "libavutil/intmath.h" #include "libavutil/libm.h" #include "libavutil/log.h" @@ -29,6 +30,7 @@ #include "internal.h" //For AVCodecInternal.recon_frame #include "me_cmp.h" #include "packet_internal.h" +#include "qpeldsp.h" #include "snow_dwt.h" #include "snow.h" @@ -38,20 +40,136 @@ #include "mpegvideo.h" #include "h263enc.h" +#define FF_ME_ITER 3 + +typedef struct SnowEncContext { + SnowContext com; + QpelDSPContext qdsp; + MpegvideoEncDSPContext mpvencdsp; + + int lambda; + int lambda2; + int pass1_rc; + + int pred; + int memc_only; + int no_bitstream; + int intra_penalty; + int motion_est; + int iterative_dia_size; + int scenechange_threshold; + + MECmpContext mecc; + 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) +#define ME_CACHE_SIZE 1024 + unsigned me_cache[ME_CACHE_SIZE]; + unsigned me_cache_generation; + + uint64_t encoding_error[SNOW_MAX_PLANES]; +} SnowEncContext; + +static void init_ref(MotionEstContext *c, const uint8_t *const src[3], + uint8_t *const ref[3], uint8_t *const ref2[3], + int x, int y, int ref_index) +{ + SnowContext *s = c->avctx->priv_data; + const int offset[3] = { + y*c-> stride + x, + ((y*c->uvstride + x) >> s->chroma_h_shift), + ((y*c->uvstride + x) >> s->chroma_h_shift), + }; + for (int i = 0; i < 3; i++) { + c->src[0][i] = src [i]; + c->ref[0][i] = ref [i] + offset[i]; + } + av_assert2(!ref_index); +} + +static inline void put_symbol(RangeCoder *c, uint8_t *state, int v, int is_signed) +{ + if (v) { + const int a = FFABS(v); + const int e = av_log2(a); + const int el = FFMIN(e, 10); + int i; + + put_rac(c, state + 0, 0); + + for (i = 0; i < el; i++) + put_rac(c, state + 1 + i, 1); //1..10 + for(; i < e; i++) + put_rac(c, state + 1 + 9, 1); //1..10 + put_rac(c, state + 1 + FFMIN(i, 9), 0); + + for (i = e - 1; i >= el; i--) + put_rac(c, state + 22 + 9, (a >> i) & 1); //22..31 + for(; i >= 0; i--) + put_rac(c, state + 22 + i, (a >> i) & 1); //22..31 + + if (is_signed) + put_rac(c, state + 11 + el, v < 0); //11..21 + } else { + put_rac(c, state + 0, 1); + } +} + +static inline void put_symbol2(RangeCoder *c, uint8_t *state, int v, int log2) +{ + int r = log2 >= 0 ? 1<= 0); + av_assert2(log2 >= -4); + + while (v >= r) { + put_rac(c, state + 4 + log2, 1); + v -= r; + log2++; + if (log2 > 0) r += r; + } + put_rac(c, state + 4 + log2, 0); + + for (int i = log2 - 1; i >= 0; i--) + put_rac(c, state + 31 - i, (v >> i) & 1); +} + +static int get_encode_buffer(SnowContext *s, AVFrame *frame) +{ + int ret; + + frame->width = s->avctx->width + 2 * EDGE_WIDTH; + frame->height = s->avctx->height + 2 * EDGE_WIDTH; + + ret = ff_encode_alloc_frame(s->avctx, frame); + if (ret < 0) + return ret; + for (int i = 0; frame->data[i]; i++) { + int offset = (EDGE_WIDTH >> (i ? s->chroma_v_shift : 0)) * + frame->linesize[i] + + (EDGE_WIDTH >> (i ? s->chroma_h_shift : 0)); + frame->data[i] += offset; + } + frame->width = s->avctx->width; + frame->height = s->avctx->height; + + return 0; +} + static av_cold int encode_init(AVCodecContext *avctx) { - SnowContext *s = avctx->priv_data; + SnowEncContext *const enc = avctx->priv_data; + SnowContext *const s = &enc->com; + MpegEncContext *const mpv = &enc->m; int plane_index, ret; int i; - if(s->pred == DWT_97 + if (enc->pred == DWT_97 && (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 AVERROR(EINVAL); } - s->spatial_decomposition_type= s->pred; //FIXME add decorrelator type r transform_type + s->spatial_decomposition_type = enc->pred; //FIXME add decorrelator type r transform_type s->mv_scale = (avctx->flags & AV_CODEC_FLAG_QPEL) ? 2 : 4; s->block_max_depth= (avctx->flags & AV_CODEC_FLAG_4MV ) ? 1 : 0; @@ -65,31 +183,59 @@ static av_cold int encode_init(AVCodecContext *avctx) s->plane[plane_index].fast_mc= 1; } + // Must be before ff_snow_common_init() + ff_hpeldsp_init(&s->hdsp, avctx->flags); if ((ret = ff_snow_common_init(avctx)) < 0) { return ret; } - ff_me_cmp_init(&s->mecc, avctx); - ff_mpegvideoencdsp_init(&s->mpvencdsp, avctx); + +#define mcf(dx,dy)\ + enc->qdsp.put_qpel_pixels_tab [0][dy+dx/4]=\ + enc->qdsp.put_no_rnd_qpel_pixels_tab[0][dy+dx/4]=\ + s->h264qpel.put_h264_qpel_pixels_tab[0][dy+dx/4];\ + enc->qdsp.put_qpel_pixels_tab [1][dy+dx/4]=\ + enc->qdsp.put_no_rnd_qpel_pixels_tab[1][dy+dx/4]=\ + s->h264qpel.put_h264_qpel_pixels_tab[1][dy+dx/4]; + + mcf( 0, 0) + mcf( 4, 0) + mcf( 8, 0) + mcf(12, 0) + mcf( 0, 4) + mcf( 4, 4) + mcf( 8, 4) + mcf(12, 4) + mcf( 0, 8) + mcf( 4, 8) + mcf( 8, 8) + mcf(12, 8) + mcf( 0,12) + mcf( 4,12) + mcf( 8,12) + mcf(12,12) + + ff_me_cmp_init(&enc->mecc, avctx); + ff_mpegvideoencdsp_init(&enc->mpvencdsp, avctx); ff_snow_alloc_blocks(s); s->version=0; - s->m.avctx = avctx; - s->m.bit_rate= avctx->bit_rate; - s->m.lmin = avctx->mb_lmin; - s->m.lmax = avctx->mb_lmax; - s->m.mb_num = (avctx->width * avctx->height + 255) / 256; // For ratecontrol + mpv->avctx = avctx; + mpv->bit_rate= avctx->bit_rate; + mpv->lmin = avctx->mb_lmin; + mpv->lmax = avctx->mb_lmax; + mpv->mb_num = (avctx->width * avctx->height + 255) / 256; // For ratecontrol - s->m.me.temp = - s->m.me.scratchpad = av_calloc(avctx->width + 64, 2*16*2*sizeof(uint8_t)); - s->m.sc.obmc_scratchpad= av_mallocz(MB_SIZE*MB_SIZE*12*sizeof(uint32_t)); - s->m.me.map = av_mallocz(2 * ME_MAP_SIZE * sizeof(*s->m.me.map)); - if (!s->m.me.scratchpad || !s->m.me.map || !s->m.sc.obmc_scratchpad) + mpv->me.temp = + mpv->me.scratchpad = av_calloc(avctx->width + 64, 2*16*2*sizeof(uint8_t)); + mpv->sc.obmc_scratchpad= av_mallocz(MB_SIZE*MB_SIZE*12*sizeof(uint32_t)); + mpv->me.map = av_mallocz(2 * ME_MAP_SIZE * sizeof(*mpv->me.map)); + if (!mpv->me.scratchpad || !mpv->me.map || !mpv->sc.obmc_scratchpad) return AVERROR(ENOMEM); - s->m.me.score_map = s->m.me.map + ME_MAP_SIZE; + mpv->me.score_map = mpv->me.map + ME_MAP_SIZE; - ff_h263_encode_init(&s->m); //mv_penalty + ff_h263_encode_init(mpv); //mv_penalty s->max_ref_frames = av_clip(avctx->refs, 1, MAX_REF_FRAMES); @@ -101,11 +247,11 @@ static av_cold int encode_init(AVCodecContext *avctx) return AVERROR(ENOMEM); } if((avctx->flags&AV_CODEC_FLAG_PASS2) || !(avctx->flags&AV_CODEC_FLAG_QSCALE)){ - ret = ff_rate_control_init(&s->m); + ret = ff_rate_control_init(mpv); if(ret < 0) return ret; } - s->pass1_rc= !(avctx->flags & (AV_CODEC_FLAG_QSCALE|AV_CODEC_FLAG_PASS2)); + enc->pass1_rc = !(avctx->flags & (AV_CODEC_FLAG_QSCALE|AV_CODEC_FLAG_PASS2)); switch(avctx->pix_fmt){ case AV_PIX_FMT_YUV444P: @@ -130,8 +276,8 @@ static av_cold int encode_init(AVCodecContext *avctx) if (ret) return ret; - ret = ff_set_cmp(&s->mecc, s->mecc.me_cmp, s->avctx->me_cmp); - ret |= ff_set_cmp(&s->mecc, s->mecc.me_sub_cmp, s->avctx->me_sub_cmp); + ret = ff_set_cmp(&enc->mecc, enc->mecc.me_cmp, s->avctx->me_cmp); + ret |= ff_set_cmp(&enc->mecc, enc->mecc.me_sub_cmp, s->avctx->me_sub_cmp); if (ret < 0) return AVERROR(EINVAL); @@ -139,10 +285,10 @@ static av_cold int encode_init(AVCodecContext *avctx) if (!s->input_picture) return AVERROR(ENOMEM); - if ((ret = ff_snow_get_buffer(s, s->input_picture)) < 0) + if ((ret = get_encode_buffer(s, s->input_picture)) < 0) return ret; - if(s->motion_est == FF_ME_ITER){ + if (enc->motion_est == FF_ME_ITER) { int size= s->b_width * s->b_height << 2*s->block_max_depth; for(i=0; imax_ref_frames; i++){ s->ref_mvs[i] = av_calloc(size, sizeof(*s->ref_mvs[i])); @@ -220,7 +366,10 @@ static inline int get_penalty_factor(int lambda, int lambda2, int type){ #define P_MV1 P[9] #define FLAG_QPEL 1 //must be 1 -static int encode_q_branch(SnowContext *s, int level, int x, int y){ +static int encode_q_branch(SnowEncContext *enc, int level, int x, int y) +{ + SnowContext *const s = &enc->com; + MotionEstContext *const c = &enc->m.me; uint8_t p_buffer[1024]; uint8_t i_buffer[1024]; uint8_t p_state[sizeof(s->block_state)]; @@ -257,7 +406,6 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){ int16_t last_mv[3][2]; 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); int mx_context= av_log2(2*FFABS(left->mx - top->mx)); int my_context= av_log2(2*FFABS(left->my - top->my)); @@ -286,18 +434,18 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){ last_mv[2][0]= bottom->mx; last_mv[2][1]= bottom->my; - s->m.mb_stride=2; - s->m.mb_x= - s->m.mb_y= 0; + enc->m.mb_stride = 2; + enc->m.mb_x = + enc->m.mb_y = 0; c->skip= 0; av_assert1(c-> stride == stride); av_assert1(c->uvstride == uvstride); - c->penalty_factor = get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_cmp); - c->sub_penalty_factor= get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_sub_cmp); - c->mb_penalty_factor = get_penalty_factor(s->lambda, s->lambda2, c->avctx->mb_cmp); - c->current_mv_penalty= c->mv_penalty[s->m.f_code=1] + MAX_DMV; + c->penalty_factor = get_penalty_factor(enc->lambda, enc->lambda2, c->avctx->me_cmp); + c->sub_penalty_factor= get_penalty_factor(enc->lambda, enc->lambda2, c->avctx->me_sub_cmp); + c->mb_penalty_factor = get_penalty_factor(enc->lambda, enc->lambda2, c->avctx->mb_cmp); + c->current_mv_penalty = c->mv_penalty[enc->m.f_code=1] + MAX_DMV; c->xmin = - x*block_w - 16+3; c->ymin = - y*block_w - 16+3; @@ -328,7 +476,7 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){ for(ref=0; refref_frames; ref++){ init_ref(c, current_data, s->last_picture[ref]->data, NULL, block_w*x, block_w*y, 0); - ref_score= ff_epzs_motion_search(&s->m, &ref_mx, &ref_my, P, 0, /*ref_index*/ 0, last_mv, + ref_score= ff_epzs_motion_search(&enc->m, &ref_mx, &ref_my, P, 0, /*ref_index*/ 0, last_mv, (1<<16)>>shift, level-LOG2_MB_SIZE+4, block_w); av_assert2(ref_mx >= c->xmin); @@ -336,8 +484,8 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){ av_assert2(ref_my >= c->ymin); av_assert2(ref_my <= c->ymax); - ref_score= c->sub_motion_search(&s->m, &ref_mx, &ref_my, ref_score, 0, 0, level-LOG2_MB_SIZE+4, block_w); - ref_score= ff_get_mb_score(&s->m, ref_mx, ref_my, 0, 0, level-LOG2_MB_SIZE+4, block_w, 0); + ref_score= c->sub_motion_search(&enc->m, &ref_mx, &ref_my, ref_score, 0, 0, level-LOG2_MB_SIZE+4, block_w); + ref_score= ff_get_mb_score(&enc->m, ref_mx, ref_my, 0, 0, level-LOG2_MB_SIZE+4, block_w, 0); ref_score+= 2*av_log2(2*ref)*c->penalty_factor; if(s->ref_mvs[ref]){ s->ref_mvs[ref][index][0]= ref_mx; @@ -369,7 +517,7 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){ put_symbol(&pc, &p_state[128 + 32*(mx_context + 16*!!best_ref)], mx - pmx, 1); put_symbol(&pc, &p_state[128 + 32*(my_context + 16*!!best_ref)], my - pmy, 1); p_len= pc.bytestream - pc.bytestream_start; - score += (s->lambda2*(get_rac_count(&pc)-base_bits))>>FF_LAMBDA_SHIFT; + score += (enc->lambda2*(get_rac_count(&pc)-base_bits))>>FF_LAMBDA_SHIFT; block_s= block_w*block_w; sum = pix_sum(current_data[0], stride, block_w, block_w); @@ -400,9 +548,9 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){ put_symbol(&ic, &i_state[96], cr-pcr, 1); } i_len= ic.bytestream - ic.bytestream_start; - iscore += (s->lambda2*(get_rac_count(&ic)-base_bits))>>FF_LAMBDA_SHIFT; + iscore += (enc->lambda2*(get_rac_count(&ic)-base_bits))>>FF_LAMBDA_SHIFT; - av_assert1(iscore < 255*255*256 + s->lambda2*10); + av_assert1(iscore < 255*255*256 + enc->lambda2*10); av_assert1(iscore >= 0); av_assert1(l>=0 && l<=255); av_assert1(pl>=0 && pl<=255); @@ -413,16 +561,16 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){ if (vard <= 64 || vard < varc) c->scene_change_score+= ff_sqrt(vard) - ff_sqrt(varc); else - c->scene_change_score+= s->m.qscale; + c->scene_change_score += enc->m.qscale; } if(level!=s->block_max_depth){ put_rac(&s->c, &s->block_state[4 + s_context], 0); - score2 = encode_q_branch(s, level+1, 2*x+0, 2*y+0); - score2+= encode_q_branch(s, level+1, 2*x+1, 2*y+0); - score2+= encode_q_branch(s, level+1, 2*x+0, 2*y+1); - score2+= encode_q_branch(s, level+1, 2*x+1, 2*y+1); - score2+= s->lambda2>>FF_LAMBDA_SHIFT; //FIXME exact split overhead + score2 = encode_q_branch(enc, level+1, 2*x+0, 2*y+0); + score2+= encode_q_branch(enc, level+1, 2*x+1, 2*y+0); + score2+= encode_q_branch(enc, level+1, 2*x+0, 2*y+1); + score2+= encode_q_branch(enc, level+1, 2*x+1, 2*y+1); + score2+= enc->lambda2>>FF_LAMBDA_SHIFT; //FIXME exact split overhead if(score2 < score && score2 < iscore) return score2; @@ -504,7 +652,9 @@ static void encode_q_branch2(SnowContext *s, int level, int x, int y){ } } -static int get_dc(SnowContext *s, int mb_x, int mb_y, int plane_index){ +static int get_dc(SnowEncContext *enc, int mb_x, int mb_y, int plane_index) +{ + SnowContext *const s = &enc->com; int i, x2, y2; Plane *p= &s->plane[plane_index]; const int block_size = MB_SIZE >> s->block_max_depth; @@ -514,7 +664,7 @@ static int get_dc(SnowContext *s, int mb_x, int mb_y, int plane_index){ const int obmc_stride= plane_index ? (2*block_size)>>s->chroma_h_shift : 2*block_size; const int ref_stride= s->current_picture->linesize[plane_index]; const uint8_t *src = s->input_picture->data[plane_index]; - IDWTELEM *dst= (IDWTELEM*)s->m.sc.obmc_scratchpad + plane_index*block_size*block_size*4; //FIXME change to unsigned + IDWTELEM *dst= (IDWTELEM*)enc->m.sc.obmc_scratchpad + plane_index*block_size*block_size*4; //FIXME change to unsigned const int b_stride = s->b_width << s->block_max_depth; const int w= p->width; const int h= p->height; @@ -600,7 +750,10 @@ static inline int get_block_bits(SnowContext *s, int x, int y, int w){ } } -static int get_block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index, uint8_t (*obmc_edged)[MB_SIZE * 2]){ +static int get_block_rd(SnowEncContext *enc, int mb_x, int mb_y, + int plane_index, uint8_t (*obmc_edged)[MB_SIZE * 2]) +{ + SnowContext *const s = &enc->com; Plane *p= &s->plane[plane_index]; const int block_size = MB_SIZE >> s->block_max_depth; const int block_w = plane_index ? block_size>>s->chroma_h_shift : block_size; @@ -609,7 +762,7 @@ static int get_block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index, uin const int ref_stride= s->current_picture->linesize[plane_index]; uint8_t *dst= s->current_picture->data[plane_index]; const uint8_t *src = s->input_picture->data[plane_index]; - IDWTELEM *pred= (IDWTELEM*)s->m.sc.obmc_scratchpad + plane_index*block_size*block_size*4; + IDWTELEM *pred= (IDWTELEM*)enc->m.sc.obmc_scratchpad + plane_index*block_size*block_size*4; uint8_t *cur = s->scratchbuf; uint8_t *tmp = s->emu_edge_buffer; const int b_stride = s->b_width << s->block_max_depth; @@ -618,7 +771,7 @@ static int get_block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index, uin const int h= p->height; int distortion; int rate= 0; - const int penalty_factor= get_penalty_factor(s->lambda, s->lambda2, s->avctx->me_cmp); + const int penalty_factor = get_penalty_factor(enc->lambda, enc->lambda2, s->avctx->me_cmp); int sx= block_w*mb_x - block_w/2; int sy= block_h*mb_y - block_h/2; int x0= FFMAX(0,-sx); @@ -672,19 +825,19 @@ static int get_block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index, uin * to improve the score of the whole frame, thus iterative motion * estimation does not always converge. */ if(s->avctx->me_cmp == FF_CMP_W97) - distortion = ff_w97_32_c(&s->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, 32); + distortion = ff_w97_32_c(&enc->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, 32); else if(s->avctx->me_cmp == FF_CMP_W53) - distortion = ff_w53_32_c(&s->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, 32); + distortion = ff_w53_32_c(&enc->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, 32); else{ distortion = 0; for(i=0; i<4; i++){ int off = sx+16*(i&1) + (sy+16*(i>>1))*ref_stride; - distortion += s->mecc.me_cmp[0](&s->m, src + off, dst + off, ref_stride, 16); + distortion += enc->mecc.me_cmp[0](&enc->m, src + off, dst + off, ref_stride, 16); } } }else{ av_assert2(block_w==8); - distortion = s->mecc.me_cmp[0](&s->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, block_w*2); + distortion = enc->mecc.me_cmp[0](&enc->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, block_w*2); } if(plane_index==0){ @@ -701,7 +854,9 @@ static int get_block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index, uin return distortion + rate*penalty_factor; } -static int get_4block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index){ +static int get_4block_rd(SnowEncContext *enc, int mb_x, int mb_y, int plane_index) +{ + SnowContext *const s = &enc->com; int i, y2; Plane *p= &s->plane[plane_index]; const int block_size = MB_SIZE >> s->block_max_depth; @@ -720,7 +875,7 @@ static int get_4block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index){ const int h= p->height; int distortion= 0; int rate= 0; - const int penalty_factor= get_penalty_factor(s->lambda, s->lambda2, s->avctx->me_cmp); + const int penalty_factor= get_penalty_factor(enc->lambda, enc->lambda2, s->avctx->me_cmp); av_assert2(s->chroma_h_shift == s->chroma_v_shift); //obmc and square assumtions below @@ -748,7 +903,7 @@ static int get_4block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index){ } av_assert1(block_w== 8 || block_w==16); - distortion += s->mecc.me_cmp[block_w==8](&s->m, src + x + y*ref_stride, dst + x + y*ref_stride, ref_stride, block_h); + distortion += enc->mecc.me_cmp[block_w==8](&enc->m, src + x + y*ref_stride, dst + x + y*ref_stride, ref_stride, block_h); } if(plane_index==0){ @@ -897,9 +1052,10 @@ static int encode_subband(SnowContext *s, SubBand *b, const IDWTELEM *src, const // encode_subband_dzr(s, b, src, parent, stride, orientation); } -static av_always_inline int check_block_intra(SnowContext *s, int mb_x, int mb_y, int p[3], +static av_always_inline int check_block_intra(SnowEncContext *enc, int mb_x, int mb_y, int p[3], uint8_t (*obmc_edged)[MB_SIZE * 2], int *best_rd) { + SnowContext *const s = &enc->com; const int b_stride= s->b_width << s->block_max_depth; BlockNode *block= &s->block[mb_x + mb_y * b_stride]; BlockNode backup= *block; @@ -913,7 +1069,7 @@ static av_always_inline int check_block_intra(SnowContext *s, int mb_x, int mb_y block->color[2] = p[2]; block->type |= BLOCK_INTRA; - rd = get_block_rd(s, mb_x, mb_y, 0, obmc_edged) + s->intra_penalty; + rd = get_block_rd(enc, mb_x, mb_y, 0, obmc_edged) + enc->intra_penalty; //FIXME chroma if(rd < *best_rd){ @@ -927,7 +1083,11 @@ static av_always_inline int check_block_intra(SnowContext *s, int mb_x, int mb_y /* special case for int[2] args we discard afterwards, * fixes compilation problem with gcc 2.95 */ -static av_always_inline int check_block_inter(SnowContext *s, int mb_x, int mb_y, int p0, int p1, uint8_t (*obmc_edged)[MB_SIZE * 2], int *best_rd){ +static av_always_inline int check_block_inter(SnowEncContext *enc, + int mb_x, int mb_y, int p0, int p1, + uint8_t (*obmc_edged)[MB_SIZE * 2], int *best_rd) +{ + SnowContext *const s = &enc->com; const int b_stride = s->b_width << s->block_max_depth; BlockNode *block = &s->block[mb_x + mb_y * b_stride]; BlockNode backup = *block; @@ -938,16 +1098,16 @@ static av_always_inline int check_block_inter(SnowContext *s, int mb_x, int mb_y av_assert2(mb_x < b_stride); index = (p0 + 31 * p1) & (ME_CACHE_SIZE-1); - value = s->me_cache_generation + (p0 >> 10) + p1 * (1 << 6) + (block->ref << 12); - if (s->me_cache[index] == value) + value = enc->me_cache_generation + (p0 >> 10) + p1 * (1 << 6) + (block->ref << 12); + if (enc->me_cache[index] == value) return 0; - s->me_cache[index] = value; + enc->me_cache[index] = value; block->mx = p0; block->my = p1; block->type &= ~BLOCK_INTRA; - rd = get_block_rd(s, mb_x, mb_y, 0, obmc_edged); + rd = get_block_rd(enc, mb_x, mb_y, 0, obmc_edged); //FIXME chroma if (rd < *best_rd) { @@ -959,7 +1119,10 @@ static av_always_inline int check_block_inter(SnowContext *s, int mb_x, int mb_y } } -static av_always_inline int check_4block_inter(SnowContext *s, int mb_x, int mb_y, int p0, int p1, int ref, int *best_rd){ +static av_always_inline int check_4block_inter(SnowEncContext *enc, int mb_x, int mb_y, + int p0, int p1, int ref, int *best_rd) +{ + SnowContext *const s = &enc->com; const int b_stride= s->b_width << s->block_max_depth; BlockNode *block= &s->block[mb_x + mb_y * b_stride]; BlockNode backup[4]; @@ -979,10 +1142,10 @@ static av_always_inline int check_4block_inter(SnowContext *s, int mb_x, int mb_ av_assert2(((mb_x|mb_y)&1) == 0); index= (p0 + 31*p1) & (ME_CACHE_SIZE-1); - value= s->me_cache_generation + (p0>>10) + (p1<<6) + (block->ref<<12); - if(s->me_cache[index] == value) + value = enc->me_cache_generation + (p0>>10) + (p1<<6) + (block->ref<<12); + if (enc->me_cache[index] == value) return 0; - s->me_cache[index]= value; + enc->me_cache[index] = value; block->mx= p0; block->my= p1; @@ -990,7 +1153,7 @@ static av_always_inline int check_4block_inter(SnowContext *s, int mb_x, int mb_ block->type &= ~BLOCK_INTRA; block[1]= block[b_stride]= block[b_stride+1]= *block; - rd= get_4block_rd(s, mb_x, mb_y, 0); + rd = get_4block_rd(enc, mb_x, mb_y, 0); //FIXME chroma if(rd < *best_rd){ @@ -1005,7 +1168,9 @@ static av_always_inline int check_4block_inter(SnowContext *s, int mb_x, int mb_ } } -static void iterative_me(SnowContext *s){ +static void iterative_me(SnowEncContext *enc) +{ + SnowContext *const s = &enc->com; int pass, mb_x, mb_y; const int b_width = s->b_width << s->block_max_depth; const int b_height= s->b_height << s->block_max_depth; @@ -1018,7 +1183,7 @@ static void iterative_me(SnowContext *s){ memcpy(state, s->block_state, sizeof(s->block_state)); for(mb_y= 0; mb_yb_height; mb_y++) for(mb_x= 0; mb_xb_width; mb_x++) - encode_q_branch(s, 0, mb_x, mb_y); + encode_q_branch(enc, 0, mb_x, mb_y); s->c = r; memcpy(s->block_state, state, sizeof(s->block_state)); } @@ -1050,9 +1215,9 @@ static void iterative_me(SnowContext *s){ backup= *block; - if(!s->me_cache_generation) - memset(s->me_cache, 0, sizeof(s->me_cache)); - s->me_cache_generation += 1<<22; + if (!enc->me_cache_generation) + memset(enc->me_cache, 0, sizeof(enc->me_cache)); + enc->me_cache_generation += 1<<22; //FIXME precalculate { @@ -1108,14 +1273,14 @@ static void iterative_me(SnowContext *s){ // intra(black) = neighbors' contribution to the current block for(i=0; i < s->nb_planes; i++) - color[i]= get_dc(s, mb_x, mb_y, i); + color[i]= get_dc(enc, mb_x, mb_y, i); // get previous score (cannot be cached due to OBMC) if(pass > 0 && (block->type&BLOCK_INTRA)){ int color0[3]= {block->color[0], block->color[1], block->color[2]}; - check_block_intra(s, mb_x, mb_y, color0, obmc_edged, &best_rd); + check_block_intra(enc, mb_x, mb_y, color0, obmc_edged, &best_rd); }else - check_block_inter(s, mb_x, mb_y, block->mx, block->my, obmc_edged, &best_rd); + check_block_inter(enc, mb_x, mb_y, block->mx, block->my, obmc_edged, &best_rd); ref_b= *block; ref_rd= best_rd; @@ -1126,30 +1291,30 @@ static void iterative_me(SnowContext *s){ block->ref= ref; best_rd= INT_MAX; - check_block_inter(s, mb_x, mb_y, mvr[0][0], mvr[0][1], obmc_edged, &best_rd); - check_block_inter(s, mb_x, mb_y, 0, 0, obmc_edged, &best_rd); + check_block_inter(enc, mb_x, mb_y, mvr[0][0], mvr[0][1], obmc_edged, &best_rd); + check_block_inter(enc, mb_x, mb_y, 0, 0, obmc_edged, &best_rd); if(tb) - check_block_inter(s, mb_x, mb_y, mvr[-b_stride][0], mvr[-b_stride][1], obmc_edged, &best_rd); + check_block_inter(enc, mb_x, mb_y, mvr[-b_stride][0], mvr[-b_stride][1], obmc_edged, &best_rd); if(lb) - check_block_inter(s, mb_x, mb_y, mvr[-1][0], mvr[-1][1], obmc_edged, &best_rd); + check_block_inter(enc, mb_x, mb_y, mvr[-1][0], mvr[-1][1], obmc_edged, &best_rd); if(rb) - check_block_inter(s, mb_x, mb_y, mvr[1][0], mvr[1][1], obmc_edged, &best_rd); + check_block_inter(enc, mb_x, mb_y, mvr[1][0], mvr[1][1], obmc_edged, &best_rd); if(bb) - check_block_inter(s, mb_x, mb_y, mvr[b_stride][0], mvr[b_stride][1], obmc_edged, &best_rd); + check_block_inter(enc, mb_x, mb_y, mvr[b_stride][0], mvr[b_stride][1], obmc_edged, &best_rd); /* fullpel ME */ //FIXME avoid subpel interpolation / round to nearest integer 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); + int dia_size = enc->iterative_dia_size ? enc->iterative_dia_size : FFMAX(s->avctx->dia_size, 1); dia_change=0; for(i=0; i < dia_size; i++){ for(j=0; jmx+square[i][0], block->my+square[i][1], obmc_edged, &best_rd); + dia_change |= check_block_inter(enc, mb_x, mb_y, block->mx+square[i][0], block->my+square[i][1], obmc_edged, &best_rd); }while(dia_change); //FIXME or try the standard 2 pass qpel or similar @@ -1171,7 +1336,7 @@ static void iterative_me(SnowContext *s){ } best_rd= ref_rd; *block= ref_b; - check_block_intra(s, mb_x, mb_y, color, obmc_edged, &best_rd); + check_block_intra(enc, mb_x, mb_y, color, obmc_edged, &best_rd); //FIXME RD style color selection if(!same_block(block, &backup)){ if(tb ) tb ->type &= ~BLOCK_OPT; @@ -1209,20 +1374,20 @@ static void iterative_me(SnowContext *s){ same_block(b[0], b[3])) continue; - if(!s->me_cache_generation) - memset(s->me_cache, 0, sizeof(s->me_cache)); - s->me_cache_generation += 1<<22; + if (!enc->me_cache_generation) + memset(enc->me_cache, 0, sizeof(enc->me_cache)); + enc->me_cache_generation += 1<<22; - init_rd= best_rd= get_4block_rd(s, mb_x, mb_y, 0); + init_rd = best_rd = get_4block_rd(enc, mb_x, mb_y, 0); //FIXME more multiref search? - check_4block_inter(s, mb_x, mb_y, + check_4block_inter(enc, mb_x, mb_y, (b[0]->mx + b[1]->mx + b[2]->mx + b[3]->mx + 2) >> 2, (b[0]->my + b[1]->my + b[2]->my + b[3]->my + 2) >> 2, 0, &best_rd); for(i=0; i<4; i++) if(!(b[i]->type&BLOCK_INTRA)) - check_4block_inter(s, mb_x, mb_y, b[i]->mx, b[i]->my, b[i]->ref, &best_rd); + check_4block_inter(enc, mb_x, mb_y, b[i]->mx, b[i]->my, b[i]->ref, &best_rd); if(init_rd != best_rd) change++; @@ -1232,13 +1397,15 @@ static void iterative_me(SnowContext *s){ } } -static void encode_blocks(SnowContext *s, int search){ +static void encode_blocks(SnowEncContext *enc, int search) +{ + SnowContext *const s = &enc->com; int x, y; int w= s->b_width; int h= s->b_height; - if(s->motion_est == FF_ME_ITER && !s->keyframe && search) - iterative_me(s); + if (enc->motion_est == FF_ME_ITER && !s->keyframe && search) + iterative_me(enc); for(y=0; yc.bytestream_end - s->c.bytestream < w*MB_SIZE*MB_SIZE*3){ //FIXME nicer limit @@ -1246,10 +1413,10 @@ static void encode_blocks(SnowContext *s, int search){ return; } for(x=0; xmotion_est == FF_ME_ITER || !search) + if (enc->motion_est == FF_ME_ITER || !search) encode_q_branch2(s, 0, x, y); else - encode_q_branch (s, 0, x, y); + encode_q_branch (enc, 0, x, y); } } } @@ -1496,8 +1663,9 @@ static int qscale2qlog(int qscale){ + 61*QROOT/8; ///< 64 > 60 } -static int ratecontrol_1pass(SnowContext *s, AVFrame *pict) +static int ratecontrol_1pass(SnowEncContext *enc, AVFrame *pict) { + SnowContext *const s = &enc->com; /* Estimate the frame's complexity as a sum of weighted dwt coefficients. * FIXME we know exact mv bits at this point, * but ratecontrol isn't set up to include them. */ @@ -1532,17 +1700,17 @@ static int ratecontrol_1pass(SnowContext *s, AVFrame *pict) coef_sum = (uint64_t)coef_sum * coef_sum >> 16; if(pict->pict_type == AV_PICTURE_TYPE_I){ - s->m.mb_var_sum = coef_sum; - s->m.mc_mb_var_sum = 0; + enc->m.mb_var_sum = coef_sum; + enc->m.mc_mb_var_sum = 0; }else{ - s->m.mc_mb_var_sum = coef_sum; - s->m.mb_var_sum = 0; + enc->m.mc_mb_var_sum = coef_sum; + enc->m.mb_var_sum = 0; } - pict->quality= ff_rate_estimate_qscale(&s->m, 1); + pict->quality= ff_rate_estimate_qscale(&enc->m, 1); if (pict->quality < 0) return INT_MIN; - s->lambda= pict->quality * 3/2; + enc->lambda= pict->quality * 3/2; delta_qlog= qscale2qlog(pict->quality) - s->qlog; s->qlog+= delta_qlog; return delta_qlog; @@ -1581,7 +1749,9 @@ static void calculate_visual_weight(SnowContext *s, Plane *p){ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet) { - SnowContext *s = avctx->priv_data; + SnowEncContext *const enc = avctx->priv_data; + SnowContext *const s = &enc->com; + MpegEncContext *const mpv = &enc->m; RangeCoder * const c= &s->c; AVCodecInternal *avci = avctx->internal; AVFrame *pic; @@ -1604,7 +1774,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, memcpy(&s->input_picture->data[i][y * s->input_picture->linesize[i]], &pict->data[i][y * pict->linesize[i]], AV_CEIL_RSHIFT(width, hshift)); - s->mpvencdsp.draw_edges(s->input_picture->data[i], s->input_picture->linesize[i], + enc->mpvencdsp.draw_edges(s->input_picture->data[i], s->input_picture->linesize[i], AV_CEIL_RSHIFT(width, hshift), AV_CEIL_RSHIFT(height, vshift), EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift, EDGE_TOP | EDGE_BOTTOM); @@ -1615,54 +1785,57 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, pic->pict_type = pict->pict_type; pic->quality = pict->quality; - s->m.picture_number= avctx->frame_num; + mpv->picture_number = avctx->frame_num; if(avctx->flags&AV_CODEC_FLAG_PASS2){ - s->m.pict_type = pic->pict_type = s->m.rc_context.entry[avctx->frame_num].new_pict_type; + mpv->pict_type = pic->pict_type = mpv->rc_context.entry[avctx->frame_num].new_pict_type; s->keyframe = pic->pict_type == AV_PICTURE_TYPE_I; if(!(avctx->flags&AV_CODEC_FLAG_QSCALE)) { - pic->quality = ff_rate_estimate_qscale(&s->m, 0); + pic->quality = ff_rate_estimate_qscale(mpv, 0); if (pic->quality < 0) return -1; } }else{ s->keyframe= avctx->gop_size==0 || avctx->frame_num % avctx->gop_size == 0; - s->m.pict_type = pic->pict_type = s->keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P; + mpv->pict_type = pic->pict_type = s->keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P; } - if(s->pass1_rc && avctx->frame_num == 0) + if (enc->pass1_rc && avctx->frame_num == 0) pic->quality = 2*FF_QP2LAMBDA; if (pic->quality) { s->qlog = qscale2qlog(pic->quality); - s->lambda = pic->quality * 3/2; + enc->lambda = pic->quality * 3/2; } if (s->qlog < 0 || (!pic->quality && (avctx->flags & AV_CODEC_FLAG_QSCALE))) { s->qlog= LOSSLESS_QLOG; - s->lambda = 0; + enc->lambda = 0; }//else keep previous frame's qlog until after motion estimation if (s->current_picture->data[0]) { int w = s->avctx->width; int h = s->avctx->height; - s->mpvencdsp.draw_edges(s->current_picture->data[0], - s->current_picture->linesize[0], w , h , - EDGE_WIDTH , EDGE_WIDTH , EDGE_TOP | EDGE_BOTTOM); + enc->mpvencdsp.draw_edges(s->current_picture->data[0], + s->current_picture->linesize[0], w , h , + EDGE_WIDTH , EDGE_WIDTH , EDGE_TOP | EDGE_BOTTOM); if (s->current_picture->data[2]) { - s->mpvencdsp.draw_edges(s->current_picture->data[1], - s->current_picture->linesize[1], w>>s->chroma_h_shift, h>>s->chroma_v_shift, - EDGE_WIDTH>>s->chroma_h_shift, EDGE_WIDTH>>s->chroma_v_shift, EDGE_TOP | EDGE_BOTTOM); - s->mpvencdsp.draw_edges(s->current_picture->data[2], - s->current_picture->linesize[2], w>>s->chroma_h_shift, h>>s->chroma_v_shift, - EDGE_WIDTH>>s->chroma_h_shift, EDGE_WIDTH>>s->chroma_v_shift, EDGE_TOP | EDGE_BOTTOM); + enc->mpvencdsp.draw_edges(s->current_picture->data[1], + s->current_picture->linesize[1], w>>s->chroma_h_shift, h>>s->chroma_v_shift, + EDGE_WIDTH>>s->chroma_h_shift, EDGE_WIDTH>>s->chroma_v_shift, EDGE_TOP | EDGE_BOTTOM); + enc->mpvencdsp.draw_edges(s->current_picture->data[2], + s->current_picture->linesize[2], w>>s->chroma_h_shift, h>>s->chroma_v_shift, + EDGE_WIDTH>>s->chroma_h_shift, EDGE_WIDTH>>s->chroma_v_shift, EDGE_TOP | EDGE_BOTTOM); } emms_c(); } - ff_snow_frame_start(s); + ff_snow_frames_prepare(s); + ret = get_encode_buffer(s, s->current_picture); + if (ret < 0) + return ret; - s->m.current_picture_ptr= &s->m.current_picture; - s->m.current_picture.f = s->current_picture; - s->m.current_picture.f->pts = pict->pts; + mpv->current_picture_ptr = &mpv->current_picture; + mpv->current_picture.f = s->current_picture; + mpv->current_picture.f->pts = pict->pts; if(pic->pict_type == AV_PICTURE_TYPE_P){ int block_width = (width +15)>>4; int block_height= (height+15)>>4; @@ -1671,40 +1844,40 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, av_assert0(s->current_picture->data[0]); av_assert0(s->last_picture[0]->data[0]); - s->m.avctx= s->avctx; - s->m. last_picture.f = s->last_picture[0]; - s->m. new_picture = s->input_picture; - s->m. last_picture_ptr= &s->m. last_picture; - s->m.linesize = stride; - s->m.uvlinesize= s->current_picture->linesize[1]; - s->m.width = width; - s->m.height= height; - s->m.mb_width = block_width; - s->m.mb_height= block_height; - 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 = pic->pict_type; - 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 & AV_CODEC_FLAG_QPEL)!=0; - s->m.out_format= FMT_H263; - s->m.unrestricted_mv= 1; + mpv->avctx = s->avctx; + mpv->last_picture.f = s->last_picture[0]; + mpv-> new_picture = s->input_picture; + mpv->last_picture_ptr = &mpv->last_picture; + mpv->linesize = stride; + mpv->uvlinesize = s->current_picture->linesize[1]; + mpv->width = width; + mpv->height = height; + mpv->mb_width = block_width; + mpv->mb_height = block_height; + mpv->mb_stride = mpv->mb_width + 1; + mpv->b8_stride = 2 * mpv->mb_width + 1; + mpv->f_code = 1; + mpv->pict_type = pic->pict_type; + mpv->motion_est = enc->motion_est; + mpv->me.scene_change_score = 0; + mpv->me.dia_size = avctx->dia_size; + mpv->quarter_sample = (s->avctx->flags & AV_CODEC_FLAG_QPEL)!=0; + mpv->out_format = FMT_H263; + mpv->unrestricted_mv = 1; - s->m.lambda = s->lambda; - s->m.qscale= (s->m.lambda*139 + FF_LAMBDA_SCALE*64) >> (FF_LAMBDA_SHIFT + 7); - s->lambda2= s->m.lambda2= (s->m.lambda*s->m.lambda + FF_LAMBDA_SCALE/2) >> FF_LAMBDA_SHIFT; + mpv->lambda = enc->lambda; + mpv->qscale = (mpv->lambda*139 + FF_LAMBDA_SCALE*64) >> (FF_LAMBDA_SHIFT + 7); + enc->lambda2 = mpv->lambda2 = (mpv->lambda*mpv->lambda + FF_LAMBDA_SCALE/2) >> FF_LAMBDA_SHIFT; - s->m.mecc= s->mecc; //move - s->m.qdsp= s->qdsp; //move - s->m.hdsp = s->hdsp; - ff_init_me(&s->m); - s->hdsp = s->m.hdsp; - s->mecc= s->m.mecc; + mpv->mecc = enc->mecc; //move + mpv->qdsp = enc->qdsp; //move + mpv->hdsp = s->hdsp; + ff_init_me(&enc->m); + s->hdsp = mpv->hdsp; + enc->mecc = mpv->mecc; } - if(s->pass1_rc){ + if (enc->pass1_rc) { memcpy(rc_header_bak, s->header_state, sizeof(s->header_state)); memcpy(rc_block_bak, s->block_state, sizeof(s->block_state)); } @@ -1722,7 +1895,7 @@ redo_frame: return AVERROR(EINVAL); } - s->m.pict_type = pic->pict_type; + mpv->pict_type = pic->pict_type; s->qbias = pic->pict_type == AV_PICTURE_TYPE_P ? 2 : 0; ff_snow_common_init_after_header(avctx); @@ -1734,9 +1907,9 @@ redo_frame: } encode_header(s); - s->m.misc_bits = 8*(s->c.bytestream - s->c.bytestream_start); - encode_blocks(s, 1); - s->m.mv_bits = 8*(s->c.bytestream - s->c.bytestream_start) - s->m.misc_bits; + mpv->misc_bits = 8 * (s->c.bytestream - s->c.bytestream_start); + encode_blocks(enc, 1); + mpv->mv_bits = 8 * (s->c.bytestream - s->c.bytestream_start) - mpv->misc_bits; for(plane_index=0; plane_index < s->nb_planes; plane_index++){ Plane *p= &s->plane[plane_index]; @@ -1745,7 +1918,7 @@ redo_frame: int x, y; // int bits= put_bits_count(&s->c.pb); - if (!s->memc_only) { + if (!enc->memc_only) { //FIXME optimize if(pict->data[plane_index]) //FIXME gray hack for(y=0; ypict_type == AV_PICTURE_TYPE_P && !(avctx->flags&AV_CODEC_FLAG_PASS2) - && s->m.me.scene_change_score > s->scenechange_threshold){ + && mpv->me.scene_change_score > enc->scenechange_threshold) { ff_init_range_encoder(c, pkt->data, pkt->size); ff_build_rac_states(c, (1LL<<32)/20, 256-8); pic->pict_type= AV_PICTURE_TYPE_I; @@ -1783,8 +1956,8 @@ redo_frame: ff_spatial_dwt(s->spatial_dwt_buffer, s->temp_dwt_buffer, w, h, w, s->spatial_decomposition_type, s->spatial_decomposition_count); - if(s->pass1_rc && plane_index==0){ - int delta_qlog = ratecontrol_1pass(s, pic); + if (enc->pass1_rc && plane_index==0) { + int delta_qlog = ratecontrol_1pass(enc, pic); if (delta_qlog <= INT_MIN) return -1; if(delta_qlog){ @@ -1793,7 +1966,7 @@ redo_frame: memcpy(s->header_state, rc_header_bak, sizeof(s->header_state)); memcpy(s->block_state, rc_block_bak, sizeof(s->block_state)); encode_header(s); - encode_blocks(s, 0); + encode_blocks(enc, 0); } } @@ -1804,7 +1977,7 @@ redo_frame: quantize(s, b, b->ibuf, b->buf, b->stride, s->qbias); if(orientation==0) decorrelate(s, b, b->ibuf, b->stride, pic->pict_type == AV_PICTURE_TYPE_P, 0); - if (!s->no_bitstream) + if (!enc->no_bitstream) encode_subband(s, b, b->ibuf, b->parent ? b->parent->ibuf : NULL, b->stride, orientation); av_assert0(b->parent==NULL || b->parent->stride == b->stride*2); if(orientation==0) @@ -1854,7 +2027,7 @@ redo_frame: } } s->avctx->error[plane_index] += error; - s->encoding_error[plane_index] = error; + enc->encoding_error[plane_index] = error; } } @@ -1866,28 +2039,27 @@ redo_frame: s->current_picture->pict_type = pic->pict_type; s->current_picture->quality = pic->quality; - s->m.frame_bits = 8*(s->c.bytestream - s->c.bytestream_start); - s->m.p_tex_bits = s->m.frame_bits - s->m.misc_bits - s->m.mv_bits; - s->m.current_picture.display_picture_number = - s->m.current_picture.coded_picture_number = avctx->frame_num; - s->m.current_picture.f->quality = pic->quality; - s->m.total_bits += 8*(s->c.bytestream - s->c.bytestream_start); - if(s->pass1_rc) - if (ff_rate_estimate_qscale(&s->m, 0) < 0) + mpv->frame_bits = 8 * (s->c.bytestream - s->c.bytestream_start); + mpv->p_tex_bits = mpv->frame_bits - mpv->misc_bits - mpv->mv_bits; + mpv->total_bits += 8*(s->c.bytestream - s->c.bytestream_start); + mpv->current_picture.display_picture_number = + mpv->current_picture.coded_picture_number = avctx->frame_num; + mpv->current_picture.f->quality = pic->quality; + if (enc->pass1_rc) + if (ff_rate_estimate_qscale(mpv, 0) < 0) return -1; if(avctx->flags&AV_CODEC_FLAG_PASS1) - ff_write_pass1_stats(&s->m); - s->m.last_pict_type = s->m.pict_type; + ff_write_pass1_stats(mpv); + mpv->last_pict_type = mpv->pict_type; emms_c(); ff_side_data_set_encoder_stats(pkt, s->current_picture->quality, - s->encoding_error, + enc->encoding_error, (s->avctx->flags&AV_CODEC_FLAG_PSNR) ? SNOW_MAX_PLANES : 0, s->current_picture->pict_type); if (s->avctx->flags & AV_CODEC_FLAG_RECON_FRAME) { - av_frame_unref(avci->recon_frame); - av_frame_ref(avci->recon_frame, s->current_picture); + av_frame_replace(avci->recon_frame, s->current_picture); } pkt->size = ff_rac_terminate(c, 0); @@ -1900,17 +2072,29 @@ redo_frame: static av_cold int encode_end(AVCodecContext *avctx) { - SnowContext *s = avctx->priv_data; + SnowEncContext *const enc = avctx->priv_data; + SnowContext *const s = &enc->com; ff_snow_common_end(s); - ff_rate_control_uninit(&s->m); + ff_rate_control_uninit(&enc->m); av_frame_free(&s->input_picture); + + for (int i = 0; i < MAX_REF_FRAMES; i++) { + av_freep(&s->ref_mvs[i]); + av_freep(&s->ref_scores[i]); + } + + enc->m.me.temp = NULL; + av_freep(&enc->m.me.scratchpad); + av_freep(&enc->m.me.map); + av_freep(&enc->m.sc.obmc_scratchpad); + av_freep(&avctx->stats_out); return 0; } -#define OFFSET(x) offsetof(SnowContext, x) +#define OFFSET(x) offsetof(SnowEncContext, 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_ITER, VE, "motion_est" }, @@ -1949,7 +2133,7 @@ const FFCodec ff_snow_encoder = { .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE | AV_CODEC_CAP_ENCODER_RECON_FRAME, - .priv_data_size = sizeof(SnowContext), + .priv_data_size = sizeof(SnowEncContext), .init = encode_init, FF_CODEC_ENCODE_CB(encode_frame), .close = encode_end, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/speedhqdec.c b/arm/raspi/third_party/ffmpeg/libavcodec/speedhqdec.c index ff106009..f3e84ab3 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/speedhqdec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/speedhqdec.c @@ -506,7 +506,7 @@ static av_cold void compute_alpha_vlcs(void) av_assert0(entry == FF_ARRAY_ELEMS(run_code)); - INIT_LE_VLC_SPARSE_STATIC(&dc_alpha_run_vlc_le, ALPHA_VLC_BITS, + VLC_INIT_LE_SPARSE_STATIC(&dc_alpha_run_vlc_le, ALPHA_VLC_BITS, FF_ARRAY_ELEMS(run_code), run_bits, 1, 1, run_code, 2, 2, @@ -546,7 +546,7 @@ static av_cold void compute_alpha_vlcs(void) av_assert0(entry == FF_ARRAY_ELEMS(level_code)); - INIT_LE_VLC_SPARSE_STATIC(&dc_alpha_level_vlc_le, ALPHA_VLC_BITS, + VLC_INIT_LE_SPARSE_STATIC(&dc_alpha_level_vlc_le, ALPHA_VLC_BITS, FF_ARRAY_ELEMS(level_code), level_bits, 1, 1, level_code, 2, 2, @@ -556,18 +556,18 @@ static av_cold void compute_alpha_vlcs(void) static av_cold void speedhq_static_init(void) { /* Exactly the same as MPEG-2, except for a little-endian reader. */ - INIT_CUSTOM_VLC_STATIC(&dc_lum_vlc_le, DC_VLC_BITS, 12, + VLC_INIT_CUSTOM_STATIC(&dc_lum_vlc_le, DC_VLC_BITS, 12, ff_mpeg12_vlc_dc_lum_bits, 1, 1, ff_mpeg12_vlc_dc_lum_code, 2, 2, - INIT_VLC_OUTPUT_LE, 512); - INIT_CUSTOM_VLC_STATIC(&dc_chroma_vlc_le, DC_VLC_BITS, 12, + VLC_INIT_OUTPUT_LE, 512); + VLC_INIT_CUSTOM_STATIC(&dc_chroma_vlc_le, DC_VLC_BITS, 12, ff_mpeg12_vlc_dc_chroma_bits, 1, 1, ff_mpeg12_vlc_dc_chroma_code, 2, 2, - INIT_VLC_OUTPUT_LE, 514); + VLC_INIT_OUTPUT_LE, 514); ff_init_2d_vlc_rl(ff_speedhq_vlc_table, speedhq_rl_vlc, ff_speedhq_run, ff_speedhq_level, SPEEDHQ_RL_NB_ELEMS, - FF_ARRAY_ELEMS(speedhq_rl_vlc), INIT_VLC_LE); + FF_ARRAY_ELEMS(speedhq_rl_vlc), VLC_INIT_LE); compute_alpha_vlcs(); } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/svq1dec.c b/arm/raspi/third_party/ffmpeg/libavcodec/svq1dec.c index c7269456..8563b291 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/svq1dec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/svq1dec.c @@ -282,7 +282,7 @@ static int svq1_decode_block_non_intra(GetBitContext *bitbuf, uint8_t *pixels, SVQ1_CALC_CODEBOOK_ENTRIES(ff_svq1_inter_codebooks); for (y = 0; y < height; y++) { - for (x = 0; x < width / 4; x++, codebook++) { + for (x = 0; x < width / 4; x++) { n3 = dst[x]; /* add mean value to vector */ n1 = n4 + ((n3 & 0xFF00FF00) >> 8); @@ -290,6 +290,8 @@ static int svq1_decode_block_non_intra(GetBitContext *bitbuf, uint8_t *pixels, SVQ1_ADD_CODEBOOK() /* store result */ dst[x] = n1 << 8 | n2; + if (codebook != NULL) + codebook++; } dst += pitch / 4; } @@ -764,8 +766,7 @@ static int svq1_decode_frame(AVCodecContext *avctx, AVFrame *cur, } if (!s->nonref) { - av_frame_unref(s->prev); - result = av_frame_ref(s->prev, cur); + result = av_frame_replace(s->prev, cur); if (result < 0) return result; } @@ -778,11 +779,11 @@ static int svq1_decode_frame(AVCodecContext *avctx, AVFrame *cur, static av_cold void svq1_static_init(void) { - INIT_VLC_STATIC(&svq1_block_type, SVQ1_BLOCK_TYPE_VLC_BITS, 4, + VLC_INIT_STATIC(&svq1_block_type, SVQ1_BLOCK_TYPE_VLC_BITS, 4, &ff_svq1_block_type_vlc[0][1], 2, 1, &ff_svq1_block_type_vlc[0][0], 2, 1, 8); - INIT_VLC_STATIC(&svq1_motion_component, 7, 33, + VLC_INIT_STATIC(&svq1_motion_component, 7, 33, &ff_mvtab[0][1], 2, 1, &ff_mvtab[0][0], 2, 1, 176); @@ -793,24 +794,24 @@ static av_cold void svq1_static_init(void) svq1_intra_multistage[i].table = &table[offset]; svq1_intra_multistage[i].table_allocated = sizes[0][i]; offset += sizes[0][i]; - init_vlc(&svq1_intra_multistage[i], 3, 8, + vlc_init(&svq1_intra_multistage[i], 3, 8, &ff_svq1_intra_multistage_vlc[i][0][1], 2, 1, &ff_svq1_intra_multistage_vlc[i][0][0], 2, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); svq1_inter_multistage[i].table = &table[offset]; svq1_inter_multistage[i].table_allocated = sizes[1][i]; offset += sizes[1][i]; - init_vlc(&svq1_inter_multistage[i], 3, 8, + vlc_init(&svq1_inter_multistage[i], 3, 8, &ff_svq1_inter_multistage_vlc[i][0][1], 2, 1, &ff_svq1_inter_multistage_vlc[i][0][0], 2, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); } - INIT_VLC_STATIC(&svq1_intra_mean, 8, 256, + VLC_INIT_STATIC(&svq1_intra_mean, 8, 256, &ff_svq1_intra_mean_vlc[0][1], 4, 2, &ff_svq1_intra_mean_vlc[0][0], 4, 2, 632); - INIT_VLC_STATIC(&svq1_inter_mean, 9, 512, + VLC_INIT_STATIC(&svq1_inter_mean, 9, 512, &ff_svq1_inter_mean_vlc[0][1], 4, 2, &ff_svq1_inter_mean_vlc[0][0], 4, 2, 1434); } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/svq1enc.c b/arm/raspi/third_party/ffmpeg/libavcodec/svq1enc.c index 4651e01a..46a484e1 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/svq1enc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/svq1enc.c @@ -26,6 +26,7 @@ * http://www.pcisys.net/~melanson/codecs/ */ +#include "libavutil/emms.h" #include "avcodec.h" #include "codec_internal.h" #include "encode.h" @@ -118,7 +119,7 @@ static void svq1_write_header(SVQ1EncContext *s, PutBitContext *pb, int frame_ty /* output 5 unknown bits (2 + 2 + 1) */ put_bits(pb, 5, 2); /* 2 needed by quicktime decoder */ - i = ff_match_2uint16((void*)ff_svq1_frame_size_table, + i = ff_match_2uint16(ff_svq1_frame_size_table, FF_ARRAY_ELEMS(ff_svq1_frame_size_table), s->frame_width, s->frame_height); put_bits(pb, 3, i); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/tak.c b/arm/raspi/third_party/ffmpeg/libavcodec/tak.c index 99678e98..91feac54 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/tak.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/tak.c @@ -144,11 +144,11 @@ int avpriv_tak_parse_streaminfo(TAKStreamInfo *s, const uint8_t *buf, int size) return tak_parse_streaminfo(s, &gb); } -int ff_tak_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, +int ff_tak_decode_frame_header(void *logctx, GetBitContext *gb, TAKStreamInfo *ti, int log_level_offset) { if (get_bits(gb, TAK_FRAME_HEADER_SYNC_ID_BITS) != TAK_FRAME_HEADER_SYNC_ID) { - av_log(avctx, AV_LOG_ERROR + log_level_offset, "missing sync id\n"); + av_log(logctx, AV_LOG_ERROR + log_level_offset, "missing sync id\n"); return AVERROR_INVALIDDATA; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/tak.h b/arm/raspi/third_party/ffmpeg/libavcodec/tak.h index 5e43598d..1d1ee645 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/tak.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/tak.h @@ -29,7 +29,6 @@ #include -#include "avcodec.h" #include "get_bits.h" #define TAK_FORMAT_DATA_TYPE_BITS 3 @@ -151,13 +150,13 @@ int avpriv_tak_parse_streaminfo(TAKStreamInfo *s, const uint8_t *buf, int size); /** * Validate and decode a frame header. - * @param avctx AVCodecContext to use as av_log() context + * @param logctx for use as av_log() context * @param[in] gb GetBitContext from which to read frame header * @param[out] s frame information * @param log_level_offset log level offset, can be used to silence * error messages. * @return non-zero on error, 0 if OK */ -int ff_tak_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, +int ff_tak_decode_frame_header(void *logctx, GetBitContext *gb, TAKStreamInfo *s, int log_level_offset); #endif /* AVCODEC_TAK_H */ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/tests/.gitignore b/arm/raspi/third_party/ffmpeg/libavcodec/tests/.gitignore index 2acfc4e8..0df4ae10 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/tests/.gitignore +++ b/arm/raspi/third_party/ffmpeg/libavcodec/tests/.gitignore @@ -1,12 +1,12 @@ +/av1_levels /avcodec -/avfft /avpacket +/bitstream_be +/bitstream_le /cabac /celp_math /codec_desc /dct -/fft -/fft-fixed32 /golomb /h264_levels /h265_levels diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/tests/av1_levels.c b/arm/raspi/third_party/ffmpeg/libavcodec/tests/av1_levels.c new file mode 100644 index 00000000..e862d197 --- /dev/null +++ b/arm/raspi/third_party/ffmpeg/libavcodec/tests/av1_levels.c @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2023 Intel Corporation + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include "libavutil/log.h" +#include "libavcodec/av1_levels.h" + +static const struct { + int width; + int height; + float framerate; + int level_idx; +} test_sizes[] = { + { 426, 240, 30.0, 0 }, + { 640, 360, 30.0, 1 }, + { 854, 480, 30.0, 4 }, + { 1280, 720, 30.0, 5 }, + { 1920, 1080, 30.0, 8 }, + { 1920, 1080, 60.0, 9 }, + { 3840, 2160, 30.0, 12 }, + { 3840, 2160, 60.0, 13 }, + { 3840, 2160, 120.0, 14 }, + { 7680, 4320, 30.0, 16 }, + { 7680, 4320, 60.0, 17 }, + { 7680, 4320, 120.0, 18 }, +}; + +static const struct { + int64_t bitrate; + int tier; + int level_idx; +} test_bitrate[] = { + { 1500000, 0, 0 }, + { 3000000, 0, 1 }, + { 6000000, 0, 4 }, + { 10000000, 0, 5 }, + { 12000000, 0, 8 }, + { 30000000, 1, 8 }, + { 20000000, 0, 9 }, + { 50000000, 1, 9 }, + { 30000000, 0, 12 }, + { 100000000, 1, 12 }, + { 40000000, 0, 13 }, + { 160000000, 1, 13 }, + { 60000000, 0, 14 }, + { 240000000, 1, 14 }, + { 100000000, 0, 17 }, + { 480000000, 1, 17 }, + { 160000000, 0, 18 }, + { 800000000, 1, 18 }, +}; + +static const struct { + int tiles; + int tile_cols; + int level_idx; +} test_tiles[] = { + { 8, 4, 0 }, + { 16, 6, 4 }, + { 32, 8, 8 }, + { 64, 8, 12 }, + { 128, 16, 16 }, +}; + +int main(void) +{ + const AV1LevelDescriptor *level; + int i; + +#define CHECK(expected, format, ...) do { \ + if (level ? (level->level_idx != expected) \ + : !level) { \ + av_log(NULL, AV_LOG_ERROR, "Incorrect level for " \ + format ": expected %d, got %d.\n", __VA_ARGS__, \ + expected, level ? level->level_idx : -1); \ + return 1; \ + } \ + } while (0) + + for (i = 0; i < FF_ARRAY_ELEMS(test_sizes); i++) { + level = ff_av1_guess_level(0, 0, + test_sizes[i].width, + test_sizes[i].height, + 0, 0, test_sizes[i].framerate); + CHECK(test_sizes[i].level_idx, "size %dx%d, framerate %f", + test_sizes[i].width, test_sizes[i].height, test_sizes[i].framerate); + } + + for (i = 0; i < FF_ARRAY_ELEMS(test_bitrate); i++) { + level = ff_av1_guess_level(test_bitrate[i].bitrate, + test_bitrate[i].tier, + 0, 0, 0, 0, 0); + CHECK(test_bitrate[i].level_idx, "bitrate %"PRId64" tier %d", + test_bitrate[i].bitrate, test_bitrate[i].tier); + } + + for (i = 0; i < FF_ARRAY_ELEMS(test_tiles); i++) { + level = ff_av1_guess_level(0, 0, 0, 0, + test_tiles[i].tiles, + test_tiles[i].tile_cols, + 0); + CHECK(test_tiles[i].level_idx, "tiles %d, tile cols %d", + test_tiles[i].tiles, + test_tiles[i].tile_cols); + } + + return 0; +} diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/tests/codec_desc.c b/arm/raspi/third_party/ffmpeg/libavcodec/tests/codec_desc.c index c9b34973..bceb91a3 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/tests/codec_desc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/tests/codec_desc.c @@ -16,7 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "libavcodec/avcodec.h" +#include "libavcodec/codec_desc.h" int main(int argc, char **argv) { diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/tests/dct.c b/arm/raspi/third_party/ffmpeg/libavcodec/tests/dct.c index c847af2f..010d0c1a 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/tests/dct.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/tests/dct.c @@ -37,12 +37,14 @@ #include "libavutil/cpu.h" #include "libavutil/common.h" +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "libavutil/lfg.h" #include "libavutil/mem_internal.h" #include "libavutil/time.h" #include "libavcodec/dct.h" +#include "libavcodec/fdctdsp.h" #include "libavcodec/idctdsp.h" #include "libavcodec/simple_idct.h" #include "libavcodec/xvididct.h" diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/tests/h264_levels.c b/arm/raspi/third_party/ffmpeg/libavcodec/tests/h264_levels.c index 98febcc4..af3bfe01 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/tests/h264_levels.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/tests/h264_levels.c @@ -16,7 +16,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "libavutil/common.h" +#include +#include + +#include "libavutil/log.h" +#include "libavutil/macros.h" #include "libavcodec/h264_levels.h" static const struct { diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/tests/motion.c b/arm/raspi/third_party/ffmpeg/libavcodec/tests/motion.c index ef6e1ff3..caa8ecb8 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/tests/motion.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/tests/motion.c @@ -30,6 +30,7 @@ #include "config.h" #include "libavcodec/me_cmp.h" #include "libavutil/cpu.h" +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "libavutil/lfg.h" #include "libavutil/mem.h" diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/thread.h b/arm/raspi/third_party/ffmpeg/libavcodec/thread.h index 88a14cfe..4edcfc31 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/thread.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/thread.h @@ -52,6 +52,8 @@ void ff_thread_flush(AVCodecContext *avctx); int ff_thread_decode_frame(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, AVPacket *avpkt); +int ff_thread_can_start_frame(AVCodecContext *avctx); + /** * If the codec defines update_thread_context(), call this * when they are ready for the next thread to start decoding @@ -62,8 +64,6 @@ int ff_thread_decode_frame(AVCodecContext *avctx, AVFrame *picture, */ void ff_thread_finish_setup(AVCodecContext *avctx); -#define ff_thread_get_format ff_get_format - /** * Wrapper around get_buffer() for frame-multithreaded codecs. * Call this function instead of ff_get_buffer(f). @@ -75,12 +75,7 @@ void ff_thread_finish_setup(AVCodecContext *avctx); int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f, int flags); /** - * Wrapper around release_buffer() frame-for multithreaded codecs. - * Call this function instead of avctx->release_buffer(f). - * The AVFrame will be copied and the actual release_buffer() call - * will be performed later. The contents of data pointed to by the - * AVFrame should not be changed until ff_thread_get_buffer() is called - * on it. + * Wrapper around av_frame_unref() for frame-threaded codecs. * * @param avctx The current context. * @param f The picture being released. diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/threadframe.h b/arm/raspi/third_party/ffmpeg/libavcodec/threadframe.h index d581c408..a8403c89 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/threadframe.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/threadframe.h @@ -87,6 +87,4 @@ int ff_thread_ref_frame(ThreadFrame *dst, const ThreadFrame *src); int ff_thread_replace_frame(AVCodecContext *avctx, ThreadFrame *dst, const ThreadFrame *src); -int ff_thread_can_start_frame(AVCodecContext *avctx); - #endif diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/tiff.c b/arm/raspi/third_party/ffmpeg/libavcodec/tiff.c index 14896459..adb49e45 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/tiff.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/tiff.c @@ -337,7 +337,7 @@ static void av_always_inline dng_blit(TiffContext *s, uint8_t *dst, int dst_stri (split vertically in the middle). */ for (line = 0; line < height / 2; line++) { uint16_t *dst_u16 = (uint16_t *)dst; - uint16_t *src_u16 = (uint16_t *)src; + const uint16_t *src_u16 = (const uint16_t *)src; /* Blit first half of input row row to initial row of output */ for (col = 0; col < width; col++) @@ -360,7 +360,7 @@ static void av_always_inline dng_blit(TiffContext *s, uint8_t *dst, int dst_stri if (is_u16) { for (line = 0; line < height; line++) { uint16_t *dst_u16 = (uint16_t *)dst; - uint16_t *src_u16 = (uint16_t *)src; + const uint16_t *src_u16 = (const uint16_t *)src; for (col = 0; col < width; col++) *dst_u16++ = dng_process_color16(*src_u16++, s->dng_lut, @@ -570,7 +570,7 @@ static int tiff_uncompress_lzma(uint8_t *dst, uint64_t *len, const uint8_t *src, lzma_stream stream = LZMA_STREAM_INIT; lzma_ret ret; - stream.next_in = (uint8_t *)src; + stream.next_in = src; stream.avail_in = size; stream.next_out = dst; stream.avail_out = *len; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/trace_headers_bsf.c b/arm/raspi/third_party/ffmpeg/libavcodec/trace_headers_bsf.c index 028b0a1e..8781f5f1 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/trace_headers_bsf.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/trace_headers_bsf.c @@ -44,6 +44,8 @@ static int trace_headers_init(AVBSFContext *bsf) ctx->cbc->trace_enable = 1; ctx->cbc->trace_level = AV_LOG_INFO; + ctx->cbc->trace_context = ctx->cbc; + ctx->cbc->trace_read_callback = ff_cbs_trace_read_log; if (bsf->par_in->extradata) { CodedBitstreamFragment *frag = &ctx->fragment; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/truemotion2.c b/arm/raspi/third_party/ffmpeg/libavcodec/truemotion2.c index 73c93359..366d8aef 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/truemotion2.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/truemotion2.c @@ -198,7 +198,7 @@ static int tm2_build_huff_table(TM2Context *ctx, TM2Codes *code) /* convert codes to vlc_table */ if (res >= 0) { - res = ff_init_vlc_from_lengths(&code->vlc, huff.max_bits, huff.max_num, + res = ff_vlc_init_from_lengths(&code->vlc, huff.max_bits, huff.max_num, huff.lens, sizeof(huff.lens[0]), NULL, 0, 0, 0, 0, ctx->avctx); if (res < 0) @@ -222,8 +222,7 @@ out: static void tm2_free_codes(TM2Codes *code) { av_free(code->recode); - if (code->vlc.table) - ff_free_vlc(&code->vlc); + ff_vlc_free(&code->vlc); } static inline int tm2_get_token(GetBitContext *gb, TM2Codes *code) diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/tscc2.c b/arm/raspi/third_party/ffmpeg/libavcodec/tscc2.c index 6e4fe503..168efe93 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/tscc2.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/tscc2.c @@ -61,9 +61,9 @@ static av_cold void tscc2_init_vlc(VLC *vlc, int *offset, int nb_codes, vlc->table = &vlc_buf[*offset]; vlc->table_allocated = FF_ARRAY_ELEMS(vlc_buf) - *offset; - ff_init_vlc_from_lengths(vlc, TSCC2_VLC_BITS, nb_codes, + ff_vlc_init_from_lengths(vlc, TSCC2_VLC_BITS, nb_codes, lens, 1, syms, sym_length, sym_length, 0, - INIT_VLC_STATIC_OVERLONG | INIT_VLC_OUTPUT_LE, NULL); + VLC_INIT_STATIC_OVERLONG | VLC_INIT_OUTPUT_LE, NULL); *offset += vlc->table_size; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/tta.c b/arm/raspi/third_party/ffmpeg/libavcodec/tta.c index 3e89571f..7763ed7f 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/tta.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/tta.c @@ -211,7 +211,7 @@ static av_cold int tta_decode_init(AVCodecContext * avctx) av_log(avctx, AV_LOG_DEBUG, "data_length: %d frame_length: %d last: %d total: %d\n", s->data_length, s->frame_length, s->last_frame_length, total_frames); - if(s->frame_length >= UINT_MAX / (s->channels * sizeof(int32_t))){ + if (s->frame_length >= UINT_MAX / (s->channels * sizeof(int32_t))) { av_log(avctx, AV_LOG_ERROR, "frame_length too large\n"); return AVERROR_INVALIDDATA; } @@ -306,14 +306,14 @@ static int tta_decode_frame(AVCodecContext *avctx, AVFrame *frame, rice->sum1 += value - (rice->sum1 >> 4); if (rice->k1 > 0 && rice->sum1 < ff_tta_shift_16[rice->k1]) rice->k1--; - else if(rice->sum1 > ff_tta_shift_16[rice->k1 + 1]) + else if (rice->sum1 > ff_tta_shift_16[rice->k1 + 1]) rice->k1++; value += ff_tta_shift_1[rice->k0]; default: rice->sum0 += value - (rice->sum0 >> 4); if (rice->k0 > 0 && rice->sum0 < ff_tta_shift_16[rice->k0]) rice->k0--; - else if(rice->sum0 > ff_tta_shift_16[rice->k0 + 1]) + else if (rice->sum0 > ff_tta_shift_16[rice->k0 + 1]) rice->k0++; } @@ -342,7 +342,7 @@ static int tta_decode_frame(AVCodecContext *avctx, AVFrame *frame, if (s->channels > 1) { int32_t *r = p - 1; for (*p += *r / 2; r > (int32_t*)p - s->channels; r--) - *r = *(r + 1) - *r; + *r = *(r + 1) - (unsigned)*r; } cur_chan = 0; i++; @@ -399,7 +399,8 @@ error: return ret; } -static av_cold int tta_decode_close(AVCodecContext *avctx) { +static av_cold int tta_decode_close(AVCodecContext *avctx) +{ TTAContext *s = avctx->priv_data; if (s->bps < 3) diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/ttadata.c b/arm/raspi/third_party/ffmpeg/libavcodec/ttadata.c index 297d7094..2137a230 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/ttadata.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/ttadata.c @@ -47,7 +47,8 @@ void ff_tta_rice_init(TTARice *c, uint32_t k0, uint32_t k1) c->sum1 = ff_tta_shift_16[k1]; } -void ff_tta_filter_init(TTAFilter *c, int32_t shift) { +void ff_tta_filter_init(TTAFilter *c, int32_t shift) +{ memset(c, 0, sizeof(TTAFilter)); c->shift = shift; c->round = ff_tta_shift_1[shift-1]; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/ttadsp.c b/arm/raspi/third_party/ffmpeg/libavcodec/ttadsp.c index fe9e3c69..5dda1958 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/ttadsp.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/ttadsp.c @@ -22,7 +22,8 @@ static void tta_filter_process_c(int32_t *qmi, int32_t *dx, int32_t *dl, int32_t *error, int32_t *in, int32_t shift, - int32_t round) { + int32_t round) +{ uint32_t *qm = qmi; if (*error < 0) { diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/ttmlenc.c b/arm/raspi/third_party/ffmpeg/libavcodec/ttmlenc.c index fb05c389..6a2ab23c 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/ttmlenc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/ttmlenc.c @@ -45,7 +45,7 @@ typedef struct { static void ttml_text_cb(void *priv, const char *text, int len) { TTMLContext *s = priv; - AVBPrint cur_line = { 0 }; + AVBPrint cur_line; AVBPrint *buffer = &s->buffer; av_bprint_init(&cur_line, len, AV_BPRINT_SIZE_UNLIMITED); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/utils.c b/arm/raspi/third_party/ffmpeg/libavcodec/utils.c index 672eb15d..8807a8c2 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/utils.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/utils.c @@ -35,7 +35,9 @@ #include "libavutil/pixfmt.h" #include "avcodec.h" #include "codec.h" +#include "codec_desc.h" #include "codec_internal.h" +#include "codec_par.h" #include "decode.h" #include "hwconfig.h" #include "thread.h" @@ -406,34 +408,6 @@ int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels, return ret; } -void ff_color_frame(AVFrame *frame, const int c[4]) -{ - const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format); - int p, y; - - av_assert0(desc->flags & AV_PIX_FMT_FLAG_PLANAR); - - for (p = 0; pnb_components; p++) { - uint8_t *dst = frame->data[p]; - int is_chroma = p == 1 || p == 2; - int bytes = is_chroma ? AV_CEIL_RSHIFT(frame->width, desc->log2_chroma_w) : frame->width; - int height = is_chroma ? AV_CEIL_RSHIFT(frame->height, desc->log2_chroma_h) : frame->height; - if (desc->comp[0].depth >= 9) { - ((uint16_t*)dst)[0] = c[p]; - av_memcpy_backptr(dst + 2, 2, bytes - 2); - dst += frame->linesize[p]; - for (y = 1; y < height; y++) { - memcpy(dst, frame->data[p], 2*bytes); - dst += frame->linesize[p]; - } - } else { - for (y = 0; y < height; y++) { - memset(dst, c[p], bytes); - dst += frame->linesize[p]; - } - } - } -} int avpriv_codec_get_cap_skip_frame_fill_param(const AVCodec *codec){ return !!(ffcodec(codec)->caps_internal & FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM); @@ -462,10 +436,10 @@ const char *avcodec_get_name(enum AVCodecID id) const char *av_get_profile_name(const AVCodec *codec, int profile) { const AVProfile *p; - if (profile == FF_PROFILE_UNKNOWN || !codec->profiles) + if (profile == AV_PROFILE_UNKNOWN || !codec->profiles) return NULL; - for (p = codec->profiles; p->profile != FF_PROFILE_UNKNOWN; p++) + for (p = codec->profiles; p->profile != AV_PROFILE_UNKNOWN; p++) if (p->profile == profile) return p->name; @@ -477,10 +451,10 @@ const char *avcodec_profile_name(enum AVCodecID codec_id, int profile) const AVCodecDescriptor *desc = avcodec_descriptor_get(codec_id); const AVProfile *p; - if (profile == FF_PROFILE_UNKNOWN || !desc || !desc->profiles) + if (profile == AV_PROFILE_UNKNOWN || !desc || !desc->profiles) return NULL; - for (p = desc->profiles; p->profile != FF_PROFILE_UNKNOWN; p++) + for (p = desc->profiles; p->profile != AV_PROFILE_UNKNOWN; p++) if (p->profile == profile) return p->name; @@ -1046,37 +1020,6 @@ AVCPBProperties *av_cpb_properties_alloc(size_t *size) return props; } -AVCPBProperties *ff_add_cpb_side_data(AVCodecContext *avctx) -{ - AVPacketSideData *tmp; - AVCPBProperties *props; - size_t size; - int i; - - for (i = 0; i < avctx->nb_coded_side_data; i++) - if (avctx->coded_side_data[i].type == AV_PKT_DATA_CPB_PROPERTIES) - return (AVCPBProperties *)avctx->coded_side_data[i].data; - - props = av_cpb_properties_alloc(&size); - if (!props) - return NULL; - - tmp = av_realloc_array(avctx->coded_side_data, avctx->nb_coded_side_data + 1, sizeof(*tmp)); - if (!tmp) { - av_freep(&props); - return NULL; - } - - avctx->coded_side_data = tmp; - avctx->nb_coded_side_data++; - - avctx->coded_side_data[avctx->nb_coded_side_data - 1].type = AV_PKT_DATA_CPB_PROPERTIES; - avctx->coded_side_data[avctx->nb_coded_side_data - 1].data = (uint8_t*)props; - avctx->coded_side_data[avctx->nb_coded_side_data - 1].size = size; - - return props; -} - static unsigned bcd2uint(uint8_t bcd) { unsigned low = bcd & 0xf; @@ -1170,22 +1113,3 @@ int64_t ff_guess_coded_bitrate(AVCodecContext *avctx) return bitrate; } - -int ff_int_from_list_or_default(void *ctx, const char * val_name, int val, - const int * array_valid_values, int default_value) -{ - int i = 0, ref_val; - - while (1) { - ref_val = array_valid_values[i]; - if (ref_val == INT_MAX) - break; - if (val == ref_val) - return val; - i++; - } - /* val is not a valid value */ - av_log(ctx, AV_LOG_DEBUG, - "%s %d are not supported. Set to default value : %d\n", val_name, val, default_value); - return default_value; -} diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/utvideo.h b/arm/raspi/third_party/ffmpeg/libavcodec/utvideo.h index 9da9329f..b081b50a 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/utvideo.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/utvideo.h @@ -27,12 +27,7 @@ * Common Ut Video header */ -#include "libavutil/common.h" -#include "avcodec.h" -#include "bswapdsp.h" -#include "utvideodsp.h" -#include "lossless_videodsp.h" -#include "lossless_videoencdsp.h" +#include "libavutil/macros.h" enum { PRED_NONE = 0, @@ -61,31 +56,4 @@ enum { UTVIDEO_444 = MKTAG('Y', 'V', '2', '4'), }; -typedef struct UtvideoContext { - const AVClass *class; - AVCodecContext *avctx; - UTVideoDSPContext utdsp; - BswapDSPContext bdsp; - LLVidDSPContext llviddsp; - LLVidEncDSPContext llvidencdsp; - - uint32_t frame_info_size, flags, frame_info, offset; - int planes; - int slices; - int compression; - int interlaced; - int frame_pred; - int pro; - int pack; - - ptrdiff_t slice_stride; - uint8_t *slice_bits, *slice_buffer[4]; - int slice_bits_size; - - const uint8_t *packed_stream[4][256]; - size_t packed_stream_size[4][256]; - const uint8_t *control_stream[4][256]; - size_t control_stream_size[4][256]; -} UtvideoContext; - #endif /* AVCODEC_UTVIDEO_H */ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/utvideodec.c b/arm/raspi/third_party/ffmpeg/libavcodec/utvideodec.c index 66c84352..8a815f55 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/utvideodec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/utvideodec.c @@ -37,8 +37,35 @@ #include "bytestream.h" #include "codec_internal.h" #include "get_bits.h" +#include "lossless_videodsp.h" #include "thread.h" #include "utvideo.h" +#include "utvideodsp.h" + +typedef struct UtvideoContext { + AVCodecContext *avctx; + UTVideoDSPContext utdsp; + BswapDSPContext bdsp; + LLVidDSPContext llviddsp; + + uint32_t frame_info_size, flags, frame_info, offset; + int planes; + int slices; + int compression; + int interlaced; + int frame_pred; + int pro; + int pack; + + uint8_t *slice_bits; + int slice_bits_size; + void *buffer; + + const uint8_t *packed_stream[4][256]; + size_t packed_stream_size[4][256]; + const uint8_t *control_stream[4][256]; + size_t control_stream_size[4][256]; +} UtvideoContext; typedef struct HuffEntry { uint8_t len; @@ -46,7 +73,7 @@ typedef struct HuffEntry { } HuffEntry; static int build_huff(UtvideoContext *c, const uint8_t *src, VLC *vlc, - int *fsym, unsigned nb_elems) + VLC_MULTI *multi, int *fsym, unsigned nb_elems) { int i; HuffEntry he[1024]; @@ -82,11 +109,35 @@ static int build_huff(UtvideoContext *c, const uint8_t *src, VLC *vlc, he[--codes_count[bits[i]]] = (HuffEntry) { bits[i], i }; #define VLC_BITS 11 - return ff_init_vlc_from_lengths(vlc, VLC_BITS, codes_count[0], + return ff_vlc_init_multi_from_lengths(vlc, multi, VLC_BITS, nb_elems, codes_count[0], &he[0].len, sizeof(*he), &he[0].sym, sizeof(*he), 2, 0, 0, c->avctx); } +#define READ_PLANE(b, end) \ +{ \ + buf = !use_pred ? dest : c->buffer; \ + i = 0; \ + for (; CACHED_BITSTREAM_READER && i < width-end && get_bits_left(&gb) > 0;) {\ + ret = get_vlc_multi(&gb, (uint8_t *)buf + i * b, multi.table, \ + vlc.table, VLC_BITS, 3); \ + if (ret > 0) \ + i += ret; \ + if (ret <= 0) \ + goto fail; \ + } \ + for (; i < width && get_bits_left(&gb) > 0; i++) \ + buf[i] = get_vlc2(&gb, vlc.table, VLC_BITS, 3); \ + if (use_pred) { \ + if (b == 2) \ + c->llviddsp.add_left_pred_int16((uint16_t *)dest, (const uint16_t *)buf, 0x3ff, width, prev); \ + else \ + c->llviddsp.add_left_pred((uint8_t *)dest, (const uint8_t *)buf, width, prev); \ + } \ + prev = dest[width-1]; \ + dest += stride; \ +} + static int decode_plane10(UtvideoContext *c, int plane_no, uint16_t *dst, ptrdiff_t stride, int width, int height, @@ -95,11 +146,12 @@ static int decode_plane10(UtvideoContext *c, int plane_no, { int i, j, slice, pix, ret; int sstart, send; + VLC_MULTI multi; VLC vlc; GetBitContext gb; int prev, fsym; - if ((ret = build_huff(c, huff, &vlc, &fsym, 1024)) < 0) { + if ((ret = build_huff(c, huff, &vlc, &multi, &fsym, 1024)) < 0) { av_log(c->avctx, AV_LOG_ERROR, "Cannot build Huffman codes\n"); return ret; } @@ -131,7 +183,7 @@ static int decode_plane10(UtvideoContext *c, int plane_no, send = 0; for (slice = 0; slice < c->slices; slice++) { - uint16_t *dest; + uint16_t *dest, *buf; int slice_data_start, slice_data_end, slice_size; sstart = send; @@ -156,37 +208,20 @@ static int decode_plane10(UtvideoContext *c, int plane_no, init_get_bits(&gb, c->slice_bits, slice_size * 8); prev = 0x200; - for (j = sstart; j < send; j++) { - for (i = 0; i < width; i++) { - pix = get_vlc2(&gb, vlc.table, VLC_BITS, 3); - if (pix < 0) { - av_log(c->avctx, AV_LOG_ERROR, "Decoding error\n"); - goto fail; - } - if (use_pred) { - prev += pix; - prev &= 0x3FF; - pix = prev; - } - dest[i] = pix; - } - dest += stride; - if (get_bits_left(&gb) < 0) { - av_log(c->avctx, AV_LOG_ERROR, - "Slice decoding ran out of bits\n"); - goto fail; - } - } + for (j = sstart; j < send; j++) + READ_PLANE(2, 3) if (get_bits_left(&gb) > 32) av_log(c->avctx, AV_LOG_WARNING, "%d bits left after decoding slice\n", get_bits_left(&gb)); } - ff_free_vlc(&vlc); + ff_vlc_free(&vlc); + ff_vlc_free_multi(&multi); return 0; fail: - ff_free_vlc(&vlc); + ff_vlc_free(&vlc); + ff_vlc_free_multi(&multi); return AVERROR_INVALIDDATA; } @@ -207,6 +242,7 @@ static int decode_plane(UtvideoContext *c, int plane_no, { int i, j, slice, pix; int sstart, send; + VLC_MULTI multi; VLC vlc; GetBitContext gb; int ret, prev, fsym; @@ -259,7 +295,7 @@ static int decode_plane(UtvideoContext *c, int plane_no, return 0; } - if (build_huff(c, src, &vlc, &fsym, 256)) { + if (build_huff(c, src, &vlc, &multi, &fsym, 256)) { av_log(c->avctx, AV_LOG_ERROR, "Cannot build Huffman codes\n"); return AVERROR_INVALIDDATA; } @@ -292,7 +328,7 @@ static int decode_plane(UtvideoContext *c, int plane_no, send = 0; for (slice = 0; slice < c->slices; slice++) { - uint8_t *dest; + uint8_t *dest, *buf; int slice_data_start, slice_data_end, slice_size; sstart = send; @@ -317,36 +353,20 @@ static int decode_plane(UtvideoContext *c, int plane_no, init_get_bits(&gb, c->slice_bits, slice_size * 8); prev = 0x80; - for (j = sstart; j < send; j++) { - for (i = 0; i < width; i++) { - pix = get_vlc2(&gb, vlc.table, VLC_BITS, 3); - if (pix < 0) { - av_log(c->avctx, AV_LOG_ERROR, "Decoding error\n"); - goto fail; - } - if (use_pred) { - prev += pix; - pix = prev; - } - dest[i] = pix; - } - if (get_bits_left(&gb) < 0) { - av_log(c->avctx, AV_LOG_ERROR, - "Slice decoding ran out of bits\n"); - goto fail; - } - dest += stride; - } + for (j = sstart; j < send; j++) + READ_PLANE(1, 5) if (get_bits_left(&gb) > 32) av_log(c->avctx, AV_LOG_WARNING, "%d bits left after decoding slice\n", get_bits_left(&gb)); } - ff_free_vlc(&vlc); + ff_vlc_free(&vlc); + ff_vlc_free_multi(&multi); return 0; fail: - ff_free_vlc(&vlc); + ff_vlc_free(&vlc); + ff_vlc_free_multi(&multi); return AVERROR_INVALIDDATA; } @@ -1039,6 +1059,10 @@ static av_cold int decode_init(AVCodecContext *avctx) return AVERROR_INVALIDDATA; } + c->buffer = av_calloc(avctx->width + 8, c->pro?2:1); + if (!c->buffer) + return AVERROR(ENOMEM); + return 0; } @@ -1047,6 +1071,7 @@ static av_cold int decode_end(AVCodecContext *avctx) UtvideoContext * const c = avctx->priv_data; av_freep(&c->slice_bits); + av_freep(&c->buffer); return 0; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/utvideoenc.c b/arm/raspi/third_party/ffmpeg/libavcodec/utvideoenc.c index 6e87bbc2..1fcb6854 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/utvideoenc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/utvideoenc.c @@ -33,11 +33,28 @@ #include "encode.h" #include "bswapdsp.h" #include "bytestream.h" +#include "lossless_videoencdsp.h" #include "put_bits.h" #include "mathops.h" #include "utvideo.h" #include "huffman.h" +typedef struct UtvideoContext { + const AVClass *class; + BswapDSPContext bdsp; + LLVidEncDSPContext llvidencdsp; + + uint32_t frame_info_size, flags; + int planes; + int slices; + int compression; + int frame_pred; + + ptrdiff_t slice_stride; + uint8_t *slice_bits, *slice_buffer[4]; + int slice_bits_size; +} UtvideoContext; + typedef struct HuffEntry { uint16_t sym; uint8_t len; @@ -76,7 +93,6 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx) int i, subsampled_height; uint32_t original_format; - c->avctx = avctx; c->frame_info_size = 4; c->slice_stride = FFALIGN(avctx->width, 32); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/v210dec.c b/arm/raspi/third_party/ffmpeg/libavcodec/v210dec.c index 814d65bb..d80fb4e7 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/v210dec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/v210dec.c @@ -33,7 +33,7 @@ typedef struct ThreadData { AVFrame *frame; - uint8_t *buf; + const uint8_t *buf; int stride; } ThreadData; @@ -111,7 +111,7 @@ static int v210_decode_slice(AVCodecContext *avctx, void *arg, int jobnr, int th int stride = td->stride; int slice_start = (avctx->height * jobnr) / s->thread_count; int slice_end = (avctx->height * (jobnr+1)) / s->thread_count; - uint8_t *psrc = td->buf + stride * slice_start; + const uint8_t *psrc = td->buf + stride * slice_start; int16_t *py = (uint16_t*)frame->data[0] + slice_start * frame->linesize[0] / 2; int16_t *pu = (uint16_t*)frame->data[1] + slice_start * frame->linesize[1] / 2; int16_t *pv = (uint16_t*)frame->data[2] + slice_start * frame->linesize[2] / 2; @@ -191,7 +191,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *pic, if (stride) { td.stride = stride; - td.buf = (uint8_t*)psrc; + td.buf = psrc; td.frame = pic; avctx->execute2(avctx, v210_decode_slice, &td, NULL, s->thread_count); } else { @@ -201,7 +201,8 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *pic, if (ret < 0) return ret; decode_row((const uint32_t *)psrc, (uint16_t *)pointers[0], (uint16_t *)pointers[1], (uint16_t *)pointers[2], avctx->width * avctx->height, s->unpack_frame); - av_image_copy(pic->data, pic->linesize, (const uint8_t **)pointers, linesizes, avctx->pix_fmt, avctx->width, avctx->height); + av_image_copy2(pic->data, pic->linesize, pointers, linesizes, + avctx->pix_fmt, avctx->width, avctx->height); av_freep(&pointers[0]); } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/v4l2_context.c b/arm/raspi/third_party/ffmpeg/libavcodec/v4l2_context.c index a40be946..f20f713e 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/v4l2_context.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/v4l2_context.c @@ -325,9 +325,13 @@ start: /* 0. handle errors */ if (pfd.revents & POLLERR) { - /* if we are trying to get free buffers but none have been queued yet - no need to raise a warning */ + /* if we are trying to get free buffers but none have been queued yet, + * or if no buffers have been allocated yet, no need to raise a warning + */ if (timeout == 0) { + if (!ctx->buffers) + return NULL; + for (i = 0; i < ctx->num_buffers; i++) { if (ctx->buffers[i].status != V4L2BUF_AVAILABLE) av_log(logger(ctx), AV_LOG_WARNING, "%s POLLERR\n", ctx->name); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/v4l2_m2m_enc.c b/arm/raspi/third_party/ffmpeg/libavcodec/v4l2_m2m_enc.c index 9a0837ec..e08db5d5 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/v4l2_m2m_enc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/v4l2_m2m_enc.c @@ -103,17 +103,17 @@ static inline unsigned int v4l2_h264_profile_from_ff(int p) unsigned int ffmpeg_val; unsigned int v4l2_val; } profile[] = { - { FF_PROFILE_H264_CONSTRAINED_BASELINE, MPEG_VIDEO(H264_PROFILE_CONSTRAINED_BASELINE) }, - { FF_PROFILE_H264_HIGH_444_PREDICTIVE, MPEG_VIDEO(H264_PROFILE_HIGH_444_PREDICTIVE) }, - { FF_PROFILE_H264_HIGH_422_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_422_INTRA) }, - { FF_PROFILE_H264_HIGH_444_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_444_INTRA) }, - { FF_PROFILE_H264_HIGH_10_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_10_INTRA) }, - { FF_PROFILE_H264_HIGH_422, MPEG_VIDEO(H264_PROFILE_HIGH_422) }, - { FF_PROFILE_H264_BASELINE, MPEG_VIDEO(H264_PROFILE_BASELINE) }, - { FF_PROFILE_H264_EXTENDED, MPEG_VIDEO(H264_PROFILE_EXTENDED) }, - { FF_PROFILE_H264_HIGH_10, MPEG_VIDEO(H264_PROFILE_HIGH_10) }, - { FF_PROFILE_H264_MAIN, MPEG_VIDEO(H264_PROFILE_MAIN) }, - { FF_PROFILE_H264_HIGH, MPEG_VIDEO(H264_PROFILE_HIGH) }, + { AV_PROFILE_H264_CONSTRAINED_BASELINE, MPEG_VIDEO(H264_PROFILE_CONSTRAINED_BASELINE) }, + { AV_PROFILE_H264_HIGH_444_PREDICTIVE, MPEG_VIDEO(H264_PROFILE_HIGH_444_PREDICTIVE) }, + { AV_PROFILE_H264_HIGH_422_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_422_INTRA) }, + { AV_PROFILE_H264_HIGH_444_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_444_INTRA) }, + { AV_PROFILE_H264_HIGH_10_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_10_INTRA) }, + { AV_PROFILE_H264_HIGH_422, MPEG_VIDEO(H264_PROFILE_HIGH_422) }, + { AV_PROFILE_H264_BASELINE, MPEG_VIDEO(H264_PROFILE_BASELINE) }, + { AV_PROFILE_H264_EXTENDED, MPEG_VIDEO(H264_PROFILE_EXTENDED) }, + { AV_PROFILE_H264_HIGH_10, MPEG_VIDEO(H264_PROFILE_HIGH_10) }, + { AV_PROFILE_H264_MAIN, MPEG_VIDEO(H264_PROFILE_MAIN) }, + { AV_PROFILE_H264_HIGH, MPEG_VIDEO(H264_PROFILE_HIGH) }, }; int i; @@ -130,11 +130,11 @@ static inline int v4l2_mpeg4_profile_from_ff(int p) unsigned int ffmpeg_val; unsigned int v4l2_val; } profile[] = { - { FF_PROFILE_MPEG4_ADVANCED_CODING, MPEG_VIDEO(MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY) }, - { FF_PROFILE_MPEG4_ADVANCED_SIMPLE, MPEG_VIDEO(MPEG4_PROFILE_ADVANCED_SIMPLE) }, - { FF_PROFILE_MPEG4_SIMPLE_SCALABLE, MPEG_VIDEO(MPEG4_PROFILE_SIMPLE_SCALABLE) }, - { FF_PROFILE_MPEG4_SIMPLE, MPEG_VIDEO(MPEG4_PROFILE_SIMPLE) }, - { FF_PROFILE_MPEG4_CORE, MPEG_VIDEO(MPEG4_PROFILE_CORE) }, + { AV_PROFILE_MPEG4_ADVANCED_CODING, MPEG_VIDEO(MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY) }, + { AV_PROFILE_MPEG4_ADVANCED_SIMPLE, MPEG_VIDEO(MPEG4_PROFILE_ADVANCED_SIMPLE) }, + { AV_PROFILE_MPEG4_SIMPLE_SCALABLE, MPEG_VIDEO(MPEG4_PROFILE_SIMPLE_SCALABLE) }, + { AV_PROFILE_MPEG4_SIMPLE, MPEG_VIDEO(MPEG4_PROFILE_SIMPLE) }, + { AV_PROFILE_MPEG4_CORE, MPEG_VIDEO(MPEG4_PROFILE_CORE) }, }; int i; @@ -206,7 +206,7 @@ static int v4l2_prepare_encoder(V4L2m2mContext *s) switch (avctx->codec_id) { case AV_CODEC_ID_H264: - if (avctx->profile != FF_PROFILE_UNKNOWN) { + if (avctx->profile != AV_PROFILE_UNKNOWN) { val = v4l2_h264_profile_from_ff(avctx->profile); if (val < 0) av_log(avctx, AV_LOG_WARNING, "h264 profile not found\n"); @@ -219,7 +219,7 @@ static int v4l2_prepare_encoder(V4L2m2mContext *s) qmax = 51; break; case AV_CODEC_ID_MPEG4: - if (avctx->profile != FF_PROFILE_UNKNOWN) { + if (avctx->profile != AV_PROFILE_UNKNOWN) { val = v4l2_mpeg4_profile_from_ff(avctx->profile); if (val < 0) av_log(avctx, AV_LOG_WARNING, "mpeg4 profile not found\n"); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_av1.c b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_av1.c index d0339b27..85b50843 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_av1.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_av1.c @@ -19,8 +19,7 @@ */ #include "libavutil/frame.h" -#include "libavutil/pixdesc.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "vaapi_decode.h" #include "internal.h" #include "av1dec.h" @@ -434,11 +433,11 @@ static int vaapi_av1_decode_slice(AVCodecContext *avctx, return 0; } -const AVHWAccel ff_av1_vaapi_hwaccel = { - .name = "av1_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AV1, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_av1_vaapi_hwaccel = { + .p.name = "av1_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = vaapi_av1_start_frame, .end_frame = vaapi_av1_end_frame, .decode_slice = vaapi_av1_decode_slice, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_decode.c b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_decode.c index dd55cbd6..ceac769c 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_decode.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_decode.c @@ -23,6 +23,7 @@ #include "libavutil/pixdesc.h" #include "avcodec.h" +#include "codec_desc.h" #include "decode.h" #include "internal.h" #include "vaapi_decode.h" @@ -390,7 +391,7 @@ static const struct { VAProfile va_profile; VAProfile (*profile_parser)(AVCodecContext *avctx); } vaapi_profile_map[] = { -#define MAP(c, p, v, ...) { AV_CODEC_ID_ ## c, FF_PROFILE_ ## p, VAProfile ## v, __VA_ARGS__ } +#define MAP(c, p, v, ...) { AV_CODEC_ID_ ## c, AV_PROFILE_ ## p, VAProfile ## v, __VA_ARGS__ } MAP(MPEG2VIDEO, MPEG2_SIMPLE, MPEG2Simple ), MAP(MPEG2VIDEO, MPEG2_MAIN, MPEG2Main ), MAP(H263, UNKNOWN, H263Baseline), @@ -497,7 +498,7 @@ static int vaapi_decode_make_config(AVCodecContext *avctx, if (avctx->codec_id != vaapi_profile_map[i].codec_id) continue; if (avctx->profile == vaapi_profile_map[i].codec_profile || - vaapi_profile_map[i].codec_profile == FF_PROFILE_UNKNOWN) + vaapi_profile_map[i].codec_profile == AV_PROFILE_UNKNOWN) profile_match = 1; va_profile = vaapi_profile_map[i].profile_parser ? diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode.c b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode.c index bfca315a..e3820956 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode.c @@ -276,21 +276,34 @@ static int vaapi_encode_issue(AVCodecContext *avctx, av_log(avctx, AV_LOG_DEBUG, "Issuing encode for pic %"PRId64"/%"PRId64" " "as type %s.\n", pic->display_order, pic->encode_order, picture_type_name[pic->type]); - if (pic->nb_refs == 0) { + if (pic->nb_refs[0] == 0 && pic->nb_refs[1] == 0) { av_log(avctx, AV_LOG_DEBUG, "No reference pictures.\n"); } else { - av_log(avctx, AV_LOG_DEBUG, "Refers to:"); - for (i = 0; i < pic->nb_refs; i++) { + av_log(avctx, AV_LOG_DEBUG, "L0 refers to"); + for (i = 0; i < pic->nb_refs[0]; i++) { av_log(avctx, AV_LOG_DEBUG, " %"PRId64"/%"PRId64, - pic->refs[i]->display_order, pic->refs[i]->encode_order); + pic->refs[0][i]->display_order, pic->refs[0][i]->encode_order); } av_log(avctx, AV_LOG_DEBUG, ".\n"); + + if (pic->nb_refs[1]) { + av_log(avctx, AV_LOG_DEBUG, "L1 refers to"); + for (i = 0; i < pic->nb_refs[1]; i++) { + av_log(avctx, AV_LOG_DEBUG, " %"PRId64"/%"PRId64, + pic->refs[1][i]->display_order, pic->refs[1][i]->encode_order); + } + av_log(avctx, AV_LOG_DEBUG, ".\n"); + } } av_assert0(!pic->encode_issued); - for (i = 0; i < pic->nb_refs; i++) { - av_assert0(pic->refs[i]); - av_assert0(pic->refs[i]->encode_issued); + for (i = 0; i < pic->nb_refs[0]; i++) { + av_assert0(pic->refs[0][i]); + av_assert0(pic->refs[0][i]->encode_issued); + } + for (i = 0; i < pic->nb_refs[1]; i++) { + av_assert0(pic->refs[1][i]); + av_assert0(pic->refs[1][i]->encode_issued); } av_log(avctx, AV_LOG_DEBUG, "Input surface is %#x.\n", pic->input_surface); @@ -650,46 +663,11 @@ fail_at_end: return err; } -static int vaapi_encode_output(AVCodecContext *avctx, - VAAPIEncodePicture *pic, AVPacket *pkt) +static int vaapi_encode_set_output_property(AVCodecContext *avctx, + VAAPIEncodePicture *pic, + AVPacket *pkt) { VAAPIEncodeContext *ctx = avctx->priv_data; - VACodedBufferSegment *buf_list, *buf; - VAStatus vas; - int total_size = 0; - uint8_t *ptr; - int err; - - err = vaapi_encode_wait(avctx, pic); - if (err < 0) - return err; - - buf_list = NULL; - vas = vaMapBuffer(ctx->hwctx->display, pic->output_buffer, - (void**)&buf_list); - if (vas != VA_STATUS_SUCCESS) { - av_log(avctx, AV_LOG_ERROR, "Failed to map output buffers: " - "%d (%s).\n", vas, vaErrorStr(vas)); - err = AVERROR(EIO); - goto fail; - } - - for (buf = buf_list; buf; buf = buf->next) - total_size += buf->size; - - err = ff_get_encode_buffer(avctx, pkt, total_size, 0); - ptr = pkt->data; - - if (err < 0) - goto fail_mapped; - - for (buf = buf_list; buf; buf = buf->next) { - av_log(avctx, AV_LOG_DEBUG, "Output buffer: %u bytes " - "(status %08x).\n", buf->size, buf->status); - - memcpy(ptr, buf->buf, buf->size); - ptr += buf->size; - } if (pic->type == PICTURE_TYPE_IDR) pkt->flags |= AV_PKT_FLAG_KEY; @@ -697,14 +675,6 @@ static int vaapi_encode_output(AVCodecContext *avctx, pkt->pts = pic->pts; pkt->duration = pic->duration; - vas = vaUnmapBuffer(ctx->hwctx->display, pic->output_buffer); - if (vas != VA_STATUS_SUCCESS) { - av_log(avctx, AV_LOG_ERROR, "Failed to unmap output buffers: " - "%d (%s).\n", vas, vaErrorStr(vas)); - err = AVERROR(EIO); - goto fail; - } - // for no-delay encoders this is handled in generic codec if (avctx->codec->capabilities & AV_CODEC_CAP_DELAY && avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { @@ -713,16 +683,180 @@ static int vaapi_encode_output(AVCodecContext *avctx, pic->opaque_ref = NULL; } + if (ctx->codec->flags & FLAG_TIMESTAMP_NO_DELAY) { + pkt->dts = pkt->pts; + return 0; + } + + if (ctx->output_delay == 0) { + pkt->dts = pkt->pts; + } else if (pic->encode_order < ctx->decode_delay) { + if (ctx->ts_ring[pic->encode_order] < INT64_MIN + ctx->dts_pts_diff) + pkt->dts = INT64_MIN; + else + pkt->dts = ctx->ts_ring[pic->encode_order] - ctx->dts_pts_diff; + } else { + pkt->dts = ctx->ts_ring[(pic->encode_order - ctx->decode_delay) % + (3 * ctx->output_delay + ctx->async_depth)]; + } + + return 0; +} + +static int vaapi_encode_get_coded_buffer_size(AVCodecContext *avctx, VABufferID buf_id) +{ + VAAPIEncodeContext *ctx = avctx->priv_data; + VACodedBufferSegment *buf_list, *buf; + int size = 0; + VAStatus vas; + int err; + + vas = vaMapBuffer(ctx->hwctx->display, buf_id, + (void**)&buf_list); + if (vas != VA_STATUS_SUCCESS) { + av_log(avctx, AV_LOG_ERROR, "Failed to map output buffers: " + "%d (%s).\n", vas, vaErrorStr(vas)); + err = AVERROR(EIO); + return err; + } + + for (buf = buf_list; buf; buf = buf->next) + size += buf->size; + + vas = vaUnmapBuffer(ctx->hwctx->display, buf_id); + if (vas != VA_STATUS_SUCCESS) { + av_log(avctx, AV_LOG_ERROR, "Failed to unmap output buffers: " + "%d (%s).\n", vas, vaErrorStr(vas)); + err = AVERROR(EIO); + return err; + } + + return size; +} + +static int vaapi_encode_get_coded_buffer_data(AVCodecContext *avctx, + VABufferID buf_id, uint8_t **dst) +{ + VAAPIEncodeContext *ctx = avctx->priv_data; + VACodedBufferSegment *buf_list, *buf; + VAStatus vas; + int err; + + vas = vaMapBuffer(ctx->hwctx->display, buf_id, + (void**)&buf_list); + if (vas != VA_STATUS_SUCCESS) { + av_log(avctx, AV_LOG_ERROR, "Failed to map output buffers: " + "%d (%s).\n", vas, vaErrorStr(vas)); + err = AVERROR(EIO); + return err; + } + + for (buf = buf_list; buf; buf = buf->next) { + av_log(avctx, AV_LOG_DEBUG, "Output buffer: %u bytes " + "(status %08x).\n", buf->size, buf->status); + + memcpy(*dst, buf->buf, buf->size); + *dst += buf->size; + } + + vas = vaUnmapBuffer(ctx->hwctx->display, buf_id); + if (vas != VA_STATUS_SUCCESS) { + av_log(avctx, AV_LOG_ERROR, "Failed to unmap output buffers: " + "%d (%s).\n", vas, vaErrorStr(vas)); + err = AVERROR(EIO); + return err; + } + + return 0; +} + +static int vaapi_encode_get_coded_data(AVCodecContext *avctx, + VAAPIEncodePicture *pic, AVPacket *pkt) +{ + VAAPIEncodeContext *ctx = avctx->priv_data; + VABufferID output_buffer_prev; + int total_size = 0; + uint8_t *ptr; + int ret; + + if (ctx->coded_buffer_ref) { + output_buffer_prev = (VABufferID)(uintptr_t)ctx->coded_buffer_ref->data; + ret = vaapi_encode_get_coded_buffer_size(avctx, output_buffer_prev); + if (ret < 0) + goto end; + total_size += ret; + } + + ret = vaapi_encode_get_coded_buffer_size(avctx, pic->output_buffer); + if (ret < 0) + goto end; + total_size += ret; + + ret = ff_get_encode_buffer(avctx, pkt, total_size, 0); + if (ret < 0) + goto end; + ptr = pkt->data; + + if (ctx->coded_buffer_ref) { + ret = vaapi_encode_get_coded_buffer_data(avctx, output_buffer_prev, &ptr); + if (ret < 0) + goto end; + } + + ret = vaapi_encode_get_coded_buffer_data(avctx, pic->output_buffer, &ptr); + if (ret < 0) + goto end; + +end: + if (ctx->coded_buffer_ref) { + av_buffer_unref(&ctx->coded_buffer_ref); + } av_buffer_unref(&pic->output_buffer_ref); pic->output_buffer = VA_INVALID_ID; + return ret; +} + +static int vaapi_encode_output(AVCodecContext *avctx, + VAAPIEncodePicture *pic, AVPacket *pkt) +{ + VAAPIEncodeContext *ctx = avctx->priv_data; + AVPacket *pkt_ptr = pkt; + int err; + + err = vaapi_encode_wait(avctx, pic); + if (err < 0) + return err; + + if (pic->non_independent_frame) { + av_assert0(!ctx->coded_buffer_ref); + ctx->coded_buffer_ref = av_buffer_ref(pic->output_buffer_ref); + + if (pic->tail_size) { + if (ctx->tail_pkt->size) { + err = AVERROR(AVERROR_BUG); + goto end; + } + + err = ff_get_encode_buffer(avctx, ctx->tail_pkt, pic->tail_size, 0); + if (err < 0) + goto end; + + memcpy(ctx->tail_pkt->data, pic->tail_data, pic->tail_size); + pkt_ptr = ctx->tail_pkt; + } + } else { + err = vaapi_encode_get_coded_data(avctx, pic, pkt); + if (err < 0) + goto end; + } + av_log(avctx, AV_LOG_DEBUG, "Output read for pic %"PRId64"/%"PRId64".\n", pic->display_order, pic->encode_order); - return 0; -fail_mapped: - vaUnmapBuffer(ctx->hwctx->display, pic->output_buffer); -fail: + vaapi_encode_set_output_property(avctx, pic, pkt_ptr); + +end: av_buffer_unref(&pic->output_buffer_ref); pic->output_buffer = VA_INVALID_ID; return err; @@ -811,8 +945,12 @@ static void vaapi_encode_add_ref(AVCodecContext *avctx, if (is_ref) { av_assert0(pic != target); - av_assert0(pic->nb_refs < MAX_PICTURE_REFERENCES); - pic->refs[pic->nb_refs++] = target; + av_assert0(pic->nb_refs[0] < MAX_PICTURE_REFERENCES && + pic->nb_refs[1] < MAX_PICTURE_REFERENCES); + if (target->display_order < pic->display_order) + pic->refs[0][pic->nb_refs[0]++] = target; + else + pic->refs[1][pic->nb_refs[1]++] = target; ++refs; } @@ -841,10 +979,16 @@ static void vaapi_encode_remove_refs(AVCodecContext *avctx, if (pic->ref_removed[level]) return; - for (i = 0; i < pic->nb_refs; i++) { - av_assert0(pic->refs[i]); - --pic->refs[i]->ref_count[level]; - av_assert0(pic->refs[i]->ref_count[level] >= 0); + for (i = 0; i < pic->nb_refs[0]; i++) { + av_assert0(pic->refs[0][i]); + --pic->refs[0][i]->ref_count[level]; + av_assert0(pic->refs[0][i]->ref_count[level] >= 0); + } + + for (i = 0; i < pic->nb_refs[1]; i++) { + av_assert0(pic->refs[1][i]); + --pic->refs[1][i]->ref_count[level]; + av_assert0(pic->refs[1][i]->ref_count[level] >= 0); } for (i = 0; i < pic->nb_dpb_pics; i++) { @@ -889,7 +1033,7 @@ static void vaapi_encode_set_b_pictures(AVCodecContext *avctx, vaapi_encode_add_ref(avctx, pic, end, 1, 1, 0); vaapi_encode_add_ref(avctx, pic, prev, 0, 0, 1); - for (ref = end->refs[1]; ref; ref = ref->refs[1]) + for (ref = end->refs[1][0]; ref; ref = ref->refs[1][0]) vaapi_encode_add_ref(avctx, pic, ref, 0, 1, 0); } *last = prev; @@ -912,7 +1056,7 @@ static void vaapi_encode_set_b_pictures(AVCodecContext *avctx, vaapi_encode_add_ref(avctx, pic, end, 1, 1, 0); vaapi_encode_add_ref(avctx, pic, prev, 0, 0, 1); - for (ref = end->refs[1]; ref; ref = ref->refs[1]) + for (ref = end->refs[1][0]; ref; ref = ref->refs[1][0]) vaapi_encode_add_ref(avctx, pic, ref, 0, 1, 0); if (i > 1) @@ -926,11 +1070,44 @@ static void vaapi_encode_set_b_pictures(AVCodecContext *avctx, } } +static void vaapi_encode_add_next_prev(AVCodecContext *avctx, + VAAPIEncodePicture *pic) +{ + VAAPIEncodeContext *ctx = avctx->priv_data; + int i; + + if (!pic) + return; + + if (pic->type == PICTURE_TYPE_IDR) { + for (i = 0; i < ctx->nb_next_prev; i++) { + --ctx->next_prev[i]->ref_count[0]; + ctx->next_prev[i] = NULL; + } + ctx->next_prev[0] = pic; + ++pic->ref_count[0]; + ctx->nb_next_prev = 1; + + return; + } + + if (ctx->nb_next_prev < MAX_PICTURE_REFERENCES) { + ctx->next_prev[ctx->nb_next_prev++] = pic; + ++pic->ref_count[0]; + } else { + --ctx->next_prev[0]->ref_count[0]; + for (i = 0; i < MAX_PICTURE_REFERENCES - 1; i++) + ctx->next_prev[i] = ctx->next_prev[i + 1]; + ctx->next_prev[i] = pic; + ++pic->ref_count[0]; + } +} + static int vaapi_encode_pick_next(AVCodecContext *avctx, VAAPIEncodePicture **pic_out) { VAAPIEncodeContext *ctx = avctx->priv_data; - VAAPIEncodePicture *pic = NULL, *next, *start; + VAAPIEncodePicture *pic = NULL, *prev = NULL, *next, *start; int i, b_counter, closed_gop_end; // If there are any B-frames already queued, the next one to encode @@ -941,11 +1118,18 @@ static int vaapi_encode_pick_next(AVCodecContext *avctx, continue; if (pic->type != PICTURE_TYPE_B) continue; - for (i = 0; i < pic->nb_refs; i++) { - if (!pic->refs[i]->encode_issued) + for (i = 0; i < pic->nb_refs[0]; i++) { + if (!pic->refs[0][i]->encode_issued) break; } - if (i == pic->nb_refs) + if (i != pic->nb_refs[0]) + continue; + + for (i = 0; i < pic->nb_refs[1]; i++) { + if (!pic->refs[1][i]->encode_issued) + break; + } + if (i == pic->nb_refs[1]) break; } @@ -1044,21 +1228,30 @@ static int vaapi_encode_pick_next(AVCodecContext *avctx, vaapi_encode_add_ref(avctx, pic, pic, 0, 1, 0); if (pic->type != PICTURE_TYPE_IDR) { - vaapi_encode_add_ref(avctx, pic, start, - pic->type == PICTURE_TYPE_P, - b_counter > 0, 0); - vaapi_encode_add_ref(avctx, pic, ctx->next_prev, 0, 0, 1); + // TODO: apply both previous and forward multi reference for all vaapi encoders. + // And L0/L1 reference frame number can be set dynamically through query + // VAConfigAttribEncMaxRefFrames attribute. + if (avctx->codec_id == AV_CODEC_ID_AV1) { + for (i = 0; i < ctx->nb_next_prev; i++) + vaapi_encode_add_ref(avctx, pic, ctx->next_prev[i], + pic->type == PICTURE_TYPE_P, + b_counter > 0, 0); + } else + vaapi_encode_add_ref(avctx, pic, start, + pic->type == PICTURE_TYPE_P, + b_counter > 0, 0); + + vaapi_encode_add_ref(avctx, pic, ctx->next_prev[ctx->nb_next_prev - 1], 0, 0, 1); } - if (ctx->next_prev) - --ctx->next_prev->ref_count[0]; if (b_counter > 0) { vaapi_encode_set_b_pictures(avctx, start, pic, pic, 1, - &ctx->next_prev); + &prev); } else { - ctx->next_prev = pic; + prev = pic; } - ++ctx->next_prev->ref_count[0]; + vaapi_encode_add_next_prev(avctx, prev); + return 0; } @@ -1205,10 +1398,23 @@ fail: int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt) { VAAPIEncodeContext *ctx = avctx->priv_data; - VAAPIEncodePicture *pic; + VAAPIEncodePicture *pic = NULL; AVFrame *frame = ctx->frame; int err; +start: + /** if no B frame before repeat P frame, sent repeat P frame out. */ + if (ctx->tail_pkt->size) { + for (VAAPIEncodePicture *tmp = ctx->pic_start; tmp; tmp = tmp->next) { + if (tmp->type == PICTURE_TYPE_B && tmp->pts < ctx->tail_pkt->pts) + break; + else if (!tmp->next) { + av_packet_move_ref(pkt, ctx->tail_pkt); + goto end; + } + } + } + err = ff_encode_get_frame(avctx, frame); if (err < 0 && err != AVERROR_EOF) return err; @@ -1228,8 +1434,6 @@ int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt) } if (ctx->has_sync_buffer_func) { - pic = NULL; - if (av_fifo_can_write(ctx->encode_fifo)) { err = vaapi_encode_pick_next(avctx, &pic); if (!err) { @@ -1255,7 +1459,6 @@ int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt) av_fifo_read(ctx->encode_fifo, &pic, 1); ctx->encode_order = pic->encode_order + 1; } else { - pic = NULL; err = vaapi_encode_pick_next(avctx, &pic); if (err < 0) return err; @@ -1276,27 +1479,21 @@ int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt) return err; } - if (ctx->output_delay == 0) { - pkt->dts = pkt->pts; - } else if (pic->encode_order < ctx->decode_delay) { - if (ctx->ts_ring[pic->encode_order] < INT64_MIN + ctx->dts_pts_diff) - pkt->dts = INT64_MIN; - else - pkt->dts = ctx->ts_ring[pic->encode_order] - ctx->dts_pts_diff; - } else { - pkt->dts = ctx->ts_ring[(pic->encode_order - ctx->decode_delay) % - (3 * ctx->output_delay + ctx->async_depth)]; - } - av_log(avctx, AV_LOG_DEBUG, "Output packet: pts %"PRId64" dts %"PRId64".\n", - pkt->pts, pkt->dts); - ctx->output_order = pic->encode_order; vaapi_encode_clear_old(avctx); + /** loop to get an available pkt in encoder flushing. */ + if (ctx->end_of_stream && !pkt->size) + goto start; + +end: + if (pkt->size) + av_log(avctx, AV_LOG_DEBUG, "Output packet: pts %"PRId64", dts %"PRId64", " + "size %d bytes.\n", pkt->pts, pkt->dts, pkt->size); + return 0; } - static av_cold void vaapi_encode_add_global_param(AVCodecContext *avctx, int type, void *buffer, size_t size) { @@ -1414,7 +1611,7 @@ static av_cold int vaapi_encode_profile_entrypoint(AVCodecContext *avctx) av_assert0(ctx->codec->profiles); for (i = 0; (ctx->codec->profiles[i].av_profile != - FF_PROFILE_UNKNOWN); i++) { + AV_PROFILE_UNKNOWN); i++) { profile = &ctx->codec->profiles[i]; if (depth != profile->depth || desc->nb_components != profile->nb_components) @@ -1424,7 +1621,7 @@ static av_cold int vaapi_encode_profile_entrypoint(AVCodecContext *avctx) desc->log2_chroma_h != profile->log2_chroma_h)) continue; if (avctx->profile != profile->av_profile && - avctx->profile != FF_PROFILE_UNKNOWN) + avctx->profile != AV_PROFILE_UNKNOWN) continue; #if VA_CHECK_VERSION(1, 0, 0) @@ -2597,6 +2794,12 @@ av_cold int ff_vaapi_encode_init(AVCodecContext *avctx) ctx->device = (AVHWDeviceContext*)ctx->device_ref->data; ctx->hwctx = ctx->device->hwctx; + ctx->tail_pkt = av_packet_alloc(); + if (!ctx->tail_pkt) { + err = AVERROR(ENOMEM); + goto fail; + } + err = vaapi_encode_profile_entrypoint(avctx); if (err < 0) goto fail; @@ -2789,6 +2992,7 @@ av_cold int ff_vaapi_encode_close(AVCodecContext *avctx) } av_frame_free(&ctx->frame); + av_packet_free(&ctx->tail_pkt); av_freep(&ctx->codec_sequence_params); av_freep(&ctx->codec_picture_params); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode.h b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode.h index a1e639f5..d0d6cc2a 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode.h @@ -49,6 +49,7 @@ enum { // A.4.1: table A.6 allows at most 20 tile columns for any level. MAX_TILE_COLS = 20, MAX_ASYNC_DEPTH = 64, + MAX_REFERENCE_LIST_NUM = 2, }; extern const AVCodecHWConfigInternal *const ff_vaapi_encode_hw_configs[]; @@ -116,10 +117,11 @@ typedef struct VAAPIEncodePicture { // but not if it isn't. int nb_dpb_pics; struct VAAPIEncodePicture *dpb[MAX_DPB_SIZE]; - // The reference pictures used in decoding this picture. If they are - // used by later pictures they will also appear in the DPB. - int nb_refs; - struct VAAPIEncodePicture *refs[MAX_PICTURE_REFERENCES]; + // The reference pictures used in decoding this picture. If they are + // used by later pictures they will also appear in the DPB. ref[0][] for + // previous reference frames. ref[1][] for future reference frames. + int nb_refs[MAX_REFERENCE_LIST_NUM]; + struct VAAPIEncodePicture *refs[MAX_REFERENCE_LIST_NUM][MAX_PICTURE_REFERENCES]; // The previous reference picture in encode order. Must be in at least // one of the reference list and DPB list. struct VAAPIEncodePicture *prev; @@ -131,10 +133,21 @@ typedef struct VAAPIEncodePicture { int nb_slices; VAAPIEncodeSlice *slices; + + /** + * indicate if current frame is an independent frame that the coded data + * can be pushed to downstream directly. Coded of non-independent frame + * data will be concatenated into next independent frame. + */ + int non_independent_frame; + /** Tail data of current pic, used only for repeat header of AV1. */ + char tail_data[MAX_PARAM_BUFFER_SIZE]; + /** Byte length of tail_data. */ + size_t tail_size; } VAAPIEncodePicture; typedef struct VAAPIEncodeProfile { - // lavc profile value (FF_PROFILE_*). + // lavc profile value (AV_PROFILE_*). int av_profile; // Supported bit depth. int depth; @@ -290,8 +303,9 @@ typedef struct VAAPIEncodeContext { // Current encoding window, in display (input) order. VAAPIEncodePicture *pic_start, *pic_end; // The next picture to use as the previous reference picture in - // encoding order. - VAAPIEncodePicture *next_prev; + // encoding order. Order from small to large in encoding order. + VAAPIEncodePicture *next_prev[MAX_PICTURE_REFERENCES]; + int nb_next_prev; // Next input order index (display order). int64_t input_order; @@ -364,6 +378,16 @@ typedef struct VAAPIEncodeContext { AVFifo *encode_fifo; // Max number of frame buffered in encoder. int async_depth; + + /** Head data for current output pkt, used only for AV1. */ + //void *header_data; + //size_t header_data_size; + + /** Buffered coded data of a pic if it is an non-independent frame. */ + AVBufferRef *coded_buffer_ref; + + /** Tail data of a pic, now only used for av1 repeat frame header. */ + AVPacket *tail_pkt; } VAAPIEncodeContext; enum { @@ -380,11 +404,14 @@ enum { // Codec supports non-IDR key pictures (that is, key pictures do // not necessarily empty the DPB). FLAG_NON_IDR_KEY_PICTURES = 1 << 5, + // Codec output packet without timestamp delay, which means the + // output packet has same PTS and DTS. + FLAG_TIMESTAMP_NO_DELAY = 1 << 6, }; typedef struct VAAPIEncodeType { // List of supported profiles and corresponding VAAPI profiles. - // (Must end with FF_PROFILE_UNKNOWN.) + // (Must end with AV_PROFILE_UNKNOWN.) const VAAPIEncodeProfile *profiles; // Codec feature flags. diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode_av1.c b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode_av1.c new file mode 100644 index 00000000..5a9ff0f7 --- /dev/null +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode_av1.c @@ -0,0 +1,951 @@ +/* + * Copyright (c) 2023 Intel Corporation + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include + +#include "libavutil/pixdesc.h" +#include "libavutil/opt.h" + +#include "cbs_av1.h" +#include "put_bits.h" +#include "codec_internal.h" +#include "av1_levels.h" +#include "vaapi_encode.h" + +#define AV1_MAX_QUANT 255 + +typedef struct VAAPIEncodeAV1Picture { + int64_t last_idr_frame; + int slot; +} VAAPIEncodeAV1Picture; + +typedef struct VAAPIEncodeAV1Context { + VAAPIEncodeContext common; + AV1RawOBU sh; /**< sequence header.*/ + AV1RawOBU fh; /**< frame header.*/ + CodedBitstreamContext *cbc; + CodedBitstreamFragment current_obu; + VAConfigAttribValEncAV1 attr; + VAConfigAttribValEncAV1Ext1 attr_ext1; + VAConfigAttribValEncAV1Ext2 attr_ext2; + + char sh_data[MAX_PARAM_BUFFER_SIZE]; /**< coded sequence header data. */ + size_t sh_data_len; /**< bit length of sh_data. */ + char fh_data[MAX_PARAM_BUFFER_SIZE]; /**< coded frame header data. */ + size_t fh_data_len; /**< bit length of fh_data. */ + + uint8_t uniform_tile; + uint8_t use_128x128_superblock; + int sb_cols; + int sb_rows; + int tile_cols_log2; + int tile_rows_log2; + int max_tile_width_sb; + int max_tile_height_sb; + uint8_t width_in_sbs_minus_1[AV1_MAX_TILE_COLS]; + uint8_t height_in_sbs_minus_1[AV1_MAX_TILE_ROWS]; + + int min_log2_tile_cols; + int max_log2_tile_cols; + int min_log2_tile_rows; + int max_log2_tile_rows; + + int q_idx_idr; + int q_idx_p; + int q_idx_b; + + /** bit positions in current frame header */ + int qindex_offset; + int loopfilter_offset; + int cdef_start_offset; + int cdef_param_size; + + /** user options */ + int profile; + int level; + int tier; + int tile_cols, tile_rows; + int tile_groups; +} VAAPIEncodeAV1Context; + +static void vaapi_encode_av1_trace_write_log(void *ctx, + PutBitContext *pbc, int length, + const char *str, const int *subscripts, + int64_t value) +{ + VAAPIEncodeAV1Context *priv = ctx; + int position; + + position = put_bits_count(pbc); + av_assert0(position >= length); + + if (!strcmp(str, "base_q_idx")) + priv->qindex_offset = position - length; + else if (!strcmp(str, "loop_filter_level[0]")) + priv->loopfilter_offset = position - length; + else if (!strcmp(str, "cdef_damping_minus_3")) + priv->cdef_start_offset = position - length; + else if (!strcmp(str, "cdef_uv_sec_strength[i]")) + priv->cdef_param_size = position - priv->cdef_start_offset; +} + +static av_cold int vaapi_encode_av1_get_encoder_caps(AVCodecContext *avctx) +{ + VAAPIEncodeContext *ctx = avctx->priv_data; + VAAPIEncodeAV1Context *priv = avctx->priv_data; + + // Surfaces must be aligned to superblock boundaries. + ctx->surface_width = FFALIGN(avctx->width, priv->use_128x128_superblock ? 128 : 64); + ctx->surface_height = FFALIGN(avctx->height, priv->use_128x128_superblock ? 128 : 64); + + return 0; +} + +static av_cold int vaapi_encode_av1_configure(AVCodecContext *avctx) +{ + VAAPIEncodeContext *ctx = avctx->priv_data; + VAAPIEncodeAV1Context *priv = avctx->priv_data; + int ret; + + ret = ff_cbs_init(&priv->cbc, AV_CODEC_ID_AV1, avctx); + if (ret < 0) + return ret; + priv->cbc->trace_enable = 1; + priv->cbc->trace_level = AV_LOG_DEBUG; + priv->cbc->trace_context = ctx; + priv->cbc->trace_write_callback = vaapi_encode_av1_trace_write_log; + + if (ctx->rc_mode->quality) { + priv->q_idx_p = av_clip(ctx->rc_quality, 0, AV1_MAX_QUANT); + if (fabs(avctx->i_quant_factor) > 0.0) + priv->q_idx_idr = + av_clip((fabs(avctx->i_quant_factor) * priv->q_idx_p + + avctx->i_quant_offset) + 0.5, + 0, AV1_MAX_QUANT); + else + priv->q_idx_idr = priv->q_idx_p; + + if (fabs(avctx->b_quant_factor) > 0.0) + priv->q_idx_b = + av_clip((fabs(avctx->b_quant_factor) * priv->q_idx_p + + avctx->b_quant_offset) + 0.5, + 0, AV1_MAX_QUANT); + else + priv->q_idx_b = priv->q_idx_p; + } else { + /** Arbitrary value */ + priv->q_idx_idr = priv->q_idx_p = priv->q_idx_b = 128; + } + + return 0; +} + +static int vaapi_encode_av1_add_obu(AVCodecContext *avctx, + CodedBitstreamFragment *au, + uint8_t type, + void *obu_unit) +{ + int ret; + + ret = ff_cbs_insert_unit_content(au, -1, + type, obu_unit, NULL); + if (ret < 0) { + av_log(avctx, AV_LOG_ERROR, "Failed to add OBU unit: " + "type = %d.\n", type); + return ret; + } + + return 0; +} + +static int vaapi_encode_av1_write_obu(AVCodecContext *avctx, + char *data, size_t *data_len, + CodedBitstreamFragment *bs) +{ + VAAPIEncodeAV1Context *priv = avctx->priv_data; + int ret; + + ret = ff_cbs_write_fragment_data(priv->cbc, bs); + if (ret < 0) { + av_log(avctx, AV_LOG_ERROR, "Failed to write packed header.\n"); + return ret; + } + + if ((size_t)8 * MAX_PARAM_BUFFER_SIZE < 8 * bs->data_size - bs->data_bit_padding) { + av_log(avctx, AV_LOG_ERROR, "Access unit too large: " + "%zu < %zu.\n", (size_t)8 * MAX_PARAM_BUFFER_SIZE, + 8 * bs->data_size - bs->data_bit_padding); + return AVERROR(ENOSPC); + } + + memcpy(data, bs->data, bs->data_size); + *data_len = 8 * bs->data_size - bs->data_bit_padding; + + return 0; +} + +static int tile_log2(int blkSize, int target) { + int k; + for (k = 0; (blkSize << k) < target; k++); + return k; +} + +static int vaapi_encode_av1_set_tile(AVCodecContext *avctx) +{ + VAAPIEncodeAV1Context *priv = avctx->priv_data; + int mi_cols, mi_rows, sb_shift, sb_size; + int max_tile_area_sb, max_tile_area_sb_varied; + int tile_width_sb, tile_height_sb, widest_tile_sb; + int tile_cols, tile_rows; + int min_log2_tiles; + int i; + + if (priv->tile_cols > AV1_MAX_TILE_COLS || + priv->tile_rows > AV1_MAX_TILE_ROWS) { + av_log(avctx, AV_LOG_ERROR, "Invalid tile number %dx%d, should less than %dx%d.\n", + priv->tile_cols, priv->tile_rows, AV1_MAX_TILE_COLS, AV1_MAX_TILE_ROWS); + return AVERROR(EINVAL); + } + + mi_cols = 2 * ((avctx->width + 7) >> 3); + mi_rows = 2 * ((avctx->height + 7) >> 3); + priv->sb_cols = priv->use_128x128_superblock ? + ((mi_cols + 31) >> 5) : ((mi_cols + 15) >> 4); + priv->sb_rows = priv->use_128x128_superblock ? + ((mi_rows + 31) >> 5) : ((mi_rows + 15) >> 4); + sb_shift = priv->use_128x128_superblock ? 5 : 4; + sb_size = sb_shift + 2; + priv->max_tile_width_sb = AV1_MAX_TILE_WIDTH >> sb_size; + max_tile_area_sb = AV1_MAX_TILE_AREA >> (2 * sb_size); + + priv->min_log2_tile_cols = tile_log2(priv->max_tile_width_sb, priv->sb_cols); + priv->max_log2_tile_cols = tile_log2(1, FFMIN(priv->sb_cols, AV1_MAX_TILE_COLS)); + priv->max_log2_tile_rows = tile_log2(1, FFMIN(priv->sb_rows, AV1_MAX_TILE_ROWS)); + min_log2_tiles = FFMAX(priv->min_log2_tile_cols, + tile_log2(max_tile_area_sb, priv->sb_rows * priv->sb_cols)); + + tile_cols = av_clip(priv->tile_cols, (priv->sb_cols + priv->max_tile_width_sb - 1) / priv->max_tile_width_sb, priv->sb_cols); + + if (!priv->tile_cols) + priv->tile_cols = tile_cols; + else if (priv->tile_cols != tile_cols){ + av_log(avctx, AV_LOG_ERROR, "Invalid tile cols %d, should be in range of %d~%d\n", + priv->tile_cols, + (priv->sb_cols + priv->max_tile_width_sb - 1) / priv->max_tile_width_sb, + priv->sb_cols); + return AVERROR(EINVAL); + } + + priv->tile_cols_log2 = tile_log2(1, priv->tile_cols); + tile_width_sb = (priv->sb_cols + (1 << priv->tile_cols_log2) - 1) >> + priv->tile_cols_log2; + + if (priv->tile_rows > priv->sb_rows) { + av_log(avctx, AV_LOG_ERROR, "Invalid tile rows %d, should be less than %d.\n", + priv->tile_rows, priv->sb_rows); + return AVERROR(EINVAL); + } + + /** Try user setting tile rows number first. */ + tile_rows = priv->tile_rows ? priv->tile_rows : 1; + for (; tile_rows <= priv->sb_rows && tile_rows <= AV1_MAX_TILE_ROWS; tile_rows++) { + /** try uniformed tile. */ + priv->tile_rows_log2 = tile_log2(1, tile_rows); + if ((priv->sb_cols + tile_width_sb - 1) / tile_width_sb == priv->tile_cols) { + for (i = 0; i < priv->tile_cols - 1; i++) + priv->width_in_sbs_minus_1[i] = tile_width_sb - 1; + priv->width_in_sbs_minus_1[i] = priv->sb_cols - (priv->tile_cols - 1) * tile_width_sb - 1; + + tile_height_sb = (priv->sb_rows + (1 << priv->tile_rows_log2) - 1) >> + priv->tile_rows_log2; + + if ((priv->sb_rows + tile_height_sb - 1) / tile_height_sb == tile_rows && + tile_height_sb <= max_tile_area_sb / tile_width_sb) { + for (i = 0; i < tile_rows - 1; i++) + priv->height_in_sbs_minus_1[i] = tile_height_sb - 1; + priv->height_in_sbs_minus_1[i] = priv->sb_rows - (tile_rows - 1) * tile_height_sb - 1; + + priv->uniform_tile = 1; + priv->min_log2_tile_rows = FFMAX(min_log2_tiles - priv->tile_cols_log2, 0); + + break; + } + } + + /** try non-uniformed tile. */ + widest_tile_sb = 0; + for (i = 0; i < priv->tile_cols; i++) { + priv->width_in_sbs_minus_1[i] = (i + 1) * priv->sb_cols / priv->tile_cols - i * priv->sb_cols / priv->tile_cols - 1; + widest_tile_sb = FFMAX(widest_tile_sb, priv->width_in_sbs_minus_1[i] + 1); + } + + if (min_log2_tiles) + max_tile_area_sb_varied = (priv->sb_rows * priv->sb_cols) >> (min_log2_tiles + 1); + else + max_tile_area_sb_varied = priv->sb_rows * priv->sb_cols; + priv->max_tile_height_sb = FFMAX(1, max_tile_area_sb_varied / widest_tile_sb); + + if (tile_rows == av_clip(tile_rows, (priv->sb_rows + priv->max_tile_height_sb - 1) / priv->max_tile_height_sb, priv->sb_rows)) { + for (i = 0; i < tile_rows; i++) + priv->height_in_sbs_minus_1[i] = (i + 1) * priv->sb_rows / tile_rows - i * priv->sb_rows / tile_rows - 1; + + break; + } + + /** Return invalid parameter if explicit tile rows is set. */ + if (priv->tile_rows) { + av_log(avctx, AV_LOG_ERROR, "Invalid tile rows %d.\n", priv->tile_rows); + return AVERROR(EINVAL); + } + } + + priv->tile_rows = tile_rows; + av_log(avctx, AV_LOG_DEBUG, "Setting tile cols/rows to %d/%d.\n", + priv->tile_cols, priv->tile_rows); + + /** check if tile cols/rows is supported by driver. */ + if (priv->attr_ext2.bits.max_tile_num_minus1) { + if ((priv->tile_cols * priv->tile_rows - 1) > priv->attr_ext2.bits.max_tile_num_minus1) { + av_log(avctx, AV_LOG_ERROR, "Unsupported tile num %d * %d = %d by driver, " + "should be at most %d.\n", priv->tile_cols, priv->tile_rows, + priv->tile_cols * priv->tile_rows, + priv->attr_ext2.bits.max_tile_num_minus1 + 1); + return AVERROR(EINVAL); + } + } + + /** check if tile group numbers is valid. */ + if (priv->tile_groups > priv->tile_cols * priv->tile_rows) { + av_log(avctx, AV_LOG_WARNING, "Invalid tile groups number %d, " + "correct to %d.\n", priv->tile_groups, priv->tile_cols * priv->tile_rows); + priv->tile_groups = priv->tile_cols * priv->tile_rows; + } + + return 0; +} + +static int vaapi_encode_av1_write_sequence_header(AVCodecContext *avctx, + char *data, size_t *data_len) +{ + VAAPIEncodeAV1Context *priv = avctx->priv_data; + + memcpy(data, &priv->sh_data, MAX_PARAM_BUFFER_SIZE * sizeof(char)); + *data_len = priv->sh_data_len; + + return 0; +} + +static int vaapi_encode_av1_init_sequence_params(AVCodecContext *avctx) +{ + VAAPIEncodeContext *ctx = avctx->priv_data; + VAAPIEncodeAV1Context *priv = avctx->priv_data; + AV1RawOBU *sh_obu = &priv->sh; + AV1RawSequenceHeader *sh = &sh_obu->obu.sequence_header; + VAEncSequenceParameterBufferAV1 *vseq = ctx->codec_sequence_params; + CodedBitstreamFragment *obu = &priv->current_obu; + const AVPixFmtDescriptor *desc; + int ret; + + memset(sh_obu, 0, sizeof(*sh_obu)); + sh_obu->header.obu_type = AV1_OBU_SEQUENCE_HEADER; + + desc = av_pix_fmt_desc_get(priv->common.input_frames->sw_format); + av_assert0(desc); + + sh->seq_profile = avctx->profile; + if (!sh->seq_force_screen_content_tools) + sh->seq_force_integer_mv = AV1_SELECT_INTEGER_MV; + sh->frame_width_bits_minus_1 = av_log2(avctx->width); + sh->frame_height_bits_minus_1 = av_log2(avctx->height); + sh->max_frame_width_minus_1 = avctx->width - 1; + sh->max_frame_height_minus_1 = avctx->height - 1; + sh->seq_tier[0] = priv->tier; + /** enable order hint and reserve maximum 8 bits for it by default. */ + sh->enable_order_hint = 1; + sh->order_hint_bits_minus_1 = 7; + + sh->color_config = (AV1RawColorConfig) { + .high_bitdepth = desc->comp[0].depth == 8 ? 0 : 1, + .color_primaries = avctx->color_primaries, + .transfer_characteristics = avctx->color_trc, + .matrix_coefficients = avctx->colorspace, + .color_description_present_flag = (avctx->color_primaries != AVCOL_PRI_UNSPECIFIED || + avctx->color_trc != AVCOL_TRC_UNSPECIFIED || + avctx->colorspace != AVCOL_SPC_UNSPECIFIED), + .color_range = avctx->color_range == AVCOL_RANGE_JPEG, + .subsampling_x = desc->log2_chroma_w, + .subsampling_y = desc->log2_chroma_h, + }; + + switch (avctx->chroma_sample_location) { + case AVCHROMA_LOC_LEFT: + sh->color_config.chroma_sample_position = AV1_CSP_VERTICAL; + break; + case AVCHROMA_LOC_TOPLEFT: + sh->color_config.chroma_sample_position = AV1_CSP_COLOCATED; + break; + default: + sh->color_config.chroma_sample_position = AV1_CSP_UNKNOWN; + break; + } + + if (avctx->level != AV_LEVEL_UNKNOWN) { + sh->seq_level_idx[0] = avctx->level; + } else { + const AV1LevelDescriptor *level; + float framerate; + + if (avctx->framerate.num > 0 && avctx->framerate.den > 0) + framerate = avctx->framerate.num / avctx->framerate.den; + else + framerate = 0; + + level = ff_av1_guess_level(avctx->bit_rate, priv->tier, + ctx->surface_width, ctx->surface_height, + priv->tile_rows * priv->tile_cols, + priv->tile_cols, framerate); + if (level) { + av_log(avctx, AV_LOG_VERBOSE, "Using level %s.\n", level->name); + sh->seq_level_idx[0] = level->level_idx; + } else { + av_log(avctx, AV_LOG_VERBOSE, "Stream will not conform to " + "any normal level, using maximum parameters level by default.\n"); + sh->seq_level_idx[0] = 31; + sh->seq_tier[0] = 1; + } + } + vseq->seq_profile = sh->seq_profile; + vseq->seq_level_idx = sh->seq_level_idx[0]; + vseq->seq_tier = sh->seq_tier[0]; + vseq->order_hint_bits_minus_1 = sh->order_hint_bits_minus_1; + vseq->intra_period = ctx->gop_size; + vseq->ip_period = ctx->b_per_p + 1; + + vseq->seq_fields.bits.enable_order_hint = sh->enable_order_hint; + + if (!(ctx->va_rc_mode & VA_RC_CQP)) { + vseq->bits_per_second = ctx->va_bit_rate; + vseq->seq_fields.bits.enable_cdef = sh->enable_cdef = 1; + } + + ret = vaapi_encode_av1_add_obu(avctx, obu, AV1_OBU_SEQUENCE_HEADER, &priv->sh); + if (ret < 0) + goto end; + + ret = vaapi_encode_av1_write_obu(avctx, priv->sh_data, &priv->sh_data_len, obu); + if (ret < 0) + goto end; + +end: + ff_cbs_fragment_reset(obu); + return ret; +} + +static int vaapi_encode_av1_init_picture_params(AVCodecContext *avctx, + VAAPIEncodePicture *pic) +{ + VAAPIEncodeContext *ctx = avctx->priv_data; + VAAPIEncodeAV1Context *priv = avctx->priv_data; + VAAPIEncodeAV1Picture *hpic = pic->priv_data; + AV1RawOBU *fh_obu = &priv->fh; + AV1RawFrameHeader *fh = &fh_obu->obu.frame.header; + VAEncPictureParameterBufferAV1 *vpic = pic->codec_picture_params; + CodedBitstreamFragment *obu = &priv->current_obu; + VAAPIEncodePicture *ref; + VAAPIEncodeAV1Picture *href; + int slot, i; + int ret; + static const int8_t default_loop_filter_ref_deltas[AV1_TOTAL_REFS_PER_FRAME] = + { 1, 0, 0, 0, -1, 0, -1, -1 }; + + memset(fh_obu, 0, sizeof(*fh_obu)); + pic->nb_slices = priv->tile_groups; + pic->non_independent_frame = pic->encode_order < pic->display_order; + fh_obu->header.obu_type = AV1_OBU_FRAME_HEADER; + fh_obu->header.obu_has_size_field = 1; + + switch (pic->type) { + case PICTURE_TYPE_IDR: + av_assert0(pic->nb_refs[0] == 0 || pic->nb_refs[1]); + fh->frame_type = AV1_FRAME_KEY; + fh->refresh_frame_flags = 0xFF; + fh->base_q_idx = priv->q_idx_idr; + hpic->slot = 0; + hpic->last_idr_frame = pic->display_order; + break; + case PICTURE_TYPE_P: + av_assert0(pic->nb_refs[0]); + fh->frame_type = AV1_FRAME_INTER; + fh->base_q_idx = priv->q_idx_p; + ref = pic->refs[0][pic->nb_refs[0] - 1]; + href = ref->priv_data; + hpic->slot = !href->slot; + hpic->last_idr_frame = href->last_idr_frame; + fh->refresh_frame_flags = 1 << hpic->slot; + + /** set the nearest frame in L0 as all reference frame. */ + for (i = 0; i < AV1_REFS_PER_FRAME; i++) { + fh->ref_frame_idx[i] = href->slot; + } + fh->primary_ref_frame = href->slot; + fh->ref_order_hint[href->slot] = ref->display_order - href->last_idr_frame; + vpic->ref_frame_ctrl_l0.fields.search_idx0 = AV1_REF_FRAME_LAST; + + /** set the 2nd nearest frame in L0 as Golden frame. */ + if (pic->nb_refs[0] > 1) { + ref = pic->refs[0][pic->nb_refs[0] - 2]; + href = ref->priv_data; + fh->ref_frame_idx[3] = href->slot; + fh->ref_order_hint[href->slot] = ref->display_order - href->last_idr_frame; + vpic->ref_frame_ctrl_l0.fields.search_idx1 = AV1_REF_FRAME_GOLDEN; + } + break; + case PICTURE_TYPE_B: + av_assert0(pic->nb_refs[0] && pic->nb_refs[1]); + fh->frame_type = AV1_FRAME_INTER; + fh->base_q_idx = priv->q_idx_b; + fh->refresh_frame_flags = 0x0; + fh->reference_select = 1; + + /** B frame will not be referenced, disable its recon frame. */ + vpic->picture_flags.bits.disable_frame_recon = 1; + + /** Use LAST_FRAME and BWDREF_FRAME for reference. */ + vpic->ref_frame_ctrl_l0.fields.search_idx0 = AV1_REF_FRAME_LAST; + vpic->ref_frame_ctrl_l1.fields.search_idx0 = AV1_REF_FRAME_BWDREF; + + ref = pic->refs[0][pic->nb_refs[0] - 1]; + href = ref->priv_data; + hpic->last_idr_frame = href->last_idr_frame; + fh->primary_ref_frame = href->slot; + fh->ref_order_hint[href->slot] = ref->display_order - href->last_idr_frame; + for (i = 0; i < AV1_REF_FRAME_GOLDEN; i++) { + fh->ref_frame_idx[i] = href->slot; + } + + ref = pic->refs[1][pic->nb_refs[1] - 1]; + href = ref->priv_data; + fh->ref_order_hint[href->slot] = ref->display_order - href->last_idr_frame; + for (i = AV1_REF_FRAME_GOLDEN; i < AV1_REFS_PER_FRAME; i++) { + fh->ref_frame_idx[i] = href->slot; + } + break; + default: + av_assert0(0 && "invalid picture type"); + } + + fh->show_frame = pic->display_order <= pic->encode_order; + fh->showable_frame = fh->frame_type != AV1_FRAME_KEY; + fh->frame_width_minus_1 = avctx->width - 1; + fh->frame_height_minus_1 = avctx->height - 1; + fh->render_width_minus_1 = fh->frame_width_minus_1; + fh->render_height_minus_1 = fh->frame_height_minus_1; + fh->order_hint = pic->display_order - hpic->last_idr_frame; + fh->tile_cols = priv->tile_cols; + fh->tile_rows = priv->tile_rows; + fh->tile_cols_log2 = priv->tile_cols_log2; + fh->tile_rows_log2 = priv->tile_rows_log2; + fh->uniform_tile_spacing_flag = priv->uniform_tile; + fh->tile_size_bytes_minus1 = priv->attr_ext2.bits.tile_size_bytes_minus1; + + /** ignore ONLY_4x4 mode for codedlossless is not fully implemented. */ + if (priv->attr_ext2.bits.tx_mode_support & 0x04) + fh->tx_mode = AV1_TX_MODE_SELECT; + else if (priv->attr_ext2.bits.tx_mode_support & 0x02) + fh->tx_mode = AV1_TX_MODE_LARGEST; + else { + av_log(avctx, AV_LOG_ERROR, "No available tx mode found.\n"); + return AVERROR(EINVAL); + } + + for (i = 0; i < fh->tile_cols; i++) + fh->width_in_sbs_minus_1[i] = vpic->width_in_sbs_minus_1[i] = priv->width_in_sbs_minus_1[i]; + + for (i = 0; i < fh->tile_rows; i++) + fh->height_in_sbs_minus_1[i] = vpic->height_in_sbs_minus_1[i] = priv->height_in_sbs_minus_1[i]; + + memcpy(fh->loop_filter_ref_deltas, default_loop_filter_ref_deltas, + AV1_TOTAL_REFS_PER_FRAME * sizeof(int8_t)); + + if (fh->frame_type == AV1_FRAME_KEY && fh->show_frame) { + fh->error_resilient_mode = 1; + } + + if (fh->frame_type == AV1_FRAME_KEY || fh->error_resilient_mode) + fh->primary_ref_frame = AV1_PRIMARY_REF_NONE; + + vpic->base_qindex = fh->base_q_idx; + vpic->frame_width_minus_1 = fh->frame_width_minus_1; + vpic->frame_height_minus_1 = fh->frame_height_minus_1; + vpic->primary_ref_frame = fh->primary_ref_frame; + vpic->reconstructed_frame = pic->recon_surface; + vpic->coded_buf = pic->output_buffer; + vpic->tile_cols = fh->tile_cols; + vpic->tile_rows = fh->tile_rows; + vpic->order_hint = fh->order_hint; +#if VA_CHECK_VERSION(1, 15, 0) + vpic->refresh_frame_flags = fh->refresh_frame_flags; +#endif + + vpic->picture_flags.bits.enable_frame_obu = 0; + vpic->picture_flags.bits.frame_type = fh->frame_type; + vpic->picture_flags.bits.reduced_tx_set = fh->reduced_tx_set; + vpic->picture_flags.bits.error_resilient_mode = fh->error_resilient_mode; + + /** let driver decide to use single or compound reference prediction mode. */ + vpic->mode_control_flags.bits.reference_mode = fh->reference_select ? 2 : 0; + vpic->mode_control_flags.bits.tx_mode = fh->tx_mode; + + vpic->tile_group_obu_hdr_info.bits.obu_has_size_field = 1; + + /** set reference. */ + for (i = 0; i < AV1_REFS_PER_FRAME; i++) + vpic->ref_frame_idx[i] = fh->ref_frame_idx[i]; + + for (i = 0; i < FF_ARRAY_ELEMS(vpic->reference_frames); i++) + vpic->reference_frames[i] = VA_INVALID_SURFACE; + + for (i = 0; i < MAX_REFERENCE_LIST_NUM; i++) { + for (int j = 0; j < pic->nb_refs[i]; j++) { + VAAPIEncodePicture *ref_pic = pic->refs[i][j]; + + slot = ((VAAPIEncodeAV1Picture*)ref_pic->priv_data)->slot; + av_assert0(vpic->reference_frames[slot] == VA_INVALID_SURFACE); + + vpic->reference_frames[slot] = ref_pic->recon_surface; + } + } + + ret = vaapi_encode_av1_add_obu(avctx, obu, AV1_OBU_FRAME_HEADER, &priv->fh); + if (ret < 0) + goto end; + + ret = vaapi_encode_av1_write_obu(avctx, priv->fh_data, &priv->fh_data_len, obu); + if (ret < 0) + goto end; + + if (!(ctx->va_rc_mode & VA_RC_CQP)) { + vpic->min_base_qindex = av_clip(avctx->qmin, 1, AV1_MAX_QUANT); + vpic->max_base_qindex = av_clip(avctx->qmax, 1, AV1_MAX_QUANT); + + vpic->bit_offset_qindex = priv->qindex_offset; + vpic->bit_offset_loopfilter_params = priv->loopfilter_offset; + vpic->bit_offset_cdef_params = priv->cdef_start_offset; + vpic->size_in_bits_cdef_params = priv->cdef_param_size; + vpic->size_in_bits_frame_hdr_obu = priv->fh_data_len; + vpic->byte_offset_frame_hdr_obu_size = (((pic->type == PICTURE_TYPE_IDR) ? + priv->sh_data_len / 8 : 0) + + (fh_obu->header.obu_extension_flag ? + 2 : 1)); + } + +end: + ff_cbs_fragment_reset(obu); + return ret; +} + +static int vaapi_encode_av1_init_slice_params(AVCodecContext *avctx, + VAAPIEncodePicture *pic, + VAAPIEncodeSlice *slice) +{ + VAAPIEncodeAV1Context *priv = avctx->priv_data; + VAEncTileGroupBufferAV1 *vslice = slice->codec_slice_params; + CodedBitstreamAV1Context *cbctx = priv->cbc->priv_data; + int div; + + /** Set tile group info. */ + div = priv->tile_cols * priv->tile_rows / priv->tile_groups; + vslice->tg_start = slice->index * div; + if (slice->index == (priv->tile_groups - 1)) { + vslice->tg_end = priv->tile_cols * priv->tile_rows - 1; + cbctx->seen_frame_header = 0; + } else { + vslice->tg_end = (slice->index + 1) * div - 1; + } + + return 0; +} + +static int vaapi_encode_av1_write_picture_header(AVCodecContext *avctx, + VAAPIEncodePicture *pic, + char *data, size_t *data_len) +{ + VAAPIEncodeAV1Context *priv = avctx->priv_data; + CodedBitstreamFragment *obu = &priv->current_obu; + CodedBitstreamAV1Context *cbctx = priv->cbc->priv_data; + AV1RawOBU *fh_obu = &priv->fh; + AV1RawFrameHeader *rep_fh = &fh_obu->obu.frame_header; + VAAPIEncodeAV1Picture *href; + int ret = 0; + + pic->tail_size = 0; + /** Pack repeat frame header. */ + if (pic->display_order > pic->encode_order) { + memset(fh_obu, 0, sizeof(*fh_obu)); + href = pic->refs[0][pic->nb_refs[0] - 1]->priv_data; + fh_obu->header.obu_type = AV1_OBU_FRAME_HEADER; + fh_obu->header.obu_has_size_field = 1; + + rep_fh->show_existing_frame = 1; + rep_fh->frame_to_show_map_idx = href->slot == 0; + rep_fh->frame_type = AV1_FRAME_INTER; + rep_fh->frame_width_minus_1 = avctx->width - 1; + rep_fh->frame_height_minus_1 = avctx->height - 1; + rep_fh->render_width_minus_1 = rep_fh->frame_width_minus_1; + rep_fh->render_height_minus_1 = rep_fh->frame_height_minus_1; + + cbctx->seen_frame_header = 0; + + ret = vaapi_encode_av1_add_obu(avctx, obu, AV1_OBU_FRAME_HEADER, &priv->fh); + if (ret < 0) + goto end; + + ret = vaapi_encode_av1_write_obu(avctx, pic->tail_data, &pic->tail_size, obu); + if (ret < 0) + goto end; + + pic->tail_size /= 8; + } + + memcpy(data, &priv->fh_data, MAX_PARAM_BUFFER_SIZE * sizeof(char)); + *data_len = priv->fh_data_len; + +end: + ff_cbs_fragment_reset(obu); + return ret; +} + +static const VAAPIEncodeProfile vaapi_encode_av1_profiles[] = { + { AV_PROFILE_AV1_MAIN, 8, 3, 1, 1, VAProfileAV1Profile0 }, + { AV_PROFILE_AV1_MAIN, 10, 3, 1, 1, VAProfileAV1Profile0 }, + { AV_PROFILE_UNKNOWN } +}; + +static const VAAPIEncodeType vaapi_encode_type_av1 = { + .profiles = vaapi_encode_av1_profiles, + .flags = FLAG_B_PICTURES | FLAG_TIMESTAMP_NO_DELAY, + .default_quality = 25, + + .get_encoder_caps = &vaapi_encode_av1_get_encoder_caps, + .configure = &vaapi_encode_av1_configure, + + .sequence_header_type = VAEncPackedHeaderSequence, + .sequence_params_size = sizeof(VAEncSequenceParameterBufferAV1), + .init_sequence_params = &vaapi_encode_av1_init_sequence_params, + .write_sequence_header = &vaapi_encode_av1_write_sequence_header, + + .picture_priv_data_size = sizeof(VAAPIEncodeAV1Picture), + .picture_header_type = VAEncPackedHeaderPicture, + .picture_params_size = sizeof(VAEncPictureParameterBufferAV1), + .init_picture_params = &vaapi_encode_av1_init_picture_params, + .write_picture_header = &vaapi_encode_av1_write_picture_header, + + .slice_params_size = sizeof(VAEncTileGroupBufferAV1), + .init_slice_params = &vaapi_encode_av1_init_slice_params, +}; + +static av_cold int vaapi_encode_av1_init(AVCodecContext *avctx) +{ + VAAPIEncodeContext *ctx = avctx->priv_data; + VAAPIEncodeAV1Context *priv = avctx->priv_data; + VAConfigAttrib attr; + VAStatus vas; + int ret; + + ctx->codec = &vaapi_encode_type_av1; + + ctx->desired_packed_headers = + VA_ENC_PACKED_HEADER_SEQUENCE | + VA_ENC_PACKED_HEADER_PICTURE; + + if (avctx->profile == AV_PROFILE_UNKNOWN) + avctx->profile = priv->profile; + if (avctx->level == AV_LEVEL_UNKNOWN) + avctx->level = priv->level; + + if (avctx->level != AV_LEVEL_UNKNOWN && avctx->level & ~0x1f) { + av_log(avctx, AV_LOG_ERROR, "Invalid level %d\n", avctx->level); + return AVERROR(EINVAL); + } + + ret = ff_vaapi_encode_init(avctx); + if (ret < 0) + return ret; + + attr.type = VAConfigAttribEncAV1; + vas = vaGetConfigAttributes(ctx->hwctx->display, + ctx->va_profile, + ctx->va_entrypoint, + &attr, 1); + if (vas != VA_STATUS_SUCCESS) { + av_log(avctx, AV_LOG_ERROR, "Failed to query " + "config attribute: %d (%s).\n", vas, vaErrorStr(vas)); + return AVERROR_EXTERNAL; + } else if (attr.value == VA_ATTRIB_NOT_SUPPORTED) { + priv->attr.value = 0; + av_log(avctx, AV_LOG_WARNING, "Attribute type:%d is not " + "supported.\n", attr.type); + } else { + priv->attr.value = attr.value; + } + + attr.type = VAConfigAttribEncAV1Ext1; + vas = vaGetConfigAttributes(ctx->hwctx->display, + ctx->va_profile, + ctx->va_entrypoint, + &attr, 1); + if (vas != VA_STATUS_SUCCESS) { + av_log(avctx, AV_LOG_ERROR, "Failed to query " + "config attribute: %d (%s).\n", vas, vaErrorStr(vas)); + return AVERROR_EXTERNAL; + } else if (attr.value == VA_ATTRIB_NOT_SUPPORTED) { + priv->attr_ext1.value = 0; + av_log(avctx, AV_LOG_WARNING, "Attribute type:%d is not " + "supported.\n", attr.type); + } else { + priv->attr_ext1.value = attr.value; + } + + /** This attr provides essential indicators, return error if not support. */ + attr.type = VAConfigAttribEncAV1Ext2; + vas = vaGetConfigAttributes(ctx->hwctx->display, + ctx->va_profile, + ctx->va_entrypoint, + &attr, 1); + if (vas != VA_STATUS_SUCCESS || attr.value == VA_ATTRIB_NOT_SUPPORTED) { + av_log(avctx, AV_LOG_ERROR, "Failed to query " + "config attribute: %d (%s).\n", vas, vaErrorStr(vas)); + return AVERROR_EXTERNAL; + } else { + priv->attr_ext2.value = attr.value; + } + + av_opt_set_int(priv->cbc->priv_data, "fixed_obu_size_length", + priv->attr_ext2.bits.obu_size_bytes_minus1 + 1, 0); + + ret = vaapi_encode_av1_set_tile(avctx); + if (ret < 0) + return ret; + + return 0; +} + +static av_cold int vaapi_encode_av1_close(AVCodecContext *avctx) +{ + VAAPIEncodeAV1Context *priv = avctx->priv_data; + + ff_cbs_fragment_free(&priv->current_obu); + ff_cbs_close(&priv->cbc); + + return ff_vaapi_encode_close(avctx); +} + +#define OFFSET(x) offsetof(VAAPIEncodeAV1Context, x) +#define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM) + +static const AVOption vaapi_encode_av1_options[] = { + VAAPI_ENCODE_COMMON_OPTIONS, + VAAPI_ENCODE_RC_OPTIONS, + { "profile", "Set profile (seq_profile)", + OFFSET(profile), AV_OPT_TYPE_INT, + { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, 0xff, FLAGS, "profile" }, + +#define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \ + { .i64 = value }, 0, 0, FLAGS, "profile" + { PROFILE("main", AV_PROFILE_AV1_MAIN) }, + { PROFILE("high", AV_PROFILE_AV1_HIGH) }, + { PROFILE("professional", AV_PROFILE_AV1_PROFESSIONAL) }, +#undef PROFILE + + { "tier", "Set tier (seq_tier)", + OFFSET(tier), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS, "tier" }, + { "main", NULL, 0, AV_OPT_TYPE_CONST, + { .i64 = 0 }, 0, 0, FLAGS, "tier" }, + { "high", NULL, 0, AV_OPT_TYPE_CONST, + { .i64 = 1 }, 0, 0, FLAGS, "tier" }, + { "level", "Set level (seq_level_idx)", + OFFSET(level), AV_OPT_TYPE_INT, + { .i64 = AV_LEVEL_UNKNOWN }, AV_LEVEL_UNKNOWN, 0x1f, FLAGS, "level" }, + +#define LEVEL(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \ + { .i64 = value }, 0, 0, FLAGS, "level" + { LEVEL("2.0", 0) }, + { LEVEL("2.1", 1) }, + { LEVEL("3.0", 4) }, + { LEVEL("3.1", 5) }, + { LEVEL("4.0", 8) }, + { LEVEL("4.1", 9) }, + { LEVEL("5.0", 12) }, + { LEVEL("5.1", 13) }, + { LEVEL("5.2", 14) }, + { LEVEL("5.3", 15) }, + { LEVEL("6.0", 16) }, + { LEVEL("6.1", 17) }, + { LEVEL("6.2", 18) }, + { LEVEL("6.3", 19) }, +#undef LEVEL + + { "tiles", "Tile columns x rows (Use minimal tile column/row number automatically by default)", + OFFSET(tile_cols), AV_OPT_TYPE_IMAGE_SIZE, { .str = NULL }, 0, 0, FLAGS }, + { "tile_groups", "Number of tile groups for encoding", + OFFSET(tile_groups), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, AV1_MAX_TILE_ROWS * AV1_MAX_TILE_COLS, FLAGS }, + + { NULL }, +}; + +static const FFCodecDefault vaapi_encode_av1_defaults[] = { + { "b", "0" }, + { "bf", "2" }, + { "g", "120" }, + { "qmin", "1" }, + { "qmax", "255" }, + { NULL }, +}; + +static const AVClass vaapi_encode_av1_class = { + .class_name = "av1_vaapi", + .item_name = av_default_item_name, + .option = vaapi_encode_av1_options, + .version = LIBAVUTIL_VERSION_INT, +}; + +const FFCodec ff_av1_vaapi_encoder = { + .p.name = "av1_vaapi", + CODEC_LONG_NAME("AV1 (VAAPI)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, + .priv_data_size = sizeof(VAAPIEncodeAV1Context), + .init = &vaapi_encode_av1_init, + FF_CODEC_RECEIVE_PACKET_CB(&ff_vaapi_encode_receive_packet), + .close = &vaapi_encode_av1_close, + .p.priv_class = &vaapi_encode_av1_class, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | + AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | + FF_CODEC_CAP_INIT_CLEANUP, + .defaults = vaapi_encode_av1_defaults, + .p.pix_fmts = (const enum AVPixelFormat[]) { + AV_PIX_FMT_VAAPI, + AV_PIX_FMT_NONE, + }, + .hw_configs = ff_vaapi_encode_hw_configs, + .p.wrapper_name = "vaapi", +}; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode_h264.c b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode_h264.c index 9ad017d5..57b5ea2b 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode_h264.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode_h264.c @@ -322,15 +322,15 @@ static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx) sps->profile_idc = avctx->profile & 0xff; - if (avctx->profile == FF_PROFILE_H264_CONSTRAINED_BASELINE || - avctx->profile == FF_PROFILE_H264_MAIN) + if (avctx->profile == AV_PROFILE_H264_CONSTRAINED_BASELINE || + avctx->profile == AV_PROFILE_H264_MAIN) sps->constraint_set1_flag = 1; - if (avctx->profile == FF_PROFILE_H264_HIGH || avctx->profile == FF_PROFILE_H264_HIGH_10) + if (avctx->profile == AV_PROFILE_H264_HIGH || avctx->profile == AV_PROFILE_H264_HIGH_10) sps->constraint_set3_flag = ctx->gop_size == 1; - if (avctx->profile == FF_PROFILE_H264_MAIN || - avctx->profile == FF_PROFILE_H264_HIGH || avctx->profile == FF_PROFILE_H264_HIGH_10) { + if (avctx->profile == AV_PROFILE_H264_MAIN || + avctx->profile == AV_PROFILE_H264_HIGH || avctx->profile == AV_PROFILE_H264_HIGH_10) { sps->constraint_set4_flag = 1; sps->constraint_set5_flag = ctx->b_per_p == 0; } @@ -340,7 +340,7 @@ static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx) else priv->dpb_frames = 1 + ctx->max_b_depth; - if (avctx->level != FF_LEVEL_UNKNOWN) { + if (avctx->level != AV_LEVEL_UNKNOWN) { sps->level_idc = avctx->level; } else { const H264LevelDescriptor *level; @@ -512,9 +512,9 @@ static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx) pps->seq_parameter_set_id = 0; pps->entropy_coding_mode_flag = - !(sps->profile_idc == FF_PROFILE_H264_BASELINE || - sps->profile_idc == FF_PROFILE_H264_EXTENDED || - sps->profile_idc == FF_PROFILE_H264_CAVLC_444); + !(sps->profile_idc == AV_PROFILE_H264_BASELINE || + sps->profile_idc == AV_PROFILE_H264_EXTENDED || + sps->profile_idc == AV_PROFILE_H264_CAVLC_444); if (!priv->coder && pps->entropy_coding_mode_flag) pps->entropy_coding_mode_flag = 0; @@ -523,9 +523,9 @@ static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx) pps->pic_init_qp_minus26 = priv->fixed_qp_idr - 26; - if (sps->profile_idc == FF_PROFILE_H264_BASELINE || - sps->profile_idc == FF_PROFILE_H264_EXTENDED || - sps->profile_idc == FF_PROFILE_H264_MAIN) { + if (sps->profile_idc == AV_PROFILE_H264_BASELINE || + sps->profile_idc == AV_PROFILE_H264_EXTENDED || + sps->profile_idc == AV_PROFILE_H264_MAIN) { pps->more_rbsp_data = 0; } else { pps->more_rbsp_data = 1; @@ -628,7 +628,7 @@ static int vaapi_encode_h264_init_picture_params(AVCodecContext *avctx, VAAPIEncodePicture *prev = pic->prev; VAAPIEncodeH264Picture *hprev = prev ? prev->priv_data : NULL; VAEncPictureParameterBufferH264 *vpic = pic->codec_picture_params; - int i; + int i, j = 0; if (pic->type == PICTURE_TYPE_IDR) { av_assert0(pic->display_order == pic->encode_order); @@ -729,24 +729,26 @@ static int vaapi_encode_h264_init_picture_params(AVCodecContext *avctx, .TopFieldOrderCnt = hpic->pic_order_cnt, .BottomFieldOrderCnt = hpic->pic_order_cnt, }; + for (int k = 0; k < MAX_REFERENCE_LIST_NUM; k++) { + for (i = 0; i < pic->nb_refs[k]; i++) { + VAAPIEncodePicture *ref = pic->refs[k][i]; + VAAPIEncodeH264Picture *href; - for (i = 0; i < pic->nb_refs; i++) { - VAAPIEncodePicture *ref = pic->refs[i]; - VAAPIEncodeH264Picture *href; + av_assert0(ref && ref->encode_order < pic->encode_order); + href = ref->priv_data; - av_assert0(ref && ref->encode_order < pic->encode_order); - href = ref->priv_data; - - vpic->ReferenceFrames[i] = (VAPictureH264) { - .picture_id = ref->recon_surface, - .frame_idx = href->frame_num, - .flags = VA_PICTURE_H264_SHORT_TERM_REFERENCE, - .TopFieldOrderCnt = href->pic_order_cnt, - .BottomFieldOrderCnt = href->pic_order_cnt, - }; + vpic->ReferenceFrames[j++] = (VAPictureH264) { + .picture_id = ref->recon_surface, + .frame_idx = href->frame_num, + .flags = VA_PICTURE_H264_SHORT_TERM_REFERENCE, + .TopFieldOrderCnt = href->pic_order_cnt, + .BottomFieldOrderCnt = href->pic_order_cnt, + }; + } } - for (; i < FF_ARRAY_ELEMS(vpic->ReferenceFrames); i++) { - vpic->ReferenceFrames[i] = (VAPictureH264) { + + for (; j < FF_ARRAY_ELEMS(vpic->ReferenceFrames); j++) { + vpic->ReferenceFrames[j] = (VAPictureH264) { .picture_id = VA_INVALID_ID, .flags = VA_PICTURE_H264_INVALID, }; @@ -948,17 +950,17 @@ static int vaapi_encode_h264_init_slice_params(AVCodecContext *avctx, if (pic->type == PICTURE_TYPE_P) { int need_rplm = 0; - for (i = 0; i < pic->nb_refs; i++) { - av_assert0(pic->refs[i]); - if (pic->refs[i] != def_l0[i]) + for (i = 0; i < pic->nb_refs[0]; i++) { + av_assert0(pic->refs[0][i]); + if (pic->refs[0][i] != def_l0[i]) need_rplm = 1; } sh->ref_pic_list_modification_flag_l0 = need_rplm; if (need_rplm) { int pic_num = hpic->frame_num; - for (i = 0; i < pic->nb_refs; i++) { - href = pic->refs[i]->priv_data; + for (i = 0; i < pic->nb_refs[0]; i++) { + href = pic->refs[0][i]->priv_data; av_assert0(href->frame_num != pic_num); if (href->frame_num < pic_num) { sh->rplm_l0[i].modification_of_pic_nums_idc = 0; @@ -977,28 +979,29 @@ static int vaapi_encode_h264_init_slice_params(AVCodecContext *avctx, } else { int need_rplm_l0 = 0, need_rplm_l1 = 0; int n0 = 0, n1 = 0; - for (i = 0; i < pic->nb_refs; i++) { - av_assert0(pic->refs[i]); - href = pic->refs[i]->priv_data; - av_assert0(href->pic_order_cnt != hpic->pic_order_cnt); - if (href->pic_order_cnt < hpic->pic_order_cnt) { - if (pic->refs[i] != def_l0[n0]) - need_rplm_l0 = 1; - ++n0; - } else { - if (pic->refs[i] != def_l1[n1]) - need_rplm_l1 = 1; - ++n1; - } + for (i = 0; i < pic->nb_refs[0]; i++) { + av_assert0(pic->refs[0][i]); + href = pic->refs[0][i]->priv_data; + av_assert0(href->pic_order_cnt < hpic->pic_order_cnt); + if (pic->refs[0][i] != def_l0[n0]) + need_rplm_l0 = 1; + ++n0; + } + + for (i = 0; i < pic->nb_refs[1]; i++) { + av_assert0(pic->refs[1][i]); + href = pic->refs[1][i]->priv_data; + av_assert0(href->pic_order_cnt > hpic->pic_order_cnt); + if (pic->refs[1][i] != def_l1[n1]) + need_rplm_l1 = 1; + ++n1; } sh->ref_pic_list_modification_flag_l0 = need_rplm_l0; if (need_rplm_l0) { int pic_num = hpic->frame_num; - for (i = j = 0; i < pic->nb_refs; i++) { - href = pic->refs[i]->priv_data; - if (href->pic_order_cnt > hpic->pic_order_cnt) - continue; + for (i = j = 0; i < pic->nb_refs[0]; i++) { + href = pic->refs[0][i]->priv_data; av_assert0(href->frame_num != pic_num); if (href->frame_num < pic_num) { sh->rplm_l0[j].modification_of_pic_nums_idc = 0; @@ -1019,10 +1022,8 @@ static int vaapi_encode_h264_init_slice_params(AVCodecContext *avctx, sh->ref_pic_list_modification_flag_l1 = need_rplm_l1; if (need_rplm_l1) { int pic_num = hpic->frame_num; - for (i = j = 0; i < pic->nb_refs; i++) { - href = pic->refs[i]->priv_data; - if (href->pic_order_cnt < hpic->pic_order_cnt) - continue; + for (i = j = 0; i < pic->nb_refs[1]; i++) { + href = pic->refs[1][i]->priv_data; av_assert0(href->frame_num != pic_num); if (href->frame_num < pic_num) { sh->rplm_l1[j].modification_of_pic_nums_idc = 0; @@ -1062,14 +1063,13 @@ static int vaapi_encode_h264_init_slice_params(AVCodecContext *avctx, vslice->RefPicList1[i].flags = VA_PICTURE_H264_INVALID; } - av_assert0(pic->nb_refs <= 2); - if (pic->nb_refs >= 1) { + if (pic->nb_refs[0]) { // Backward reference for P- or B-frame. av_assert0(pic->type == PICTURE_TYPE_P || pic->type == PICTURE_TYPE_B); vslice->RefPicList0[0] = vpic->ReferenceFrames[0]; } - if (pic->nb_refs >= 2) { + if (pic->nb_refs[1]) { // Forward reference for B-frame. av_assert0(pic->type == PICTURE_TYPE_B); vslice->RefPicList1[0] = vpic->ReferenceFrames[1]; @@ -1159,13 +1159,13 @@ static av_cold int vaapi_encode_h264_configure(AVCodecContext *avctx) static const VAAPIEncodeProfile vaapi_encode_h264_profiles[] = { #if VA_CHECK_VERSION(1, 18, 0) - { FF_PROFILE_H264_HIGH_10, 10, 3, 1, 1, VAProfileH264High10 }, + { AV_PROFILE_H264_HIGH_10, 10, 3, 1, 1, VAProfileH264High10 }, #endif - { FF_PROFILE_H264_HIGH, 8, 3, 1, 1, VAProfileH264High }, - { FF_PROFILE_H264_MAIN, 8, 3, 1, 1, VAProfileH264Main }, - { FF_PROFILE_H264_CONSTRAINED_BASELINE, + { AV_PROFILE_H264_HIGH, 8, 3, 1, 1, VAProfileH264High }, + { AV_PROFILE_H264_MAIN, 8, 3, 1, 1, VAProfileH264Main }, + { AV_PROFILE_H264_CONSTRAINED_BASELINE, 8, 3, 1, 1, VAProfileH264ConstrainedBaseline }, - { FF_PROFILE_UNKNOWN } + { AV_PROFILE_UNKNOWN } }; static const VAAPIEncodeType vaapi_encode_type_h264 = { @@ -1207,40 +1207,40 @@ static av_cold int vaapi_encode_h264_init(AVCodecContext *avctx) ctx->codec = &vaapi_encode_type_h264; - if (avctx->profile == FF_PROFILE_UNKNOWN) + if (avctx->profile == AV_PROFILE_UNKNOWN) avctx->profile = priv->profile; - if (avctx->level == FF_LEVEL_UNKNOWN) + if (avctx->level == AV_LEVEL_UNKNOWN) avctx->level = priv->level; if (avctx->compression_level == FF_COMPRESSION_DEFAULT) avctx->compression_level = priv->quality; // Reject unsupported profiles. switch (avctx->profile) { - case FF_PROFILE_H264_BASELINE: + case AV_PROFILE_H264_BASELINE: av_log(avctx, AV_LOG_WARNING, "H.264 baseline profile is not " "supported, using constrained baseline profile instead.\n"); - avctx->profile = FF_PROFILE_H264_CONSTRAINED_BASELINE; + avctx->profile = AV_PROFILE_H264_CONSTRAINED_BASELINE; break; - case FF_PROFILE_H264_EXTENDED: + case AV_PROFILE_H264_EXTENDED: av_log(avctx, AV_LOG_ERROR, "H.264 extended profile " "is not supported.\n"); return AVERROR_PATCHWELCOME; - case FF_PROFILE_H264_HIGH_10_INTRA: + case AV_PROFILE_H264_HIGH_10_INTRA: av_log(avctx, AV_LOG_ERROR, "H.264 high 10 intra profile " "is not supported.\n"); return AVERROR_PATCHWELCOME; - case FF_PROFILE_H264_HIGH_422: - case FF_PROFILE_H264_HIGH_422_INTRA: - case FF_PROFILE_H264_HIGH_444: - case FF_PROFILE_H264_HIGH_444_PREDICTIVE: - case FF_PROFILE_H264_HIGH_444_INTRA: - case FF_PROFILE_H264_CAVLC_444: + case AV_PROFILE_H264_HIGH_422: + case AV_PROFILE_H264_HIGH_422_INTRA: + case AV_PROFILE_H264_HIGH_444: + case AV_PROFILE_H264_HIGH_444_PREDICTIVE: + case AV_PROFILE_H264_HIGH_444_INTRA: + case AV_PROFILE_H264_CAVLC_444: av_log(avctx, AV_LOG_ERROR, "H.264 non-4:2:0 profiles " "are not supported.\n"); return AVERROR_PATCHWELCOME; } - if (avctx->level != FF_LEVEL_UNKNOWN && avctx->level & ~0xff) { + if (avctx->level != AV_LEVEL_UNKNOWN && avctx->level & ~0xff) { av_log(avctx, AV_LOG_ERROR, "Invalid level %d: must fit " "in 8-bit unsigned integer.\n", avctx->level); return AVERROR(EINVAL); @@ -1313,19 +1313,19 @@ static const AVOption vaapi_encode_h264_options[] = { { "profile", "Set profile (profile_idc and constraint_set*_flag)", OFFSET(profile), AV_OPT_TYPE_INT, - { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, 0xffff, FLAGS, "profile" }, + { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, 0xffff, FLAGS, "profile" }, #define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \ { .i64 = value }, 0, 0, FLAGS, "profile" - { PROFILE("constrained_baseline", FF_PROFILE_H264_CONSTRAINED_BASELINE) }, - { PROFILE("main", FF_PROFILE_H264_MAIN) }, - { PROFILE("high", FF_PROFILE_H264_HIGH) }, - { PROFILE("high10", FF_PROFILE_H264_HIGH_10) }, + { PROFILE("constrained_baseline", AV_PROFILE_H264_CONSTRAINED_BASELINE) }, + { PROFILE("main", AV_PROFILE_H264_MAIN) }, + { PROFILE("high", AV_PROFILE_H264_HIGH) }, + { PROFILE("high10", AV_PROFILE_H264_HIGH_10) }, #undef PROFILE { "level", "Set level (level_idc)", OFFSET(level), AV_OPT_TYPE_INT, - { .i64 = FF_LEVEL_UNKNOWN }, FF_LEVEL_UNKNOWN, 0xff, FLAGS, "level" }, + { .i64 = AV_LEVEL_UNKNOWN }, AV_LEVEL_UNKNOWN, 0xff, FLAGS, "level" }, #define LEVEL(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \ { .i64 = value }, 0, 0, FLAGS, "level" diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode_h265.c b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode_h265.c index aa7e532f..239ef235 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode_h265.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode_h265.c @@ -346,7 +346,7 @@ static int vaapi_encode_h265_init_sequence_params(AVCodecContext *avctx) ptl->general_lower_bit_rate_constraint_flag = 1; - if (avctx->level != FF_LEVEL_UNKNOWN) { + if (avctx->level != AV_LEVEL_UNKNOWN) { ptl->general_level_idc = avctx->level; } else { const H265LevelDescriptor *level; @@ -764,7 +764,7 @@ static int vaapi_encode_h265_init_picture_params(AVCodecContext *avctx, VAAPIEncodePicture *prev = pic->prev; VAAPIEncodeH265Picture *hprev = prev ? prev->priv_data : NULL; VAEncPictureParameterBufferHEVC *vpic = pic->codec_picture_params; - int i; + int i, j = 0; if (pic->type == PICTURE_TYPE_IDR) { av_assert0(pic->display_order == pic->encode_order); @@ -789,8 +789,8 @@ static int vaapi_encode_h265_init_picture_params(AVCodecContext *avctx, hpic->pic_type = 1; } else { VAAPIEncodePicture *irap_ref; - av_assert0(pic->refs[0] && pic->refs[1]); - for (irap_ref = pic; irap_ref; irap_ref = irap_ref->refs[1]) { + av_assert0(pic->refs[0][0] && pic->refs[1][0]); + for (irap_ref = pic; irap_ref; irap_ref = irap_ref->refs[1][0]) { if (irap_ref->type == PICTURE_TYPE_I) break; } @@ -915,24 +915,27 @@ static int vaapi_encode_h265_init_picture_params(AVCodecContext *avctx, .flags = 0, }; - for (i = 0; i < pic->nb_refs; i++) { - VAAPIEncodePicture *ref = pic->refs[i]; - VAAPIEncodeH265Picture *href; + for (int k = 0; k < MAX_REFERENCE_LIST_NUM; k++) { + for (i = 0; i < pic->nb_refs[k]; i++) { + VAAPIEncodePicture *ref = pic->refs[k][i]; + VAAPIEncodeH265Picture *href; - av_assert0(ref && ref->encode_order < pic->encode_order); - href = ref->priv_data; + av_assert0(ref && ref->encode_order < pic->encode_order); + href = ref->priv_data; - vpic->reference_frames[i] = (VAPictureHEVC) { - .picture_id = ref->recon_surface, - .pic_order_cnt = href->pic_order_cnt, - .flags = (ref->display_order < pic->display_order ? - VA_PICTURE_HEVC_RPS_ST_CURR_BEFORE : 0) | - (ref->display_order > pic->display_order ? - VA_PICTURE_HEVC_RPS_ST_CURR_AFTER : 0), - }; + vpic->reference_frames[j++] = (VAPictureHEVC) { + .picture_id = ref->recon_surface, + .pic_order_cnt = href->pic_order_cnt, + .flags = (ref->display_order < pic->display_order ? + VA_PICTURE_HEVC_RPS_ST_CURR_BEFORE : 0) | + (ref->display_order > pic->display_order ? + VA_PICTURE_HEVC_RPS_ST_CURR_AFTER : 0), + }; + } } - for (; i < FF_ARRAY_ELEMS(vpic->reference_frames); i++) { - vpic->reference_frames[i] = (VAPictureHEVC) { + + for (; j < FF_ARRAY_ELEMS(vpic->reference_frames); j++) { + vpic->reference_frames[j] = (VAPictureHEVC) { .picture_id = VA_INVALID_ID, .flags = VA_PICTURE_HEVC_INVALID, }; @@ -1016,21 +1019,33 @@ static int vaapi_encode_h265_init_slice_params(AVCodecContext *avctx, memset(rps, 0, sizeof(*rps)); rps_pics = 0; - for (i = 0; i < pic->nb_refs; i++) { - strp = pic->refs[i]->priv_data; - rps_poc[rps_pics] = strp->pic_order_cnt; - rps_used[rps_pics] = 1; - ++rps_pics; + for (i = 0; i < MAX_REFERENCE_LIST_NUM; i++) { + for (j = 0; j < pic->nb_refs[i]; j++) { + strp = pic->refs[i][j]->priv_data; + rps_poc[rps_pics] = strp->pic_order_cnt; + rps_used[rps_pics] = 1; + ++rps_pics; + } } + for (i = 0; i < pic->nb_dpb_pics; i++) { if (pic->dpb[i] == pic) continue; - for (j = 0; j < pic->nb_refs; j++) { - if (pic->dpb[i] == pic->refs[j]) + + for (j = 0; j < pic->nb_refs[0]; j++) { + if (pic->dpb[i] == pic->refs[0][j]) break; } - if (j < pic->nb_refs) + if (j < pic->nb_refs[0]) continue; + + for (j = 0; j < pic->nb_refs[1]; j++) { + if (pic->dpb[i] == pic->refs[1][j]) + break; + } + if (j < pic->nb_refs[1]) + continue; + strp = pic->dpb[i]->priv_data; rps_poc[rps_pics] = strp->pic_order_cnt; rps_used[rps_pics] = 0; @@ -1155,8 +1170,7 @@ static int vaapi_encode_h265_init_slice_params(AVCodecContext *avctx, vslice->ref_pic_list1[i].flags = VA_PICTURE_HEVC_INVALID; } - av_assert0(pic->nb_refs <= 2); - if (pic->nb_refs >= 1) { + if (pic->nb_refs[0]) { // Backward reference for P- or B-frame. av_assert0(pic->type == PICTURE_TYPE_P || pic->type == PICTURE_TYPE_B); @@ -1165,7 +1179,7 @@ static int vaapi_encode_h265_init_slice_params(AVCodecContext *avctx, // Reference for GPB B-frame, L0 == L1 vslice->ref_pic_list1[0] = vpic->reference_frames[0]; } - if (pic->nb_refs >= 2) { + if (pic->nb_refs[1]) { // Forward reference for B-frame. av_assert0(pic->type == PICTURE_TYPE_B); vslice->ref_pic_list1[0] = vpic->reference_frames[1]; @@ -1290,22 +1304,22 @@ static av_cold int vaapi_encode_h265_configure(AVCodecContext *avctx) } static const VAAPIEncodeProfile vaapi_encode_h265_profiles[] = { - { FF_PROFILE_HEVC_MAIN, 8, 3, 1, 1, VAProfileHEVCMain }, - { FF_PROFILE_HEVC_REXT, 8, 3, 1, 1, VAProfileHEVCMain }, + { AV_PROFILE_HEVC_MAIN, 8, 3, 1, 1, VAProfileHEVCMain }, + { AV_PROFILE_HEVC_REXT, 8, 3, 1, 1, VAProfileHEVCMain }, #if VA_CHECK_VERSION(0, 37, 0) - { FF_PROFILE_HEVC_MAIN_10, 10, 3, 1, 1, VAProfileHEVCMain10 }, - { FF_PROFILE_HEVC_REXT, 10, 3, 1, 1, VAProfileHEVCMain10 }, + { AV_PROFILE_HEVC_MAIN_10, 10, 3, 1, 1, VAProfileHEVCMain10 }, + { AV_PROFILE_HEVC_REXT, 10, 3, 1, 1, VAProfileHEVCMain10 }, #endif #if VA_CHECK_VERSION(1, 2, 0) - { FF_PROFILE_HEVC_REXT, 12, 3, 1, 1, VAProfileHEVCMain12 }, - { FF_PROFILE_HEVC_REXT, 8, 3, 1, 0, VAProfileHEVCMain422_10 }, - { FF_PROFILE_HEVC_REXT, 10, 3, 1, 0, VAProfileHEVCMain422_10 }, - { FF_PROFILE_HEVC_REXT, 12, 3, 1, 0, VAProfileHEVCMain422_12 }, - { FF_PROFILE_HEVC_REXT, 8, 3, 0, 0, VAProfileHEVCMain444 }, - { FF_PROFILE_HEVC_REXT, 10, 3, 0, 0, VAProfileHEVCMain444_10 }, - { FF_PROFILE_HEVC_REXT, 12, 3, 0, 0, VAProfileHEVCMain444_12 }, + { AV_PROFILE_HEVC_REXT, 12, 3, 1, 1, VAProfileHEVCMain12 }, + { AV_PROFILE_HEVC_REXT, 8, 3, 1, 0, VAProfileHEVCMain422_10 }, + { AV_PROFILE_HEVC_REXT, 10, 3, 1, 0, VAProfileHEVCMain422_10 }, + { AV_PROFILE_HEVC_REXT, 12, 3, 1, 0, VAProfileHEVCMain422_12 }, + { AV_PROFILE_HEVC_REXT, 8, 3, 0, 0, VAProfileHEVCMain444 }, + { AV_PROFILE_HEVC_REXT, 10, 3, 0, 0, VAProfileHEVCMain444_10 }, + { AV_PROFILE_HEVC_REXT, 12, 3, 0, 0, VAProfileHEVCMain444_12 }, #endif - { FF_PROFILE_UNKNOWN } + { AV_PROFILE_UNKNOWN } }; static const VAAPIEncodeType vaapi_encode_type_h265 = { @@ -1348,12 +1362,12 @@ static av_cold int vaapi_encode_h265_init(AVCodecContext *avctx) ctx->codec = &vaapi_encode_type_h265; - if (avctx->profile == FF_PROFILE_UNKNOWN) + if (avctx->profile == AV_PROFILE_UNKNOWN) avctx->profile = priv->profile; - if (avctx->level == FF_LEVEL_UNKNOWN) + if (avctx->level == AV_LEVEL_UNKNOWN) avctx->level = priv->level; - if (avctx->level != FF_LEVEL_UNKNOWN && avctx->level & ~0xff) { + if (avctx->level != AV_LEVEL_UNKNOWN && avctx->level & ~0xff) { av_log(avctx, AV_LOG_ERROR, "Invalid level %d: must fit " "in 8-bit unsigned integer.\n", avctx->level); return AVERROR(EINVAL); @@ -1395,13 +1409,13 @@ static const AVOption vaapi_encode_h265_options[] = { { "profile", "Set profile (general_profile_idc)", OFFSET(profile), AV_OPT_TYPE_INT, - { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, 0xff, FLAGS, "profile" }, + { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, 0xff, FLAGS, "profile" }, #define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \ { .i64 = value }, 0, 0, FLAGS, "profile" - { PROFILE("main", FF_PROFILE_HEVC_MAIN) }, - { PROFILE("main10", FF_PROFILE_HEVC_MAIN_10) }, - { PROFILE("rext", FF_PROFILE_HEVC_REXT) }, + { PROFILE("main", AV_PROFILE_HEVC_MAIN) }, + { PROFILE("main10", AV_PROFILE_HEVC_MAIN_10) }, + { PROFILE("rext", AV_PROFILE_HEVC_REXT) }, #undef PROFILE { "tier", "Set tier (general_tier_flag)", @@ -1414,7 +1428,7 @@ static const AVOption vaapi_encode_h265_options[] = { { "level", "Set level (general_level_idc)", OFFSET(level), AV_OPT_TYPE_INT, - { .i64 = FF_LEVEL_UNKNOWN }, FF_LEVEL_UNKNOWN, 0xff, FLAGS, "level" }, + { .i64 = AV_LEVEL_UNKNOWN }, AV_LEVEL_UNKNOWN, 0xff, FLAGS, "level" }, #define LEVEL(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \ { .i64 = value }, 0, 0, FLAGS, "level" diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode_mjpeg.c b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode_mjpeg.c index cb7588b9..c17747e3 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode_mjpeg.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode_mjpeg.c @@ -480,15 +480,15 @@ static av_cold int vaapi_encode_mjpeg_configure(AVCodecContext *avctx) } static const VAAPIEncodeProfile vaapi_encode_mjpeg_profiles[] = { - { FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, + { AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, 8, 1, 0, 0, VAProfileJPEGBaseline }, - { FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, + { AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, 8, 3, 1, 1, VAProfileJPEGBaseline }, - { FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, + { AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, 8, 3, 1, 0, VAProfileJPEGBaseline }, - { FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, + { AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, 8, 3, 0, 0, VAProfileJPEGBaseline }, - { FF_PROFILE_UNKNOWN } + { AV_PROFILE_UNKNOWN } }; static const VAAPIEncodeType vaapi_encode_type_mjpeg = { diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode_mpeg2.c b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode_mpeg2.c index 9261d19a..d1904bf4 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode_mpeg2.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode_mpeg2.c @@ -458,12 +458,12 @@ static int vaapi_encode_mpeg2_init_picture_params(AVCodecContext *avctx, break; case PICTURE_TYPE_P: vpic->picture_type = VAEncPictureTypePredictive; - vpic->forward_reference_picture = pic->refs[0]->recon_surface; + vpic->forward_reference_picture = pic->refs[0][0]->recon_surface; break; case PICTURE_TYPE_B: vpic->picture_type = VAEncPictureTypeBidirectional; - vpic->forward_reference_picture = pic->refs[0]->recon_surface; - vpic->backward_reference_picture = pic->refs[1]->recon_surface; + vpic->forward_reference_picture = pic->refs[0][0]->recon_surface; + vpic->backward_reference_picture = pic->refs[1][0]->recon_surface; break; default: av_assert0(0 && "invalid picture type"); @@ -558,9 +558,9 @@ static av_cold int vaapi_encode_mpeg2_configure(AVCodecContext *avctx) } static const VAAPIEncodeProfile vaapi_encode_mpeg2_profiles[] = { - { FF_PROFILE_MPEG2_MAIN, 8, 3, 1, 1, VAProfileMPEG2Main }, - { FF_PROFILE_MPEG2_SIMPLE, 8, 3, 1, 1, VAProfileMPEG2Simple }, - { FF_PROFILE_UNKNOWN } + { AV_PROFILE_MPEG2_MAIN, 8, 3, 1, 1, VAProfileMPEG2Main }, + { AV_PROFILE_MPEG2_SIMPLE, 8, 3, 1, 1, VAProfileMPEG2Simple }, + { AV_PROFILE_UNKNOWN } }; static const VAAPIEncodeType vaapi_encode_type_mpeg2 = { @@ -595,9 +595,9 @@ static av_cold int vaapi_encode_mpeg2_init(AVCodecContext *avctx) ctx->codec = &vaapi_encode_type_mpeg2; - if (avctx->profile == FF_PROFILE_UNKNOWN) + if (avctx->profile == AV_PROFILE_UNKNOWN) avctx->profile = priv->profile; - if (avctx->level == FF_LEVEL_UNKNOWN) + if (avctx->level == AV_LEVEL_UNKNOWN) avctx->level = priv->level; // Reject unknown levels (these are required to set f_code for @@ -644,12 +644,12 @@ static const AVOption vaapi_encode_mpeg2_options[] = { { "profile", "Set profile (in profile_and_level_indication)", OFFSET(profile), AV_OPT_TYPE_INT, - { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, 7, FLAGS, "profile" }, + { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, 7, FLAGS, "profile" }, #define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \ { .i64 = value }, 0, 0, FLAGS, "profile" - { PROFILE("simple", FF_PROFILE_MPEG2_SIMPLE) }, - { PROFILE("main", FF_PROFILE_MPEG2_MAIN) }, + { PROFILE("simple", AV_PROFILE_MPEG2_SIMPLE) }, + { PROFILE("main", AV_PROFILE_MPEG2_MAIN) }, #undef PROFILE { "level", "Set level (in profile_and_level_indication)", diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode_vp8.c b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode_vp8.c index ae6a8d31..8a557b96 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode_vp8.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode_vp8.c @@ -86,7 +86,7 @@ static int vaapi_encode_vp8_init_picture_params(AVCodecContext *avctx, switch (pic->type) { case PICTURE_TYPE_IDR: case PICTURE_TYPE_I: - av_assert0(pic->nb_refs == 0); + av_assert0(pic->nb_refs[0] == 0 && pic->nb_refs[1] == 0); vpic->ref_flags.bits.force_kf = 1; vpic->ref_last_frame = vpic->ref_gf_frame = @@ -94,14 +94,14 @@ static int vaapi_encode_vp8_init_picture_params(AVCodecContext *avctx, VA_INVALID_SURFACE; break; case PICTURE_TYPE_P: - av_assert0(pic->nb_refs == 1); + av_assert0(!pic->nb_refs[1]); vpic->ref_flags.bits.no_ref_last = 0; vpic->ref_flags.bits.no_ref_gf = 1; vpic->ref_flags.bits.no_ref_arf = 1; vpic->ref_last_frame = vpic->ref_gf_frame = vpic->ref_arf_frame = - pic->refs[0]->recon_surface; + pic->refs[0][0]->recon_surface; break; default: av_assert0(0 && "invalid picture type"); @@ -180,7 +180,7 @@ static av_cold int vaapi_encode_vp8_configure(AVCodecContext *avctx) static const VAAPIEncodeProfile vaapi_encode_vp8_profiles[] = { { 0 /* VP8 has no profiles */, 8, 3, 1, 1, VAProfileVP8Version0_3 }, - { FF_PROFILE_UNKNOWN } + { AV_PROFILE_UNKNOWN } }; static const VAAPIEncodeType vaapi_encode_type_vp8 = { diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode_vp9.c b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode_vp9.c index af1353ce..c2a8dec7 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode_vp9.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_encode_vp9.c @@ -96,15 +96,15 @@ static int vaapi_encode_vp9_init_picture_params(AVCodecContext *avctx, switch (pic->type) { case PICTURE_TYPE_IDR: - av_assert0(pic->nb_refs == 0); + av_assert0(pic->nb_refs[0] == 0 && pic->nb_refs[1] == 0); vpic->ref_flags.bits.force_kf = 1; vpic->refresh_frame_flags = 0xff; hpic->slot = 0; break; case PICTURE_TYPE_P: - av_assert0(pic->nb_refs == 1); + av_assert0(!pic->nb_refs[1]); { - VAAPIEncodeVP9Picture *href = pic->refs[0]->priv_data; + VAAPIEncodeVP9Picture *href = pic->refs[0][0]->priv_data; av_assert0(href->slot == 0 || href->slot == 1); if (ctx->max_b_depth > 0) { @@ -120,10 +120,10 @@ static int vaapi_encode_vp9_init_picture_params(AVCodecContext *avctx, } break; case PICTURE_TYPE_B: - av_assert0(pic->nb_refs == 2); + av_assert0(pic->nb_refs[0] && pic->nb_refs[1]); { - VAAPIEncodeVP9Picture *href0 = pic->refs[0]->priv_data, - *href1 = pic->refs[1]->priv_data; + VAAPIEncodeVP9Picture *href0 = pic->refs[0][0]->priv_data, + *href1 = pic->refs[1][0]->priv_data; av_assert0(href0->slot < pic->b_depth + 1 && href1->slot < pic->b_depth + 1); @@ -157,12 +157,14 @@ static int vaapi_encode_vp9_init_picture_params(AVCodecContext *avctx, for (i = 0; i < FF_ARRAY_ELEMS(vpic->reference_frames); i++) vpic->reference_frames[i] = VA_INVALID_SURFACE; - for (i = 0; i < pic->nb_refs; i++) { - VAAPIEncodePicture *ref_pic = pic->refs[i]; - int slot; - slot = ((VAAPIEncodeVP9Picture*)ref_pic->priv_data)->slot; - av_assert0(vpic->reference_frames[slot] == VA_INVALID_SURFACE); - vpic->reference_frames[slot] = ref_pic->recon_surface; + for (i = 0; i < MAX_REFERENCE_LIST_NUM; i++) { + for (int j = 0; j < pic->nb_refs[i]; j++) { + VAAPIEncodePicture *ref_pic = pic->refs[i][j]; + int slot; + slot = ((VAAPIEncodeVP9Picture*)ref_pic->priv_data)->slot; + av_assert0(vpic->reference_frames[slot] == VA_INVALID_SURFACE); + vpic->reference_frames[slot] = ref_pic->recon_surface; + } } vpic->pic_flags.bits.frame_type = (pic->type != PICTURE_TYPE_IDR); @@ -227,11 +229,11 @@ static av_cold int vaapi_encode_vp9_configure(AVCodecContext *avctx) } static const VAAPIEncodeProfile vaapi_encode_vp9_profiles[] = { - { FF_PROFILE_VP9_0, 8, 3, 1, 1, VAProfileVP9Profile0 }, - { FF_PROFILE_VP9_1, 8, 3, 0, 0, VAProfileVP9Profile1 }, - { FF_PROFILE_VP9_2, 10, 3, 1, 1, VAProfileVP9Profile2 }, - { FF_PROFILE_VP9_3, 10, 3, 0, 0, VAProfileVP9Profile3 }, - { FF_PROFILE_UNKNOWN } + { AV_PROFILE_VP9_0, 8, 3, 1, 1, VAProfileVP9Profile0 }, + { AV_PROFILE_VP9_1, 8, 3, 0, 0, VAProfileVP9Profile1 }, + { AV_PROFILE_VP9_2, 10, 3, 1, 1, VAProfileVP9Profile2 }, + { AV_PROFILE_VP9_3, 10, 3, 0, 0, VAProfileVP9Profile3 }, + { AV_PROFILE_UNKNOWN } }; static const VAAPIEncodeType vaapi_encode_type_vp9 = { diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_h264.c b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_h264.c index 9332aa6f..55cf5a05 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_h264.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_h264.c @@ -22,7 +22,7 @@ #include "h264dec.h" #include "h264_ps.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "vaapi_decode.h" /** @@ -385,11 +385,11 @@ static int vaapi_h264_decode_slice(AVCodecContext *avctx, return 0; } -const AVHWAccel ff_h264_vaapi_hwaccel = { - .name = "h264_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_h264_vaapi_hwaccel = { + .p.name = "h264_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = &vaapi_h264_start_frame, .end_frame = &vaapi_h264_end_frame, .decode_slice = &vaapi_h264_decode_slice, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_hevc.c b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_hevc.c index 8b12484f..3bdd2dd1 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_hevc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_hevc.c @@ -25,7 +25,7 @@ #include "avcodec.h" #include "hevcdec.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "vaapi_decode.h" #include "vaapi_hevc.h" #include "h265_profile_level.h" @@ -227,8 +227,8 @@ static int vaapi_hevc_start_frame(AVCodecContext *avctx, } #if VA_CHECK_VERSION(1, 2, 0) - if (avctx->profile == FF_PROFILE_HEVC_REXT || - avctx->profile == FF_PROFILE_HEVC_SCC) { + if (avctx->profile == AV_PROFILE_HEVC_REXT || + avctx->profile == AV_PROFILE_HEVC_SCC) { pic->pic_param.rext = (VAPictureParameterBufferHEVCRext) { .range_extension_pic_fields.bits = { .transform_skip_rotation_enabled_flag = sps->transform_skip_rotation_enabled_flag, @@ -262,7 +262,7 @@ static int vaapi_hevc_start_frame(AVCodecContext *avctx, sps->sps_num_palette_predictor_initializers : 0); - if (avctx->profile == FF_PROFILE_HEVC_SCC) { + if (avctx->profile == AV_PROFILE_HEVC_SCC) { pic->pic_param.scc = (VAPictureParameterBufferHEVCScc) { .screen_content_pic_fields.bits = { .pps_curr_pic_ref_enabled_flag = pps->pps_curr_pic_ref_enabled_flag, @@ -294,7 +294,7 @@ static int vaapi_hevc_start_frame(AVCodecContext *avctx, } #endif - pic_param_size = avctx->profile >= FF_PROFILE_HEVC_REXT ? + pic_param_size = avctx->profile >= AV_PROFILE_HEVC_REXT ? sizeof(pic->pic_param) : sizeof(VAPictureParameterBufferHEVC); err = ff_vaapi_decode_make_param_buffer(avctx, &pic->pic, @@ -347,7 +347,7 @@ static int vaapi_hevc_end_frame(AVCodecContext *avctx) VASliceParameterBufferHEVC *last_slice_param = (VASliceParameterBufferHEVC *)&pic->last_slice_param; int ret; - int slice_param_size = avctx->profile >= FF_PROFILE_HEVC_REXT ? + int slice_param_size = avctx->profile >= AV_PROFILE_HEVC_REXT ? sizeof(pic->last_slice_param) : sizeof(VASliceParameterBufferHEVC); if (pic->last_size) { @@ -377,10 +377,10 @@ static void fill_pred_weight_table(AVCodecContext *avctx, { int i; #if VA_CHECK_VERSION(1, 2, 0) - int is_rext = avctx->profile >= FF_PROFILE_HEVC_REXT; + int is_rext = avctx->profile >= AV_PROFILE_HEVC_REXT; #else int is_rext = 0; - if (avctx->profile >= FF_PROFILE_HEVC_REXT) + if (avctx->profile >= AV_PROFILE_HEVC_REXT) av_log(avctx, AV_LOG_WARNING, "Please consider to update to VAAPI 1.2.0 " "or above, which can support REXT related setting correctly.\n"); #endif @@ -461,7 +461,7 @@ static int vaapi_hevc_decode_slice(AVCodecContext *avctx, VAAPIDecodePictureHEVC *pic = h->ref->hwaccel_picture_private; VASliceParameterBufferHEVC *last_slice_param = (VASliceParameterBufferHEVC *)&pic->last_slice_param; - int slice_param_size = avctx->profile >= FF_PROFILE_HEVC_REXT ? + int slice_param_size = avctx->profile >= AV_PROFILE_HEVC_REXT ? sizeof(pic->last_slice_param) : sizeof(VASliceParameterBufferHEVC); int nb_list = (sh->slice_type == HEVC_SLICE_B) ? @@ -526,7 +526,7 @@ static int vaapi_hevc_decode_slice(AVCodecContext *avctx, fill_pred_weight_table(avctx, h, sh, last_slice_param); #if VA_CHECK_VERSION(1, 2, 0) - if (avctx->profile >= FF_PROFILE_HEVC_REXT) { + if (avctx->profile >= AV_PROFILE_HEVC_REXT) { pic->last_slice_param.rext = (VASliceParameterBufferHEVCRext) { .slice_ext_flags.bits = { .cu_chroma_qp_offset_enabled_flag = sh->cu_chroma_qp_offset_enabled_flag, @@ -654,11 +654,11 @@ end: return VAProfileNone; } -const AVHWAccel ff_hevc_vaapi_hwaccel = { - .name = "hevc_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_hevc_vaapi_hwaccel = { + .p.name = "hevc_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = vaapi_hevc_start_frame, .end_frame = vaapi_hevc_end_frame, .decode_slice = vaapi_hevc_decode_slice, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_mjpeg.c b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_mjpeg.c index 81582114..5b8d47bb 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_mjpeg.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_mjpeg.c @@ -19,7 +19,7 @@ #include #include -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "vaapi_decode.h" #include "mjpegdec.h" @@ -142,11 +142,11 @@ fail: return err; } -const AVHWAccel ff_mjpeg_vaapi_hwaccel = { - .name = "mjpeg_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MJPEG, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_mjpeg_vaapi_hwaccel = { + .p.name = "mjpeg_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MJPEG, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = &vaapi_mjpeg_start_frame, .end_frame = &vaapi_mjpeg_end_frame, .decode_slice = &vaapi_mjpeg_decode_slice, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_mpeg2.c b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_mpeg2.c index 5e2b8891..eeb4e873 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_mpeg2.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_mpeg2.c @@ -20,7 +20,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "mpegutils.h" #include "mpegvideo.h" #include "mpegvideodec.h" @@ -172,11 +172,11 @@ static int vaapi_mpeg2_decode_slice(AVCodecContext *avctx, const uint8_t *buffer return 0; } -const AVHWAccel ff_mpeg2_vaapi_hwaccel = { - .name = "mpeg2_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG2VIDEO, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_mpeg2_vaapi_hwaccel = { + .p.name = "mpeg2_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG2VIDEO, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = &vaapi_mpeg2_start_frame, .end_frame = &vaapi_mpeg2_end_frame, .decode_slice = &vaapi_mpeg2_decode_slice, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_mpeg4.c b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_mpeg4.c index 4e74e038..363b686e 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_mpeg4.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_mpeg4.c @@ -23,7 +23,7 @@ #include "config_components.h" #include "h263.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "mpeg4videodec.h" #include "mpegvideo.h" #include "mpegvideodec.h" @@ -180,11 +180,11 @@ static int vaapi_mpeg4_decode_slice(AVCodecContext *avctx, const uint8_t *buffer } #if CONFIG_MPEG4_VAAPI_HWACCEL -const AVHWAccel ff_mpeg4_vaapi_hwaccel = { - .name = "mpeg4_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG4, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_mpeg4_vaapi_hwaccel = { + .p.name = "mpeg4_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG4, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = &vaapi_mpeg4_start_frame, .end_frame = &vaapi_mpeg4_end_frame, .decode_slice = &vaapi_mpeg4_decode_slice, @@ -198,11 +198,11 @@ const AVHWAccel ff_mpeg4_vaapi_hwaccel = { #endif #if CONFIG_H263_VAAPI_HWACCEL -const AVHWAccel ff_h263_vaapi_hwaccel = { - .name = "h263_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H263, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_h263_vaapi_hwaccel = { + .p.name = "h263_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H263, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = &vaapi_mpeg4_start_frame, .end_frame = &vaapi_mpeg4_end_frame, .decode_slice = &vaapi_mpeg4_decode_slice, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_vc1.c b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_vc1.c index fb2132e8..09a5c852 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_vc1.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_vc1.c @@ -22,11 +22,10 @@ #include "config_components.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "mpegvideodec.h" #include "vaapi_decode.h" #include "vc1.h" -#include "vc1data.h" /** Translate FFmpeg MV modes to VA API */ static int get_VAMvModeVC1(enum MVModes mv_mode) @@ -501,11 +500,11 @@ static int vaapi_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, } #if CONFIG_WMV3_VAAPI_HWACCEL -const AVHWAccel ff_wmv3_vaapi_hwaccel = { - .name = "wmv3_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WMV3, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_wmv3_vaapi_hwaccel = { + .p.name = "wmv3_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WMV3, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = &vaapi_vc1_start_frame, .end_frame = &vaapi_vc1_end_frame, .decode_slice = &vaapi_vc1_decode_slice, @@ -518,11 +517,11 @@ const AVHWAccel ff_wmv3_vaapi_hwaccel = { }; #endif -const AVHWAccel ff_vc1_vaapi_hwaccel = { - .name = "vc1_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VC1, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_vc1_vaapi_hwaccel = { + .p.name = "vc1_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VC1, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = &vaapi_vc1_start_frame, .end_frame = &vaapi_vc1_end_frame, .decode_slice = &vaapi_vc1_decode_slice, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_vp8.c b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_vp8.c index 5b18bf8f..31137a45 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_vp8.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_vp8.c @@ -19,7 +19,7 @@ #include #include -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "vaapi_decode.h" #include "vp8.h" @@ -220,11 +220,11 @@ fail: return err; } -const AVHWAccel ff_vp8_vaapi_hwaccel = { - .name = "vp8_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP8, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_vp8_vaapi_hwaccel = { + .p.name = "vp8_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP8, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = &vaapi_vp8_start_frame, .end_frame = &vaapi_vp8_end_frame, .decode_slice = &vaapi_vp8_decode_slice, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_vp9.c b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_vp9.c index 776382f6..9dc7d5e7 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_vp9.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vaapi_vp9.c @@ -22,7 +22,7 @@ #include "libavutil/pixdesc.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "vaapi_decode.h" #include "vp9shared.h" @@ -168,11 +168,11 @@ static int vaapi_vp9_decode_slice(AVCodecContext *avctx, return 0; } -const AVHWAccel ff_vp9_vaapi_hwaccel = { - .name = "vp9_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP9, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_vp9_vaapi_hwaccel = { + .p.name = "vp9_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP9, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = vaapi_vp9_start_frame, .end_frame = vaapi_vp9_end_frame, .decode_slice = vaapi_vp9_decode_slice, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vc1dec.c b/arm/raspi/third_party/ffmpeg/libavcodec/vc1dec.c index 9e343d00..449d2fea 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vc1dec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vc1dec.c @@ -34,6 +34,7 @@ #include "decode.h" #include "get_bits.h" #include "h263dec.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "mpeg_er.h" #include "mpegvideo.h" @@ -483,108 +484,108 @@ static av_cold void vc1_init_static(void) { static VLCElem vlc_table[32372]; - INIT_VLC_STATIC(&ff_vc1_norm2_vlc, VC1_NORM2_VLC_BITS, 4, + VLC_INIT_STATIC(&ff_vc1_norm2_vlc, VC1_NORM2_VLC_BITS, 4, vc1_norm2_bits, 1, 1, vc1_norm2_codes, 1, 1, 1 << VC1_NORM2_VLC_BITS); - INIT_VLC_STATIC(&ff_vc1_norm6_vlc, VC1_NORM6_VLC_BITS, 64, + VLC_INIT_STATIC(&ff_vc1_norm6_vlc, VC1_NORM6_VLC_BITS, 64, vc1_norm6_bits, 1, 1, vc1_norm6_codes, 2, 2, 556); - INIT_VLC_STATIC(&ff_vc1_imode_vlc, VC1_IMODE_VLC_BITS, 7, + VLC_INIT_STATIC(&ff_vc1_imode_vlc, VC1_IMODE_VLC_BITS, 7, vc1_imode_bits, 1, 1, vc1_imode_codes, 1, 1, 1 << VC1_IMODE_VLC_BITS); for (int i = 0; i < 3; i++) { ff_vc1_ttmb_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 0]]; ff_vc1_ttmb_vlc[i].table_allocated = vlc_offs[i * 3 + 1] - vlc_offs[i * 3 + 0]; - init_vlc(&ff_vc1_ttmb_vlc[i], VC1_TTMB_VLC_BITS, 16, + vlc_init(&ff_vc1_ttmb_vlc[i], VC1_TTMB_VLC_BITS, 16, vc1_ttmb_bits[i], 1, 1, - vc1_ttmb_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC); + vc1_ttmb_codes[i], 2, 2, VLC_INIT_USE_STATIC); ff_vc1_ttblk_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 1]]; ff_vc1_ttblk_vlc[i].table_allocated = vlc_offs[i * 3 + 2] - vlc_offs[i * 3 + 1]; - init_vlc(&ff_vc1_ttblk_vlc[i], VC1_TTBLK_VLC_BITS, 8, + vlc_init(&ff_vc1_ttblk_vlc[i], VC1_TTBLK_VLC_BITS, 8, vc1_ttblk_bits[i], 1, 1, - vc1_ttblk_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + vc1_ttblk_codes[i], 1, 1, VLC_INIT_USE_STATIC); ff_vc1_subblkpat_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 2]]; ff_vc1_subblkpat_vlc[i].table_allocated = vlc_offs[i * 3 + 3] - vlc_offs[i * 3 + 2]; - init_vlc(&ff_vc1_subblkpat_vlc[i], VC1_SUBBLKPAT_VLC_BITS, 15, + vlc_init(&ff_vc1_subblkpat_vlc[i], VC1_SUBBLKPAT_VLC_BITS, 15, vc1_subblkpat_bits[i], 1, 1, - vc1_subblkpat_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + vc1_subblkpat_codes[i], 1, 1, VLC_INIT_USE_STATIC); } for (int i = 0; i < 4; i++) { ff_vc1_4mv_block_pattern_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 9]]; ff_vc1_4mv_block_pattern_vlc[i].table_allocated = vlc_offs[i * 3 + 10] - vlc_offs[i * 3 + 9]; - init_vlc(&ff_vc1_4mv_block_pattern_vlc[i], VC1_4MV_BLOCK_PATTERN_VLC_BITS, 16, + vlc_init(&ff_vc1_4mv_block_pattern_vlc[i], VC1_4MV_BLOCK_PATTERN_VLC_BITS, 16, vc1_4mv_block_pattern_bits[i], 1, 1, - vc1_4mv_block_pattern_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + vc1_4mv_block_pattern_codes[i], 1, 1, VLC_INIT_USE_STATIC); ff_vc1_cbpcy_p_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 10]]; ff_vc1_cbpcy_p_vlc[i].table_allocated = vlc_offs[i * 3 + 11] - vlc_offs[i * 3 + 10]; - init_vlc(&ff_vc1_cbpcy_p_vlc[i], VC1_CBPCY_P_VLC_BITS, 64, + vlc_init(&ff_vc1_cbpcy_p_vlc[i], VC1_CBPCY_P_VLC_BITS, 64, vc1_cbpcy_p_bits[i], 1, 1, - vc1_cbpcy_p_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC); + vc1_cbpcy_p_codes[i], 2, 2, VLC_INIT_USE_STATIC); ff_vc1_mv_diff_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 11]]; ff_vc1_mv_diff_vlc[i].table_allocated = vlc_offs[i * 3 + 12] - vlc_offs[i * 3 + 11]; - init_vlc(&ff_vc1_mv_diff_vlc[i], VC1_MV_DIFF_VLC_BITS, 73, + vlc_init(&ff_vc1_mv_diff_vlc[i], VC1_MV_DIFF_VLC_BITS, 73, vc1_mv_diff_bits[i], 1, 1, - vc1_mv_diff_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC); + vc1_mv_diff_codes[i], 2, 2, VLC_INIT_USE_STATIC); } for (int i = 0; i < 8; i++) { ff_vc1_ac_coeff_table[i].table = &vlc_table[vlc_offs[i * 2 + 21]]; ff_vc1_ac_coeff_table[i].table_allocated = vlc_offs[i * 2 + 22] - vlc_offs[i * 2 + 21]; - init_vlc(&ff_vc1_ac_coeff_table[i], AC_VLC_BITS, ff_vc1_ac_sizes[i], + vlc_init(&ff_vc1_ac_coeff_table[i], AC_VLC_BITS, ff_vc1_ac_sizes[i], &vc1_ac_tables[i][0][1], 8, 4, - &vc1_ac_tables[i][0][0], 8, 4, INIT_VLC_USE_NEW_STATIC); + &vc1_ac_tables[i][0][0], 8, 4, VLC_INIT_USE_STATIC); /* initialize interlaced MVDATA tables (2-Ref) */ ff_vc1_2ref_mvdata_vlc[i].table = &vlc_table[vlc_offs[i * 2 + 22]]; ff_vc1_2ref_mvdata_vlc[i].table_allocated = vlc_offs[i * 2 + 23] - vlc_offs[i * 2 + 22]; - init_vlc(&ff_vc1_2ref_mvdata_vlc[i], VC1_2REF_MVDATA_VLC_BITS, 126, + vlc_init(&ff_vc1_2ref_mvdata_vlc[i], VC1_2REF_MVDATA_VLC_BITS, 126, vc1_2ref_mvdata_bits[i], 1, 1, - vc1_2ref_mvdata_codes[i], 4, 4, INIT_VLC_USE_NEW_STATIC); + vc1_2ref_mvdata_codes[i], 4, 4, VLC_INIT_USE_STATIC); } for (int i = 0; i < 4; i++) { /* initialize 4MV MBMODE VLC tables for interlaced frame P picture */ ff_vc1_intfr_4mv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 37]]; ff_vc1_intfr_4mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 38] - vlc_offs[i * 3 + 37]; - init_vlc(&ff_vc1_intfr_4mv_mbmode_vlc[i], VC1_INTFR_4MV_MBMODE_VLC_BITS, 15, + vlc_init(&ff_vc1_intfr_4mv_mbmode_vlc[i], VC1_INTFR_4MV_MBMODE_VLC_BITS, 15, vc1_intfr_4mv_mbmode_bits[i], 1, 1, - vc1_intfr_4mv_mbmode_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC); + vc1_intfr_4mv_mbmode_codes[i], 2, 2, VLC_INIT_USE_STATIC); /* initialize NON-4MV MBMODE VLC tables for the same */ ff_vc1_intfr_non4mv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 38]]; ff_vc1_intfr_non4mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 39] - vlc_offs[i * 3 + 38]; - init_vlc(&ff_vc1_intfr_non4mv_mbmode_vlc[i], VC1_INTFR_NON4MV_MBMODE_VLC_BITS, 9, + vlc_init(&ff_vc1_intfr_non4mv_mbmode_vlc[i], VC1_INTFR_NON4MV_MBMODE_VLC_BITS, 9, vc1_intfr_non4mv_mbmode_bits[i], 1, 1, - vc1_intfr_non4mv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + vc1_intfr_non4mv_mbmode_codes[i], 1, 1, VLC_INIT_USE_STATIC); /* initialize interlaced MVDATA tables (1-Ref) */ ff_vc1_1ref_mvdata_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 39]]; ff_vc1_1ref_mvdata_vlc[i].table_allocated = vlc_offs[i * 3 + 40] - vlc_offs[i * 3 + 39]; - init_vlc(&ff_vc1_1ref_mvdata_vlc[i], VC1_1REF_MVDATA_VLC_BITS, 72, + vlc_init(&ff_vc1_1ref_mvdata_vlc[i], VC1_1REF_MVDATA_VLC_BITS, 72, vc1_1ref_mvdata_bits[i], 1, 1, - vc1_1ref_mvdata_codes[i], 4, 4, INIT_VLC_USE_NEW_STATIC); + vc1_1ref_mvdata_codes[i], 4, 4, VLC_INIT_USE_STATIC); } for (int i = 0; i < 4; i++) { /* Initialize 2MV Block pattern VLC tables */ ff_vc1_2mv_block_pattern_vlc[i].table = &vlc_table[vlc_offs[i + 49]]; ff_vc1_2mv_block_pattern_vlc[i].table_allocated = vlc_offs[i + 50] - vlc_offs[i + 49]; - init_vlc(&ff_vc1_2mv_block_pattern_vlc[i], VC1_2MV_BLOCK_PATTERN_VLC_BITS, 4, + vlc_init(&ff_vc1_2mv_block_pattern_vlc[i], VC1_2MV_BLOCK_PATTERN_VLC_BITS, 4, vc1_2mv_block_pattern_bits[i], 1, 1, - vc1_2mv_block_pattern_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + vc1_2mv_block_pattern_codes[i], 1, 1, VLC_INIT_USE_STATIC); } for (int i = 0; i < 8; i++) { /* Initialize interlaced CBPCY VLC tables (Table 124 - Table 131) */ ff_vc1_icbpcy_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 53]]; ff_vc1_icbpcy_vlc[i].table_allocated = vlc_offs[i * 3 + 54] - vlc_offs[i * 3 + 53]; - init_vlc(&ff_vc1_icbpcy_vlc[i], VC1_ICBPCY_VLC_BITS, 63, + vlc_init(&ff_vc1_icbpcy_vlc[i], VC1_ICBPCY_VLC_BITS, 63, vc1_icbpcy_p_bits[i], 1, 1, - vc1_icbpcy_p_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC); + vc1_icbpcy_p_codes[i], 2, 2, VLC_INIT_USE_STATIC); /* Initialize interlaced field picture MBMODE VLC tables */ ff_vc1_if_mmv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 54]]; ff_vc1_if_mmv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 55] - vlc_offs[i * 3 + 54]; - init_vlc(&ff_vc1_if_mmv_mbmode_vlc[i], VC1_IF_MMV_MBMODE_VLC_BITS, 8, + vlc_init(&ff_vc1_if_mmv_mbmode_vlc[i], VC1_IF_MMV_MBMODE_VLC_BITS, 8, vc1_if_mmv_mbmode_bits[i], 1, 1, - vc1_if_mmv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + vc1_if_mmv_mbmode_codes[i], 1, 1, VLC_INIT_USE_STATIC); ff_vc1_if_1mv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 55]]; ff_vc1_if_1mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 56] - vlc_offs[i * 3 + 55]; - init_vlc(&ff_vc1_if_1mv_mbmode_vlc[i], VC1_IF_1MV_MBMODE_VLC_BITS, 6, + vlc_init(&ff_vc1_if_1mv_mbmode_vlc[i], VC1_IF_1MV_MBMODE_VLC_BITS, 6, vc1_if_1mv_mbmode_bits[i], 1, 1, - vc1_if_1mv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + vc1_if_1mv_mbmode_codes[i], 1, 1, VLC_INIT_USE_STATIC); } ff_msmp4_vc1_vlcs_init_once(); } @@ -1096,19 +1097,26 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, } if (avctx->hwaccel) { + const FFHWAccel *hwaccel = ffhwaccel(avctx->hwaccel); s->mb_y = 0; if (v->field_mode && buf_start_second_field) { // decode first field s->picture_structure = PICT_BOTTOM_FIELD - v->tff; - if ((ret = avctx->hwaccel->start_frame(avctx, buf_start, buf_start_second_field - buf_start)) < 0) + ret = hwaccel->start_frame(avctx, buf_start, + buf_start_second_field - buf_start); + if (ret < 0) goto err; if (n_slices1 == -1) { // no slices, decode the field as-is - if ((ret = avctx->hwaccel->decode_slice(avctx, buf_start, buf_start_second_field - buf_start)) < 0) + ret = hwaccel->decode_slice(avctx, buf_start, + buf_start_second_field - buf_start); + if (ret < 0) goto err; } else { - if ((ret = avctx->hwaccel->decode_slice(avctx, buf_start, slices[0].rawbuf - buf_start)) < 0) + ret = hwaccel->decode_slice(avctx, buf_start, + slices[0].rawbuf - buf_start); + if (ret < 0) goto err; for (i = 0 ; i < n_slices1 + 1; i++) { @@ -1126,12 +1134,14 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, } } - if ((ret = avctx->hwaccel->decode_slice(avctx, slices[i].rawbuf, slices[i].raw_size)) < 0) + ret = hwaccel->decode_slice(avctx, slices[i].rawbuf, + slices[i].raw_size); + if (ret < 0) goto err; } } - if ((ret = avctx->hwaccel->end_frame(avctx)) < 0) + if ((ret = hwaccel->end_frame(avctx)) < 0) goto err; // decode second field @@ -1147,15 +1157,21 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, } v->s.current_picture_ptr->f->pict_type = v->s.pict_type; - if ((ret = avctx->hwaccel->start_frame(avctx, buf_start_second_field, (buf + buf_size) - buf_start_second_field)) < 0) + ret = hwaccel->start_frame(avctx, buf_start_second_field, + (buf + buf_size) - buf_start_second_field); + if (ret < 0) goto err; if (n_slices - n_slices1 == 2) { // no slices, decode the field as-is - if ((ret = avctx->hwaccel->decode_slice(avctx, buf_start_second_field, (buf + buf_size) - buf_start_second_field)) < 0) + ret = hwaccel->decode_slice(avctx, buf_start_second_field, + (buf + buf_size) - buf_start_second_field); + if (ret < 0) goto err; } else { - if ((ret = avctx->hwaccel->decode_slice(avctx, buf_start_second_field, slices[n_slices1 + 2].rawbuf - buf_start_second_field)) < 0) + ret = hwaccel->decode_slice(avctx, buf_start_second_field, + slices[n_slices1 + 2].rawbuf - buf_start_second_field); + if (ret < 0) goto err; for (i = n_slices1 + 2; i < n_slices; i++) { @@ -1173,25 +1189,33 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, } } - if ((ret = avctx->hwaccel->decode_slice(avctx, slices[i].rawbuf, slices[i].raw_size)) < 0) + ret = hwaccel->decode_slice(avctx, slices[i].rawbuf, + slices[i].raw_size); + if (ret < 0) goto err; } } - if ((ret = avctx->hwaccel->end_frame(avctx)) < 0) + if ((ret = hwaccel->end_frame(avctx)) < 0) goto err; } else { s->picture_structure = PICT_FRAME; - if ((ret = avctx->hwaccel->start_frame(avctx, buf_start, (buf + buf_size) - buf_start)) < 0) + ret = hwaccel->start_frame(avctx, buf_start, + (buf + buf_size) - buf_start); + if (ret < 0) goto err; if (n_slices == 0) { // no slices, decode the frame as-is - if ((ret = avctx->hwaccel->decode_slice(avctx, buf_start, (buf + buf_size) - buf_start)) < 0) + ret = hwaccel->decode_slice(avctx, buf_start, + (buf + buf_size) - buf_start); + if (ret < 0) goto err; } else { // decode the frame part as the first slice - if ((ret = avctx->hwaccel->decode_slice(avctx, buf_start, slices[0].rawbuf - buf_start)) < 0) + ret = hwaccel->decode_slice(avctx, buf_start, + slices[0].rawbuf - buf_start); + if (ret < 0) goto err; // and process the slices as additional slices afterwards @@ -1210,11 +1234,13 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, } } - if ((ret = avctx->hwaccel->decode_slice(avctx, slices[i].rawbuf, slices[i].raw_size)) < 0) + ret = hwaccel->decode_slice(avctx, slices[i].rawbuf, + slices[i].raw_size); + if (ret < 0) goto err; } } - if ((ret = avctx->hwaccel->end_frame(avctx)) < 0) + if ((ret = hwaccel->end_frame(avctx)) < 0) goto err; } } else { @@ -1322,7 +1348,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, if ( !v->field_mode && avctx->codec_id != AV_CODEC_ID_WMV3IMAGE && avctx->codec_id != AV_CODEC_ID_VC1IMAGE) - ff_er_frame_end(&s->er); + ff_er_frame_end(&s->er, NULL); } ff_mpv_frame_end(s); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vdpau.c b/arm/raspi/third_party/ffmpeg/libavcodec/vdpau.c index 0bb793c0..2b9b78d8 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vdpau.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vdpau.c @@ -27,6 +27,7 @@ #include "avcodec.h" #include "decode.h" +#include "hwaccel_internal.h" #include "internal.h" #include "mpegvideodec.h" #include "vc1.h" @@ -324,8 +325,8 @@ static int ff_vdpau_common_reinit(AVCodecContext *avctx) avctx->coded_height == vdctx->height && (!hwctx || !hwctx->reset)) return 0; - avctx->hwaccel->uninit(avctx); - return avctx->hwaccel->init(avctx); + FF_HW_SIMPLE_CALL(avctx, uninit); + return FF_HW_SIMPLE_CALL(avctx, init); } int ff_vdpau_common_start_frame(struct vdpau_picture_context *pic_ctx, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vdpau_av1.c b/arm/raspi/third_party/ffmpeg/libavcodec/vdpau_av1.c index 3c3c8e61..80923092 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vdpau_av1.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vdpau_av1.c @@ -25,7 +25,7 @@ #include "avcodec.h" #include "internal.h" #include "av1dec.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "vdpau.h" #include "vdpau_internal.h" @@ -337,13 +337,13 @@ static int vdpau_av1_init(AVCodecContext *avctx) uint32_t level = avctx->level; switch (avctx->profile) { - case FF_PROFILE_AV1_MAIN: + case AV_PROFILE_AV1_MAIN: profile = VDP_DECODER_PROFILE_AV1_MAIN; break; - case FF_PROFILE_AV1_HIGH: + case AV_PROFILE_AV1_HIGH: profile = VDP_DECODER_PROFILE_AV1_HIGH; break; - case FF_PROFILE_AV1_PROFESSIONAL: + case AV_PROFILE_AV1_PROFESSIONAL: profile = VDP_DECODER_PROFILE_AV1_PROFESSIONAL; break; default: @@ -353,11 +353,11 @@ static int vdpau_av1_init(AVCodecContext *avctx) return ff_vdpau_common_init(avctx, profile, level); } -const AVHWAccel ff_av1_vdpau_hwaccel = { - .name = "av1_vdpau", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AV1, - .pix_fmt = AV_PIX_FMT_VDPAU, +const FFHWAccel ff_av1_vdpau_hwaccel = { + .p.name = "av1_vdpau", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, + .p.pix_fmt = AV_PIX_FMT_VDPAU, .start_frame = vdpau_av1_start_frame, .end_frame = vdpau_av1_end_frame, .decode_slice = vdpau_av1_decode_slice, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vdpau_h264.c b/arm/raspi/third_party/ffmpeg/libavcodec/vdpau_h264.c index 525e2084..9c08e404 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vdpau_h264.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vdpau_h264.c @@ -26,7 +26,7 @@ #include "avcodec.h" #include "h264dec.h" #include "h264_ps.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "mpegutils.h" #include "vdpau.h" #include "vdpau_internal.h" @@ -219,35 +219,35 @@ static int vdpau_h264_init(AVCodecContext *avctx) VdpDecoderProfile profile; uint32_t level = avctx->level; - switch (avctx->profile & ~FF_PROFILE_H264_INTRA) { - case FF_PROFILE_H264_BASELINE: + switch (avctx->profile & ~AV_PROFILE_H264_INTRA) { + case AV_PROFILE_H264_BASELINE: profile = VDP_DECODER_PROFILE_H264_BASELINE; break; - case FF_PROFILE_H264_CONSTRAINED_BASELINE: + case AV_PROFILE_H264_CONSTRAINED_BASELINE: #ifdef VDP_DECODER_PROFILE_H264_CONSTRAINED_BASELINE profile = VDP_DECODER_PROFILE_H264_CONSTRAINED_BASELINE; break; #endif - case FF_PROFILE_H264_MAIN: + case AV_PROFILE_H264_MAIN: profile = VDP_DECODER_PROFILE_H264_MAIN; break; - case FF_PROFILE_H264_HIGH: + case AV_PROFILE_H264_HIGH: profile = VDP_DECODER_PROFILE_H264_HIGH; break; #ifdef VDP_DECODER_PROFILE_H264_EXTENDED - case FF_PROFILE_H264_EXTENDED: + case AV_PROFILE_H264_EXTENDED: profile = VDP_DECODER_PROFILE_H264_EXTENDED; break; #endif - case FF_PROFILE_H264_HIGH_10: + case AV_PROFILE_H264_HIGH_10: /* XXX: High 10 can be treated as High so long as only 8 bits per * format are supported. */ profile = VDP_DECODER_PROFILE_H264_HIGH; break; #ifdef VDP_DECODER_PROFILE_H264_HIGH_444_PREDICTIVE - case FF_PROFILE_H264_HIGH_422: - case FF_PROFILE_H264_HIGH_444_PREDICTIVE: - case FF_PROFILE_H264_CAVLC_444: + case AV_PROFILE_H264_HIGH_422: + case AV_PROFILE_H264_HIGH_444_PREDICTIVE: + case AV_PROFILE_H264_CAVLC_444: profile = VDP_DECODER_PROFILE_H264_HIGH_444_PREDICTIVE; break; #endif @@ -255,17 +255,17 @@ static int vdpau_h264_init(AVCodecContext *avctx) return AVERROR(ENOTSUP); } - if ((avctx->profile & FF_PROFILE_H264_INTRA) && avctx->level == 11) + if ((avctx->profile & AV_PROFILE_H264_INTRA) && avctx->level == 11) level = VDP_DECODER_LEVEL_H264_1b; return ff_vdpau_common_init(avctx, profile, level); } -const AVHWAccel ff_h264_vdpau_hwaccel = { - .name = "h264_vdpau", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, - .pix_fmt = AV_PIX_FMT_VDPAU, +const FFHWAccel ff_h264_vdpau_hwaccel = { + .p.name = "h264_vdpau", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, + .p.pix_fmt = AV_PIX_FMT_VDPAU, .start_frame = vdpau_h264_start_frame, .end_frame = vdpau_h264_end_frame, .decode_slice = vdpau_h264_decode_slice, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vdpau_hevc.c b/arm/raspi/third_party/ffmpeg/libavcodec/vdpau_hevc.c index 2669040f..4cd7ce56 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vdpau_hevc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vdpau_hevc.c @@ -25,7 +25,7 @@ #include "avcodec.h" #include "hevc_data.h" #include "hevcdec.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "vdpau.h" #include "vdpau_internal.h" #include "h265_profile_level.h" @@ -519,16 +519,16 @@ static int vdpau_hevc_init(AVCodecContext *avctx) int ret; switch (avctx->profile) { - case FF_PROFILE_HEVC_MAIN: + case AV_PROFILE_HEVC_MAIN: profile = VDP_DECODER_PROFILE_HEVC_MAIN; break; - case FF_PROFILE_HEVC_MAIN_10: + case AV_PROFILE_HEVC_MAIN_10: profile = VDP_DECODER_PROFILE_HEVC_MAIN_10; break; - case FF_PROFILE_HEVC_MAIN_STILL_PICTURE: + case AV_PROFILE_HEVC_MAIN_STILL_PICTURE: profile = VDP_DECODER_PROFILE_HEVC_MAIN_STILL; break; - case FF_PROFILE_HEVC_REXT: + case AV_PROFILE_HEVC_REXT: ret = vdpau_hevc_parse_rext_profile(avctx, &profile); if (ret) return AVERROR(ENOTSUP); @@ -540,11 +540,11 @@ static int vdpau_hevc_init(AVCodecContext *avctx) return ff_vdpau_common_init(avctx, profile, level); } -const AVHWAccel ff_hevc_vdpau_hwaccel = { - .name = "hevc_vdpau", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, - .pix_fmt = AV_PIX_FMT_VDPAU, +const FFHWAccel ff_hevc_vdpau_hwaccel = { + .p.name = "hevc_vdpau", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, + .p.pix_fmt = AV_PIX_FMT_VDPAU, .start_frame = vdpau_hevc_start_frame, .end_frame = vdpau_hevc_end_frame, .decode_slice = vdpau_hevc_decode_slice, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vdpau_mpeg12.c b/arm/raspi/third_party/ffmpeg/libavcodec/vdpau_mpeg12.c index 79007aa1..bbf76eb4 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vdpau_mpeg12.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vdpau_mpeg12.c @@ -26,7 +26,7 @@ #include #include "avcodec.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "mpegvideo.h" #include "vdpau.h" #include "vdpau_internal.h" @@ -106,11 +106,11 @@ static int vdpau_mpeg1_init(AVCodecContext *avctx) VDP_DECODER_LEVEL_MPEG1_NA); } -const AVHWAccel ff_mpeg1_vdpau_hwaccel = { - .name = "mpeg1_vdpau", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG1VIDEO, - .pix_fmt = AV_PIX_FMT_VDPAU, +const FFHWAccel ff_mpeg1_vdpau_hwaccel = { + .p.name = "mpeg1_vdpau", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG1VIDEO, + .p.pix_fmt = AV_PIX_FMT_VDPAU, .start_frame = vdpau_mpeg_start_frame, .end_frame = ff_vdpau_mpeg_end_frame, .decode_slice = vdpau_mpeg_decode_slice, @@ -128,10 +128,10 @@ static int vdpau_mpeg2_init(AVCodecContext *avctx) VdpDecoderProfile profile; switch (avctx->profile) { - case FF_PROFILE_MPEG2_MAIN: + case AV_PROFILE_MPEG2_MAIN: profile = VDP_DECODER_PROFILE_MPEG2_MAIN; break; - case FF_PROFILE_MPEG2_SIMPLE: + case AV_PROFILE_MPEG2_SIMPLE: profile = VDP_DECODER_PROFILE_MPEG2_SIMPLE; break; default: @@ -141,11 +141,11 @@ static int vdpau_mpeg2_init(AVCodecContext *avctx) return ff_vdpau_common_init(avctx, profile, VDP_DECODER_LEVEL_MPEG2_HL); } -const AVHWAccel ff_mpeg2_vdpau_hwaccel = { - .name = "mpeg2_vdpau", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG2VIDEO, - .pix_fmt = AV_PIX_FMT_VDPAU, +const FFHWAccel ff_mpeg2_vdpau_hwaccel = { + .p.name = "mpeg2_vdpau", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG2VIDEO, + .p.pix_fmt = AV_PIX_FMT_VDPAU, .start_frame = vdpau_mpeg_start_frame, .end_frame = ff_vdpau_mpeg_end_frame, .decode_slice = vdpau_mpeg_decode_slice, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vdpau_mpeg4.c b/arm/raspi/third_party/ffmpeg/libavcodec/vdpau_mpeg4.c index 1211b1df..055426b9 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vdpau_mpeg4.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vdpau_mpeg4.c @@ -24,7 +24,7 @@ #include #include "avcodec.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "mpeg4videodec.h" #include "vdpau.h" #include "vdpau_internal.h" @@ -95,13 +95,13 @@ static int vdpau_mpeg4_init(AVCodecContext *avctx) VdpDecoderProfile profile; switch (avctx->profile) { - case FF_PROFILE_MPEG4_SIMPLE: + case AV_PROFILE_MPEG4_SIMPLE: profile = VDP_DECODER_PROFILE_MPEG4_PART2_SP; break; // As any ASP decoder must be able to decode SP, this // should be a safe fallback if profile is unknown/unspecified. - case FF_PROFILE_UNKNOWN: - case FF_PROFILE_MPEG4_ADVANCED_SIMPLE: + case AV_PROFILE_UNKNOWN: + case AV_PROFILE_MPEG4_ADVANCED_SIMPLE: profile = VDP_DECODER_PROFILE_MPEG4_PART2_ASP; break; default: @@ -111,11 +111,11 @@ static int vdpau_mpeg4_init(AVCodecContext *avctx) return ff_vdpau_common_init(avctx, profile, avctx->level); } -const AVHWAccel ff_mpeg4_vdpau_hwaccel = { - .name = "mpeg4_vdpau", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG4, - .pix_fmt = AV_PIX_FMT_VDPAU, +const FFHWAccel ff_mpeg4_vdpau_hwaccel = { + .p.name = "mpeg4_vdpau", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG4, + .p.pix_fmt = AV_PIX_FMT_VDPAU, .start_frame = vdpau_mpeg4_start_frame, .end_frame = ff_vdpau_mpeg_end_frame, .decode_slice = vdpau_mpeg4_decode_slice, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vdpau_vc1.c b/arm/raspi/third_party/ffmpeg/libavcodec/vdpau_vc1.c index 00b33f42..4e5ee144 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vdpau_vc1.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vdpau_vc1.c @@ -26,7 +26,7 @@ #include #include "avcodec.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "vc1.h" #include "vdpau.h" #include "vdpau_internal.h" @@ -121,13 +121,13 @@ static int vdpau_vc1_init(AVCodecContext *avctx) VdpDecoderProfile profile; switch (avctx->profile) { - case FF_PROFILE_VC1_SIMPLE: + case AV_PROFILE_VC1_SIMPLE: profile = VDP_DECODER_PROFILE_VC1_SIMPLE; break; - case FF_PROFILE_VC1_MAIN: + case AV_PROFILE_VC1_MAIN: profile = VDP_DECODER_PROFILE_VC1_MAIN; break; - case FF_PROFILE_VC1_ADVANCED: + case AV_PROFILE_VC1_ADVANCED: profile = VDP_DECODER_PROFILE_VC1_ADVANCED; break; default: @@ -138,11 +138,11 @@ static int vdpau_vc1_init(AVCodecContext *avctx) } #if CONFIG_WMV3_VDPAU_HWACCEL -const AVHWAccel ff_wmv3_vdpau_hwaccel = { - .name = "wm3_vdpau", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WMV3, - .pix_fmt = AV_PIX_FMT_VDPAU, +const FFHWAccel ff_wmv3_vdpau_hwaccel = { + .p.name = "wm3_vdpau", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WMV3, + .p.pix_fmt = AV_PIX_FMT_VDPAU, .start_frame = vdpau_vc1_start_frame, .end_frame = ff_vdpau_mpeg_end_frame, .decode_slice = vdpau_vc1_decode_slice, @@ -155,11 +155,11 @@ const AVHWAccel ff_wmv3_vdpau_hwaccel = { }; #endif -const AVHWAccel ff_vc1_vdpau_hwaccel = { - .name = "vc1_vdpau", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VC1, - .pix_fmt = AV_PIX_FMT_VDPAU, +const FFHWAccel ff_vc1_vdpau_hwaccel = { + .p.name = "vc1_vdpau", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VC1, + .p.pix_fmt = AV_PIX_FMT_VDPAU, .start_frame = vdpau_vc1_start_frame, .end_frame = ff_vdpau_mpeg_end_frame, .decode_slice = vdpau_vc1_decode_slice, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vdpau_vp9.c b/arm/raspi/third_party/ffmpeg/libavcodec/vdpau_vp9.c index 49fe1818..424e2e60 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vdpau_vp9.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vdpau_vp9.c @@ -23,9 +23,8 @@ #include #include "libavutil/pixdesc.h" #include "avcodec.h" -#include "vp9data.h" +#include "hwaccel_internal.h" #include "vp9dec.h" -#include "hwconfig.h" #include "vdpau.h" #include "vdpau_internal.h" @@ -204,16 +203,16 @@ static int vdpau_vp9_init(AVCodecContext *avctx) uint32_t level = avctx->level; switch (avctx->profile) { - case FF_PROFILE_VP9_0: + case AV_PROFILE_VP9_0: profile = VDP_DECODER_PROFILE_VP9_PROFILE_0; break; - case FF_PROFILE_VP9_1: + case AV_PROFILE_VP9_1: profile = VDP_DECODER_PROFILE_VP9_PROFILE_1; break; - case FF_PROFILE_VP9_2: + case AV_PROFILE_VP9_2: profile = VDP_DECODER_PROFILE_VP9_PROFILE_2; break; - case FF_PROFILE_VP9_3: + case AV_PROFILE_VP9_3: profile = VDP_DECODER_PROFILE_VP9_PROFILE_3; break; default: @@ -223,11 +222,11 @@ static int vdpau_vp9_init(AVCodecContext *avctx) return ff_vdpau_common_init(avctx, profile, level); } -const AVHWAccel ff_vp9_vdpau_hwaccel = { - .name = "vp9_vdpau", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP9, - .pix_fmt = AV_PIX_FMT_VDPAU, +const FFHWAccel ff_vp9_vdpau_hwaccel = { + .p.name = "vp9_vdpau", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP9, + .p.pix_fmt = AV_PIX_FMT_VDPAU, .start_frame = vdpau_vp9_start_frame, .end_frame = vdpau_vp9_end_frame, .decode_slice = vdpau_vp9_decode_slice, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/version.h b/arm/raspi/third_party/ffmpeg/libavcodec/version.h index 9411511e..87b7284a 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/version.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/version.h @@ -29,7 +29,7 @@ #include "version_major.h" -#define LIBAVCODEC_VERSION_MINOR 22 +#define LIBAVCODEC_VERSION_MINOR 28 #define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/version_major.h b/arm/raspi/third_party/ffmpeg/libavcodec/version_major.h index 95c5aec0..b9164fe5 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/version_major.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/version_major.h @@ -50,6 +50,9 @@ #define FF_API_TICKS_PER_FRAME (LIBAVCODEC_VERSION_MAJOR < 61) #define FF_API_DROPCHANGED (LIBAVCODEC_VERSION_MAJOR < 61) +#define FF_API_AVFFT (LIBAVCODEC_VERSION_MAJOR < 62) +#define FF_API_FF_PROFILE_LEVEL (LIBAVCODEC_VERSION_MAJOR < 62) + // reminder to remove CrystalHD decoders on next major bump #define FF_CODEC_CRYSTAL_HD (LIBAVCODEC_VERSION_MAJOR < 61) diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/videotoolbox.c b/arm/raspi/third_party/ffmpeg/libavcodec/videotoolbox.c index 64443255..963379d4 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/videotoolbox.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/videotoolbox.c @@ -33,6 +33,7 @@ #include "internal.h" #include "h264dec.h" #include "hevcdec.h" +#include "hwaccel_internal.h" #include "mpegvideo.h" #include "proresdec.h" #include @@ -1284,11 +1285,11 @@ int ff_videotoolbox_frame_params(AVCodecContext *avctx, return 0; } -const AVHWAccel ff_h263_videotoolbox_hwaccel = { - .name = "h263_videotoolbox", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H263, - .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, +const FFHWAccel ff_h263_videotoolbox_hwaccel = { + .p.name = "h263_videotoolbox", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H263, + .p.pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, .alloc_frame = ff_videotoolbox_alloc_frame, .start_frame = videotoolbox_mpeg_start_frame, .decode_slice = videotoolbox_mpeg_decode_slice, @@ -1299,11 +1300,11 @@ const AVHWAccel ff_h263_videotoolbox_hwaccel = { .priv_data_size = sizeof(VTContext), }; -const AVHWAccel ff_hevc_videotoolbox_hwaccel = { - .name = "hevc_videotoolbox", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, - .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, +const FFHWAccel ff_hevc_videotoolbox_hwaccel = { + .p.name = "hevc_videotoolbox", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, + .p.pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, .alloc_frame = ff_videotoolbox_alloc_frame, .start_frame = videotoolbox_hevc_start_frame, .decode_slice = videotoolbox_hevc_decode_slice, @@ -1315,11 +1316,11 @@ const AVHWAccel ff_hevc_videotoolbox_hwaccel = { .priv_data_size = sizeof(VTContext), }; -const AVHWAccel ff_h264_videotoolbox_hwaccel = { - .name = "h264_videotoolbox", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, - .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, +const FFHWAccel ff_h264_videotoolbox_hwaccel = { + .p.name = "h264_videotoolbox", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, + .p.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, @@ -1331,11 +1332,11 @@ const AVHWAccel ff_h264_videotoolbox_hwaccel = { .priv_data_size = sizeof(VTContext), }; -const AVHWAccel ff_mpeg1_videotoolbox_hwaccel = { - .name = "mpeg1_videotoolbox", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG1VIDEO, - .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, +const FFHWAccel ff_mpeg1_videotoolbox_hwaccel = { + .p.name = "mpeg1_videotoolbox", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG1VIDEO, + .p.pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, .alloc_frame = ff_videotoolbox_alloc_frame, .start_frame = videotoolbox_mpeg_start_frame, .decode_slice = videotoolbox_mpeg_decode_slice, @@ -1346,11 +1347,11 @@ const AVHWAccel ff_mpeg1_videotoolbox_hwaccel = { .priv_data_size = sizeof(VTContext), }; -const AVHWAccel ff_mpeg2_videotoolbox_hwaccel = { - .name = "mpeg2_videotoolbox", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG2VIDEO, - .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, +const FFHWAccel ff_mpeg2_videotoolbox_hwaccel = { + .p.name = "mpeg2_videotoolbox", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG2VIDEO, + .p.pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, .alloc_frame = ff_videotoolbox_alloc_frame, .start_frame = videotoolbox_mpeg_start_frame, .decode_slice = videotoolbox_mpeg_decode_slice, @@ -1361,11 +1362,11 @@ const AVHWAccel ff_mpeg2_videotoolbox_hwaccel = { .priv_data_size = sizeof(VTContext), }; -const AVHWAccel ff_mpeg4_videotoolbox_hwaccel = { - .name = "mpeg4_videotoolbox", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG4, - .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, +const FFHWAccel ff_mpeg4_videotoolbox_hwaccel = { + .p.name = "mpeg4_videotoolbox", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG4, + .p.pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, .alloc_frame = ff_videotoolbox_alloc_frame, .start_frame = videotoolbox_mpeg_start_frame, .decode_slice = videotoolbox_mpeg_decode_slice, @@ -1376,11 +1377,11 @@ const AVHWAccel ff_mpeg4_videotoolbox_hwaccel = { .priv_data_size = sizeof(VTContext), }; -const AVHWAccel ff_prores_videotoolbox_hwaccel = { - .name = "prores_videotoolbox", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PRORES, - .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, +const FFHWAccel ff_prores_videotoolbox_hwaccel = { + .p.name = "prores_videotoolbox", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PRORES, + .p.pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, .alloc_frame = ff_videotoolbox_alloc_frame, .start_frame = videotoolbox_prores_start_frame, .decode_slice = videotoolbox_prores_decode_slice, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/videotoolbox_vp9.c b/arm/raspi/third_party/ffmpeg/libavcodec/videotoolbox_vp9.c index a998f36d..f5489854 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/videotoolbox_vp9.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/videotoolbox_vp9.c @@ -31,6 +31,7 @@ #include "libavutil/intreadwrite.h" #include "libavutil/pixdesc.h" #include "decode.h" +#include "hwaccel_internal.h" #include "internal.h" #include "vp9shared.h" @@ -125,11 +126,11 @@ static int videotoolbox_vp9_end_frame(AVCodecContext *avctx) return ff_videotoolbox_common_end_frame(avctx, frame); } -const AVHWAccel ff_vp9_videotoolbox_hwaccel = { - .name = "vp9_videotoolbox", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP9, - .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, +const FFHWAccel ff_vp9_videotoolbox_hwaccel = { + .p.name = "vp9_videotoolbox", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP9, + .p.pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, .alloc_frame = ff_videotoolbox_alloc_frame, .start_frame = videotoolbox_vp9_start_frame, .decode_slice = videotoolbox_vp9_decode_slice, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/videotoolboxenc.c b/arm/raspi/third_party/ffmpeg/libavcodec/videotoolboxenc.c index 61143513..1d159532 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/videotoolboxenc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/videotoolboxenc.c @@ -206,7 +206,7 @@ static void loadVTEncSymbols(void){ GET_SYM(kVTCompressionPropertyKey_MinAllowedFrameQP, "MinAllowedFrameQP"); } -#define H264_PROFILE_CONSTRAINED_HIGH (FF_PROFILE_H264_HIGH | FF_PROFILE_H264_CONSTRAINED) +#define H264_PROFILE_CONSTRAINED_HIGH (AV_PROFILE_H264_HIGH | AV_PROFILE_H264_CONSTRAINED) typedef enum VTH264Entropy{ VT_ENTROPY_NOT_SET, @@ -232,6 +232,7 @@ typedef struct VTEncContext { AVClass *class; enum AVCodecID codec_id; VTCompressionSessionRef session; + CFDictionaryRef supported_props; CFStringRef ycbcr_matrix; CFStringRef color_primaries; CFStringRef transfer_function; @@ -321,6 +322,34 @@ static void clear_frame_queue(VTEncContext *vtctx) set_async_error(vtctx, 0); } +static void vtenc_reset(VTEncContext *vtctx) +{ + if (vtctx->session) { + CFRelease(vtctx->session); + vtctx->session = NULL; + } + + if (vtctx->supported_props) { + CFRelease(vtctx->supported_props); + vtctx->supported_props = NULL; + } + + if (vtctx->color_primaries) { + CFRelease(vtctx->color_primaries); + vtctx->color_primaries = NULL; + } + + if (vtctx->transfer_function) { + CFRelease(vtctx->transfer_function); + vtctx->transfer_function = NULL; + } + + if (vtctx->ycbcr_matrix) { + CFRelease(vtctx->ycbcr_matrix); + vtctx->ycbcr_matrix = NULL; + } +} + static int vtenc_q_pop(VTEncContext *vtctx, bool wait, CMSampleBufferRef *buf, ExtraSEI **sei) { BufNode *info; @@ -455,22 +484,22 @@ static CMVideoCodecType get_cm_codec_type(AVCodecContext *avctx, return kCMVideoCodecType_HEVC; case AV_CODEC_ID_PRORES: switch (profile) { - case FF_PROFILE_PRORES_PROXY: + case AV_PROFILE_PRORES_PROXY: return MKBETAG('a','p','c','o'); // kCMVideoCodecType_AppleProRes422Proxy - case FF_PROFILE_PRORES_LT: + case AV_PROFILE_PRORES_LT: return MKBETAG('a','p','c','s'); // kCMVideoCodecType_AppleProRes422LT - case FF_PROFILE_PRORES_STANDARD: + case AV_PROFILE_PRORES_STANDARD: return MKBETAG('a','p','c','n'); // kCMVideoCodecType_AppleProRes422 - case FF_PROFILE_PRORES_HQ: + case AV_PROFILE_PRORES_HQ: return MKBETAG('a','p','c','h'); // kCMVideoCodecType_AppleProRes422HQ - case FF_PROFILE_PRORES_4444: + case AV_PROFILE_PRORES_4444: return MKBETAG('a','p','4','h'); // kCMVideoCodecType_AppleProRes4444 - case FF_PROFILE_PRORES_XQ: + case AV_PROFILE_PRORES_XQ: return MKBETAG('a','p','4','x'); // kCMVideoCodecType_AppleProRes4444XQ default: av_log(avctx, AV_LOG_ERROR, "Unknown profile ID: %d, using auto\n", profile); - case FF_PROFILE_UNKNOWN: + case AV_PROFILE_UNKNOWN: if (desc && ((desc->flags & AV_PIX_FMT_FLAG_ALPHA) || desc->log2_chroma_w == 0)) @@ -736,18 +765,18 @@ static bool get_vt_h264_profile_level(AVCodecContext *avctx, VTEncContext *vtctx = avctx->priv_data; int profile = vtctx->profile; - if (profile == FF_PROFILE_UNKNOWN && vtctx->level) { + if (profile == AV_PROFILE_UNKNOWN && vtctx->level) { //Need to pick a profile if level is not auto-selected. - profile = vtctx->has_b_frames ? FF_PROFILE_H264_MAIN : FF_PROFILE_H264_BASELINE; + profile = vtctx->has_b_frames ? AV_PROFILE_H264_MAIN : AV_PROFILE_H264_BASELINE; } *profile_level_val = NULL; switch (profile) { - case FF_PROFILE_UNKNOWN: + case AV_PROFILE_UNKNOWN: return true; - case FF_PROFILE_H264_BASELINE: + case AV_PROFILE_H264_BASELINE: switch (vtctx->level) { case 0: *profile_level_val = compat_keys.kVTProfileLevel_H264_Baseline_AutoLevel; break; @@ -769,7 +798,7 @@ static bool get_vt_h264_profile_level(AVCodecContext *avctx, } break; - case FF_PROFILE_H264_CONSTRAINED_BASELINE: + case AV_PROFILE_H264_CONSTRAINED_BASELINE: *profile_level_val = compat_keys.kVTProfileLevel_H264_ConstrainedBaseline_AutoLevel; if (vtctx->level != 0) { @@ -781,7 +810,7 @@ static bool get_vt_h264_profile_level(AVCodecContext *avctx, } break; - case FF_PROFILE_H264_MAIN: + case AV_PROFILE_H264_MAIN: switch (vtctx->level) { case 0: *profile_level_val = compat_keys.kVTProfileLevel_H264_Main_AutoLevel; break; @@ -812,7 +841,7 @@ static bool get_vt_h264_profile_level(AVCodecContext *avctx, } break; - case FF_PROFILE_H264_HIGH: + case AV_PROFILE_H264_HIGH: switch (vtctx->level) { case 0: *profile_level_val = compat_keys.kVTProfileLevel_H264_High_AutoLevel; break; @@ -835,7 +864,7 @@ static bool get_vt_h264_profile_level(AVCodecContext *avctx, compat_keys.kVTProfileLevel_H264_High_5_2; break; } break; - case FF_PROFILE_H264_EXTENDED: + case AV_PROFILE_H264_EXTENDED: switch (vtctx->level) { case 0: *profile_level_val = compat_keys.kVTProfileLevel_H264_Extended_AutoLevel; break; @@ -868,13 +897,13 @@ static bool get_vt_hevc_profile_level(AVCodecContext *avctx, *profile_level_val = NULL; switch (profile) { - case FF_PROFILE_UNKNOWN: + case AV_PROFILE_UNKNOWN: return true; - case FF_PROFILE_HEVC_MAIN: + case AV_PROFILE_HEVC_MAIN: *profile_level_val = compat_keys.kVTProfileLevel_HEVC_Main_AutoLevel; break; - case FF_PROFILE_HEVC_MAIN_10: + case AV_PROFILE_HEVC_MAIN_10: *profile_level_val = compat_keys.kVTProfileLevel_HEVC_Main10_AutoLevel; break; @@ -1001,132 +1030,20 @@ pbinfo_nomem: return AVERROR(ENOMEM); } -static int get_cv_color_primaries(AVCodecContext *avctx, - CFStringRef *primaries) -{ - enum AVColorPrimaries pri = avctx->color_primaries; - switch (pri) { - case AVCOL_PRI_UNSPECIFIED: - *primaries = NULL; - break; - - case AVCOL_PRI_BT470BG: - *primaries = kCVImageBufferColorPrimaries_EBU_3213; - break; - - case AVCOL_PRI_SMPTE170M: - *primaries = kCVImageBufferColorPrimaries_SMPTE_C; - break; - - case AVCOL_PRI_BT709: - *primaries = kCVImageBufferColorPrimaries_ITU_R_709_2; - break; - - case AVCOL_PRI_BT2020: - *primaries = compat_keys.kCVImageBufferColorPrimaries_ITU_R_2020; - break; - - default: - av_log(avctx, AV_LOG_ERROR, "Color primaries %s is not supported.\n", av_color_primaries_name(pri)); - *primaries = NULL; - return -1; - } - - return 0; -} - -static int get_cv_transfer_function(AVCodecContext *avctx, - CFStringRef *transfer_fnc, - CFNumberRef *gamma_level) +static int get_cv_gamma(AVCodecContext *avctx, + CFNumberRef *gamma_level) { enum AVColorTransferCharacteristic trc = avctx->color_trc; - Float32 gamma; + Float32 gamma = 0; *gamma_level = NULL; - switch (trc) { - case AVCOL_TRC_UNSPECIFIED: - *transfer_fnc = NULL; - break; - - case AVCOL_TRC_BT709: - *transfer_fnc = kCVImageBufferTransferFunction_ITU_R_709_2; - break; - - case AVCOL_TRC_SMPTE240M: - *transfer_fnc = kCVImageBufferTransferFunction_SMPTE_240M_1995; - break; - -#if HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_SMPTE_ST_2084_PQ - case AVCOL_TRC_SMPTE2084: - *transfer_fnc = kCVImageBufferTransferFunction_SMPTE_ST_2084_PQ; - break; -#endif -#if HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_LINEAR - case AVCOL_TRC_LINEAR: - *transfer_fnc = kCVImageBufferTransferFunction_Linear; - break; -#endif -#if HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_ITU_R_2100_HLG - case AVCOL_TRC_ARIB_STD_B67: - *transfer_fnc = kCVImageBufferTransferFunction_ITU_R_2100_HLG; - break; -#endif - - case AVCOL_TRC_GAMMA22: - gamma = 2.2; - *transfer_fnc = kCVImageBufferTransferFunction_UseGamma; - *gamma_level = CFNumberCreate(NULL, kCFNumberFloat32Type, &gamma); - break; - - case AVCOL_TRC_GAMMA28: - gamma = 2.8; - *transfer_fnc = kCVImageBufferTransferFunction_UseGamma; - *gamma_level = CFNumberCreate(NULL, kCFNumberFloat32Type, &gamma); - break; - - case AVCOL_TRC_BT2020_10: - case AVCOL_TRC_BT2020_12: - *transfer_fnc = compat_keys.kCVImageBufferTransferFunction_ITU_R_2020; - break; - - default: - *transfer_fnc = NULL; - av_log(avctx, AV_LOG_ERROR, "Transfer function %s is not supported.\n", av_color_transfer_name(trc)); - return -1; - } - - return 0; -} - -static int get_cv_ycbcr_matrix(AVCodecContext *avctx, CFStringRef *matrix) { - switch(avctx->colorspace) { - case AVCOL_SPC_BT709: - *matrix = kCVImageBufferYCbCrMatrix_ITU_R_709_2; - break; - - case AVCOL_SPC_UNSPECIFIED: - case AVCOL_SPC_RGB: - *matrix = NULL; - break; - - case AVCOL_SPC_BT470BG: - case AVCOL_SPC_SMPTE170M: - *matrix = kCVImageBufferYCbCrMatrix_ITU_R_601_4; - break; - - case AVCOL_SPC_SMPTE240M: - *matrix = kCVImageBufferYCbCrMatrix_SMPTE_240M_1995; - break; - - case AVCOL_SPC_BT2020_NCL: - *matrix = compat_keys.kCVImageBufferYCbCrMatrix_ITU_R_2020; - break; - - default: - av_log(avctx, AV_LOG_ERROR, "Color space %s is not supported.\n", av_color_space_name(avctx->colorspace)); - return -1; - } + if (trc == AVCOL_TRC_GAMMA22) + gamma = 2.2; + else if (trc == AVCOL_TRC_GAMMA28) + gamma = 2.8; + if (gamma != 0) + *gamma_level = CFNumberCreate(NULL, kCFNumberFloat32Type, &gamma); return 0; } @@ -1222,6 +1139,50 @@ static int vtenc_create_encoder(AVCodecContext *avctx, return AVERROR_EXTERNAL; } +#if defined (MAC_OS_X_VERSION_10_13) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_13) + if (__builtin_available(macOS 10.13, *)) { + status = VTCopySupportedPropertyDictionaryForEncoder(avctx->width, + avctx->height, + codec_type, + enc_info, + NULL, + &vtctx->supported_props); + + if (status != noErr) { + av_log(avctx, AV_LOG_ERROR,"Error retrieving the supported property dictionary err=%"PRId64"\n", (int64_t)status); + return AVERROR_EXTERNAL; + } + } +#endif + + // Dump the init encoder + { + CFStringRef encoderID = NULL; + status = VTSessionCopyProperty(vtctx->session, + kVTCompressionPropertyKey_EncoderID, + kCFAllocatorDefault, + &encoderID); + if (status == noErr) { + CFIndex length = CFStringGetLength(encoderID); + CFIndex max_size = CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8); + char *name = av_malloc(max_size); + if (!name) { + CFRelease(encoderID); + return AVERROR(ENOMEM); + } + + CFStringGetCString(encoderID, + name, + max_size, + kCFStringEncodingUTF8); + av_log(avctx, AV_LOG_DEBUG, "Init the encoder: %s\n", name); + + av_freep(&name); + } + if (encoderID != NULL) + CFRelease(encoderID); + } + if (avctx->flags & AV_CODEC_FLAG_QSCALE && !vtenc_qscale_enabled()) { av_log(avctx, AV_LOG_ERROR, "Error: -q:v qscale not available for encoder. Use -b:v bitrate instead.\n"); return AVERROR_EXTERNAL; @@ -1633,12 +1594,12 @@ static int vtenc_configure_encoder(AVCodecContext *avctx) vtctx->get_param_set_func = CMVideoFormatDescriptionGetH264ParameterSetAtIndex; vtctx->has_b_frames = avctx->max_b_frames > 0; - if(vtctx->has_b_frames && (0xFF & vtctx->profile) == FF_PROFILE_H264_BASELINE){ + if(vtctx->has_b_frames && (0xFF & vtctx->profile) == AV_PROFILE_H264_BASELINE){ av_log(avctx, AV_LOG_WARNING, "Cannot use B-frames with baseline profile. Output will not contain B-frames.\n"); vtctx->has_b_frames = 0; } - if (vtctx->entropy == VT_CABAC && (0xFF & vtctx->profile) == FF_PROFILE_H264_BASELINE) { + if (vtctx->entropy == VT_CABAC && (0xFF & vtctx->profile) == AV_PROFILE_H264_BASELINE) { av_log(avctx, AV_LOG_WARNING, "CABAC entropy requires 'main' or 'high' profile, but baseline was requested. Encode will not use CABAC entropy.\n"); vtctx->entropy = VT_ENTROPY_NOT_SET; } @@ -1694,9 +1655,10 @@ static int vtenc_configure_encoder(AVCodecContext *avctx) vtctx->dts_delta = vtctx->has_b_frames ? -1 : 0; - get_cv_transfer_function(avctx, &vtctx->transfer_function, &gamma_level); - get_cv_ycbcr_matrix(avctx, &vtctx->ycbcr_matrix); - get_cv_color_primaries(avctx, &vtctx->color_primaries); + get_cv_gamma(avctx, &gamma_level); + vtctx->transfer_function = av_map_videotoolbox_color_trc_from_av(avctx->color_trc); + vtctx->ycbcr_matrix = av_map_videotoolbox_color_matrix_from_av(avctx->colorspace); + vtctx->color_primaries = av_map_videotoolbox_color_primaries_from_av(avctx->color_primaries); if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) { @@ -1743,9 +1705,8 @@ static av_cold int vtenc_init(AVCodecContext *avctx) pthread_cond_init(&vtctx->cv_sample_sent, NULL); // It can happen when user set avctx->profile directly. - if (vtctx->profile == FF_PROFILE_UNKNOWN) + if (vtctx->profile == AV_PROFILE_UNKNOWN) vtctx->profile = avctx->profile; - vtctx->session = NULL; status = vtenc_configure_encoder(avctx); if (status) return status; @@ -2514,8 +2475,8 @@ static int create_cv_pixel_buffer(AVCodecContext *avctx, vtstatus = VTCompressionSessionPrepareToEncodeFrames(vtctx->session); if (vtstatus == kVTInvalidSessionErr) { - CFRelease(vtctx->session); - vtctx->session = NULL; + vtenc_reset(vtctx); + status = vtenc_configure_encoder(avctx); if (status == 0) pix_buf_pool = VTCompressionSessionGetPixelBufferPool(vtctx->session); @@ -2771,10 +2732,7 @@ static int vtenc_populate_extradata(AVCodecContext *avctx, pe_cleanup: CVPixelBufferRelease(pix_buf); - if(vtctx->session) - CFRelease(vtctx->session); - - vtctx->session = NULL; + vtenc_reset(vtctx); vtctx->frame_ct_out = 0; av_assert0(status != 0 || (avctx->extradata && avctx->extradata_size > 0)); @@ -2797,23 +2755,8 @@ static av_cold int vtenc_close(AVCodecContext *avctx) clear_frame_queue(vtctx); pthread_cond_destroy(&vtctx->cv_sample_sent); pthread_mutex_destroy(&vtctx->lock); - CFRelease(vtctx->session); - vtctx->session = NULL; - if (vtctx->color_primaries) { - CFRelease(vtctx->color_primaries); - vtctx->color_primaries = NULL; - } - - if (vtctx->transfer_function) { - CFRelease(vtctx->transfer_function); - vtctx->transfer_function = NULL; - } - - if (vtctx->ycbcr_matrix) { - CFRelease(vtctx->ycbcr_matrix); - vtctx->ycbcr_matrix = NULL; - } + vtenc_reset(vtctx); return 0; } @@ -2889,13 +2832,13 @@ static const enum AVPixelFormat prores_pix_fmts[] = { #define OFFSET(x) offsetof(VTEncContext, x) static const AVOption h264_options[] = { - { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, INT_MAX, VE, "profile" }, - { "baseline", "Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_BASELINE }, INT_MIN, INT_MAX, VE, "profile" }, - { "constrained_baseline", "Constrained Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_CONSTRAINED_BASELINE }, INT_MIN, INT_MAX, VE, "profile" }, - { "main", "Main Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_MAIN }, INT_MIN, INT_MAX, VE, "profile" }, - { "high", "High Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_HIGH }, INT_MIN, INT_MAX, VE, "profile" }, + { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, INT_MAX, VE, "profile" }, + { "baseline", "Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_BASELINE }, INT_MIN, INT_MAX, VE, "profile" }, + { "constrained_baseline", "Constrained Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_CONSTRAINED_BASELINE }, INT_MIN, INT_MAX, VE, "profile" }, + { "main", "Main Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_MAIN }, INT_MIN, INT_MAX, VE, "profile" }, + { "high", "High Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_HIGH }, INT_MIN, INT_MAX, VE, "profile" }, { "constrained_high", "Constrained High Profile", 0, AV_OPT_TYPE_CONST, { .i64 = H264_PROFILE_CONSTRAINED_HIGH }, INT_MIN, INT_MAX, VE, "profile" }, - { "extended", "Extend Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_EXTENDED }, INT_MIN, INT_MAX, VE, "profile" }, + { "extended", "Extend Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_EXTENDED }, INT_MIN, INT_MAX, VE, "profile" }, { "level", "Level", OFFSET(level), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 52, VE, "level" }, { "1.3", "Level 1.3, only available with Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = 13 }, INT_MIN, INT_MAX, VE, "level" }, @@ -2946,9 +2889,9 @@ const FFCodec ff_h264_videotoolbox_encoder = { }; static const AVOption hevc_options[] = { - { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, INT_MAX, VE, "profile" }, - { "main", "Main Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_HEVC_MAIN }, INT_MIN, INT_MAX, VE, "profile" }, - { "main10", "Main10 Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_HEVC_MAIN_10 }, INT_MIN, INT_MAX, VE, "profile" }, + { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, INT_MAX, VE, "profile" }, + { "main", "Main Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_HEVC_MAIN }, INT_MIN, INT_MAX, VE, "profile" }, + { "main10", "Main10 Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_HEVC_MAIN_10 }, INT_MIN, INT_MAX, VE, "profile" }, { "alpha_quality", "Compression quality for the alpha channel", OFFSET(alpha_quality), AV_OPT_TYPE_DOUBLE, { .dbl = 0.0 }, 0.0, 1.0, VE }, @@ -2983,14 +2926,14 @@ const FFCodec ff_hevc_videotoolbox_encoder = { }; static const AVOption prores_options[] = { - { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, FF_PROFILE_PRORES_XQ, VE, "profile" }, - { "auto", "Automatically determine based on input format", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, VE, "profile" }, - { "proxy", "ProRes 422 Proxy", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_PROXY }, INT_MIN, INT_MAX, VE, "profile" }, - { "lt", "ProRes 422 LT", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_LT }, INT_MIN, INT_MAX, VE, "profile" }, - { "standard", "ProRes 422", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_STANDARD }, INT_MIN, INT_MAX, VE, "profile" }, - { "hq", "ProRes 422 HQ", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_HQ }, INT_MIN, INT_MAX, VE, "profile" }, - { "4444", "ProRes 4444", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_4444 }, INT_MIN, INT_MAX, VE, "profile" }, - { "xq", "ProRes 4444 XQ", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_XQ }, INT_MIN, INT_MAX, VE, "profile" }, + { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, AV_PROFILE_PRORES_XQ, VE, "profile" }, + { "auto", "Automatically determine based on input format", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, VE, "profile" }, + { "proxy", "ProRes 422 Proxy", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_PROXY }, INT_MIN, INT_MAX, VE, "profile" }, + { "lt", "ProRes 422 LT", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_LT }, INT_MIN, INT_MAX, VE, "profile" }, + { "standard", "ProRes 422", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_STANDARD }, INT_MIN, INT_MAX, VE, "profile" }, + { "hq", "ProRes 422 HQ", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_HQ }, INT_MIN, INT_MAX, VE, "profile" }, + { "4444", "ProRes 4444", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_4444 }, INT_MIN, INT_MAX, VE, "profile" }, + { "xq", "ProRes 4444 XQ", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_XQ }, INT_MIN, INT_MAX, VE, "profile" }, COMMON_OPTIONS { NULL }, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vlc.c b/arm/raspi/third_party/ffmpeg/libavcodec/vlc.c index 96f2b28c..e4bbf294 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vlc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vlc.c @@ -30,6 +30,7 @@ #include "libavutil/avassert.h" #include "libavutil/error.h" #include "libavutil/internal.h" +#include "libavutil/intreadwrite.h" #include "libavutil/log.h" #include "libavutil/macros.h" #include "libavutil/mem.h" @@ -63,7 +64,7 @@ static int alloc_table(VLC *vlc, int size, int use_static) vlc->table_size += size; if (vlc->table_size > vlc->table_allocated) { if (use_static) - abort(); // cannot do anything, init_vlc() is used with too little memory + abort(); // cannot do anything, vlc_init() is used with too little memory vlc->table_allocated += (1 << vlc->bits); vlc->table = av_realloc_f(vlc->table, vlc->table_allocated, sizeof(*vlc->table)); if (!vlc->table) { @@ -99,7 +100,7 @@ static int vlc_common_init(VLC *vlc, int nb_bits, int nb_codes, { vlc->bits = nb_bits; vlc->table_size = 0; - if (flags & INIT_VLC_USE_NEW_STATIC) { + if (flags & VLC_INIT_USE_STATIC) { av_assert0(nb_codes <= LOCALBUF_ELEMS); } else { vlc->table = NULL; @@ -143,7 +144,7 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes, if (table_nb_bits > 30) return AVERROR(EINVAL); table_size = 1 << table_nb_bits; - table_index = alloc_table(vlc, table_size, flags & INIT_VLC_USE_NEW_STATIC); + table_index = alloc_table(vlc, table_size, flags & VLC_INIT_USE_STATIC); ff_dlog(NULL, "new table index=%d size=%d\n", table_index, table_size); if (table_index < 0) return table_index; @@ -161,7 +162,7 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes, int nb = 1 << (table_nb_bits - n); int inc = 1; - if (flags & INIT_VLC_OUTPUT_LE) { + if (flags & VLC_INIT_OUTPUT_LE) { j = bitswap_32(code); inc = 1 << n; } @@ -199,7 +200,7 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes, subtable_bits = FFMAX(subtable_bits, n); } subtable_bits = FFMIN(subtable_bits, table_nb_bits); - j = (flags & INIT_VLC_OUTPUT_LE) ? bitswap_32(code_prefix) >> (32 - table_nb_bits) : code_prefix; + j = (flags & VLC_INIT_OUTPUT_LE) ? bitswap_32(code_prefix) >> (32 - table_nb_bits) : code_prefix; table[j].len = -subtable_bits; ff_dlog(NULL, "%4x: n=%d (subtable)\n", j, codes[i].bits + table_nb_bits); @@ -230,9 +231,9 @@ static int vlc_common_end(VLC *vlc, int nb_bits, int nb_codes, VLCcode *codes, { int ret = build_table(vlc, nb_bits, nb_codes, codes, flags); - if (flags & INIT_VLC_USE_NEW_STATIC) { + if (flags & VLC_INIT_USE_STATIC) { if (vlc->table_size != vlc->table_allocated && - !(flags & (INIT_VLC_STATIC_OVERLONG & ~INIT_VLC_USE_NEW_STATIC))) + !(flags & (VLC_INIT_STATIC_OVERLONG & ~VLC_INIT_USE_STATIC))) av_log(NULL, AV_LOG_ERROR, "needed %d had %d\n", vlc->table_size, vlc->table_allocated); av_assert0(ret >= 0); } else { @@ -246,30 +247,7 @@ static int vlc_common_end(VLC *vlc, int nb_bits, int nb_codes, VLCcode *codes, return 0; } -/* Build VLC decoding tables suitable for use with get_vlc(). - - 'nb_bits' sets the decoding table size (2^nb_bits) entries. The - bigger it is, the faster is the decoding. But it should not be too - big to save memory and L1 cache. '9' is a good compromise. - - 'nb_codes' : number of vlcs codes - - 'bits' : table which gives the size (in bits) of each vlc code. - - 'codes' : table which gives the bit pattern of of each vlc code. - - 'symbols' : table which gives the values to be returned from get_vlc(). - - 'xxx_wrap' : give the number of bytes between each entry of the - 'bits' or 'codes' tables. - - 'xxx_size' : gives the number of bytes of each entry of the 'bits' - or 'codes' tables. Currently 1,2 and 4 are supported. - - 'wrap' and 'size' make it possible to use any memory configuration and types - (byte/word/long) to store the 'bits', 'codes', and 'symbols' tables. -*/ -int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, +int ff_vlc_init_sparse(VLC *vlc, int nb_bits, int nb_codes, const void *bits, int bits_wrap, int bits_size, const void *codes, int codes_wrap, int codes_size, const void *symbols, int symbols_wrap, int symbols_size, @@ -291,7 +269,7 @@ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, if (!(condition)) \ continue; \ if (len > 3*nb_bits || len > 32) { \ - av_log(NULL, AV_LOG_ERROR, "Too long VLC (%u) in init_vlc\n", len);\ + av_log(NULL, AV_LOG_ERROR, "Too long VLC (%u) in vlc_init\n", len);\ if (buf != localbuf) \ av_free(buf); \ return AVERROR(EINVAL); \ @@ -300,12 +278,12 @@ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, GET_DATA(buf[j].code, codes, i, codes_wrap, codes_size); \ if (buf[j].code >= (1LL< nb_bits); - // qsort is the slowest part of init_vlc, and could probably be improved or avoided + // qsort is the slowest part of vlc_init, and could probably be improved or avoided AV_QSORT(buf, j, struct VLCcode, compare_vlcspec); COPY(len && len <= nb_bits); nb_codes = j; @@ -325,7 +303,7 @@ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, flags, localbuf); } -int ff_init_vlc_from_lengths(VLC *vlc, int nb_bits, int nb_codes, +int ff_vlc_init_from_lengths(VLC *vlc, int nb_bits, int nb_codes, const int8_t *lens, int lens_wrap, const void *symbols, int symbols_wrap, int symbols_size, int offset, int flags, void *logctx) @@ -372,7 +350,153 @@ fail: return AVERROR_INVALIDDATA; } -void ff_free_vlc(VLC *vlc) +static void add_level(VLC_MULTI_ELEM *table, const int nb_elems, + const int num, const int numbits, + const VLCcode *buf, + uint32_t curcode, int curlen, + int curlimit, int curlevel, + const int minlen, const int max, + unsigned* levelcnt, VLC_MULTI_ELEM *info) +{ + if (nb_elems > 256 && curlevel > 2) + return; // No room + for (int i = num-1; i > max; i--) { + for (int j = 0; j < 2; j++) { + int newlimit, sym; + int t = j ? i-1 : i; + int l = buf[t].bits; + uint32_t code; + + sym = buf[t].symbol; + if (l >= curlimit) + return; + code = curcode + (buf[t].code >> curlen); + newlimit = curlimit - l; + l += curlen; + if (nb_elems>256) AV_WN16(info->val+2*curlevel, sym); + else info->val[curlevel] = sym&0xFF; + + if (curlevel) { // let's not add single entries + uint32_t val = code >> (32 - numbits); + uint32_t nb = val + (1U << (numbits - l)); + info->len = l; + info->num = curlevel+1; + for (; val < nb; val++) + AV_COPY64(table+val, info); + levelcnt[curlevel-1]++; + } + + if (curlevel+1 < VLC_MULTI_MAX_SYMBOLS && newlimit >= minlen) { + add_level(table, nb_elems, num, numbits, buf, + code, l, newlimit, curlevel+1, + minlen, max, levelcnt, info); + } + } + } +} + +static int vlc_multi_gen(VLC_MULTI_ELEM *table, const VLC *single, + const int nb_elems, const int nb_codes, const int numbits, + VLCcode *buf, void *logctx) +{ + int minbits, maxbits, max = nb_codes-1; + unsigned count[VLC_MULTI_MAX_SYMBOLS-1] = { 0, }; + VLC_MULTI_ELEM info = { { 0, }, 0, 0, }; + + minbits = buf[0].bits; + maxbits = buf[0].bits; + + for (int n = 1; n < nb_codes; n++) { + minbits = FFMIN(minbits, buf[n].bits); + maxbits = FFMAX(maxbits, buf[n].bits); + } + maxbits = FFMIN(maxbits, numbits); + + while (max >= nb_codes/2) { + if (buf[max].bits+minbits > maxbits) + break; + max--; + } + + for (int j = 0; j < 1<table[j].len; + table[j].num = single->table[j].len > 0 ? 1 : 0; + AV_WN16(table[j].val, single->table[j].sym); + } + + add_level(table, nb_elems, nb_codes, numbits, buf, + 0, 0, FFMIN(maxbits, numbits), 0, minbits, max, count, &info); + + av_log(logctx, AV_LOG_DEBUG, "Joint: %d/%d/%d/%d/%d codes min=%ubits max=%u\n", + count[0], count[1], count[2], count[3], count[4], minbits, max); + + return 0; +} + +int ff_vlc_init_multi_from_lengths(VLC *vlc, VLC_MULTI *multi, int nb_bits, int nb_elems, + int nb_codes, const int8_t *lens, int lens_wrap, + const void *symbols, int symbols_wrap, int symbols_size, + int offset, int flags, void *logctx) +{ + VLCcode localbuf[LOCALBUF_ELEMS], *buf = localbuf; + uint64_t code; + int ret, j, len_max = FFMIN(32, 3 * nb_bits); + + ret = vlc_common_init(vlc, nb_bits, nb_codes, &buf, flags); + if (ret < 0) + return ret; + + multi->table = av_malloc(sizeof(*multi->table) << nb_bits); + if (!multi->table) + return AVERROR(ENOMEM); + + j = code = 0; + for (int i = 0; i < nb_codes; i++, lens += lens_wrap) { + int len = *lens; + if (len > 0) { + unsigned sym; + + buf[j].bits = len; + if (symbols) + GET_DATA(sym, symbols, i, symbols_wrap, symbols_size) + else + sym = i; + buf[j].symbol = sym + offset; + buf[j++].code = code; + } else if (len < 0) { + len = -len; + } else + continue; + if (len > len_max || code & ((1U << (32 - len)) - 1)) { + av_log(logctx, AV_LOG_ERROR, "Invalid VLC (length %u)\n", len); + goto fail; + } + code += 1U << (32 - len); + if (code > UINT32_MAX + 1ULL) { + av_log(logctx, AV_LOG_ERROR, "Overdetermined VLC tree\n"); + goto fail; + } + } + ret = vlc_common_end(vlc, nb_bits, j, buf, flags, buf); + if (ret < 0) + goto fail; + ret = vlc_multi_gen(multi->table, vlc, nb_elems, j, nb_bits, buf, logctx); + if (buf != localbuf) + av_free(buf); + return ret; +fail: + if (buf != localbuf) + av_free(buf); + ff_vlc_free_multi(multi); + return AVERROR_INVALIDDATA; +} + +void ff_vlc_free_multi(VLC_MULTI *vlc) +{ + av_freep(&vlc->table); +} + +void ff_vlc_free(VLC *vlc) { av_freep(&vlc->table); } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vlc.h b/arm/raspi/third_party/ffmpeg/libavcodec/vlc.h index e63c4847..3f7c033a 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vlc.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vlc.h @@ -21,6 +21,8 @@ #include +#define VLC_MULTI_MAX_SYMBOLS 6 + // When changing this, be sure to also update tableprint_vlc.h accordingly. typedef int16_t VLCBaseType; @@ -34,22 +36,62 @@ typedef struct VLC { int table_size, table_allocated; } VLC; +typedef struct VLC_MULTI_ELEM { + uint8_t val[VLC_MULTI_MAX_SYMBOLS]; + int8_t len; // -31,32 + uint8_t num; +} VLC_MULTI_ELEM; + +typedef struct VLC_MULTI { + VLC_MULTI_ELEM *table; + int table_size, table_allocated; +} VLC_MULTI; + typedef struct RL_VLC_ELEM { int16_t level; int8_t len; uint8_t run; } RL_VLC_ELEM; -#define init_vlc(vlc, nb_bits, nb_codes, \ +#define vlc_init(vlc, nb_bits, nb_codes, \ bits, bits_wrap, bits_size, \ codes, codes_wrap, codes_size, \ flags) \ - ff_init_vlc_sparse(vlc, nb_bits, nb_codes, \ + ff_vlc_init_sparse(vlc, nb_bits, nb_codes, \ bits, bits_wrap, bits_size, \ codes, codes_wrap, codes_size, \ NULL, 0, 0, flags) -int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, +/** + * Build VLC decoding tables suitable for use with get_vlc2(). + * + * @param[in,out] vlc The VLC to be initialized; table and table_allocated + * must have been set when initializing a static VLC, + * otherwise this will be treated as uninitialized. + * @param[in] nb_bits The number of bits to use for the VLC table; + * higher values take up more memory and cache, but + * allow to read codes with fewer reads. + * Corresponds to the `bits` parameter of get_vlc2(). + * @param[in] nb_codes The number of provided bits, codes and (if supplied) + * symbol entries. + * @param[in] bits The lengths (in bits) of the codes. Entries > 0 + * correspond to valid codes; entries == 0 will be skipped. + * @param[in] bits_wrap Stride (in bytes) of the bits table. + * @param[in] codes_size Size of the bits. 1, 2 and 4 are supported. + * @param[in] codes Table which gives the bit pattern of of each vlc code. + * @param[in] codes_wrap Stride (in bytes) of the codes table. + * @param[in] codes_size Size of the codes. 1, 2 and 4 are supported. + * @param[in] symbols The symbols, i.e. what is returned from get_vlc2() + * when the corresponding code is encountered. + * May be NULL, then 0, 1, 2, 3, 4,... will be used. + * @param[in] symbols_wrap Stride (in bytes) of the symbols table. + * @param[in] symbols_size Size of the symbols. 1 and 2 are supported. + * @param[in] flags A combination of the VLC_INIT_* flags. + * + * 'wrap' and 'size' make it possible to use any memory configuration and types + * (byte/word/int) to store the 'bits', 'codes', and 'symbols' tables. + */ +int ff_vlc_init_sparse(VLC *vlc, int nb_bits, int nb_codes, const void *bits, int bits_wrap, int bits_size, const void *codes, int codes_wrap, int codes_size, const void *symbols, int symbols_wrap, int symbols_size, @@ -81,63 +123,103 @@ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, * @param[in] symbols_wrap Stride (in bytes) of the symbols. * @param[in] symbols_size Size of the symbols. 1 and 2 are supported. * @param[in] offset An offset to apply to all the valid symbols. - * @param[in] flags A combination of the INIT_VLC_* flags; notice that - * INIT_VLC_INPUT_LE is pointless and ignored. + * @param[in] flags A combination of the VLC_INIT_* flags; notice that + * VLC_INIT_INPUT_LE is pointless and ignored. */ -int ff_init_vlc_from_lengths(VLC *vlc, int nb_bits, int nb_codes, +int ff_vlc_init_from_lengths(VLC *vlc, int nb_bits, int nb_codes, const int8_t *lens, int lens_wrap, const void *symbols, int symbols_wrap, int symbols_size, int offset, int flags, void *logctx); -void ff_free_vlc(VLC *vlc); +/** + * Build VLC decoding tables suitable for use with get_vlc_multi() + * + * This function takes lengths and symbols and calculates the codes from them. + * For this the input lengths and symbols have to be sorted according to "left + * nodes in the corresponding tree first". + * + * @param[in,out] vlc The VLC to be initialized; table and table_allocated + * must have been set when initializing a static VLC, + * otherwise this will be treated as uninitialized. + * @param[in,out] multi The VLC_MULTI to be initialized; table and table_allocated + * must have been set when initializing a static VLC, + * otherwise this will be treated as uninitialized. + * @param[in] nb_bits The number of bits to use for the VLC table; + * higher values take up more memory and cache, but + * allow to read codes with fewer reads. + * @param[in] nb_elems The max possible number of elements. + * @param[in] nb_codes The number of provided length and (if supplied) symbol + * entries. + * @param[in] lens The lengths of the codes. Entries > 0 correspond to + * valid codes; entries == 0 will be skipped and entries + * with len < 0 indicate that the tree is incomplete and + * has an open end of length -len at this position. + * @param[in] lens_wrap Stride (in bytes) of the lengths. + * @param[in] symbols The symbols, i.e. what is returned from get_vlc2() + * when the corresponding code is encountered. + * May be NULL, then 0, 1, 2, 3, 4,... will be used. + * @param[in] symbols_wrap Stride (in bytes) of the symbols. + * @param[in] symbols_size Size of the symbols. 1 and 2 are supported. + * @param[in] offset An offset to apply to all the valid symbols. + * @param[in] flags A combination of the VLC_INIT_* flags; notice that + * VLC_INIT_INPUT_LE is pointless and ignored. + */ +int ff_vlc_init_multi_from_lengths(VLC *vlc, VLC_MULTI *multi, int nb_bits, int nb_elems, + int nb_codes, const int8_t *lens, int lens_wrap, + const void *symbols, int symbols_wrap, int symbols_size, + int offset, int flags, void *logctx); -/* If INIT_VLC_INPUT_LE is set, the LSB bit of the codes used to + +void ff_vlc_free_multi(VLC_MULTI *vlc); +void ff_vlc_free(VLC *vlc); + +#define VLC_INIT_USE_STATIC 1 +#define VLC_INIT_STATIC_OVERLONG (2 | VLC_INIT_USE_STATIC) +/* If VLC_INIT_INPUT_LE is set, the LSB bit of the codes used to * initialize the VLC table is the first bit to be read. */ -#define INIT_VLC_INPUT_LE 2 +#define VLC_INIT_INPUT_LE 4 /* If set the VLC is intended for a little endian bitstream reader. */ -#define INIT_VLC_OUTPUT_LE 8 -#define INIT_VLC_LE (INIT_VLC_INPUT_LE | INIT_VLC_OUTPUT_LE) -#define INIT_VLC_USE_NEW_STATIC 4 -#define INIT_VLC_STATIC_OVERLONG (1 | INIT_VLC_USE_NEW_STATIC) +#define VLC_INIT_OUTPUT_LE 8 +#define VLC_INIT_LE (VLC_INIT_INPUT_LE | VLC_INIT_OUTPUT_LE) -#define INIT_CUSTOM_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \ +#define VLC_INIT_CUSTOM_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \ h, i, j, flags, static_size) \ do { \ static VLCElem table[static_size]; \ (vlc)->table = table; \ (vlc)->table_allocated = static_size; \ - ff_init_vlc_sparse(vlc, bits, a, b, c, d, e, f, g, h, i, j, \ - flags | INIT_VLC_USE_NEW_STATIC); \ + ff_vlc_init_sparse(vlc, bits, a, b, c, d, e, f, g, h, i, j, \ + flags | VLC_INIT_USE_STATIC); \ } while (0) -#define INIT_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, h, i, j, static_size) \ - INIT_CUSTOM_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \ +#define VLC_INIT_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, h, i, j, static_size) \ + VLC_INIT_CUSTOM_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \ h, i, j, 0, static_size) -#define INIT_LE_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, h, i, j, static_size) \ - INIT_CUSTOM_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \ - h, i, j, INIT_VLC_LE, static_size) +#define VLC_INIT_LE_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, h, i, j, static_size) \ + VLC_INIT_CUSTOM_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \ + h, i, j, VLC_INIT_LE, static_size) -#define INIT_CUSTOM_VLC_STATIC(vlc, bits, a, b, c, d, e, f, g, flags, static_size) \ - INIT_CUSTOM_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \ +#define VLC_INIT_CUSTOM_STATIC(vlc, bits, a, b, c, d, e, f, g, flags, static_size) \ + VLC_INIT_CUSTOM_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \ NULL, 0, 0, flags, static_size) -#define INIT_VLC_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size) \ - INIT_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, NULL, 0, 0, static_size) +#define VLC_INIT_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size) \ + VLC_INIT_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, NULL, 0, 0, static_size) -#define INIT_LE_VLC_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size) \ - INIT_LE_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, NULL, 0, 0, static_size) +#define VLC_INIT_LE_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size) \ + VLC_INIT_LE_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, NULL, 0, 0, static_size) -#define INIT_VLC_STATIC_FROM_LENGTHS(vlc, bits, nb_codes, lens, len_wrap, \ +#define VLC_INIT_STATIC_FROM_LENGTHS(vlc, bits, nb_codes, lens, len_wrap, \ symbols, symbols_wrap, symbols_size, \ offset, flags, static_size) \ do { \ static VLCElem table[static_size]; \ (vlc)->table = table; \ (vlc)->table_allocated = static_size; \ - ff_init_vlc_from_lengths(vlc, bits, nb_codes, lens, len_wrap, \ + ff_vlc_init_from_lengths(vlc, bits, nb_codes, lens, len_wrap, \ symbols, symbols_wrap, symbols_size, \ - offset, flags | INIT_VLC_USE_NEW_STATIC, \ + offset, flags | VLC_INIT_USE_STATIC, \ NULL); \ } while (0) diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vmdvideo.c b/arm/raspi/third_party/ffmpeg/libavcodec/vmdvideo.c index 226ae0d3..2da8af31 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vmdvideo.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vmdvideo.c @@ -454,8 +454,7 @@ static int vmdvideo_decode_frame(AVCodecContext *avctx, AVFrame *frame, memcpy(frame->data[1], s->palette, PALETTE_COUNT * 4); /* shuffle frames */ - av_frame_unref(s->prev_frame); - if ((ret = av_frame_ref(s->prev_frame, frame)) < 0) + if ((ret = av_frame_replace(s->prev_frame, frame)) < 0) return ret; *got_frame = 1; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vmixdec.c b/arm/raspi/third_party/ffmpeg/libavcodec/vmixdec.c index d0f2219a..d6b6e355 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vmixdec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vmixdec.c @@ -23,7 +23,6 @@ #include #include -#include "libavutil/avassert.h" #include "libavutil/intreadwrite.h" #include "libavutil/mem_internal.h" @@ -45,18 +44,28 @@ typedef struct SliceContext { typedef struct VMIXContext { int nb_slices; + int lshift; int16_t factors[64]; uint8_t scan[64]; - SliceContext slices[255]; + SliceContext *slices; + unsigned int slices_size; IDCTDSPContext idsp; } VMIXContext; -static const uint8_t quality[25] = { - 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, - 18, 20, 22, 24, 28, 32, 36, 40, 44, 48, 52, 56, 64, +static const uint8_t quality[] = { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1,64,63,62,61, + 60,59,58,57,56,55,54,53,52,51, + 50,49,48,47,46,45,44,43,42,41, + 40,39,38,37,36,35,34,33,32,31, + 30,29,28,27,26,25,24,23,22,21, + 20,19,18,17,16,15,14,13,12,11, + 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, }; static const uint8_t quant[64] = { @@ -107,6 +116,7 @@ static int decode_dcac(AVCodecContext *avctx, const uint8_t *scan = s->scan; const int add = plane ? 0 : 1024; int i, dc_v = 0, ac_v = 0, dc = 0; + const int lshift = s->lshift; for (int y = 0; y < 2; y++) { for (int x = 0; x < width; x += 8) { @@ -115,8 +125,10 @@ static int decode_dcac(AVCodecContext *avctx, if (dc_run > 0) { dc_run--; } else { + if (get_bits_left(dc_gb) < 1) + return AVERROR_INVALIDDATA; dc_v = get_se_golomb_vmix(dc_gb); - dc += dc_v; + dc += (unsigned)dc_v; if (!dc_v) dc_run = get_ue_golomb_long(dc_gb); } @@ -127,14 +139,16 @@ static int decode_dcac(AVCodecContext *avctx, continue; } + if (get_bits_left(ac_gb) < 1) + return AVERROR_INVALIDDATA; ac_v = get_se_golomb_vmix(ac_gb); i = scan[n]; - block[i] = (ac_v * factors[i]) >> 4; + block[i] = ((unsigned)ac_v * factors[i]) >> 4; if (!ac_v) ac_run = get_ue_golomb_long(ac_gb); } - block[0] = ((dc + add) * 16) >> 4; + block[0] = ((unsigned)dc << lshift) + (unsigned)add; s->idsp.idct_put(dst + x, linesize, block); } @@ -208,22 +222,27 @@ static int decode_frame(AVCodecContext *avctx, AVPacket *avpkt) { VMIXContext *s = avctx->priv_data; - unsigned offset = 3, q; + unsigned offset, q; int ret; if (avpkt->size <= 7) return AVERROR_INVALIDDATA; - if (avpkt->data[0] != 0x01) + s->lshift = 0; + offset = 2 + avpkt->data[0]; + if (offset == 5) + s->lshift = avpkt->data[1]; + else if (offset != 3) return AVERROR_INVALIDDATA; - q = av_clip(99 - av_clip(avpkt->data[1], 0, 99), 0, FF_ARRAY_ELEMS(quality) - 1); + q = quality[FFMIN(avpkt->data[offset - 2], FF_ARRAY_ELEMS(quality)-1)]; for (int n = 0; n < 64; n++) - s->factors[n] = quant[n] * quality[q]; + s->factors[n] = quant[n] * q; - s->nb_slices = avpkt->data[2]; - if (!s->nb_slices || s->nb_slices > (avctx->height + 15) / 16) - return AVERROR_INVALIDDATA; + s->nb_slices = (avctx->height + 15) / 16; + av_fast_mallocz(&s->slices, &s->slices_size, s->nb_slices * sizeof(*s->slices)); + if (!s->slices) + return AVERROR(ENOMEM); for (int n = 0; n < s->nb_slices; n++) { unsigned slice_size; @@ -275,6 +294,13 @@ static int decode_frame(AVCodecContext *avctx, return avpkt->size; } +static av_cold int decode_end(AVCodecContext *avctx) +{ + VMIXContext *s = avctx->priv_data; + av_freep(&s->slices); + return 0; +} + const FFCodec ff_vmix_decoder = { .p.name = "vmix", CODEC_LONG_NAME("vMix Video"), @@ -282,6 +308,7 @@ const FFCodec ff_vmix_decoder = { .p.id = AV_CODEC_ID_VMIX, .priv_data_size = sizeof(VMIXContext), .init = decode_init, + .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vorbis.c b/arm/raspi/third_party/ffmpeg/libavcodec/vorbis.c index d0b660b4..3d859975 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vorbis.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vorbis.c @@ -27,8 +27,10 @@ */ #include "libavutil/common.h" +#include "libavutil/error.h" +#include "libavutil/log.h" +#include "libavutil/macros.h" -#include "avcodec.h" #include "vorbis.h" #include "vorbis_data.h" @@ -104,7 +106,7 @@ int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num) return 0; } -int ff_vorbis_ready_floor1_list(AVCodecContext *avctx, +int ff_vorbis_ready_floor1_list(void *logctx, vorbis_floor1_entry *list, int values) { int i; @@ -130,7 +132,7 @@ int ff_vorbis_ready_floor1_list(AVCodecContext *avctx, int j; for (j = i + 1; j < values; j++) { if (list[i].x == list[j].x) { - av_log(avctx, AV_LOG_ERROR, + av_log(logctx, AV_LOG_ERROR, "Duplicate value found in floor 1 X coordinates\n"); return AVERROR_INVALIDDATA; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vorbis.h b/arm/raspi/third_party/ffmpeg/libavcodec/vorbis.h index aa1ec571..7190465f 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vorbis.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vorbis.h @@ -23,8 +23,6 @@ #include -#include "avcodec.h" - typedef struct vorbis_floor1_entry { uint16_t x; uint16_t sort; @@ -32,7 +30,7 @@ typedef struct vorbis_floor1_entry { uint16_t high; } vorbis_floor1_entry; -int ff_vorbis_ready_floor1_list(AVCodecContext *avctx, +int ff_vorbis_ready_floor1_list(void *logctx, vorbis_floor1_entry *list, int values); unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n); // x^(1/n) int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vorbisdec.c b/arm/raspi/third_party/ffmpeg/libavcodec/vorbisdec.c index 1d2a0997..faeaeadd 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vorbisdec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vorbisdec.c @@ -210,7 +210,7 @@ static void vorbis_free(vorbis_context *vc) if (vc->codebooks) for (i = 0; i < vc->codebook_count; ++i) { av_freep(&vc->codebooks[i].codevectors); - ff_free_vlc(&vc->codebooks[i].vlc); + ff_vlc_free(&vc->codebooks[i].vlc); } av_freep(&vc->codebooks); @@ -454,11 +454,11 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc) codebook_setup->maxdepth = (codebook_setup->maxdepth+codebook_setup->nb_bits - 1) / codebook_setup->nb_bits; - if ((ret = init_vlc(&codebook_setup->vlc, codebook_setup->nb_bits, + if ((ret = vlc_init(&codebook_setup->vlc, codebook_setup->nb_bits, entries, tmp_vlc_bits, sizeof(*tmp_vlc_bits), sizeof(*tmp_vlc_bits), tmp_vlc_codes, sizeof(*tmp_vlc_codes), sizeof(*tmp_vlc_codes), - INIT_VLC_LE))) { + VLC_INIT_LE))) { av_log(vc->avctx, AV_LOG_ERROR, " Error generating vlc tables. \n"); goto error; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vp3.c b/arm/raspi/third_party/ffmpeg/libavcodec/vp3.c index 9e097c89..98dabfc9 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vp3.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vp3.c @@ -35,6 +35,7 @@ #include #include +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/mem_internal.h" @@ -346,7 +347,6 @@ static void vp3_decode_flush(AVCodecContext *avctx) static av_cold int vp3_decode_end(AVCodecContext *avctx) { Vp3DecodeContext *s = avctx->priv_data; - int i, j; free_tables(avctx); av_freep(&s->edge_emu_buffer); @@ -359,20 +359,20 @@ static av_cold int vp3_decode_end(AVCodecContext *avctx) av_frame_free(&s->last_frame.f); av_frame_free(&s->golden_frame.f); - for (i = 0; i < FF_ARRAY_ELEMS(s->coeff_vlc); i++) - ff_free_vlc(&s->coeff_vlc[i]); + for (int i = 0; i < FF_ARRAY_ELEMS(s->coeff_vlc); i++) + ff_vlc_free(&s->coeff_vlc[i]); - ff_free_vlc(&s->superblock_run_length_vlc); - ff_free_vlc(&s->fragment_run_length_vlc); - ff_free_vlc(&s->mode_code_vlc); - ff_free_vlc(&s->motion_vector_vlc); + ff_vlc_free(&s->superblock_run_length_vlc); + ff_vlc_free(&s->fragment_run_length_vlc); + ff_vlc_free(&s->mode_code_vlc); + ff_vlc_free(&s->motion_vector_vlc); - for (j = 0; j < 2; j++) - for (i = 0; i < 7; i++) - ff_free_vlc(&s->vp4_mv_vlc[j][i]); + for (int j = 0; j < 2; j++) + for (int i = 0; i < 7; i++) + ff_vlc_free(&s->vp4_mv_vlc[j][i]); - for (i = 0; i < 2; i++) - ff_free_vlc(&s->block_pattern_vlc[i]); + for (int i = 0; i < 2; i++) + ff_vlc_free(&s->block_pattern_vlc[i]); return 0; } @@ -385,10 +385,9 @@ static av_cold int vp3_decode_end(AVCodecContext *avctx) */ static int init_block_mapping(Vp3DecodeContext *s) { - int sb_x, sb_y, plane; - int x, y, i, j = 0; + int j = 0; - for (plane = 0; plane < 3; plane++) { + for (int plane = 0; plane < 3; plane++) { int sb_width = plane ? s->c_superblock_width : s->y_superblock_width; int sb_height = plane ? s->c_superblock_height @@ -396,11 +395,11 @@ static int init_block_mapping(Vp3DecodeContext *s) int frag_width = s->fragment_width[!!plane]; int frag_height = s->fragment_height[!!plane]; - for (sb_y = 0; sb_y < sb_height; sb_y++) - for (sb_x = 0; sb_x < sb_width; sb_x++) - for (i = 0; i < 16; i++) { - x = 4 * sb_x + hilbert_offset[i][0]; - y = 4 * sb_y + hilbert_offset[i][1]; + for (int sb_y = 0; sb_y < sb_height; sb_y++) + for (int sb_x = 0; sb_x < sb_width; sb_x++) + for (int i = 0; i < 16; i++) { + int x = 4 * sb_x + hilbert_offset[i][0]; + int y = 4 * sb_y + hilbert_offset[i][1]; if (x < frag_width && y < frag_height) s->superblock_fragments[j++] = s->fragment_start[plane] + @@ -420,12 +419,11 @@ static int init_block_mapping(Vp3DecodeContext *s) static void init_dequantizer(Vp3DecodeContext *s, int qpi) { int ac_scale_factor = s->coded_ac_scale_factor[s->qps[qpi]]; - int i, plane, inter, qri, bmi, bmj, qistart; - for (inter = 0; inter < 2; inter++) { - for (plane = 0; plane < 3; plane++) { + for (int inter = 0; inter < 2; inter++) { + for (int plane = 0; plane < 3; plane++) { int dc_scale_factor = s->coded_dc_scale_factor[!!plane][s->qps[qpi]]; - int sum = 0; + int sum = 0, bmi, bmj, qistart, qri; for (qri = 0; qri < s->qr_count[inter][plane]; qri++) { sum += s->qr_size[inter][plane][qri]; if (s->qps[qpi] <= sum) @@ -434,7 +432,7 @@ static void init_dequantizer(Vp3DecodeContext *s, int qpi) qistart = sum - s->qr_size[inter][plane][qri]; bmi = s->qr_base[inter][plane][qri]; bmj = s->qr_base[inter][plane][qri + 1]; - for (i = 0; i < 64; i++) { + for (int i = 0; i < 64; i++) { int coeff = (2 * (sum - s->qps[qpi]) * s->base_matrix[bmi][i] - 2 * (qistart - s->qps[qpi]) * s->base_matrix[bmj][i] + s->qr_size[inter][plane][qri]) / @@ -471,7 +469,7 @@ static void init_loop_filter(Vp3DecodeContext *s) */ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) { - int superblock_starts[3] = { + const int superblock_starts[3] = { 0, s->u_superblock_start, s->v_superblock_start }; int bit = 0; @@ -479,9 +477,7 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) int current_run = 0; int num_partial_superblocks = 0; - int i, j; int current_fragment; - int plane; int plane0_num_coded_frags = 0; if (s->keyframe) { @@ -536,7 +532,7 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) if (current_run == 34) current_run += get_bits(gb, 12); - for (j = 0; j < current_run; current_superblock++) { + for (int j = 0; j < current_run; current_superblock++) { if (current_superblock >= s->superblock_count) { av_log(s->avctx, AV_LOG_ERROR, "Invalid fully coded superblock run length\n"); @@ -572,7 +568,7 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) s->coded_fragment_list[0] = s->keyframe ? s->kf_coded_fragment_list : s->nkf_coded_fragment_list; - for (plane = 0; plane < 3; plane++) { + for (int plane = 0; plane < 3; plane++) { int sb_start = superblock_starts[plane]; int sb_end = sb_start + (plane ? s->c_superblock_count : s->y_superblock_count); @@ -580,9 +576,9 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) if (s->keyframe) { if (s->num_kf_coded_fragment[plane] == -1) { - for (i = sb_start; i < sb_end; i++) { + for (int i = sb_start; i < sb_end; i++) { /* iterate through all 16 fragments in a superblock */ - for (j = 0; j < 16; j++) { + for (int j = 0; j < 16; j++) { /* if the fragment is in bounds, check its coding status */ current_fragment = s->superblock_fragments[i * 16 + j]; if (current_fragment != -1) { @@ -595,12 +591,12 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) } else num_coded_frags = s->num_kf_coded_fragment[plane]; } else { - for (i = sb_start; i < sb_end && get_bits_left(gb) > 0; i++) { + for (int i = sb_start; i < sb_end && get_bits_left(gb) > 0; i++) { if (get_bits_left(gb) < plane0_num_coded_frags >> 2) { return AVERROR_INVALIDDATA; } /* iterate through all 16 fragments in a superblock */ - for (j = 0; j < 16; j++) { + for (int j = 0; j < 16; j++) { /* if the fragment is in bounds, check its coding status */ current_fragment = s->superblock_fragments[i * 16 + j]; if (current_fragment != -1) { @@ -635,7 +631,7 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) if (!plane) plane0_num_coded_frags = num_coded_frags; s->total_num_coded_frags += num_coded_frags; - for (i = 0; i < 64; i++) + for (int i = 0; i < 64; i++) s->num_coded_frags[plane][i] = num_coded_frags; if (plane < 2) s->coded_fragment_list[plane + 1] = s->coded_fragment_list[plane] + @@ -697,7 +693,7 @@ static int vp4_get_block_pattern(Vp3DecodeContext *s, GetBitContext *gb, int *ne static int vp4_unpack_macroblocks(Vp3DecodeContext *s, GetBitContext *gb) { - int plane, i, j, k, fragment; + int fragment; int next_block_pattern_table; int bit, current_run, has_partial; @@ -708,7 +704,7 @@ static int vp4_unpack_macroblocks(Vp3DecodeContext *s, GetBitContext *gb) has_partial = 0; bit = get_bits1(gb); - for (i = 0; i < s->yuv_macroblock_count; i += current_run) { + for (int i = 0; i < s->yuv_macroblock_count; i += current_run) { if (get_bits_left(gb) <= 0) return AVERROR_INVALIDDATA; current_run = vp4_get_mb_count(s, gb); @@ -724,7 +720,7 @@ static int vp4_unpack_macroblocks(Vp3DecodeContext *s, GetBitContext *gb) return AVERROR_INVALIDDATA; bit = get_bits1(gb); current_run = vp4_get_mb_count(s, gb); - for (i = 0; i < s->yuv_macroblock_count; i++) { + for (int i = 0; i < s->yuv_macroblock_count; i++) { if (!s->superblock_coding[i]) { if (!current_run) { bit ^= 1; @@ -739,9 +735,7 @@ static int vp4_unpack_macroblocks(Vp3DecodeContext *s, GetBitContext *gb) } next_block_pattern_table = 0; - i = 0; - for (plane = 0; plane < 3; plane++) { - int sb_x, sb_y; + for (int plane = 0, i = 0; plane < 3; plane++) { int sb_width = plane ? s->c_superblock_width : s->y_superblock_width; int sb_height = plane ? s->c_superblock_height : s->y_superblock_height; int mb_width = plane ? s->c_macroblock_width : s->macroblock_width; @@ -749,9 +743,9 @@ static int vp4_unpack_macroblocks(Vp3DecodeContext *s, GetBitContext *gb) int fragment_width = s->fragment_width[!!plane]; int fragment_height = s->fragment_height[!!plane]; - for (sb_y = 0; sb_y < sb_height; sb_y++) { - for (sb_x = 0; sb_x < sb_width; sb_x++) { - for (j = 0; j < 4; j++) { + for (int sb_y = 0; sb_y < sb_height; sb_y++) { + for (int sb_x = 0; sb_x < sb_width; sb_x++) { + for (int j = 0; j < 4; j++) { int mb_x = 2 * sb_x + (j >> 1); int mb_y = 2 * sb_y + (j >> 1) ^ (j & 1); int mb_coded, pattern, coded; @@ -768,7 +762,7 @@ static int vp4_unpack_macroblocks(Vp3DecodeContext *s, GetBitContext *gb) else pattern = 0; - for (k = 0; k < 4; k++) { + for (int k = 0; k < 4; k++) { if (BLOCK_X >= fragment_width || BLOCK_Y >= fragment_height) continue; fragment = s->fragment_start[plane] + BLOCK_Y * fragment_width + BLOCK_X; @@ -791,7 +785,6 @@ static int vp4_unpack_macroblocks(Vp3DecodeContext *s, GetBitContext *gb) */ static int unpack_modes(Vp3DecodeContext *s, GetBitContext *gb) { - int i, j, k, sb_x, sb_y; int scheme; int current_macroblock; int current_fragment; @@ -801,7 +794,7 @@ static int unpack_modes(Vp3DecodeContext *s, GetBitContext *gb) Vp3Fragment *frag; if (s->keyframe) { - for (i = 0; i < s->fragment_count; i++) + for (int i = 0; i < s->fragment_count; i++) s->all_fragments[i].coding_method = MODE_INTRA; } else { /* fetch the mode coding scheme for this frame */ @@ -809,9 +802,9 @@ static int unpack_modes(Vp3DecodeContext *s, GetBitContext *gb) /* is it a custom coding scheme? */ if (scheme == 0) { - for (i = 0; i < 8; i++) + for (int i = 0; i < 8; i++) custom_mode_alphabet[i] = MODE_INTER_NO_MV; - for (i = 0; i < 8; i++) + for (int i = 0; i < 8; i++) custom_mode_alphabet[get_bits(gb, 3)] = i; alphabet = custom_mode_alphabet; } else @@ -819,12 +812,13 @@ static int unpack_modes(Vp3DecodeContext *s, GetBitContext *gb) /* iterate through all of the macroblocks that contain 1 or more * coded fragments */ - for (sb_y = 0; sb_y < s->y_superblock_height; sb_y++) { - for (sb_x = 0; sb_x < s->y_superblock_width; sb_x++) { + for (int sb_y = 0; sb_y < s->y_superblock_height; sb_y++) { + for (int sb_x = 0; sb_x < s->y_superblock_width; sb_x++) { if (get_bits_left(gb) <= 0) return -1; - for (j = 0; j < 4; j++) { + for (int j = 0; j < 4; j++) { + int k; int mb_x = 2 * sb_x + (j >> 1); int mb_y = 2 * sb_y + (((j >> 1) + j) & 1); current_macroblock = mb_y * s->macroblock_width + mb_x; @@ -905,7 +899,6 @@ static int vp4_get_mv(Vp3DecodeContext *s, GetBitContext *gb, int axis, int last */ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb) { - int j, k, sb_x, sb_y; int coding_mode; int motion_x[4]; int motion_y[4]; @@ -927,12 +920,12 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb) /* iterate through all of the macroblocks that contain 1 or more * coded fragments */ - for (sb_y = 0; sb_y < s->y_superblock_height; sb_y++) { - for (sb_x = 0; sb_x < s->y_superblock_width; sb_x++) { + for (int sb_y = 0; sb_y < s->y_superblock_height; sb_y++) { + for (int sb_x = 0; sb_x < s->y_superblock_width; sb_x++) { if (get_bits_left(gb) <= 0) return -1; - for (j = 0; j < 4; j++) { + for (int j = 0; j < 4; j++) { int mb_x = 2 * sb_x + (j >> 1); int mb_y = 2 * sb_y + (((j >> 1) + j) & 1); current_macroblock = mb_y * s->macroblock_width + mb_x; @@ -980,7 +973,7 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb) /* fetch 4 vectors from the bitstream, one for each * Y fragment, then average for the C fragment vectors */ - for (k = 0; k < 4; k++) { + for (int k = 0; k < 4; k++) { current_fragment = BLOCK_Y * s->fragment_width[0] + BLOCK_X; if (s->all_fragments[current_fragment].coding_method != MODE_COPY) { if (coding_mode == 0) { @@ -1036,7 +1029,7 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb) } /* assign the motion vectors to the correct fragments */ - for (k = 0; k < 4; k++) { + for (int k = 0; k < 4; k++) { current_fragment = BLOCK_Y * s->fragment_width[0] + BLOCK_X; if (s->macroblock_coding[current_macroblock] == MODE_INTER_FOURMV) { @@ -1077,13 +1070,13 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb) motion_x[1] = (motion_x[1] >> 1) | (motion_x[1] & 1); } frag = 2 * mb_y * s->fragment_width[1] + mb_x; - for (k = 0; k < 2; k++) { + for (int k = 0; k < 2; k++) { s->motion_val[1][frag][0] = motion_x[k]; s->motion_val[1][frag][1] = motion_y[k]; frag += s->fragment_width[1]; } } else { - for (k = 0; k < 4; k++) { + for (int k = 0; k < 4; k++) { frag = BLOCK_Y * s->fragment_width[1] + BLOCK_X; if (s->macroblock_coding[current_macroblock] == MODE_INTER_FOURMV) { s->motion_val[1][frag][0] = motion_x[k]; @@ -1103,11 +1096,11 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb) static int unpack_block_qpis(Vp3DecodeContext *s, GetBitContext *gb) { - int qpi, i, j, bit, run_length, blocks_decoded, num_blocks_at_qpi; int num_blocks = s->total_num_coded_frags; - for (qpi = 0; qpi < s->nqps - 1 && num_blocks > 0; qpi++) { - i = blocks_decoded = num_blocks_at_qpi = 0; + for (int qpi = 0; qpi < s->nqps - 1 && num_blocks > 0; qpi++) { + int i = 0, blocks_decoded = 0, num_blocks_at_qpi = 0; + int bit, run_length; bit = get_bits1(gb) ^ 1; run_length = 0; @@ -1127,7 +1120,7 @@ static int unpack_block_qpis(Vp3DecodeContext *s, GetBitContext *gb) if (!bit) num_blocks_at_qpi += run_length; - for (j = 0; j < run_length; i++) { + for (int j = 0; j < run_length; i++) { if (i >= s->total_num_coded_frags) return -1; @@ -1181,11 +1174,11 @@ static inline int get_coeff(GetBitContext *gb, int token, int16_t *coeff) * be passed into the next call to this same function. */ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb, - VLC *table, int coeff_index, + const VLC *table, int coeff_index, int plane, int eob_run) { - int i, j = 0; + int j = 0; int token; int zero_run = 0; int16_t coeff = 0; @@ -1195,7 +1188,7 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb, int16_t *dct_tokens = s->dct_tokens[plane][coeff_index]; /* local references to structure members to avoid repeated dereferences */ - int *coded_fragment_list = s->coded_fragment_list[plane]; + const int *coded_fragment_list = s->coded_fragment_list[plane]; Vp3Fragment *all_fragments = s->all_fragments; const VLCElem *vlc_table = table->table; @@ -1266,7 +1259,7 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb, // zero runs code multiple coefficients, // so don't try to decode coeffs for those higher levels - for (i = coeff_index + 1; i <= coeff_index + zero_run; i++) + for (int i = coeff_index + 1; i <= coeff_index + zero_run; i++) s->num_coded_frags[plane][i]--; coeff_i++; } else { @@ -1281,7 +1274,7 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb, // decrement the number of blocks that have higher coefficients for each // EOB run at this level if (blocks_ended) - for (i = coeff_index + 1; i < 64; i++) + for (int i = coeff_index + 1; i < 64; i++) s->num_coded_frags[plane][i] -= blocks_ended; // setup the next buffer @@ -1303,7 +1296,6 @@ static void reverse_dc_prediction(Vp3DecodeContext *s, */ static int unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb) { - int i; int dc_y_table; int dc_c_table; int ac_y_table; @@ -1357,29 +1349,29 @@ static int unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb) ac_c_table = get_bits(gb, 4); /* build tables of AC VLC tables */ - for (i = 1; i <= 5; i++) { + for (int i = 1; i <= 5; i++) { /* AC VLC table group 1 */ y_tables[i] = &s->coeff_vlc[ac_y_table + 16]; c_tables[i] = &s->coeff_vlc[ac_c_table + 16]; } - for (i = 6; i <= 14; i++) { + for (int i = 6; i <= 14; i++) { /* AC VLC table group 2 */ y_tables[i] = &s->coeff_vlc[ac_y_table + 32]; c_tables[i] = &s->coeff_vlc[ac_c_table + 32]; } - for (i = 15; i <= 27; i++) { + for (int i = 15; i <= 27; i++) { /* AC VLC table group 3 */ y_tables[i] = &s->coeff_vlc[ac_y_table + 48]; c_tables[i] = &s->coeff_vlc[ac_c_table + 48]; } - for (i = 28; i <= 63; i++) { + for (int i = 28; i <= 63; i++) { /* AC VLC table group 4 */ y_tables[i] = &s->coeff_vlc[ac_y_table + 64]; c_tables[i] = &s->coeff_vlc[ac_c_table + 64]; } /* decode all AC coefficients */ - for (i = 1; i <= 63; i++) { + for (int i = 1; i <= 63; i++) { residual_eob_run = unpack_vlcs(s, gb, y_tables[i], i, 0, residual_eob_run); if (residual_eob_run < 0) @@ -1406,7 +1398,7 @@ static int unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb) * @return < 0 on error */ static int vp4_unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb, - VLC *vlc_tables[64], + const VLC *vlc_tables[64], int plane, int eob_tracker[64], int fragment) { int token; @@ -1466,24 +1458,20 @@ static void vp4_dc_predictor_reset(VP4Predictor *p) static void vp4_dc_pred_before(const Vp3DecodeContext *s, VP4Predictor dc_pred[6][6], int sb_x) { - int i, j; - - for (i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) dc_pred[0][i + 1] = s->dc_pred_row[sb_x * 4 + i]; - for (j = 1; j < 5; j++) - for (i = 0; i < 4; i++) + for (int j = 1; j < 5; j++) + for (int i = 0; i < 4; i++) vp4_dc_predictor_reset(&dc_pred[j][i + 1]); } static void vp4_dc_pred_after(Vp3DecodeContext *s, VP4Predictor dc_pred[6][6], int sb_x) { - int i; - - for (i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) s->dc_pred_row[sb_x * 4 + i] = dc_pred[4][i + 1]; - for (i = 1; i < 5; i++) + for (int i = 1; i < 5; i++) dc_pred[i][0] = dc_pred[i][4]; } @@ -1519,10 +1507,9 @@ static int vp4_dc_pred(const Vp3DecodeContext *s, const VP4Predictor * dc_pred, static void vp4_set_tokens_base(Vp3DecodeContext *s) { - int plane, i; int16_t *base = s->dct_tokens_base; - for (plane = 0; plane < 3; plane++) { - for (i = 0; i < 64; i++) { + for (int plane = 0; plane < 3; plane++) { + for (int i = 0; i < 64; i++) { s->dct_tokens[plane][i] = base; base += s->fragment_width[!!plane] * s->fragment_height[!!plane]; } @@ -1531,13 +1518,11 @@ static void vp4_set_tokens_base(Vp3DecodeContext *s) static int vp4_unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb) { - int i, j; int dc_y_table; int dc_c_table; int ac_y_table; int ac_c_table; - VLC *tables[2][64]; - int plane, sb_y, sb_x; + const VLC *tables[2][64]; int eob_tracker[64]; VP4Predictor dc_pred[6][6]; int last_dc[NB_VP4_DC_TYPES]; @@ -1557,22 +1542,22 @@ static int vp4_unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb) /* DC table group */ tables[0][0] = &s->coeff_vlc[dc_y_table]; tables[1][0] = &s->coeff_vlc[dc_c_table]; - for (i = 1; i <= 5; i++) { + for (int i = 1; i <= 5; i++) { /* AC VLC table group 1 */ tables[0][i] = &s->coeff_vlc[ac_y_table + 16]; tables[1][i] = &s->coeff_vlc[ac_c_table + 16]; } - for (i = 6; i <= 14; i++) { + for (int i = 6; i <= 14; i++) { /* AC VLC table group 2 */ tables[0][i] = &s->coeff_vlc[ac_y_table + 32]; tables[1][i] = &s->coeff_vlc[ac_c_table + 32]; } - for (i = 15; i <= 27; i++) { + for (int i = 15; i <= 27; i++) { /* AC VLC table group 3 */ tables[0][i] = &s->coeff_vlc[ac_y_table + 48]; tables[1][i] = &s->coeff_vlc[ac_c_table + 48]; } - for (i = 28; i <= 63; i++) { + for (int i = 28; i <= 63; i++) { /* AC VLC table group 4 */ tables[0][i] = &s->coeff_vlc[ac_y_table + 64]; tables[1][i] = &s->coeff_vlc[ac_c_table + 64]; @@ -1582,21 +1567,21 @@ static int vp4_unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb) memset(last_dc, 0, sizeof(last_dc)); - for (plane = 0; plane < ((s->avctx->flags & AV_CODEC_FLAG_GRAY) ? 1 : 3); plane++) { + for (int plane = 0; plane < ((s->avctx->flags & AV_CODEC_FLAG_GRAY) ? 1 : 3); plane++) { memset(eob_tracker, 0, sizeof(eob_tracker)); /* initialise dc prediction */ - for (i = 0; i < s->fragment_width[!!plane]; i++) + for (int i = 0; i < s->fragment_width[!!plane]; i++) vp4_dc_predictor_reset(&s->dc_pred_row[i]); - for (j = 0; j < 6; j++) - for (i = 0; i < 6; i++) + for (int j = 0; j < 6; j++) + for (int i = 0; i < 6; i++) vp4_dc_predictor_reset(&dc_pred[j][i]); - for (sb_y = 0; sb_y * 4 < s->fragment_height[!!plane]; sb_y++) { - for (sb_x = 0; sb_x *4 < s->fragment_width[!!plane]; sb_x++) { + for (int sb_y = 0; sb_y * 4 < s->fragment_height[!!plane]; sb_y++) { + for (int sb_x = 0; sb_x *4 < s->fragment_width[!!plane]; sb_x++) { vp4_dc_pred_before(s, dc_pred, sb_x); - for (j = 0; j < 16; j++) { + for (int j = 0; j < 16; j++) { int hx = hilbert_offset[j][0]; int hy = hilbert_offset[j][1]; int x = 4 * sb_x + hx; @@ -1653,7 +1638,6 @@ static void reverse_dc_prediction(Vp3DecodeContext *s, #define PUR 2 #define PL 1 - int x, y; int i = first_fragment; int predicted_dc; @@ -1723,9 +1707,9 @@ static void reverse_dc_prediction(Vp3DecodeContext *s, last_dc[2] = 0; /* for each fragment row... */ - for (y = 0; y < fragment_height; y++) { + for (int y = 0; y < fragment_height; y++) { /* for each fragment in a row... */ - for (x = 0; x < fragment_width; x++, i++) { + for (int x = 0; x < fragment_width; x++, i++) { /* reverse prediction if this block was coded */ if (s->all_fragments[i].coding_method != MODE_COPY) { @@ -1796,7 +1780,6 @@ static void reverse_dc_prediction(Vp3DecodeContext *s, static void apply_loop_filter(Vp3DecodeContext *s, int plane, int ystart, int yend) { - int x, y; int *bounding_values = s->bounding_values_array + 127; int width = s->fragment_width[!!plane]; @@ -1808,8 +1791,8 @@ static void apply_loop_filter(Vp3DecodeContext *s, int plane, stride = -stride; plane_data += s->data_offset[plane] + 8 * ystart * stride; - for (y = ystart; y < yend; y++) { - for (x = 0; x < width; x++) { + for (int y = ystart; y < yend; y++) { + for (int x = 0; x < width; x++) { /* This code basically just deblocks on the edges of coded blocks. * However, it has to be much more complicated because of the * brain damaged deblock ordering used in VP3/Theora. Order matters @@ -1860,11 +1843,11 @@ static void apply_loop_filter(Vp3DecodeContext *s, int plane, * Pull DCT tokens from the 64 levels to decode and dequant the coefficients * for the next block in coding order */ -static inline int vp3_dequant(Vp3DecodeContext *s, Vp3Fragment *frag, +static inline int vp3_dequant(Vp3DecodeContext *s, const Vp3Fragment *frag, int plane, int inter, int16_t block[64]) { - int16_t *dequantizer = s->qmat[frag->qpi][inter][plane]; - uint8_t *perm = s->idct_scantable; + const int16_t *dequantizer = s->qmat[frag->qpi][inter][plane]; + const uint8_t *perm = s->idct_scantable; int i = 0; do { @@ -1907,7 +1890,7 @@ end: */ static void vp3_draw_horiz_band(Vp3DecodeContext *s, int y) { - int h, cy, i; + int h, cy; int offset[AV_NUM_DATA_POINTERS]; if (HAVE_THREADS && s->avctx->active_thread_type & FF_THREAD_FRAME) { @@ -1936,7 +1919,7 @@ static void vp3_draw_horiz_band(Vp3DecodeContext *s, int y) offset[0] = s->current_frame.f->linesize[0] * y; offset[1] = s->current_frame.f->linesize[1] * cy; offset[2] = s->current_frame.f->linesize[2] * cy; - for (i = 3; i < AV_NUM_DATA_POINTERS; i++) + for (int i = 3; i < AV_NUM_DATA_POINTERS; i++) offset[i] = 0; emms_c(); @@ -1947,7 +1930,7 @@ static void vp3_draw_horiz_band(Vp3DecodeContext *s, int y) * Wait for the reference frame of the current fragment. * The progress value is in luma pixel rows. */ -static void await_reference_row(Vp3DecodeContext *s, Vp3Fragment *fragment, +static void await_reference_row(Vp3DecodeContext *s, const Vp3Fragment *fragment, int motion_y, int y) { const ThreadFrame *ref_frame; @@ -1971,13 +1954,13 @@ static void await_reference_row(Vp3DecodeContext *s, Vp3Fragment *fragment, * @return non-zero if temp (edge_emu_buffer) was populated */ static int vp4_mc_loop_filter(Vp3DecodeContext *s, int plane, int motion_x, int motion_y, int bx, int by, - uint8_t * motion_source, int stride, int src_x, int src_y, uint8_t *temp) + const uint8_t *motion_source, ptrdiff_t stride, + int src_x, int src_y, uint8_t *temp) { int motion_shift = plane ? 4 : 2; int subpel_mask = plane ? 3 : 1; int *bounding_values = s->bounding_values_array + 127; - int i; int x, y; int x2, y2; int x_subpel, y_subpel; @@ -2058,7 +2041,7 @@ static int vp4_mc_loop_filter(Vp3DecodeContext *s, int plane, int motion_x, int safe_loop_filter(v_loop_filter, loop + (y_offset + 1)*loop_stride + 1, loop_stride, bounding_values); } - for (i = 0; i < 9; i++) + for (int i = 0; i < 9; i++) memcpy(temp + i*stride, loop + (i + 1) * loop_stride + 1, 9); return 1; @@ -2071,29 +2054,35 @@ static int vp4_mc_loop_filter(Vp3DecodeContext *s, int plane, int motion_x, int */ static void render_slice(Vp3DecodeContext *s, int slice) { - int x, y, i, j, fragment; int16_t *block = s->block; int motion_x = 0xdeadbeef, motion_y = 0xdeadbeef; + /* When decoding keyframes, the earlier frames may not be available, + * so to avoid using undefined pointer arithmetic on them we just + * use the current frame instead. Nothing is ever read from these + * frames in case of a keyframe. */ + const AVFrame *last_frame = s->last_frame.f->data[0] ? + s->last_frame.f : s->current_frame.f; + const AVFrame *golden_frame = s->golden_frame.f->data[0] ? + s->golden_frame.f : s->current_frame.f; int motion_halfpel_index; - uint8_t *motion_source; - int plane, first_pixel; + int first_pixel; if (slice >= s->c_superblock_height) return; - for (plane = 0; plane < 3; plane++) { + for (int plane = 0; plane < 3; plane++) { uint8_t *output_plane = s->current_frame.f->data[plane] + s->data_offset[plane]; - uint8_t *last_plane = s->last_frame.f->data[plane] + + const uint8_t *last_plane = last_frame->data[plane] + s->data_offset[plane]; - uint8_t *golden_plane = s->golden_frame.f->data[plane] + + const uint8_t *golden_plane = golden_frame->data[plane] + s->data_offset[plane]; ptrdiff_t stride = s->current_frame.f->linesize[plane]; int plane_width = s->width >> (plane && s->chroma_x_shift); int plane_height = s->height >> (plane && s->chroma_y_shift); - int8_t(*motion_val)[2] = s->motion_val[!!plane]; + const int8_t (*motion_val)[2] = s->motion_val[!!plane]; - int sb_x, sb_y = slice << (!plane && s->chroma_y_shift); + int sb_y = slice << (!plane && s->chroma_y_shift); int slice_height = sb_y + 1 + (!plane && s->chroma_y_shift); int slice_width = plane ? s->c_superblock_width : s->y_superblock_width; @@ -2113,14 +2102,14 @@ static void render_slice(Vp3DecodeContext *s, int slice) /* for each superblock row in the slice (both of them)... */ for (; sb_y < slice_height; sb_y++) { /* for each superblock in a row... */ - for (sb_x = 0; sb_x < slice_width; sb_x++) { + for (int sb_x = 0; sb_x < slice_width; sb_x++) { /* for each block in a superblock... */ - for (j = 0; j < 16; j++) { - x = 4 * sb_x + hilbert_offset[j][0]; - y = 4 * sb_y + hilbert_offset[j][1]; - fragment = y * fragment_width + x; + for (int j = 0; j < 16; j++) { + int x = 4 * sb_x + hilbert_offset[j][0]; + int y = 4 * sb_y + hilbert_offset[j][1]; + int fragment = y * fragment_width + x; - i = fragment_start + fragment; + int i = fragment_start + fragment; // bounds check if (x >= fragment_width || y >= fragment_height) @@ -2136,6 +2125,7 @@ static void render_slice(Vp3DecodeContext *s, int slice) /* transform if this block was coded */ if (s->all_fragments[i].coding_method != MODE_COPY) { + const uint8_t *motion_source; if ((s->all_fragments[i].coding_method == MODE_USING_GOLDEN) || (s->all_fragments[i].coding_method == MODE_GOLDEN_MV)) motion_source = golden_plane; @@ -2327,13 +2317,10 @@ static av_cold int init_frames(Vp3DecodeContext *s) static av_cold int vp3_decode_init(AVCodecContext *avctx) { Vp3DecodeContext *s = avctx->priv_data; - int i, inter, plane, ret; + int ret; int c_width; int c_height; int y_fragment_count, c_fragment_count; -#if CONFIG_VP4_DECODER - int j; -#endif ret = init_frames(s); if (ret < 0) @@ -2362,7 +2349,7 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) ff_videodsp_init(&s->vdsp, 8); ff_vp3dsp_init(&s->vp3dsp, avctx->flags); - for (i = 0; i < 64; i++) { + for (int i = 0; i < 64; i++) { #define TRANSPOSE(x) (((x) >> 3) | (((x) & 7) << 3)) s->idct_permutation[i] = TRANSPOSE(i); s->idct_scantable[i] = TRANSPOSE(ff_zigzag_direct[i]); @@ -2371,7 +2358,7 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) /* initialize to an impossible value which will force a recalculation * in the first frame decode */ - for (i = 0; i < 3; i++) + for (int i = 0; i < 3; i++) s->qps[i] = -1; ret = av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &s->chroma_x_shift, &s->chroma_y_shift); @@ -2416,7 +2403,7 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) if (!s->theora_tables) { const uint8_t (*bias_tabs)[32][2]; - for (i = 0; i < 64; i++) { + for (int i = 0; i < 64; i++) { s->coded_dc_scale_factor[0][i] = s->version < 2 ? vp31_dc_scale_factor[i] : vp4_y_dc_scale_factor[i]; s->coded_dc_scale_factor[1][i] = s->version < 2 ? vp31_dc_scale_factor[i] : vp4_uv_dc_scale_factor[i]; s->coded_ac_scale_factor[i] = s->version < 2 ? vp31_ac_scale_factor[i] : vp4_ac_scale_factor[i]; @@ -2426,8 +2413,8 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) s->filter_limit_values[i] = s->version < 2 ? vp31_filter_limit_values[i] : vp4_filter_limit_values[i]; } - for (inter = 0; inter < 2; inter++) { - for (plane = 0; plane < 3; plane++) { + for (int inter = 0; inter < 2; inter++) { + for (int plane = 0; plane < 3; plane++) { s->qr_count[inter][plane] = 1; s->qr_size[inter][plane][0] = 63; s->qr_base[inter][plane][0] = @@ -2438,7 +2425,7 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) /* init VLC tables */ bias_tabs = CONFIG_VP4_DECODER && s->version >= 2 ? vp4_bias : vp3_bias; for (int i = 0; i < FF_ARRAY_ELEMS(s->coeff_vlc); i++) { - ret = ff_init_vlc_from_lengths(&s->coeff_vlc[i], 11, 32, + ret = ff_vlc_init_from_lengths(&s->coeff_vlc[i], 11, 32, &bias_tabs[i][0][1], 2, &bias_tabs[i][0][0], 2, 1, 0, 0, avctx); @@ -2446,10 +2433,10 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) return ret; } } else { - for (i = 0; i < FF_ARRAY_ELEMS(s->coeff_vlc); i++) { + for (int i = 0; i < FF_ARRAY_ELEMS(s->coeff_vlc); i++) { const HuffTable *tab = &s->huffman_table[i]; - ret = ff_init_vlc_from_lengths(&s->coeff_vlc[i], 11, tab->nb_entries, + ret = ff_vlc_init_from_lengths(&s->coeff_vlc[i], 11, tab->nb_entries, &tab->entries[0].len, sizeof(*tab->entries), &tab->entries[0].sym, sizeof(*tab->entries), 1, 0, 0, avctx); @@ -2458,25 +2445,25 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) } } - ret = ff_init_vlc_from_lengths(&s->superblock_run_length_vlc, SUPERBLOCK_VLC_BITS, 34, + ret = ff_vlc_init_from_lengths(&s->superblock_run_length_vlc, SUPERBLOCK_VLC_BITS, 34, superblock_run_length_vlc_lens, 1, NULL, 0, 0, 1, 0, avctx); if (ret < 0) return ret; - ret = ff_init_vlc_from_lengths(&s->fragment_run_length_vlc, 5, 30, + ret = ff_vlc_init_from_lengths(&s->fragment_run_length_vlc, 5, 30, fragment_run_length_vlc_len, 1, NULL, 0, 0, 0, 0, avctx); if (ret < 0) return ret; - ret = ff_init_vlc_from_lengths(&s->mode_code_vlc, 3, 8, + ret = ff_vlc_init_from_lengths(&s->mode_code_vlc, 3, 8, mode_code_vlc_len, 1, NULL, 0, 0, 0, 0, avctx); if (ret < 0) return ret; - ret = ff_init_vlc_from_lengths(&s->motion_vector_vlc, VP3_MV_VLC_BITS, 63, + ret = ff_vlc_init_from_lengths(&s->motion_vector_vlc, VP3_MV_VLC_BITS, 63, &motion_vector_vlc_table[0][1], 2, &motion_vector_vlc_table[0][0], 2, 1, -31, 0, avctx); @@ -2484,9 +2471,9 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) return ret; #if CONFIG_VP4_DECODER - for (j = 0; j < 2; j++) - for (i = 0; i < 7; i++) { - ret = ff_init_vlc_from_lengths(&s->vp4_mv_vlc[j][i], VP4_MV_VLC_BITS, 63, + for (int j = 0; j < 2; j++) + for (int i = 0; i < 7; i++) { + ret = ff_vlc_init_from_lengths(&s->vp4_mv_vlc[j][i], VP4_MV_VLC_BITS, 63, &vp4_mv_vlc[j][i][0][1], 2, &vp4_mv_vlc[j][i][0][0], 2, 1, -31, 0, avctx); @@ -2495,8 +2482,8 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) } /* version >= 2 */ - for (i = 0; i < 2; i++) - if ((ret = init_vlc(&s->block_pattern_vlc[i], 3, 14, + for (int i = 0; i < 2; i++) + if ((ret = vlc_init(&s->block_pattern_vlc[i], 3, 14, &vp4_block_pattern_vlc[i][0][1], 2, 1, &vp4_block_pattern_vlc[i][0][0], 2, 1, 0)) < 0) return ret; @@ -2511,24 +2498,19 @@ static int update_frames(AVCodecContext *avctx) Vp3DecodeContext *s = avctx->priv_data; int ret = 0; - /* shuffle frames (last = current) */ - ff_thread_release_ext_buffer(avctx, &s->last_frame); - ret = ff_thread_ref_frame(&s->last_frame, &s->current_frame); - if (ret < 0) - goto fail; - if (s->keyframe) { ff_thread_release_ext_buffer(avctx, &s->golden_frame); ret = ff_thread_ref_frame(&s->golden_frame, &s->current_frame); } + /* shuffle frames */ + ff_thread_release_ext_buffer(avctx, &s->last_frame); + FFSWAP(ThreadFrame, s->last_frame, s->current_frame); -fail: - ff_thread_release_ext_buffer(avctx, &s->current_frame); return ret; } #if HAVE_THREADS -static int ref_frame(Vp3DecodeContext *s, ThreadFrame *dst, ThreadFrame *src) +static int ref_frame(Vp3DecodeContext *s, ThreadFrame *dst, const ThreadFrame *src) { ff_thread_release_ext_buffer(s->avctx, dst); if (src->f->data[0]) @@ -2536,7 +2518,7 @@ static int ref_frame(Vp3DecodeContext *s, ThreadFrame *dst, ThreadFrame *src) return 0; } -static int ref_frames(Vp3DecodeContext *dst, Vp3DecodeContext *src) +static int ref_frames(Vp3DecodeContext *dst, const Vp3DecodeContext *src) { int ret; if ((ret = ref_frame(dst, &dst->current_frame, &src->current_frame)) < 0 || @@ -2548,8 +2530,9 @@ static int ref_frames(Vp3DecodeContext *dst, Vp3DecodeContext *src) static int vp3_update_thread_context(AVCodecContext *dst, const AVCodecContext *src) { - Vp3DecodeContext *s = dst->priv_data, *s1 = src->priv_data; - int qps_changed = 0, i, err; + Vp3DecodeContext *s = dst->priv_data; + const Vp3DecodeContext *s1 = src->priv_data; + int qps_changed = 0, err; if (!s1->current_frame.f->data[0] || s->width != s1->width || s->height != s1->height) { @@ -2566,7 +2549,7 @@ static int vp3_update_thread_context(AVCodecContext *dst, const AVCodecContext * s->keyframe = s1->keyframe; // copy qscale data if necessary - for (i = 0; i < 3; i++) { + for (int i = 0; i < 3; i++) { if (s->qps[i] != s1->qps[1]) { qps_changed = 1; memcpy(&s->qmat[i], &s1->qmat[i], sizeof(s->qmat[i])); @@ -2595,7 +2578,7 @@ static int vp3_decode_frame(AVCodecContext *avctx, AVFrame *frame, int buf_size = avpkt->size; Vp3DecodeContext *s = avctx->priv_data; GetBitContext gb; - int i, ret; + int ret; if ((ret = init_get_bits8(&gb, buf, buf_size)) < 0) return ret; @@ -2645,14 +2628,14 @@ static int vp3_decode_frame(AVCodecContext *avctx, AVFrame *frame, } if (!s->theora) skip_bits(&gb, 1); - for (i = 0; i < 3; i++) + for (int i = 0; i < 3; i++) s->last_qps[i] = s->qps[i]; s->nqps = 0; do { s->qps[s->nqps++] = get_bits(&gb, 6); } while (s->theora >= 0x030200 && s->nqps < 3 && get_bits1(&gb)); - for (i = s->nqps; i < 3; i++) + for (int i = s->nqps; i < 3; i++) s->qps[i] = -1; if (s->avctx->debug & FF_DEBUG_PICT_INFO) @@ -2666,7 +2649,7 @@ static int vp3_decode_frame(AVCodecContext *avctx, AVFrame *frame, if (s->qps[0] != s->last_qps[0]) init_loop_filter(s); - for (i = 0; i < s->nqps; i++) + for (int i = 0; i < s->nqps; i++) // reinit all dequantizers if the first one changed, because // the DC of the first quantizer must be used for all matrices if (s->qps[i] != s->last_qps[i] || s->qps[0] != s->last_qps[0]) @@ -2756,9 +2739,9 @@ static int vp3_decode_frame(AVCodecContext *avctx, AVFrame *frame, ff_thread_report_progress(&s->last_frame, INT_MAX, 0); } } + ff_thread_finish_setup(avctx); memset(s->all_fragments, 0, s->fragment_count * sizeof(Vp3Fragment)); - ff_thread_finish_setup(avctx); if (s->version < 2) { if ((ret = unpack_superblocks(s, &gb)) < 0) { @@ -2800,7 +2783,7 @@ static int vp3_decode_frame(AVCodecContext *avctx, AVFrame *frame, #endif } - for (i = 0; i < 3; i++) { + for (int i = 0; i < 3; i++) { int height = s->height >> (i && s->chroma_y_shift); if (s->flipped_image) s->data_offset[i] = 0; @@ -2809,12 +2792,12 @@ static int vp3_decode_frame(AVCodecContext *avctx, AVFrame *frame, } s->last_slice_end = 0; - for (i = 0; i < s->c_superblock_height; i++) + for (int i = 0; i < s->c_superblock_height; i++) render_slice(s, i); // filter the last row if (s->version < 2) - for (i = 0; i < 3; i++) { + for (int i = 0; i < 3; i++) { int row = (s->height >> (3 + (i && s->chroma_y_shift))) - 1; apply_loop_filter(s, i, row, row + 1); } @@ -3003,7 +2986,7 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb) static int theora_decode_tables(AVCodecContext *avctx, GetBitContext *gb) { Vp3DecodeContext *s = avctx->priv_data; - int i, n, matrices, inter, plane, ret; + int n, matrices, ret; if (!s->theora_header) return AVERROR_INVALIDDATA; @@ -3012,7 +2995,7 @@ static int theora_decode_tables(AVCodecContext *avctx, GetBitContext *gb) n = get_bits(gb, 3); /* loop filter limit values table */ if (n) - for (i = 0; i < 64; i++) + for (int i = 0; i < 64; i++) s->filter_limit_values[i] = get_bits(gb, n); } @@ -3021,7 +3004,7 @@ static int theora_decode_tables(AVCodecContext *avctx, GetBitContext *gb) else n = 16; /* quality threshold table */ - for (i = 0; i < 64; i++) + for (int i = 0; i < 64; i++) s->coded_ac_scale_factor[i] = get_bits(gb, n); if (s->theora >= 0x030200) @@ -3029,7 +3012,7 @@ static int theora_decode_tables(AVCodecContext *avctx, GetBitContext *gb) else n = 16; /* dc scale factor table */ - for (i = 0; i < 64; i++) + for (int i = 0; i < 64; i++) s->coded_dc_scale_factor[0][i] = s->coded_dc_scale_factor[1][i] = get_bits(gb, n); @@ -3043,12 +3026,12 @@ static int theora_decode_tables(AVCodecContext *avctx, GetBitContext *gb) return -1; } - for (n = 0; n < matrices; n++) - for (i = 0; i < 64; i++) - s->base_matrix[n][i] = get_bits(gb, 8); + for (int j = 0; j < matrices; j++) + for (int i = 0; i < 64; i++) + s->base_matrix[j][i] = get_bits(gb, 8); - for (inter = 0; inter <= 1; inter++) { - for (plane = 0; plane <= 2; plane++) { + for (int inter = 0; inter <= 1; inter++) { + for (int plane = 0; plane <= 2; plane++) { int newqr = 1; if (inter || plane > 0) newqr = get_bits1(gb); @@ -3071,7 +3054,7 @@ static int theora_decode_tables(AVCodecContext *avctx, GetBitContext *gb) int qi = 0; for (;;) { - i = get_bits(gb, av_log2(matrices - 1) + 1); + int i = get_bits(gb, av_log2(matrices - 1) + 1); if (i >= matrices) { av_log(avctx, AV_LOG_ERROR, "invalid base matrix index\n"); @@ -3113,7 +3096,6 @@ static av_cold int theora_decode_init(AVCodecContext *avctx) int ptype; const uint8_t *header_start[3]; int header_len[3]; - int i; int ret; avctx->pix_fmt = AV_PIX_FMT_YUV420P; @@ -3131,7 +3113,7 @@ static av_cold int theora_decode_init(AVCodecContext *avctx) return -1; } - for (i = 0; i < 3; i++) { + for (int i = 0; i < 3; i++) { if (header_len[i] <= 0) continue; ret = init_get_bits8(&gb, header_start[i], header_len[i]); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vp56.c b/arm/raspi/third_party/ffmpeg/libavcodec/vp56.c index a5c5b236..f2ee3faf 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vp56.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vp56.c @@ -607,8 +607,7 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, AVFrame *rframe, } if (avctx->pix_fmt == AV_PIX_FMT_YUVA420P) { - av_frame_unref(s->alpha_context->frames[VP56_FRAME_CURRENT]); - if ((ret = av_frame_ref(s->alpha_context->frames[VP56_FRAME_CURRENT], p)) < 0) { + if ((ret = av_frame_replace(s->alpha_context->frames[VP56_FRAME_CURRENT], p)) < 0) { av_frame_unref(p); if (res == VP56_SIZE_CHANGE) ff_set_dimensions(avctx, 0, 0); @@ -764,8 +763,7 @@ static int ff_vp56_decode_mbs(AVCodecContext *avctx, void *data, next: if ((p->flags & AV_FRAME_FLAG_KEY) || s->golden_frame) { - av_frame_unref(s->frames[VP56_FRAME_GOLDEN]); - if ((res = av_frame_ref(s->frames[VP56_FRAME_GOLDEN], p)) < 0) + if ((res = av_frame_replace(s->frames[VP56_FRAME_GOLDEN], p)) < 0) return res; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vp6.c b/arm/raspi/third_party/ffmpeg/libavcodec/vp6.c index 7a519cf1..97d63a58 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vp6.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vp6.c @@ -279,7 +279,7 @@ static int vp6_build_huff_tree(VP56Context *s, uint8_t coeff_model[], nodes[map[2*i+1]].count = b + !b; } - ff_free_vlc(vlc); + ff_vlc_free(vlc); /* then build the huffman tree according to probabilities */ return ff_huff_build_tree(s->avctx, vlc, size, FF_HUFFMAN_BITS, nodes, vp6_huff_cmp, @@ -708,11 +708,11 @@ static av_cold void vp6_decode_free_context(VP56Context *s) ff_vp56_free_context(s); for (pt=0; pt<2; pt++) { - ff_free_vlc(&s->dccv_vlc[pt]); - ff_free_vlc(&s->runv_vlc[pt]); + ff_vlc_free(&s->dccv_vlc[pt]); + ff_vlc_free(&s->runv_vlc[pt]); for (ct=0; ct<3; ct++) for (cg=0; cg<6; cg++) - ff_free_vlc(&s->ract_vlc[pt][ct][cg]); + ff_vlc_free(&s->ract_vlc[pt][ct][cg]); } } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vp8.c b/arm/raspi/third_party/ffmpeg/libavcodec/vp8.c index 50afe19b..64b1c7f6 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vp8.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vp8.c @@ -31,6 +31,7 @@ #include "avcodec.h" #include "codec_internal.h" #include "decode.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "mathops.h" #include "thread.h" @@ -104,23 +105,21 @@ static int vp8_alloc_frame(VP8Context *s, VP8Frame *f, int ref) if ((ret = ff_thread_get_ext_buffer(s->avctx, &f->tf, ref ? AV_GET_BUFFER_FLAG_REF : 0)) < 0) return ret; - if (!(f->seg_map = av_buffer_allocz(s->mb_width * s->mb_height))) + if (!(f->seg_map = av_buffer_allocz(s->mb_width * s->mb_height))) { + ret = AVERROR(ENOMEM); goto fail; - if (s->avctx->hwaccel) { - const AVHWAccel *hwaccel = s->avctx->hwaccel; - if (hwaccel->frame_priv_data_size) { - f->hwaccel_priv_buf = ff_hwaccel_frame_priv_alloc(s->avctx, hwaccel); - if (!f->hwaccel_priv_buf) - goto fail; - f->hwaccel_picture_private = f->hwaccel_priv_buf->data; - } } + ret = ff_hwaccel_frame_priv_alloc(s->avctx, &f->hwaccel_picture_private, + &f->hwaccel_priv_buf); + if (ret < 0) + goto fail; + return 0; fail: av_buffer_unref(&f->seg_map); ff_thread_release_ext_buffer(s->avctx, &f->tf); - return AVERROR(ENOMEM); + return ret; } static void vp8_release_frame(VP8Context *s, VP8Frame *f) @@ -168,8 +167,8 @@ static void vp8_decode_flush_impl(AVCodecContext *avctx, int free_mem) if (free_mem) free_buffers(s); - if (avctx->hwaccel && avctx->hwaccel->flush) - avctx->hwaccel->flush(avctx); + if (FF_HW_HAS_CB(avctx, flush)) + FF_HW_SIMPLE_CALL(avctx, flush); } static void vp8_decode_flush(AVCodecContext *avctx) @@ -2766,15 +2765,16 @@ int vp78_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, ff_thread_finish_setup(avctx); if (avctx->hwaccel) { - ret = avctx->hwaccel->start_frame(avctx, avpkt->data, avpkt->size); + const FFHWAccel *hwaccel = ffhwaccel(avctx->hwaccel); + ret = hwaccel->start_frame(avctx, avpkt->data, avpkt->size); if (ret < 0) goto err; - ret = avctx->hwaccel->decode_slice(avctx, avpkt->data, avpkt->size); + ret = hwaccel->decode_slice(avctx, avpkt->data, avpkt->size); if (ret < 0) goto err; - ret = avctx->hwaccel->end_frame(avctx); + ret = hwaccel->end_frame(avctx); if (ret < 0) goto err; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vp9.c b/arm/raspi/third_party/ffmpeg/libavcodec/vp9.c index 4f704ec0..3cc27aa8 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vp9.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vp9.c @@ -27,6 +27,7 @@ #include "codec_internal.h" #include "decode.h" #include "get_bits.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "profiles.h" #include "thread.h" @@ -119,12 +120,14 @@ static int vp9_frame_alloc(AVCodecContext *avctx, VP9Frame *f) s->frame_extradata_pool = av_buffer_pool_init(sz * (1 + sizeof(VP9mvrefPair)), NULL); if (!s->frame_extradata_pool) { s->frame_extradata_pool_size = 0; + ret = AVERROR(ENOMEM); goto fail; } s->frame_extradata_pool_size = sz; } f->extradata = av_buffer_pool_get(s->frame_extradata_pool); if (!f->extradata) { + ret = AVERROR(ENOMEM); goto fail; } memset(f->extradata->data, 0, f->extradata->size); @@ -132,22 +135,16 @@ static int vp9_frame_alloc(AVCodecContext *avctx, VP9Frame *f) f->segmentation_map = f->extradata->data; f->mv = (VP9mvrefPair *) (f->extradata->data + sz); - if (avctx->hwaccel) { - const AVHWAccel *hwaccel = avctx->hwaccel; - av_assert0(!f->hwaccel_picture_private); - if (hwaccel->frame_priv_data_size) { - f->hwaccel_priv_buf = ff_hwaccel_frame_priv_alloc(avctx, hwaccel); - if (!f->hwaccel_priv_buf) - goto fail; - f->hwaccel_picture_private = f->hwaccel_priv_buf->data; - } - } + ret = ff_hwaccel_frame_priv_alloc(avctx, &f->hwaccel_picture_private, + &f->hwaccel_priv_buf); + if (ret < 0) + goto fail; return 0; fail: vp9_frame_unref(avctx, f); - return AVERROR(ENOMEM); + return ret; } static int vp9_frame_ref(AVCodecContext *avctx, VP9Frame *dst, VP9Frame *src) @@ -253,7 +250,7 @@ static int update_size(AVCodecContext *avctx, int w, int h) *fmtp++ = s->pix_fmt; *fmtp = AV_PIX_FMT_NONE; - ret = ff_thread_get_format(avctx, pix_fmts); + ret = ff_get_format(avctx, pix_fmts); if (ret < 0) return ret; @@ -1639,13 +1636,14 @@ static int vp9_decode_frame(AVCodecContext *avctx, AVFrame *frame, } if (avctx->hwaccel) { - ret = avctx->hwaccel->start_frame(avctx, NULL, 0); + const FFHWAccel *hwaccel = ffhwaccel(avctx->hwaccel); + ret = hwaccel->start_frame(avctx, NULL, 0); if (ret < 0) return ret; - ret = avctx->hwaccel->decode_slice(avctx, pkt->data, pkt->size); + ret = hwaccel->decode_slice(avctx, pkt->data, pkt->size); if (ret < 0) return ret; - ret = avctx->hwaccel->end_frame(avctx); + ret = hwaccel->end_frame(avctx); if (ret < 0) return ret; goto finish; @@ -1802,8 +1800,8 @@ static void vp9_decode_flush(AVCodecContext *avctx) for (i = 0; i < 8; i++) ff_thread_release_ext_buffer(avctx, &s->s.refs[i]); - if (avctx->hwaccel && avctx->hwaccel->flush) - avctx->hwaccel->flush(avctx); + if (FF_HW_HAS_CB(avctx, flush)) + FF_HW_SIMPLE_CALL(avctx, flush); } static av_cold int vp9_decode_init(AVCodecContext *avctx) diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vqcdec.c b/arm/raspi/third_party/ffmpeg/libavcodec/vqcdec.c index c3bce879..462d810a 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vqcdec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vqcdec.c @@ -53,7 +53,7 @@ static VLC vector_vlc; static av_cold void vqc_init_static_data(void) { - INIT_VLC_STATIC_FROM_LENGTHS(&vector_vlc, VECTOR_VLC_BITS, FF_ARRAY_ELEMS(vector_nbits), + VLC_INIT_STATIC_FROM_LENGTHS(&vector_vlc, VECTOR_VLC_BITS, FF_ARRAY_ELEMS(vector_nbits), vector_nbits, 1, vector_symbols, 1, 1, 0, 0, 1 << VECTOR_VLC_BITS); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vulkan_av1.c b/arm/raspi/third_party/ffmpeg/libavcodec/vulkan_av1.c index d0f40192..b1373722 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vulkan_av1.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vulkan_av1.c @@ -104,12 +104,9 @@ static int vk_av1_fill_pict(AVCodecContext *avctx, const AV1Frame **ref_src, static int vk_av1_create_params(AVCodecContext *avctx, AVBufferRef **buf) { - VkResult ret; - const AV1DecContext *s = avctx->priv_data; FFVulkanDecodeContext *dec = avctx->internal->hwaccel_priv_data; FFVulkanDecodeShared *ctx = (FFVulkanDecodeShared *)dec->shared_ref->data; - FFVulkanFunctions *vk = &ctx->s.vkfn; const AV1RawSequenceHeader *seq = s->raw_seq; @@ -118,10 +115,7 @@ static int vk_av1_create_params(AVCodecContext *avctx, AVBufferRef **buf) VkVideoDecodeAV1SessionParametersCreateInfoMESA av1_params; VkVideoSessionParametersCreateInfoKHR session_params_create; - AVBufferRef *tmp; - VkVideoSessionParametersKHR *par = av_malloc(sizeof(*par)); - if (!par) - return AVERROR(ENOMEM); + int err; av1_sequence_header = (StdVideoAV1MESASequenceHeader) { .flags = (StdVideoAV1MESASequenceHeaderFlags) { @@ -189,26 +183,12 @@ static int vk_av1_create_params(AVCodecContext *avctx, AVBufferRef **buf) .videoSessionParametersTemplate = NULL, }; - /* Create session parameters */ - ret = vk->CreateVideoSessionParametersKHR(ctx->s.hwctx->act_dev, &session_params_create, - ctx->s.hwctx->alloc, par); - if (ret != VK_SUCCESS) { - av_log(avctx, AV_LOG_ERROR, "Unable to create Vulkan video session parameters: %s!\n", - ff_vk_ret2str(ret)); - return AVERROR_EXTERNAL; - } - - tmp = av_buffer_create((uint8_t *)par, sizeof(*par), ff_vk_decode_free_params, - ctx, 0); - if (!tmp) { - ff_vk_decode_free_params(ctx, (uint8_t *)par); - return AVERROR(ENOMEM); - } + err = ff_vk_decode_create_params(buf, avctx, ctx, &session_params_create); + if (err < 0) + return err; av_log(avctx, AV_LOG_DEBUG, "Created frame parameters\n"); - *buf = tmp; - return 0; } @@ -572,11 +552,11 @@ static void vk_av1_free_frame_priv(void *_hwctx, uint8_t *data) av_free(ap); } -const AVHWAccel ff_av1_vulkan_hwaccel = { - .name = "av1_vulkan", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AV1, - .pix_fmt = AV_PIX_FMT_VULKAN, +const FFHWAccel ff_av1_vulkan_hwaccel = { + .p.name = "av1_vulkan", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, + .p.pix_fmt = AV_PIX_FMT_VULKAN, .start_frame = &vk_av1_start_frame, .decode_slice = &vk_av1_decode_slice, .end_frame = &vk_av1_end_frame, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vulkan_decode.c b/arm/raspi/third_party/ffmpeg/libavcodec/vulkan_decode.c index f20733fb..ef4a1c38 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vulkan_decode.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vulkan_decode.c @@ -176,6 +176,7 @@ int ff_vk_decode_prepare_frame(FFVulkanDecodeContext *dec, AVFrame *pic, { int err; FFVulkanDecodeShared *ctx = (FFVulkanDecodeShared *)dec->shared_ref->data; + FFVulkanFunctions *vk = &ctx->s.vkfn; vkpic->slices_size = 0; @@ -189,6 +190,9 @@ int ff_vk_decode_prepare_frame(FFVulkanDecodeContext *dec, AVFrame *pic, vkpic->img_view_out = NULL; vkpic->img_view_dest = NULL; + vkpic->destroy_image_view = vk->DestroyImageView; + vkpic->wait_semaphores = vk->WaitSemaphores; + if (dec->layered_dpb && alloc_dpb) { vkpic->img_view_ref = ctx->layered_view; vkpic->img_aspect_ref = ctx->layered_aspect; @@ -554,9 +558,6 @@ int ff_vk_decode_frame(AVCodecContext *avctx, void ff_vk_decode_free_frame(AVHWDeviceContext *dev_ctx, FFVulkanDecodePicture *vp) { AVVulkanDeviceContext *hwctx = dev_ctx->hwctx; - PFN_vkGetDeviceProcAddr device_proc_addr; - PFN_vkWaitSemaphores wait_semaphores; - PFN_vkDestroyImageView destroy_image_view; VkSemaphoreWaitInfo sem_wait = (VkSemaphoreWaitInfo) { .sType = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO, @@ -565,27 +566,22 @@ void ff_vk_decode_free_frame(AVHWDeviceContext *dev_ctx, FFVulkanDecodePicture * .semaphoreCount = 1, }; - /* Guaranteed to exist */ - device_proc_addr = (PFN_vkGetDeviceProcAddr)hwctx->get_proc_addr(hwctx->inst, "vkGetDeviceProcAddr"); - destroy_image_view = (PFN_vkDestroyImageView)device_proc_addr(hwctx->act_dev, "vkDestroyImageView"); - wait_semaphores = (PFN_vkWaitSemaphores)device_proc_addr(hwctx->act_dev, "vkWaitSemaphores"); - /* We do not have to lock the frame here because we're not interested * in the actual current semaphore value, but only that it's later than * the time we submitted the image for decoding. */ if (vp->sem) - wait_semaphores(hwctx->act_dev, &sem_wait, UINT64_MAX); + vp->wait_semaphores(hwctx->act_dev, &sem_wait, UINT64_MAX); /* Free slices data */ av_buffer_unref(&vp->slices_buf); /* Destroy image view (out) */ if (vp->img_view_out && vp->img_view_out != vp->img_view_dest) - destroy_image_view(hwctx->act_dev, vp->img_view_out, hwctx->alloc); + vp->destroy_image_view(hwctx->act_dev, vp->img_view_out, hwctx->alloc); /* Destroy image view (ref, unlayered) */ if (vp->img_view_dest) - destroy_image_view(hwctx->act_dev, vp->img_view_dest, hwctx->alloc); + vp->destroy_image_view(hwctx->act_dev, vp->img_view_dest, hwctx->alloc); av_frame_free(&vp->dpb_frame); } @@ -682,7 +678,7 @@ static VkResult vulkan_setup_profile(AVCodecContext *avctx, VkVideoProfileListInfoKHR *profile_list = &prof->profile_list; VkVideoDecodeH264ProfileInfoKHR *h264_profile = &prof->h264_profile; - VkVideoDecodeH264ProfileInfoKHR *h265_profile = &prof->h265_profile; + VkVideoDecodeH265ProfileInfoKHR *h265_profile = &prof->h265_profile; VkVideoDecodeAV1ProfileInfoMESA *av1_profile = &prof->av1_profile; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->sw_pix_fmt); @@ -696,8 +692,8 @@ static VkResult vulkan_setup_profile(AVCodecContext *avctx, /* Vulkan transmits all the constrant_set flags, rather than wanting them * merged in the profile IDC */ - h264_profile->stdProfileIdc = cur_profile & ~(FF_PROFILE_H264_CONSTRAINED | - FF_PROFILE_H264_INTRA); + h264_profile->stdProfileIdc = cur_profile & ~(AV_PROFILE_H264_CONSTRAINED | + AV_PROFILE_H264_INTRA); h264_profile->pictureLayout = avctx->field_order == AV_FIELD_UNKNOWN || avctx->field_order == AV_FIELD_PROGRESSIVE ? @@ -789,8 +785,8 @@ static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_ } cur_profile = avctx->profile; - base_profile = avctx->codec_id == AV_CODEC_ID_H264 ? FF_PROFILE_H264_CONSTRAINED_BASELINE : - avctx->codec_id == AV_CODEC_ID_H265 ? FF_PROFILE_HEVC_MAIN : + base_profile = avctx->codec_id == AV_CODEC_ID_H264 ? AV_PROFILE_H264_CONSTRAINED_BASELINE : + avctx->codec_id == AV_CODEC_ID_H265 ? AV_PROFILE_HEVC_MAIN : avctx->codec_id == AV_CODEC_ID_AV1 ? STD_VIDEO_AV1_MESA_PROFILE_MAIN : 0; @@ -837,8 +833,8 @@ static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_ return AVERROR_EXTERNAL; } - max_level = avctx->codec_id == AV_CODEC_ID_H264 ? h264_caps.maxLevelIdc : - avctx->codec_id == AV_CODEC_ID_H265 ? h265_caps.maxLevelIdc : + max_level = avctx->codec_id == AV_CODEC_ID_H264 ? ff_vk_h264_level_to_av(h264_caps.maxLevelIdc) : + avctx->codec_id == AV_CODEC_ID_H265 ? ff_vk_h265_level_to_av(h265_caps.maxLevelIdc) : avctx->codec_id == AV_CODEC_ID_AV1 ? av1_caps.maxLevelIdc : 0; @@ -863,6 +859,9 @@ static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_ caps->maxDpbSlots); av_log(avctx, AV_LOG_VERBOSE, " Maximum active references: %u\n", caps->maxActiveReferencePictures); + av_log(avctx, AV_LOG_VERBOSE, " Codec header name: '%s' (driver), '%s' (compiled)\n", + caps->stdHeaderVersion.extensionName, + dec_ext[avctx->codec_id]->extensionName); av_log(avctx, AV_LOG_VERBOSE, " Codec header version: %i.%i.%i (driver), %i.%i.%i (compiled)\n", CODEC_VER(caps->stdHeaderVersion.specVersion), CODEC_VER(dec_ext[avctx->codec_id]->specVersion)); @@ -1054,7 +1053,7 @@ int ff_vk_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx) return err; } -void ff_vk_decode_free_params(void *opaque, uint8_t *data) +static void vk_decode_free_params(void *opaque, uint8_t *data) { FFVulkanDecodeShared *ctx = opaque; FFVulkanFunctions *vk = &ctx->s.vkfn; @@ -1064,6 +1063,35 @@ void ff_vk_decode_free_params(void *opaque, uint8_t *data) av_free(par); } +int ff_vk_decode_create_params(AVBufferRef **par_ref, void *logctx, FFVulkanDecodeShared *ctx, + const VkVideoSessionParametersCreateInfoKHR *session_params_create) +{ + VkVideoSessionParametersKHR *par = av_malloc(sizeof(*par)); + const FFVulkanFunctions *vk = &ctx->s.vkfn; + VkResult ret; + + if (!par) + return AVERROR(ENOMEM); + + /* Create session parameters */ + ret = vk->CreateVideoSessionParametersKHR(ctx->s.hwctx->act_dev, session_params_create, + ctx->s.hwctx->alloc, par); + if (ret != VK_SUCCESS) { + av_log(logctx, AV_LOG_ERROR, "Unable to create Vulkan video session parameters: %s!\n", + ff_vk_ret2str(ret)); + av_free(par); + return AVERROR_EXTERNAL; + } + *par_ref = av_buffer_create((uint8_t *)par, sizeof(*par), + vk_decode_free_params, ctx, 0); + if (!*par_ref) { + vk_decode_free_params(ctx, (uint8_t *)par); + return AVERROR(ENOMEM); + } + + return 0; +} + int ff_vk_decode_uninit(AVCodecContext *avctx) { FFVulkanDecodeContext *dec = avctx->internal->hwaccel_priv_data; @@ -1072,7 +1100,7 @@ int ff_vk_decode_uninit(AVCodecContext *avctx) /* Wait on and free execution pool */ ff_vk_exec_pool_free(&ctx->s, &dec->exec_pool); - av_buffer_pool_uninit(&dec->tmp_pool); + av_freep(&dec->hevc_headers); av_buffer_unref(&dec->session_params); av_buffer_unref(&dec->shared_ref); av_freep(&dec->slice_off); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vulkan_decode.h b/arm/raspi/third_party/ffmpeg/libavcodec/vulkan_decode.h index 1b4e1cc7..c983b440 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vulkan_decode.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vulkan_decode.h @@ -20,14 +20,14 @@ #define AVCODEC_VULKAN_DECODE_H #include "decode.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "internal.h" #include "vulkan_video.h" typedef struct FFVulkanDecodeProfileData { VkVideoDecodeH264ProfileInfoKHR h264_profile; - VkVideoDecodeH264ProfileInfoKHR h265_profile; + VkVideoDecodeH265ProfileInfoKHR h265_profile; VkVideoDecodeAV1ProfileInfoMESA av1_profile; VkVideoDecodeUsageInfoKHR usage; VkVideoProfileInfoKHR profile; @@ -64,8 +64,8 @@ typedef struct FFVulkanDecodeContext { uint32_t frame_id_alloc_mask; /* For AV1 only */ /* Thread-local state below */ - AVBufferPool *tmp_pool; /* Pool for temporary data, if needed (HEVC) */ - size_t tmp_pool_ele_size; + struct HEVCHeaderSet *hevc_headers; + size_t hevc_headers_size; uint32_t *slice_off; unsigned int slice_off_max; @@ -97,6 +97,10 @@ typedef struct FFVulkanDecodePicture { /* Slice data */ AVBufferRef *slices_buf; size_t slices_size; + + /* Vulkan functions needed for destruction, as no other context is guaranteed to exist */ + PFN_vkWaitSemaphores wait_semaphores; + PFN_vkDestroyImageView destroy_image_view; } FFVulkanDecodePicture; /** @@ -156,9 +160,10 @@ int ff_vk_get_decode_buffer(FFVulkanDecodeContext *ctx, AVBufferRef **buf, void *create_pNext, size_t size); /** - * Free VkVideoSessionParametersKHR. + * Create VkVideoSessionParametersKHR wrapped in an AVBufferRef. */ -void ff_vk_decode_free_params(void *opaque, uint8_t *data); +int ff_vk_decode_create_params(AVBufferRef **par_ref, void *logctx, FFVulkanDecodeShared *ctx, + const VkVideoSessionParametersCreateInfoKHR *session_params_create); /** * Flush decoder. diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vulkan_h264.c b/arm/raspi/third_party/ffmpeg/libavcodec/vulkan_h264.c index 84bcef79..32ef32d6 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vulkan_h264.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vulkan_h264.c @@ -43,6 +43,8 @@ typedef struct H264VulkanDecodePicture { VkVideoDecodeH264PictureInfoKHR h264_pic_info; } H264VulkanDecodePicture; +const static int h264_scaling_list8_order[] = { 0, 3, 1, 4, 2, 5 }; + static int vk_h264_fill_pict(AVCodecContext *avctx, H264Picture **ref_src, VkVideoReferenceSlotInfoKHR *ref_slot, /* Main structure */ VkVideoPictureResourceInfoKHR *ref, /* Goes in ^ */ @@ -143,12 +145,13 @@ static void set_sps(const SPS *sps, }; for (int i = 0; i < STD_VIDEO_H264_SCALING_LIST_4X4_NUM_LISTS; i++) - memcpy(vksps_scaling->ScalingList4x4[i], sps->scaling_matrix4[i], - STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS * sizeof(**sps->scaling_matrix4)); + for (int j = 0; j < STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS; j++) + vksps_scaling->ScalingList4x4[i][j] = sps->scaling_matrix4[i][ff_zigzag_scan[j]]; for (int i = 0; i < STD_VIDEO_H264_SCALING_LIST_8X8_NUM_LISTS; i++) - memcpy(vksps_scaling->ScalingList8x8[i], sps->scaling_matrix8[i], - STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS * sizeof(**sps->scaling_matrix8)); + for (int j = 0; j < STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS; j++) + vksps_scaling->ScalingList8x8[i][j] = + sps->scaling_matrix8[h264_scaling_list8_order[i]][ff_zigzag_direct[j]]; *vksps_vui_header = (StdVideoH264HrdParameters) { .cpb_cnt_minus1 = sps->cpb_cnt - 1, @@ -248,12 +251,13 @@ static void set_pps(const PPS *pps, const SPS *sps, }; for (int i = 0; i < STD_VIDEO_H264_SCALING_LIST_4X4_NUM_LISTS; i++) - memcpy(vkpps_scaling->ScalingList4x4[i], pps->scaling_matrix4[i], - STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS * sizeof(**pps->scaling_matrix4)); + for (int j = 0; j < STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS; j++) + vkpps_scaling->ScalingList4x4[i][j] = pps->scaling_matrix4[i][ff_zigzag_scan[j]]; for (int i = 0; i < STD_VIDEO_H264_SCALING_LIST_8X8_NUM_LISTS; i++) - memcpy(vkpps_scaling->ScalingList8x8[i], pps->scaling_matrix8[i], - STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS * sizeof(**pps->scaling_matrix8)); + for (int j = 0; j < STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS; j++) + vkpps_scaling->ScalingList8x8[i][j] = + pps->scaling_matrix8[h264_scaling_list8_order[i]][ff_zigzag_direct[j]]; *vkpps = (StdVideoH264PictureParameterSet) { .seq_parameter_set_id = pps->sps_id, @@ -281,10 +285,9 @@ static void set_pps(const PPS *pps, const SPS *sps, static int vk_h264_create_params(AVCodecContext *avctx, AVBufferRef **buf) { - VkResult ret; + int err; FFVulkanDecodeContext *dec = avctx->internal->hwaccel_priv_data; FFVulkanDecodeShared *ctx = (FFVulkanDecodeShared *)dec->shared_ref->data; - FFVulkanFunctions *vk = &ctx->s.vkfn; const H264Context *h = avctx->priv_data; /* SPS */ @@ -315,11 +318,6 @@ static int vk_h264_create_params(AVCodecContext *avctx, AVBufferRef **buf) .videoSessionParametersTemplate = NULL, }; - AVBufferRef *tmp; - VkVideoSessionParametersKHR *par = av_malloc(sizeof(*par)); - if (!par) - return AVERROR(ENOMEM); - /* SPS list */ for (int i = 0; i < FF_ARRAY_ELEMS(h->ps.sps_list); i++) { if (h->ps.sps_list[i]) { @@ -343,27 +341,13 @@ static int vk_h264_create_params(AVCodecContext *avctx, AVBufferRef **buf) h264_params.maxStdSPSCount = h264_params_info.stdSPSCount; h264_params.maxStdPPSCount = h264_params_info.stdPPSCount; - /* Create session parameters */ - ret = vk->CreateVideoSessionParametersKHR(ctx->s.hwctx->act_dev, &session_params_create, - ctx->s.hwctx->alloc, par); - if (ret != VK_SUCCESS) { - av_log(avctx, AV_LOG_ERROR, "Unable to create Vulkan video session parameters: %s!\n", - ff_vk_ret2str(ret)); - return AVERROR_EXTERNAL; - } - - tmp = av_buffer_create((uint8_t *)par, sizeof(*par), ff_vk_decode_free_params, - ctx, 0); - if (!tmp) { - ff_vk_decode_free_params(ctx, (uint8_t *)par); - return AVERROR(ENOMEM); - } + err = ff_vk_decode_create_params(buf, avctx, ctx, &session_params_create); + if (err < 0) + return err; av_log(avctx, AV_LOG_DEBUG, "Created frame parameters: %i SPS %i PPS\n", h264_params_info.stdSPSCount, h264_params_info.stdPPSCount); - *buf = tmp; - return 0; } @@ -558,11 +542,11 @@ static void vk_h264_free_frame_priv(void *_hwctx, uint8_t *data) av_free(hp); } -const AVHWAccel ff_h264_vulkan_hwaccel = { - .name = "h264_vulkan", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, - .pix_fmt = AV_PIX_FMT_VULKAN, +const FFHWAccel ff_h264_vulkan_hwaccel = { + .p.name = "h264_vulkan", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, + .p.pix_fmt = AV_PIX_FMT_VULKAN, .start_frame = &vk_h264_start_frame, .decode_slice = &vk_h264_decode_slice, .end_frame = &vk_h264_end_frame, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vulkan_hevc.c b/arm/raspi/third_party/ffmpeg/libavcodec/vulkan_hevc.c index ab0f6b96..52f223ce 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vulkan_hevc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vulkan_hevc.c @@ -17,6 +17,7 @@ */ #include "hevcdec.h" +#include "hevc_data.h" #include "hevc_ps.h" #include "vulkan_decode.h" @@ -67,49 +68,33 @@ typedef struct HEVCHeaderSet { HEVCHeaderVPS *hvps; } HEVCHeaderSet; -static int get_data_set_buf(FFVulkanDecodeContext *s, AVBufferRef **data_buf, - int nb_vps, AVBufferRef * const vps_list[HEVC_MAX_VPS_COUNT]) +static int alloc_hevc_header_structs(FFVulkanDecodeContext *s, + int nb_vps, + AVBufferRef * const vps_list[HEVC_MAX_VPS_COUNT]) { uint8_t *data_ptr; HEVCHeaderSet *hdr; - size_t base_size = sizeof(StdVideoH265SequenceParameterSet)*HEVC_MAX_SPS_COUNT + - sizeof(HEVCHeaderSPS)*HEVC_MAX_SPS_COUNT + - sizeof(StdVideoH265PictureParameterSet)*HEVC_MAX_PPS_COUNT + - sizeof(HEVCHeaderPPS)*HEVC_MAX_PPS_COUNT + - sizeof(StdVideoH265VideoParameterSet)*HEVC_MAX_VPS_COUNT + - sizeof(HEVCHeaderVPS *); - - size_t vps_size = sizeof(StdVideoH265ProfileTierLevel) + - sizeof(StdVideoH265DecPicBufMgr) + - sizeof(StdVideoH265HrdParameters)*HEVC_MAX_LAYER_SETS + - sizeof(HEVCHeaderVPSSet *); - - size_t buf_size = base_size + vps_size*nb_vps; - + size_t buf_size = sizeof(HEVCHeaderSet) + nb_vps*sizeof(HEVCHeaderVPS); for (int i = 0; i < nb_vps; i++) { const HEVCVPS *vps = (const HEVCVPS *)vps_list[i]->data; buf_size += sizeof(HEVCHeaderVPSSet)*vps->vps_num_hrd_parameters; } - if (buf_size > s->tmp_pool_ele_size) { - av_buffer_pool_uninit(&s->tmp_pool); - s->tmp_pool_ele_size = 0; - s->tmp_pool = av_buffer_pool_init(buf_size, NULL); - if (!s->tmp_pool) + if (buf_size > s->hevc_headers_size) { + av_freep(&s->hevc_headers); + s->hevc_headers_size = 0; + s->hevc_headers = av_mallocz(buf_size); + if (!s->hevc_headers) return AVERROR(ENOMEM); - s->tmp_pool_ele_size = buf_size; + s->hevc_headers_size = buf_size; } - *data_buf = av_buffer_pool_get(s->tmp_pool); - if (!(*data_buf)) - return AVERROR(ENOMEM); - - /* Setup pointers */ - data_ptr = (*data_buf)->data; - hdr = (HEVCHeaderSet *)data_ptr; - hdr->hvps = (HEVCHeaderVPS *)(data_ptr + base_size); - data_ptr += base_size + vps_size*nb_vps; + /* Setup struct pointers */ + hdr = s->hevc_headers; + data_ptr = (uint8_t *)hdr; + hdr->hvps = (HEVCHeaderVPS *)(data_ptr + sizeof(HEVCHeaderSet)); + data_ptr += sizeof(HEVCHeaderSet) + nb_vps*sizeof(HEVCHeaderVPS); for (int i = 0; i < nb_vps; i++) { const HEVCVPS *vps = (const HEVCVPS *)vps_list[i]->data; hdr->hvps[i].sls = (HEVCHeaderVPSSet *)data_ptr; @@ -205,6 +190,43 @@ static StdVideoH265LevelIdc convert_to_vk_level_idc(int level_idc) } } +static void copy_scaling_list(const ScalingList *sl, StdVideoH265ScalingLists *vksl) +{ + for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_4X4_NUM_LISTS; i++) { + for (int j = 0; j < STD_VIDEO_H265_SCALING_LIST_4X4_NUM_ELEMENTS; j++) { + uint8_t pos = 4 * ff_hevc_diag_scan4x4_y[j] + ff_hevc_diag_scan4x4_x[j]; + vksl->ScalingList4x4[i][j] = sl->sl[0][i][pos]; + } + } + + for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_8X8_NUM_LISTS; i++) { + for (int j = 0; j < STD_VIDEO_H265_SCALING_LIST_8X8_NUM_ELEMENTS; j++) { + uint8_t pos = 8 * ff_hevc_diag_scan8x8_y[j] + ff_hevc_diag_scan8x8_x[j]; + vksl->ScalingList8x8[i][j] = sl->sl[1][i][pos]; + } + } + + for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS; i++) { + for (int j = 0; j < STD_VIDEO_H265_SCALING_LIST_16X16_NUM_ELEMENTS; j++) { + uint8_t pos = 8 * ff_hevc_diag_scan8x8_y[j] + ff_hevc_diag_scan8x8_x[j]; + vksl->ScalingList16x16[i][j] = sl->sl[2][i][pos]; + } + } + + for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS; i++) { + for (int j = 0; j < STD_VIDEO_H265_SCALING_LIST_32X32_NUM_ELEMENTS; j++) { + uint8_t pos = 8 * ff_hevc_diag_scan8x8_y[j] + ff_hevc_diag_scan8x8_x[j]; + vksl->ScalingList32x32[i][j] = sl->sl[3][i * 3][pos]; + } + } + + memcpy(vksl->ScalingListDCCoef16x16, sl->sl_dc[0], + STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS * sizeof(*vksl->ScalingListDCCoef16x16)); + + for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS; i++) + vksl->ScalingListDCCoef32x32[i] = sl->sl_dc[1][i * 3]; +} + static void set_sps(const HEVCSPS *sps, int sps_idx, StdVideoH265ScalingLists *vksps_scaling, StdVideoH265HrdParameters *vksps_vui_header, @@ -218,27 +240,7 @@ static void set_sps(const HEVCSPS *sps, int sps_idx, StdVideoH265ShortTermRefPicSet *str, StdVideoH265LongTermRefPicsSps *ltr) { - for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_4X4_NUM_LISTS; i++) - memcpy(vksps_scaling->ScalingList4x4[i], sps->scaling_list.sl[0][i], - STD_VIDEO_H265_SCALING_LIST_4X4_NUM_ELEMENTS * sizeof(**vksps_scaling->ScalingList4x4)); - - for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_8X8_NUM_LISTS; i++) - memcpy(vksps_scaling->ScalingList8x8[i], sps->scaling_list.sl[1][i], - STD_VIDEO_H265_SCALING_LIST_8X8_NUM_ELEMENTS * sizeof(**vksps_scaling->ScalingList8x8)); - - for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS; i++) - memcpy(vksps_scaling->ScalingList16x16[i], sps->scaling_list.sl[2][i], - STD_VIDEO_H265_SCALING_LIST_16X16_NUM_ELEMENTS * sizeof(**vksps_scaling->ScalingList16x16)); - - for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS; i++) - memcpy(vksps_scaling->ScalingList32x32[i], sps->scaling_list.sl[3][i * 3], - STD_VIDEO_H265_SCALING_LIST_32X32_NUM_ELEMENTS * sizeof(**vksps_scaling->ScalingList32x32)); - - memcpy(vksps_scaling->ScalingListDCCoef16x16, sps->scaling_list.sl_dc[0], - STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS * sizeof(*vksps_scaling->ScalingListDCCoef16x16)); - - for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS; i++) - vksps_scaling->ScalingListDCCoef32x32[i] = sps->scaling_list.sl_dc[1][i * 3]; + copy_scaling_list(&sps->scaling_list, vksps_scaling); *vksps_vui_header = (StdVideoH265HrdParameters) { .flags = (StdVideoH265HrdFlags) { @@ -464,27 +466,7 @@ static void set_pps(const HEVCPPS *pps, const HEVCSPS *sps, StdVideoH265PictureParameterSet *vkpps, StdVideoH265PredictorPaletteEntries *pal) { - for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_4X4_NUM_LISTS; i++) - memcpy(vkpps_scaling->ScalingList4x4[i], pps->scaling_list.sl[0][i], - STD_VIDEO_H265_SCALING_LIST_4X4_NUM_ELEMENTS * sizeof(**vkpps_scaling->ScalingList4x4)); - - for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_8X8_NUM_LISTS; i++) - memcpy(vkpps_scaling->ScalingList8x8[i], pps->scaling_list.sl[1][i], - STD_VIDEO_H265_SCALING_LIST_8X8_NUM_ELEMENTS * sizeof(**vkpps_scaling->ScalingList8x8)); - - for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS; i++) - memcpy(vkpps_scaling->ScalingList16x16[i], pps->scaling_list.sl[2][i], - STD_VIDEO_H265_SCALING_LIST_16X16_NUM_ELEMENTS * sizeof(**vkpps_scaling->ScalingList16x16)); - - for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS; i++) - memcpy(vkpps_scaling->ScalingList32x32[i], pps->scaling_list.sl[3][i * 3], - STD_VIDEO_H265_SCALING_LIST_32X32_NUM_ELEMENTS * sizeof(**vkpps_scaling->ScalingList32x32)); - - memcpy(vkpps_scaling->ScalingListDCCoef16x16, pps->scaling_list.sl_dc[0], - STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS * sizeof(*vkpps_scaling->ScalingListDCCoef16x16)); - - for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS; i++) - vkpps_scaling->ScalingListDCCoef32x32[i] = sps->scaling_list.sl_dc[1][i * 3]; + copy_scaling_list(&pps->scaling_list, vkpps_scaling); *vkpps = (StdVideoH265PictureParameterSet) { .flags = (StdVideoH265PpsFlags) { @@ -652,11 +634,9 @@ static void set_vps(const HEVCVPS *vps, static int vk_hevc_create_params(AVCodecContext *avctx, AVBufferRef **buf) { int err; - VkResult ret; const HEVCContext *h = avctx->priv_data; FFVulkanDecodeContext *dec = avctx->internal->hwaccel_priv_data; FFVulkanDecodeShared *ctx = (FFVulkanDecodeShared *)dec->shared_ref->data; - FFVulkanFunctions *vk = &ctx->s.vkfn; VkVideoDecodeH265SessionParametersAddInfoKHR h265_params_info = { .sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_KHR, @@ -676,22 +656,16 @@ static int vk_hevc_create_params(AVCodecContext *avctx, AVBufferRef **buf) }; int nb_vps = 0; - AVBufferRef *data_set; HEVCHeaderSet *hdr; - AVBufferRef *tmp; - VkVideoSessionParametersKHR *par = av_malloc(sizeof(*par)); - if (!par) - return AVERROR(ENOMEM); - for (int i = 0; h->ps.vps_list[i]; i++) nb_vps++; - err = get_data_set_buf(dec, &data_set, nb_vps, h->ps.vps_list); + err = alloc_hevc_header_structs(dec, nb_vps, h->ps.vps_list); if (err < 0) return err; - hdr = (HEVCHeaderSet *)data_set->data; + hdr = dec->hevc_headers; h265_params_info.pStdSPSs = hdr->sps; h265_params_info.pStdPPSs = hdr->pps; @@ -727,29 +701,14 @@ static int vk_hevc_create_params(AVCodecContext *avctx, AVBufferRef **buf) h265_params.maxStdPPSCount = h265_params_info.stdPPSCount; h265_params.maxStdVPSCount = h265_params_info.stdVPSCount; - /* Create session parameters */ - ret = vk->CreateVideoSessionParametersKHR(ctx->s.hwctx->act_dev, &session_params_create, - ctx->s.hwctx->alloc, par); - av_buffer_unref(&data_set); - if (ret != VK_SUCCESS) { - av_log(avctx, AV_LOG_ERROR, "Unable to create Vulkan video session parameters: %s!\n", - ff_vk_ret2str(ret)); - return AVERROR_EXTERNAL; - } - - tmp = av_buffer_create((uint8_t *)par, sizeof(*par), ff_vk_decode_free_params, - ctx, 0); - if (!tmp) { - ff_vk_decode_free_params(ctx, (uint8_t *)par); - return AVERROR(ENOMEM); - } + err = ff_vk_decode_create_params(buf, avctx, ctx, &session_params_create); + if (err < 0) + return err; av_log(avctx, AV_LOG_DEBUG, "Created frame parameters: %i SPS %i PPS %i VPS\n", h265_params_info.stdSPSCount, h265_params_info.stdPPSCount, h265_params_info.stdVPSCount); - *buf = tmp; - return 0; } @@ -954,11 +913,11 @@ static void vk_hevc_free_frame_priv(void *_hwctx, uint8_t *data) av_free(hp); } -const AVHWAccel ff_hevc_vulkan_hwaccel = { - .name = "hevc_vulkan", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, - .pix_fmt = AV_PIX_FMT_VULKAN, +const FFHWAccel ff_hevc_vulkan_hwaccel = { + .p.name = "hevc_vulkan", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, + .p.pix_fmt = AV_PIX_FMT_VULKAN, .start_frame = &vk_hevc_start_frame, .decode_slice = &vk_hevc_decode_slice, .end_frame = &vk_hevc_end_frame, diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vulkan_video.c b/arm/raspi/third_party/ffmpeg/libavcodec/vulkan_video.c index 9a363aab..236aa124 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vulkan_video.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vulkan_video.c @@ -154,6 +154,51 @@ VkVideoComponentBitDepthFlagBitsKHR ff_vk_depth_from_av_depth(int depth) return VK_VIDEO_COMPONENT_BIT_DEPTH_INVALID_KHR; } +int ff_vk_h264_level_to_av(StdVideoH264LevelIdc level) +{ + switch (level) { + case STD_VIDEO_H264_LEVEL_IDC_1_0: return 10; + case STD_VIDEO_H264_LEVEL_IDC_1_1: return 11; + case STD_VIDEO_H264_LEVEL_IDC_1_2: return 12; + case STD_VIDEO_H264_LEVEL_IDC_1_3: return 13; + case STD_VIDEO_H264_LEVEL_IDC_2_0: return 20; + case STD_VIDEO_H264_LEVEL_IDC_2_1: return 21; + case STD_VIDEO_H264_LEVEL_IDC_2_2: return 22; + case STD_VIDEO_H264_LEVEL_IDC_3_0: return 30; + case STD_VIDEO_H264_LEVEL_IDC_3_1: return 31; + case STD_VIDEO_H264_LEVEL_IDC_3_2: return 32; + case STD_VIDEO_H264_LEVEL_IDC_4_0: return 40; + case STD_VIDEO_H264_LEVEL_IDC_4_1: return 41; + case STD_VIDEO_H264_LEVEL_IDC_4_2: return 42; + case STD_VIDEO_H264_LEVEL_IDC_5_0: return 50; + case STD_VIDEO_H264_LEVEL_IDC_5_1: return 51; + case STD_VIDEO_H264_LEVEL_IDC_5_2: return 52; + case STD_VIDEO_H264_LEVEL_IDC_6_0: return 60; + case STD_VIDEO_H264_LEVEL_IDC_6_1: return 61; + default: + case STD_VIDEO_H264_LEVEL_IDC_6_2: return 62; + } +} + +int ff_vk_h265_level_to_av(StdVideoH265LevelIdc level) +{ + switch (level) { + case STD_VIDEO_H265_LEVEL_IDC_1_0: return 10; + case STD_VIDEO_H265_LEVEL_IDC_2_0: return 20; + case STD_VIDEO_H265_LEVEL_IDC_2_1: return 21; + case STD_VIDEO_H265_LEVEL_IDC_3_0: return 30; + case STD_VIDEO_H265_LEVEL_IDC_3_1: return 31; + case STD_VIDEO_H265_LEVEL_IDC_4_0: return 40; + case STD_VIDEO_H265_LEVEL_IDC_4_1: return 41; + case STD_VIDEO_H265_LEVEL_IDC_5_0: return 50; + case STD_VIDEO_H265_LEVEL_IDC_5_1: return 51; + case STD_VIDEO_H265_LEVEL_IDC_6_0: return 60; + case STD_VIDEO_H265_LEVEL_IDC_6_1: return 61; + default: + case STD_VIDEO_H265_LEVEL_IDC_6_2: return 62; + } +} + static void free_data_buf(void *opaque, uint8_t *data) { FFVulkanContext *ctx = opaque; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vulkan_video.h b/arm/raspi/third_party/ffmpeg/libavcodec/vulkan_video.h index 183ce89b..b28e3fe0 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vulkan_video.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vulkan_video.h @@ -71,6 +71,13 @@ VkVideoChromaSubsamplingFlagBitsKHR ff_vk_subsampling_from_av_desc(const AVPixFm */ VkVideoComponentBitDepthFlagBitsKHR ff_vk_depth_from_av_depth(int depth); + +/** + * Convert level from Vulkan to AV. + */ +int ff_vk_h264_level_to_av(StdVideoH264LevelIdc level); +int ff_vk_h265_level_to_av(StdVideoH265LevelIdc level); + typedef struct FFVkVideoBuffer { FFVkBuffer buf; uint8_t *mem; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vvc_mp4toannexb_bsf.c b/arm/raspi/third_party/ffmpeg/libavcodec/vvc_mp4toannexb_bsf.c index 9e606cdc..25c37269 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vvc_mp4toannexb_bsf.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vvc_mp4toannexb_bsf.c @@ -24,14 +24,12 @@ #include "libavutil/intreadwrite.h" #include "libavutil/mem.h" -#include "avcodec.h" #include "bsf.h" #include "bsf_internal.h" #include "bytestream.h" +#include "defs.h" #include "vvc.h" -#include "libavcodec/get_bits.h" - #define MIN_VVCC_LENGTH 23 typedef struct VVCBSFContext { diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/vvc_parser.c b/arm/raspi/third_party/ffmpeg/libavcodec/vvc_parser.c index 3951ebe5..c661595e 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/vvc_parser.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/vvc_parser.c @@ -225,10 +225,10 @@ static void get_slice_poc(VVCParserContext *s, int *poc, } else { if ((poc_lsb < prev_poc_lsb) && ((prev_poc_lsb - poc_lsb) >= (max_poc_lsb / 2))) - poc_msb = prev_poc_msb + max_poc_lsb; + poc_msb = prev_poc_msb + (unsigned)max_poc_lsb; else if ((poc_lsb > prev_poc_lsb) && ((poc_lsb - prev_poc_lsb) > (max_poc_lsb / 2))) - poc_msb = prev_poc_msb - max_poc_lsb; + poc_msb = prev_poc_msb - (unsigned)max_poc_lsb; else poc_msb = prev_poc_msb; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/wavarc.c b/arm/raspi/third_party/ffmpeg/libavcodec/wavarc.c index 6daad6a5..09ed4d47 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/wavarc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/wavarc.c @@ -111,7 +111,7 @@ static av_cold int wavarc_init(AVCodecContext *avctx) } s->max_framesize = s->nb_samples * 16; - s->bitstream = av_calloc(s->max_framesize, sizeof(*s->bitstream)); + s->bitstream = av_calloc(s->max_framesize + AV_INPUT_BUFFER_PADDING_SIZE, sizeof(*s->bitstream)); if (!s->bitstream) return AVERROR(ENOMEM); @@ -154,11 +154,11 @@ static void do_stereo(WavArcContext *s, int ch, int correlated, int len) } else { if (correlated) { for (int n = 0; n < nb_samples; n++) - s->samples[1][n + len] += s->samples[0][n + len]; + s->samples[1][n + len] += (unsigned)s->samples[0][n + len]; } for (int n = 0; n < len; n++) { s->pred[0][n] = s->samples[1][nb_samples + n]; - s->pred[1][n] = s->pred[0][n] - s->samples[0][nb_samples + n]; + s->pred[1][n] = s->pred[0][n] - (unsigned)s->samples[0][nb_samples + n]; } } } @@ -205,7 +205,7 @@ static int decode_1dif(AVCodecContext *avctx, if (block_type < 4 && block_type >= 0) { k = 1 + (avctx->sample_fmt == AV_SAMPLE_FMT_S16P); k = get_urice(gb, k) + 1; - if (k > 32) + if (k >= 32) return AVERROR_INVALIDDATA; } @@ -218,6 +218,10 @@ static int decode_1dif(AVCodecContext *avctx, continue; case 6: s->shift = get_urice(gb, 2); + if ((unsigned)s->shift > 31) { + s->shift = 0; + return AVERROR_INVALIDDATA; + } continue; case 5: if (avctx->sample_fmt == AV_SAMPLE_FMT_U8P) { @@ -239,18 +243,18 @@ static int decode_1dif(AVCodecContext *avctx, break; case 3: for (int n = 0; n < s->nb_samples; n++) - samples[n + 4] = get_srice(gb, k) + (samples[n + 3] - samples[n + 2]) * 3 + + samples[n + 4] = get_srice(gb, k) + (samples[n + 3] - (unsigned)samples[n + 2]) * 3 + samples[n + 1]; finished = 1; break; case 2: for (int n = 0; n < s->nb_samples; n++) - samples[n + 4] = get_srice(gb, k) + (samples[n + 3] * 2 - samples[n + 2]); + samples[n + 4] = get_srice(gb, k) + (samples[n + 3] * 2U - samples[n + 2]); finished = 1; break; case 1: for (int n = 0; n < s->nb_samples; n++) - samples[n + 4] = get_srice(gb, k) + samples[n + 3]; + samples[n + 4] = get_srice(gb, k) + (unsigned)samples[n + 3]; finished = 1; break; case 0: @@ -297,7 +301,7 @@ static int decode_2slp(AVCodecContext *avctx, if (block_type < 5 && block_type >= 0) { k = 1 + (avctx->sample_fmt == AV_SAMPLE_FMT_S16P); k = get_urice(gb, k) + 1; - if (k > 32) + if (k >= 32) return AVERROR_INVALIDDATA; } @@ -307,13 +311,17 @@ static int decode_2slp(AVCodecContext *avctx, return AVERROR_EOF; case 8: s->nb_samples = get_urice(gb, 8); - if (s->nb_samples > 570) { + if (s->nb_samples > 570U) { s->nb_samples = 570; return AVERROR_INVALIDDATA; } continue; case 7: s->shift = get_urice(gb, 2); + if ((unsigned)s->shift > 31) { + s->shift = 0; + return AVERROR_INVALIDDATA; + } continue; case 6: if (avctx->sample_fmt == AV_SAMPLE_FMT_U8P) { @@ -335,13 +343,13 @@ static int decode_2slp(AVCodecContext *avctx, break; case 4: for (int n = 0; n < s->nb_samples; n++) - samples[n + 70] = get_srice(gb, k) + (samples[n + 69] - samples[n + 68]) * 3 + + samples[n + 70] = get_srice(gb, k) + (samples[n + 69] - (unsigned)samples[n + 68]) * 3 + samples[n + 67]; finished = 1; break; case 3: for (int n = 0; n < s->nb_samples; n++) - samples[n + 70] = get_srice(gb, k) + (samples[n + 69] * 2 - samples[n + 68]); + samples[n + 70] = get_srice(gb, k) + (samples[n + 69] * 2U - samples[n + 68]); finished = 1; break; case 2: @@ -351,7 +359,7 @@ static int decode_2slp(AVCodecContext *avctx, break; case 1: for (int n = 0; n < s->nb_samples; n++) - samples[n + 70] = get_srice(gb, k) + samples[n + 69]; + samples[n + 70] = get_srice(gb, k) + (unsigned)samples[n + 69]; finished = 1; break; case 0: @@ -404,13 +412,13 @@ static int ac_init(AVCodecContext *avctx, return 0; } -static unsigned ac_get_prob(WavArcContext *s) +static uint16_t ac_get_prob(WavArcContext *s) { - return ((s->freq_range - 1) + ((unsigned)s->ac_value - (unsigned)s->ac_low) * - (unsigned)s->freq_range) / (((unsigned)s->ac_high - (unsigned)s->ac_low) + 1) & 0xffffu; + return ((s->freq_range - 1) + (s->ac_value - s->ac_low) * s->freq_range) / + ((s->ac_high - s->ac_low) + 1U); } -static unsigned ac_map_symbol(WavArcContext *s, unsigned prob) +static uint8_t ac_map_symbol(WavArcContext *s, uint16_t prob) { int idx = 255; @@ -427,33 +435,43 @@ static int ac_normalize(AVCodecContext *avctx, WavArcContext *s, GetBitContext * { int range; - range = (unsigned)s->ac_high - (unsigned)s->ac_low + 1; - s->ac_high = (int16_t)((range * (unsigned)s->range_high) / (unsigned)s->freq_range) + -1 + s->ac_low; - s->ac_low += (int16_t)((range * (unsigned)s->range_low) / (unsigned)s->freq_range); + if (s->ac_high < s->ac_low) + goto fail; + + range = (s->ac_high - s->ac_low) + 1; + s->ac_high = (range * s->range_high) / s->freq_range + s->ac_low - 1; + s->ac_low += (range * s->range_low) / s->freq_range; + + if (s->ac_high < s->ac_low) + goto fail; for (;;) { if ((s->ac_high & 0x8000) != (s->ac_low & 0x8000)) { - if ((s->ac_low & 0x4000) == 0 || (s->ac_high & 0x4000) != 0) + if (((s->ac_low & 0x4000) == 0) || ((s->ac_high & 0x4000) != 0)) return 0; s->ac_value ^= 0x4000; s->ac_low &= 0x3fff; s->ac_high |= 0x4000; } - s->ac_low = s->ac_low << 1; - s->ac_high = s->ac_high * 2 + 1; - if (s->ac_high < s->ac_low) { - av_log(avctx, AV_LOG_ERROR, "invalid state\n"); - return AVERROR_INVALIDDATA; - } + s->ac_low = s->ac_low * 2; + s->ac_high = s->ac_high * 2 | 1; + if (s->ac_high < s->ac_low) + goto fail; if (get_bits_left(gb) <= 0) { av_log(avctx, AV_LOG_ERROR, "overread in arithmetic coder\n"); - return AVERROR_INVALIDDATA; + goto fail; } s->ac_value = s->ac_value * 2 + get_bits1(gb); + if (s->ac_low > s->ac_value || s->ac_high < s->ac_value) + goto fail; } + +fail: + av_log(avctx, AV_LOG_ERROR, "invalid state\n"); + return AVERROR_INVALIDDATA; } static void ac_init_model(WavArcContext *s) @@ -476,11 +494,11 @@ static int ac_read_model(AVCodecContext *avctx, end = get_bits(gb, 8); for (;;) { - while (start <= end) + while (start <= end) { + if (get_bits_left(gb) < 8) + return AVERROR_INVALIDDATA; s->model[start++] = get_bits(gb, 8); - - if (get_bits_left(gb) < 8) - return AVERROR_INVALIDDATA; + } if (get_bits_left(gb) < 8) return AVERROR_INVALIDDATA; @@ -521,6 +539,8 @@ static int decode_5elp(AVCodecContext *avctx, if (block_type >= 0 && block_type <= 7) { k = 1 + (avctx->sample_fmt == AV_SAMPLE_FMT_S16P); k = get_urice(gb, k) + 1; + if (k >= 32) + return AVERROR_INVALIDDATA; } if (block_type <= 2 || block_type == 6 || block_type == 13 || @@ -560,9 +580,9 @@ static int decode_5elp(AVCodecContext *avctx, } for (int n = 0; n < s->nb_samples; n++) { - unsigned prob = ac_get_prob(s); - prob = ac_map_symbol(s, prob); - ac_out[n] = prob - 0x80; + uint16_t prob = ac_get_prob(s); + int ac = ac_map_symbol(s, prob); + ac_out[n] = ac - 0x80; if ((ret = ac_normalize(avctx, s, &ac_gb)) < 0) return ret; } @@ -579,13 +599,17 @@ static int decode_5elp(AVCodecContext *avctx, return AVERROR_EOF; case 11: s->nb_samples = get_urice(gb, 8); - if (s->nb_samples > 570) { + if (s->nb_samples > 570U) { s->nb_samples = 570; return AVERROR_INVALIDDATA; } continue; case 10: s->shift = get_urice(gb, 2); + if ((unsigned)s->shift > 31) { + s->shift = 0; + return AVERROR_INVALIDDATA; + } continue; case 9: if (avctx->sample_fmt == AV_SAMPLE_FMT_U8P) { @@ -608,11 +632,16 @@ static int decode_5elp(AVCodecContext *avctx, case 20: case 7: for (int n = 0; n < s->nb_samples; n++) - samples[n + 70] = ac_out[n] + samples[n + 69] * 3 - samples[n + 68] * 3 + samples[n + 67]; + samples[n + 70] += ac_out[n] + samples[n + 69] * 3U - samples[n + 68] * 3U + samples[n + 67]; finished = 1; break; case 19: case 6: + for (int n = 0; n < 70; n++) { + ac_pred[n] = samples[n]; + samples[n] = 0; + } + for (int n = 0; n < s->nb_samples; n++) { int sum = 15; @@ -621,24 +650,31 @@ static int decode_5elp(AVCodecContext *avctx, samples[n + 70] += ac_out[n] + (sum >> 4); } + + for (int n = 0; n < 70; n++) + samples[n] = ac_pred[n]; + + for (int n = 0; n < s->nb_samples; n++) + samples[n + 70] += ac_out[n] + samples[n + 69] * 3U - samples[n + 68] * 3U + samples[n + 67]; + finished = 1; break; case 18: case 5: for (int n = 0; n < s->nb_samples; n++) - samples[n + 70] = ac_out[n] + samples[n + 69] * 2 - samples[n + 68]; + samples[n + 70] += ac_out[n] + samples[n + 69] * 2U - samples[n + 68]; finished = 1; break; case 17: case 4: for (int n = 0; n < s->nb_samples; n++) - samples[n + 70] = ac_out[n]; + samples[n + 70] += ac_out[n]; finished = 1; break; case 16: case 3: for (int n = 0; n < s->nb_samples; n++) - samples[n + 70] = ac_out[n] + samples[n + 69]; + samples[n + 70] += ac_out[n] + (unsigned)samples[n + 69]; finished = 1; break; case 15: @@ -661,7 +697,7 @@ static int decode_5elp(AVCodecContext *avctx, samples[n] = ac_pred[n]; for (int n = 0; n < s->nb_samples; n++) - samples[n + 70] += samples[n + 69] * 2 - samples[n + 68]; + samples[n + 70] += samples[n + 69] * 2U - samples[n + 68]; finished = 1; break; @@ -678,14 +714,14 @@ static int decode_5elp(AVCodecContext *avctx, for (int o = 0; o < order; o++) sum += s->filter[ch][o] * (unsigned)samples[n + 70 - o - 1]; - samples[n + 70] += ac_out[n] + (sum >> 4); + samples[n + 70] += (unsigned)ac_out[n] + (sum >> 4); } for (int n = 0; n < 70; n++) samples[n] = ac_pred[n]; for (int n = 0; n < s->nb_samples; n++) - samples[n + 70] += samples[n + 69]; + samples[n + 70] += (unsigned)samples[n + 69]; finished = 1; break; @@ -697,7 +733,7 @@ static int decode_5elp(AVCodecContext *avctx, for (int o = 0; o < order; o++) sum += s->filter[ch][o] * (unsigned)samples[n + 70 - o - 1]; - samples[n + 70] += ac_out[n] + (sum >> 4); + samples[n + 70] += (unsigned)ac_out[n] + (sum >> 4); } finished = 1; break; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/wavpack.c b/arm/raspi/third_party/ffmpeg/libavcodec/wavpack.c index 4346304f..966f4b83 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/wavpack.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/wavpack.c @@ -96,12 +96,10 @@ typedef struct WavpackFrameContext { uint8_t *value_lookup[MAX_HISTORY_BINS]; } WavpackFrameContext; -#define WV_MAX_FRAME_DECODERS 14 - typedef struct WavpackContext { AVCodecContext *avctx; - WavpackFrameContext *fdec[WV_MAX_FRAME_DECODERS]; + WavpackFrameContext **fdec; int fdec_num; int block; @@ -796,71 +794,73 @@ static inline int wv_unpack_stereo(WavpackFrameContext *s, GetBitContext *gb, if (last) break; for (i = 0; i < s->terms; i++) { - t = s->decorr[i].value; + Decorr *decorr = &s->decorr[i]; + + t = decorr->value; if (t > 0) { if (t > 8) { if (t & 1) { - A = 2U * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1]; - B = 2U * s->decorr[i].samplesB[0] - s->decorr[i].samplesB[1]; + A = 2U * decorr->samplesA[0] - decorr->samplesA[1]; + B = 2U * decorr->samplesB[0] - decorr->samplesB[1]; } else { - A = (int)(3U * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1]) >> 1; - B = (int)(3U * s->decorr[i].samplesB[0] - s->decorr[i].samplesB[1]) >> 1; + A = (int)(3U * decorr->samplesA[0] - decorr->samplesA[1]) >> 1; + B = (int)(3U * decorr->samplesB[0] - decorr->samplesB[1]) >> 1; } - s->decorr[i].samplesA[1] = s->decorr[i].samplesA[0]; - s->decorr[i].samplesB[1] = s->decorr[i].samplesB[0]; - j = 0; + decorr->samplesA[1] = decorr->samplesA[0]; + decorr->samplesB[1] = decorr->samplesB[0]; + j = 0; } else { - A = s->decorr[i].samplesA[pos]; - B = s->decorr[i].samplesB[pos]; + A = decorr->samplesA[pos]; + B = decorr->samplesB[pos]; j = (pos + t) & 7; } if (type != AV_SAMPLE_FMT_S16P) { - L2 = L + ((s->decorr[i].weightA * (int64_t)A + 512) >> 10); - R2 = R + ((s->decorr[i].weightB * (int64_t)B + 512) >> 10); + L2 = L + ((decorr->weightA * (int64_t)A + 512) >> 10); + R2 = R + ((decorr->weightB * (int64_t)B + 512) >> 10); } else { - L2 = L + (unsigned)((int)(s->decorr[i].weightA * (unsigned)A + 512) >> 10); - R2 = R + (unsigned)((int)(s->decorr[i].weightB * (unsigned)B + 512) >> 10); + L2 = L + (unsigned)((int)(decorr->weightA * (unsigned)A + 512) >> 10); + R2 = R + (unsigned)((int)(decorr->weightB * (unsigned)B + 512) >> 10); } if (A && L) - s->decorr[i].weightA -= ((((L ^ A) >> 30) & 2) - 1) * s->decorr[i].delta; + decorr->weightA -= ((((L ^ A) >> 30) & 2) - 1) * decorr->delta; if (B && R) - s->decorr[i].weightB -= ((((R ^ B) >> 30) & 2) - 1) * s->decorr[i].delta; - s->decorr[i].samplesA[j] = L = L2; - s->decorr[i].samplesB[j] = R = R2; + decorr->weightB -= ((((R ^ B) >> 30) & 2) - 1) * decorr->delta; + decorr->samplesA[j] = L = L2; + decorr->samplesB[j] = R = R2; } else if (t == -1) { if (type != AV_SAMPLE_FMT_S16P) - L2 = L + ((s->decorr[i].weightA * (int64_t)s->decorr[i].samplesA[0] + 512) >> 10); + L2 = L + ((decorr->weightA * (int64_t)decorr->samplesA[0] + 512) >> 10); else - L2 = L + (unsigned)((int)(s->decorr[i].weightA * (unsigned)s->decorr[i].samplesA[0] + 512) >> 10); - UPDATE_WEIGHT_CLIP(s->decorr[i].weightA, s->decorr[i].delta, s->decorr[i].samplesA[0], L); + L2 = L + (unsigned)((int)(decorr->weightA * (unsigned)decorr->samplesA[0] + 512) >> 10); + UPDATE_WEIGHT_CLIP(decorr->weightA, decorr->delta, decorr->samplesA[0], L); L = L2; if (type != AV_SAMPLE_FMT_S16P) - R2 = R + ((s->decorr[i].weightB * (int64_t)L2 + 512) >> 10); + R2 = R + ((decorr->weightB * (int64_t)L2 + 512) >> 10); else - R2 = R + (unsigned)((int)(s->decorr[i].weightB * (unsigned)L2 + 512) >> 10); - UPDATE_WEIGHT_CLIP(s->decorr[i].weightB, s->decorr[i].delta, L2, R); - R = R2; - s->decorr[i].samplesA[0] = R; + R2 = R + (unsigned)((int)(decorr->weightB * (unsigned)L2 + 512) >> 10); + UPDATE_WEIGHT_CLIP(decorr->weightB, decorr->delta, L2, R); + R = R2; + decorr->samplesA[0] = R; } else { if (type != AV_SAMPLE_FMT_S16P) - R2 = R + ((s->decorr[i].weightB * (int64_t)s->decorr[i].samplesB[0] + 512) >> 10); + R2 = R + ((decorr->weightB * (int64_t)decorr->samplesB[0] + 512) >> 10); else - R2 = R + (unsigned)((int)(s->decorr[i].weightB * (unsigned)s->decorr[i].samplesB[0] + 512) >> 10); - UPDATE_WEIGHT_CLIP(s->decorr[i].weightB, s->decorr[i].delta, s->decorr[i].samplesB[0], R); + R2 = R + (unsigned)((int)(decorr->weightB * (unsigned)decorr->samplesB[0] + 512) >> 10); + UPDATE_WEIGHT_CLIP(decorr->weightB, decorr->delta, decorr->samplesB[0], R); R = R2; if (t == -3) { - R2 = s->decorr[i].samplesA[0]; - s->decorr[i].samplesA[0] = R; + R2 = decorr->samplesA[0]; + decorr->samplesA[0] = R; } if (type != AV_SAMPLE_FMT_S16P) - L2 = L + ((s->decorr[i].weightA * (int64_t)R2 + 512) >> 10); + L2 = L + ((decorr->weightA * (int64_t)R2 + 512) >> 10); else - L2 = L + (unsigned)((int)(s->decorr[i].weightA * (unsigned)R2 + 512) >> 10); - UPDATE_WEIGHT_CLIP(s->decorr[i].weightA, s->decorr[i].delta, R2, L); - L = L2; - s->decorr[i].samplesB[0] = L; + L2 = L + (unsigned)((int)(decorr->weightA * (unsigned)R2 + 512) >> 10); + UPDATE_WEIGHT_CLIP(decorr->weightA, decorr->delta, R2, L); + L = L2; + decorr->samplesB[0] = L; } } @@ -922,25 +922,27 @@ static inline int wv_unpack_mono(WavpackFrameContext *s, GetBitContext *gb, if (last) break; for (i = 0; i < s->terms; i++) { - t = s->decorr[i].value; + Decorr *decorr = &s->decorr[i]; + + t = decorr->value; if (t > 8) { if (t & 1) - A = 2U * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1]; + A = 2U * decorr->samplesA[0] - decorr->samplesA[1]; else - A = (int)(3U * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1]) >> 1; - s->decorr[i].samplesA[1] = s->decorr[i].samplesA[0]; - j = 0; + A = (int)(3U * decorr->samplesA[0] - decorr->samplesA[1]) >> 1; + decorr->samplesA[1] = decorr->samplesA[0]; + j = 0; } else { - A = s->decorr[i].samplesA[pos]; + A = decorr->samplesA[pos]; j = (pos + t) & 7; } if (type != AV_SAMPLE_FMT_S16P) - S = T + ((s->decorr[i].weightA * (int64_t)A + 512) >> 10); + S = T + ((decorr->weightA * (int64_t)A + 512) >> 10); else - S = T + (unsigned)((int)(s->decorr[i].weightA * (unsigned)A + 512) >> 10); + S = T + (unsigned)((int)(decorr->weightA * (unsigned)A + 512) >> 10); if (A && T) - s->decorr[i].weightA -= ((((T ^ A) >> 30) & 2) - 1) * s->decorr[i].delta; - s->decorr[i].samplesA[j] = T = S; + decorr->weightA -= ((((T ^ A) >> 30) & 2) - 1) * decorr->delta; + decorr->samplesA[j] = T = S; } pos = (pos + 1) & 7; crc = crc * 3 + S; @@ -971,7 +973,8 @@ static inline int wv_unpack_mono(WavpackFrameContext *s, GetBitContext *gb, static av_cold int wv_alloc_frame_context(WavpackContext *c) { - if (c->fdec_num == WV_MAX_FRAME_DECODERS) + c->fdec = av_realloc_f(c->fdec, c->fdec_num + 1, sizeof(*c->fdec)); + if (!c->fdec) return -1; c->fdec[c->fdec_num] = av_mallocz(sizeof(**c->fdec)); @@ -1064,6 +1067,7 @@ static av_cold int wavpack_decode_end(AVCodecContext *avctx) for (int i = 0; i < s->fdec_num; i++) av_freep(&s->fdec[i]); + av_freep(&s->fdec); s->fdec_num = 0; ff_thread_release_ext_buffer(avctx, &s->curr_frame); @@ -1127,7 +1131,7 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no, else if ((s->frame_flags & 0x03) <= 1) sample_fmt = AV_SAMPLE_FMT_S16P; else - sample_fmt = AV_SAMPLE_FMT_S32P; + sample_fmt = AV_SAMPLE_FMT_S32P; if (wc->ch_offset && avctx->sample_fmt != sample_fmt) return AVERROR_INVALIDDATA; @@ -1219,36 +1223,38 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no, } t = 0; for (i = s->terms - 1; (i >= 0) && (t < size); i--) { - if (s->decorr[i].value > 8) { - s->decorr[i].samplesA[0] = + Decorr *decorr = &s->decorr[i]; + + if (decorr->value > 8) { + decorr->samplesA[0] = wp_exp2(bytestream2_get_le16(&gb)); - s->decorr[i].samplesA[1] = + decorr->samplesA[1] = wp_exp2(bytestream2_get_le16(&gb)); if (s->stereo_in) { - s->decorr[i].samplesB[0] = + decorr->samplesB[0] = wp_exp2(bytestream2_get_le16(&gb)); - s->decorr[i].samplesB[1] = + decorr->samplesB[1] = wp_exp2(bytestream2_get_le16(&gb)); - t += 4; + t += 4; } t += 4; - } else if (s->decorr[i].value < 0) { - s->decorr[i].samplesA[0] = + } else if (decorr->value < 0) { + decorr->samplesA[0] = wp_exp2(bytestream2_get_le16(&gb)); - s->decorr[i].samplesB[0] = + decorr->samplesB[0] = wp_exp2(bytestream2_get_le16(&gb)); - t += 4; + t += 4; } else { - for (j = 0; j < s->decorr[i].value; j++) { - s->decorr[i].samplesA[j] = + for (j = 0; j < decorr->value; j++) { + decorr->samplesA[j] = wp_exp2(bytestream2_get_le16(&gb)); if (s->stereo_in) { - s->decorr[i].samplesB[j] = + decorr->samplesB[j] = wp_exp2(bytestream2_get_le16(&gb)); } } - t += s->decorr[i].value * 2 * (s->stereo_in + 1); + t += decorr->value * 2 * (s->stereo_in + 1); } } got_samples = 1; @@ -1415,18 +1421,12 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no, size = bytestream2_get_byte(&gb); chan |= (bytestream2_get_byte(&gb) & 0xF) << 8; chan += 1; - if (avctx->ch_layout.nb_channels != chan) - av_log(avctx, AV_LOG_WARNING, "%i channels signalled" - " instead of %i.\n", chan, avctx->ch_layout.nb_channels); chmask = bytestream2_get_le24(&gb); break; case 5: size = bytestream2_get_byte(&gb); chan |= (bytestream2_get_byte(&gb) & 0xF) << 8; chan += 1; - if (avctx->ch_layout.nb_channels != chan) - av_log(avctx, AV_LOG_WARNING, "%i channels signalled" - " instead of %i.\n", chan, avctx->ch_layout.nb_channels); chmask = bytestream2_get_le32(&gb); break; default: @@ -1519,11 +1519,7 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no, return AVERROR_INVALIDDATA; } } else { - ret = av_channel_layout_copy(&new_ch_layout, &avctx->ch_layout); - if (ret < 0) { - av_log(avctx, AV_LOG_ERROR, "Error copying channel layout\n"); - return ret; - } + av_channel_layout_default(&new_ch_layout, chan); } } else { av_channel_layout_default(&new_ch_layout, s->stereo + 1); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/wavpackenc.c b/arm/raspi/third_party/ffmpeg/libavcodec/wavpackenc.c index 9271e879..33a5dfcc 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/wavpackenc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/wavpackenc.c @@ -2592,7 +2592,16 @@ static int wavpack_encode_block(WavPackEncodeContext *s, s->avctx->ch_layout.u.mask != AV_CH_LAYOUT_STEREO) { put_metadata_block(&pb, WP_ID_CHANINFO, 5); bytestream2_put_byte(&pb, s->avctx->ch_layout.nb_channels); - bytestream2_put_le32(&pb, s->avctx->ch_layout.u.mask); + if (s->avctx->ch_layout.u.mask >> 32) + bytestream2_put_le32(&pb, 0); + else + bytestream2_put_le32(&pb, s->avctx->ch_layout.u.mask); + bytestream2_put_byte(&pb, 0); + } else if (s->flags & WV_INITIAL_BLOCK && + s->avctx->ch_layout.order == AV_CHANNEL_ORDER_UNSPEC) { + put_metadata_block(&pb, WP_ID_CHANINFO, 5); + bytestream2_put_byte(&pb, s->avctx->ch_layout.nb_channels); + bytestream2_put_le32(&pb, 0); bytestream2_put_byte(&pb, 0); } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/webp.c b/arm/raspi/third_party/ffmpeg/libavcodec/webp.c index d35cb66f..54b3fde6 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/webp.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/webp.c @@ -233,7 +233,7 @@ static void image_ctx_free(ImageContext *img) if (img->huffman_groups) { for (i = 0; i < img->nb_huffman_groups; i++) { for (j = 0; j < HUFFMAN_CODES_PER_META_CODE; j++) - ff_free_vlc(&img->huffman_groups[i * HUFFMAN_CODES_PER_META_CODE + j].vlc); + ff_vlc_free(&img->huffman_groups[i * HUFFMAN_CODES_PER_META_CODE + j].vlc); } av_free(img->huffman_groups); } @@ -300,9 +300,9 @@ static int huff_reader_build_canonical(HuffReader *r, const uint8_t *code_length return AVERROR_INVALIDDATA; } - ret = init_vlc(&r->vlc, 8, alphabet_size, + ret = vlc_init(&r->vlc, 8, alphabet_size, code_lengths, sizeof(*code_lengths), sizeof(*code_lengths), - codes, sizeof(*codes), sizeof(*codes), INIT_VLC_OUTPUT_LE); + codes, sizeof(*codes), sizeof(*codes), VLC_INIT_OUTPUT_LE); if (ret < 0) { av_free(codes); return ret; @@ -415,7 +415,7 @@ static int read_huffman_code_normal(WebPContext *s, HuffReader *hc, ret = huff_reader_build_canonical(hc, code_lengths, alphabet_size); finish: - ff_free_vlc(&code_len_hc.vlc); + ff_vlc_free(&code_len_hc.vlc); av_free(code_lengths); return ret; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/wma.c b/arm/raspi/third_party/ffmpeg/libavcodec/wma.c index 41d16e52..3b4d049a 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/wma.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/wma.c @@ -42,7 +42,7 @@ static av_cold int init_coef_vlc(VLC *vlc, uint16_t **prun_table, float *flevel_table; int i, l, j, k, level, ret; - ret = init_vlc(vlc, VLCBITS, n, table_bits, 1, 1, table_codes, 4, 4, 0); + ret = vlc_init(vlc, VLCBITS, n, table_bits, 1, 1, table_codes, 4, 4, 0); if (ret < 0) return ret; @@ -372,11 +372,11 @@ int ff_wma_end(AVCodecContext *avctx) av_tx_uninit(&s->mdct_ctx[i]); if (s->use_exp_vlc) - ff_free_vlc(&s->exp_vlc); + ff_vlc_free(&s->exp_vlc); if (s->use_noise_coding) - ff_free_vlc(&s->hgain_vlc); + ff_vlc_free(&s->hgain_vlc); for (i = 0; i < 2; i++) { - ff_free_vlc(&s->coef_vlc[i]); + ff_vlc_free(&s->coef_vlc[i]); av_freep(&s->run_table[i]); av_freep(&s->level_table[i]); av_freep(&s->int_table[i]); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/wmadec.c b/arm/raspi/third_party/ffmpeg/libavcodec/wmadec.c index bc18d182..ab48e28e 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/wmadec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/wmadec.c @@ -119,7 +119,7 @@ static av_cold int wma_decode_init(AVCodecContext *avctx) } if (s->use_noise_coding) { - ret = ff_init_vlc_from_lengths(&s->hgain_vlc, HGAINVLCBITS, + ret = ff_vlc_init_from_lengths(&s->hgain_vlc, HGAINVLCBITS, FF_ARRAY_ELEMS(ff_wma_hgain_hufftab), &ff_wma_hgain_hufftab[0][1], 2, &ff_wma_hgain_hufftab[0][0], 2, 1, @@ -130,7 +130,7 @@ static av_cold int wma_decode_init(AVCodecContext *avctx) if (s->use_exp_vlc) { // FIXME move out of context - ret = init_vlc(&s->exp_vlc, EXPVLCBITS, sizeof(ff_aac_scalefactor_bits), + ret = vlc_init(&s->exp_vlc, EXPVLCBITS, sizeof(ff_aac_scalefactor_bits), ff_aac_scalefactor_bits, 1, 1, ff_aac_scalefactor_code, 4, 4, 0); if (ret < 0) diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/wmaprodec.c b/arm/raspi/third_party/ffmpeg/libavcodec/wmaprodec.c index f523f363..61b86ad6 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/wmaprodec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/wmaprodec.c @@ -320,25 +320,25 @@ static av_cold int get_rate(AVCodecContext *avctx) static av_cold void decode_init_static(void) { - INIT_VLC_STATIC_FROM_LENGTHS(&sf_vlc, SCALEVLCBITS, HUFF_SCALE_SIZE, + VLC_INIT_STATIC_FROM_LENGTHS(&sf_vlc, SCALEVLCBITS, HUFF_SCALE_SIZE, &scale_table[0][1], 2, &scale_table[0][0], 2, 1, -60, 0, 616); - INIT_VLC_STATIC_FROM_LENGTHS(&sf_rl_vlc, VLCBITS, HUFF_SCALE_RL_SIZE, + VLC_INIT_STATIC_FROM_LENGTHS(&sf_rl_vlc, VLCBITS, HUFF_SCALE_RL_SIZE, &scale_rl_table[0][1], 2, &scale_rl_table[0][0], 2, 1, 0, 0, 1406); - INIT_VLC_STATIC_FROM_LENGTHS(&coef_vlc[0], VLCBITS, HUFF_COEF0_SIZE, + VLC_INIT_STATIC_FROM_LENGTHS(&coef_vlc[0], VLCBITS, HUFF_COEF0_SIZE, coef0_lens, 1, coef0_syms, 2, 2, 0, 0, 2108); - INIT_VLC_STATIC_FROM_LENGTHS(&coef_vlc[1], VLCBITS, HUFF_COEF1_SIZE, + VLC_INIT_STATIC_FROM_LENGTHS(&coef_vlc[1], VLCBITS, HUFF_COEF1_SIZE, &coef1_table[0][1], 2, &coef1_table[0][0], 2, 1, 0, 0, 3912); - INIT_VLC_STATIC_FROM_LENGTHS(&vec4_vlc, VLCBITS, HUFF_VEC4_SIZE, + VLC_INIT_STATIC_FROM_LENGTHS(&vec4_vlc, VLCBITS, HUFF_VEC4_SIZE, vec4_lens, 1, vec4_syms, 2, 2, -1, 0, 604); - INIT_VLC_STATIC_FROM_LENGTHS(&vec2_vlc, VLCBITS, HUFF_VEC2_SIZE, + VLC_INIT_STATIC_FROM_LENGTHS(&vec2_vlc, VLCBITS, HUFF_VEC2_SIZE, &vec2_table[0][1], 2, &vec2_table[0][0], 2, 1, -1, 0, 562); - INIT_VLC_STATIC_FROM_LENGTHS(&vec1_vlc, VLCBITS, HUFF_VEC1_SIZE, + VLC_INIT_STATIC_FROM_LENGTHS(&vec1_vlc, VLCBITS, HUFF_VEC1_SIZE, &vec1_table[0][1], 2, &vec1_table[0][0], 2, 1, 0, 0, 562); diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/wmavoice.c b/arm/raspi/third_party/ffmpeg/libavcodec/wmavoice.c index 44fda0e2..dd7cc64d 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/wmavoice.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/wmavoice.c @@ -31,6 +31,7 @@ #include "libavutil/float_dsp.h" #include "libavutil/mem_internal.h" #include "libavutil/thread.h" +#include "libavutil/tx.h" #include "avcodec.h" #include "codec_internal.h" #include "decode.h" @@ -41,8 +42,6 @@ #include "acelp_vectors.h" #include "acelp_filters.h" #include "lsp.h" -#include "dct.h" -#include "rdft.h" #include "sinewin.h" #define MAX_BLOCKS 8 ///< maximum number of blocks per frame @@ -263,10 +262,10 @@ typedef struct WMAVoiceContext { * smoothing and so on, and context variables for FFT/iFFT. * @{ */ - RDFTContext rdft, irdft; ///< contexts for FFT-calculation in the - ///< postfilter (for denoise filter) - DCTContext dct, dst; ///< contexts for phase shift (in Hilbert - ///< transform, part of postfilter) + AVTXContext *rdft, *irdft; ///< contexts for FFT-calculation in the + av_tx_fn rdft_fn, irdft_fn; ///< postfilter (for denoise filter) + AVTXContext *dct, *dst; ///< contexts for phase shift (in Hilbert + av_tx_fn dct_fn, dst_fn; ///< transform, part of postfilter) float sin[511], cos[511]; ///< 8-bit cosine/sine windows over [-pi,pi] ///< range float postfilter_agc; ///< gain control memory, used in @@ -277,9 +276,9 @@ typedef struct WMAVoiceContext { ///< by postfilter float denoise_filter_cache[MAX_FRAMESIZE]; int denoise_filter_cache_size; ///< samples in #denoise_filter_cache - DECLARE_ALIGNED(32, float, tilted_lpcs_pf)[0x80]; + DECLARE_ALIGNED(32, float, tilted_lpcs_pf)[0x82]; ///< aligned buffer for LPC tilting - DECLARE_ALIGNED(32, float, denoise_coeffs_pf)[0x80]; + DECLARE_ALIGNED(32, float, denoise_coeffs_pf)[0x82]; ///< aligned buffer for denoise coefficients DECLARE_ALIGNED(32, float, synth_filter_out_buf)[0x80 + MAX_LSPS_ALIGN16]; ///< aligned buffer for postfilter speech @@ -321,7 +320,7 @@ static av_cold void wmavoice_init_static_data(void) 14, 14, 14, 14 }; - INIT_VLC_STATIC_FROM_LENGTHS(&frame_type_vlc, VLC_NBITS, + VLC_INIT_STATIC_FROM_LENGTHS(&frame_type_vlc, VLC_NBITS, FF_ARRAY_ELEMS(bits), bits, 1, NULL, 0, 0, 0, 0, 132); } @@ -388,10 +387,24 @@ static av_cold int wmavoice_decode_init(AVCodecContext *ctx) s->spillover_bitsize = 3 + av_ceil_log2(ctx->block_align); s->do_apf = flags & 0x1; if (s->do_apf) { - if ((ret = ff_rdft_init(&s->rdft, 7, DFT_R2C)) < 0 || - (ret = ff_rdft_init(&s->irdft, 7, IDFT_C2R)) < 0 || - (ret = ff_dct_init (&s->dct, 6, DCT_I)) < 0 || - (ret = ff_dct_init (&s->dst, 6, DST_I)) < 0) + float scale = 1.0f; + + ret = av_tx_init(&s->rdft, &s->rdft_fn, AV_TX_FLOAT_RDFT, 0, 1 << 7, &scale, 0); + if (ret < 0) + return ret; + + ret = av_tx_init(&s->irdft, &s->irdft_fn, AV_TX_FLOAT_RDFT, 1, 1 << 7, &scale, 0); + if (ret < 0) + return ret; + + scale = 1.0 / (1 << 6); + ret = av_tx_init(&s->dct, &s->dct_fn, AV_TX_FLOAT_DCT_I, 0, 1 << 6, &scale, 0); + if (ret < 0) + return ret; + + scale = 1.0 / (1 << 6); + ret = av_tx_init(&s->dst, &s->dst_fn, AV_TX_FLOAT_DST_I, 0, 1 << 6, &scale, 0); + if (ret < 0) return ret; ff_sine_window_init(s->cos, 256); @@ -596,20 +609,25 @@ static float tilt_factor(const float *lpcs, int n_lpcs) /** * Derive denoise filter coefficients (in real domain) from the LPCs. */ -static void calc_input_response(WMAVoiceContext *s, float *lpcs, - int fcb_type, float *coeffs, int remainder) +static void calc_input_response(WMAVoiceContext *s, float *lpcs_src, + int fcb_type, float *coeffs_dst, int remainder) { float last_coeff, min = 15.0, max = -15.0; float irange, angle_mul, gain_mul, range, sq; + LOCAL_ALIGNED_32(float, coeffs, [0x82]); + LOCAL_ALIGNED_32(float, lpcs, [0x82]); + LOCAL_ALIGNED_32(float, lpcs_dct, [0x82]); int n, idx; + memcpy(coeffs, coeffs_dst, 0x82*sizeof(float)); + /* Create frequency power spectrum of speech input (i.e. RDFT of LPCs) */ - s->rdft.rdft_calc(&s->rdft, lpcs); + s->rdft_fn(s->rdft, lpcs, lpcs_src, sizeof(float)); #define log_range(var, assign) do { \ float tmp = log10f(assign); var = tmp; \ max = FFMAX(max, tmp); min = FFMIN(min, tmp); \ } while (0) - log_range(last_coeff, lpcs[1] * lpcs[1]); + log_range(last_coeff, lpcs[64] * lpcs[64]); for (n = 1; n < 64; n++) log_range(lpcs[n], lpcs[n * 2] * lpcs[n * 2] + lpcs[n * 2 + 1] * lpcs[n * 2 + 1]); @@ -649,8 +667,8 @@ static void calc_input_response(WMAVoiceContext *s, float *lpcs, * is a sine input) by doing a phase shift (in theory, H(sin())=cos()). * Hilbert_Transform(RDFT(x)) = Laplace_Transform(x), which calculates the * "moment" of the LPCs in this filter. */ - s->dct.dct_calc(&s->dct, lpcs); - s->dst.dct_calc(&s->dst, lpcs); + s->dct_fn(s->dct, lpcs_dct, lpcs, sizeof(float)); + s->dst_fn(s->dst, lpcs, lpcs_dct, sizeof(float)); /* Split out the coefficient indexes into phase/magnitude pairs */ idx = 255 + av_clip(lpcs[64], -255, 255); @@ -668,25 +686,25 @@ static void calc_input_response(WMAVoiceContext *s, float *lpcs, coeffs[n * 2 + 1] = coeffs[n] * s->sin[idx]; coeffs[n * 2] = coeffs[n] * s->cos[idx]; } - coeffs[1] = last_coeff; + coeffs[64] = last_coeff; /* move into real domain */ - s->irdft.rdft_calc(&s->irdft, coeffs); + s->irdft_fn(s->irdft, coeffs_dst, coeffs, sizeof(AVComplexFloat)); /* tilt correction and normalize scale */ - memset(&coeffs[remainder], 0, sizeof(coeffs[0]) * (128 - remainder)); + memset(&coeffs_dst[remainder], 0, sizeof(coeffs_dst[0]) * (128 - remainder)); if (s->denoise_tilt_corr) { float tilt_mem = 0; - coeffs[remainder - 1] = 0; + coeffs_dst[remainder - 1] = 0; ff_tilt_compensation(&tilt_mem, - -1.8 * tilt_factor(coeffs, remainder - 1), - coeffs, remainder); + -1.8 * tilt_factor(coeffs_dst, remainder - 1), + coeffs_dst, remainder); } - sq = (1.0 / 64.0) * sqrtf(1 / avpriv_scalarproduct_float_c(coeffs, coeffs, + sq = (1.0 / 64.0) * sqrtf(1 / avpriv_scalarproduct_float_c(coeffs_dst, coeffs_dst, remainder)); for (n = 0; n < remainder; n++) - coeffs[n] *= sq; + coeffs_dst[n] *= sq; } /** @@ -722,6 +740,8 @@ static void wiener_denoise(WMAVoiceContext *s, int fcb_type, int remainder, lim, n; if (fcb_type != FCB_TYPE_SILENCE) { + LOCAL_ALIGNED_32(float, coeffs_f, [0x82]); + LOCAL_ALIGNED_32(float, synth_f, [0x82]); float *tilted_lpcs = s->tilted_lpcs_pf, *coeffs = s->denoise_coeffs_pf, tilt_mem = 0; @@ -742,16 +762,16 @@ static void wiener_denoise(WMAVoiceContext *s, int fcb_type, /* apply coefficients (in frequency spectrum domain), i.e. complex * number multiplication */ memset(&synth_pf[size], 0, sizeof(synth_pf[0]) * (128 - size)); - s->rdft.rdft_calc(&s->rdft, synth_pf); - s->rdft.rdft_calc(&s->rdft, coeffs); - synth_pf[0] *= coeffs[0]; - synth_pf[1] *= coeffs[1]; - for (n = 1; n < 64; n++) { - float v1 = synth_pf[n * 2], v2 = synth_pf[n * 2 + 1]; - synth_pf[n * 2] = v1 * coeffs[n * 2] - v2 * coeffs[n * 2 + 1]; - synth_pf[n * 2 + 1] = v2 * coeffs[n * 2] + v1 * coeffs[n * 2 + 1]; + s->rdft_fn(s->rdft, synth_f, synth_pf, sizeof(float)); + s->rdft_fn(s->rdft, coeffs_f, coeffs, sizeof(float)); + synth_f[0] *= coeffs_f[0]; + synth_f[1] *= coeffs_f[1]; + for (n = 1; n <= 64; n++) { + float v1 = synth_f[n * 2], v2 = synth_f[n * 2 + 1]; + synth_f[n * 2] = v1 * coeffs_f[n * 2] - v2 * coeffs_f[n * 2 + 1]; + synth_f[n * 2 + 1] = v2 * coeffs_f[n * 2] + v1 * coeffs_f[n * 2 + 1]; } - s->irdft.rdft_calc(&s->irdft, synth_pf); + s->irdft_fn(s->irdft, synth_pf, synth_f, sizeof(AVComplexFloat)); } /* merge filter output with the history of previous runs */ @@ -1986,10 +2006,10 @@ static av_cold int wmavoice_decode_end(AVCodecContext *ctx) WMAVoiceContext *s = ctx->priv_data; if (s->do_apf) { - ff_rdft_end(&s->rdft); - ff_rdft_end(&s->irdft); - ff_dct_end(&s->dct); - ff_dct_end(&s->dst); + av_tx_uninit(&s->rdft); + av_tx_uninit(&s->irdft); + av_tx_uninit(&s->dct); + av_tx_uninit(&s->dst); } return 0; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/wnv1.c b/arm/raspi/third_party/ffmpeg/libavcodec/wnv1.c index 5c57db00..ffc9174a 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/wnv1.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/wnv1.c @@ -115,10 +115,10 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *p, static av_cold void wnv1_init_static(void) { - INIT_VLC_STATIC_FROM_LENGTHS(&code_vlc, CODE_VLC_BITS, 16, + VLC_INIT_STATIC_FROM_LENGTHS(&code_vlc, CODE_VLC_BITS, 16, &code_tab[0][1], 2, &code_tab[0][0], 2, 1, - -7, INIT_VLC_OUTPUT_LE, 1 << CODE_VLC_BITS); + -7, VLC_INIT_OUTPUT_LE, 1 << CODE_VLC_BITS); } static av_cold int decode_init(AVCodecContext *avctx) diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/x86/Makefile b/arm/raspi/third_party/ffmpeg/libavcodec/x86/Makefile index 118daca3..d5fb3064 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/x86/Makefile +++ b/arm/raspi/third_party/ffmpeg/libavcodec/x86/Makefile @@ -5,11 +5,9 @@ OBJS-$(CONFIG_AC3DSP) += x86/ac3dsp_init.o OBJS-$(CONFIG_AUDIODSP) += x86/audiodsp_init.o OBJS-$(CONFIG_BLOCKDSP) += x86/blockdsp_init.o OBJS-$(CONFIG_BSWAPDSP) += x86/bswapdsp_init.o -OBJS-$(CONFIG_DCT) += x86/dct_init.o OBJS-$(CONFIG_DIRAC_DECODER) += x86/diracdsp_init.o \ x86/dirac_dwt_init.o OBJS-$(CONFIG_FDCTDSP) += x86/fdctdsp_init.o -OBJS-$(CONFIG_FFT) += x86/fft_init.o OBJS-$(CONFIG_FMTCONVERT) += x86/fmtconvert_init.o OBJS-$(CONFIG_H263DSP) += x86/h263dsp_init.o OBJS-$(CONFIG_H264CHROMA) += x86/h264chroma_init.o @@ -75,7 +73,6 @@ OBJS-$(CONFIG_UTVIDEO_DECODER) += x86/utvideodsp_init.o OBJS-$(CONFIG_V210_DECODER) += x86/v210-init.o OBJS-$(CONFIG_V210_ENCODER) += x86/v210enc_init.o OBJS-$(CONFIG_VORBIS_DECODER) += x86/vorbisdsp_init.o -OBJS-$(CONFIG_VP3_DECODER) += x86/hpeldsp_vp3_init.o OBJS-$(CONFIG_VP6_DECODER) += x86/vp6dsp_init.o OBJS-$(CONFIG_VP9_DECODER) += x86/vp9dsp_init.o \ x86/vp9dsp_init_10bpp.o \ @@ -99,8 +96,6 @@ X86ASM-OBJS-$(CONFIG_AC3DSP) += x86/ac3dsp.o \ X86ASM-OBJS-$(CONFIG_AUDIODSP) += x86/audiodsp.o X86ASM-OBJS-$(CONFIG_BLOCKDSP) += x86/blockdsp.o X86ASM-OBJS-$(CONFIG_BSWAPDSP) += x86/bswapdsp.o -X86ASM-OBJS-$(CONFIG_DCT) += x86/dct32.o -X86ASM-OBJS-$(CONFIG_FFT) += x86/fft.o X86ASM-OBJS-$(CONFIG_FMTCONVERT) += x86/fmtconvert.o X86ASM-OBJS-$(CONFIG_H263DSP) += x86/h263_loopfilter.o X86ASM-OBJS-$(CONFIG_H264CHROMA) += x86/h264_chromamc.o \ @@ -127,7 +122,7 @@ X86ASM-OBJS-$(CONFIG_LLVIDDSP) += x86/lossless_videodsp.o X86ASM-OBJS-$(CONFIG_LLVIDENCDSP) += x86/lossless_videoencdsp.o X86ASM-OBJS-$(CONFIG_LPC) += x86/lpc.o X86ASM-OBJS-$(CONFIG_ME_CMP) += x86/me_cmp.o -X86ASM-OBJS-$(CONFIG_MPEGAUDIODSP) += x86/imdct36.o +X86ASM-OBJS-$(CONFIG_MPEGAUDIODSP) += x86/dct32.o x86/imdct36.o X86ASM-OBJS-$(CONFIG_MPEGVIDEOENC) += x86/mpegvideoencdsp.o X86ASM-OBJS-$(CONFIG_OPUS_DECODER) += x86/opusdsp.o X86ASM-OBJS-$(CONFIG_OPUS_ENCODER) += x86/celt_pvq_search.o @@ -192,7 +187,6 @@ X86ASM-OBJS-$(CONFIG_UTVIDEO_DECODER) += x86/utvideodsp.o X86ASM-OBJS-$(CONFIG_V210_ENCODER) += x86/v210enc.o X86ASM-OBJS-$(CONFIG_V210_DECODER) += x86/v210.o X86ASM-OBJS-$(CONFIG_VORBIS_DECODER) += x86/vorbisdsp.o -X86ASM-OBJS-$(CONFIG_VP3_DECODER) += x86/hpeldsp_vp3.o X86ASM-OBJS-$(CONFIG_VP6_DECODER) += x86/vp6dsp.o X86ASM-OBJS-$(CONFIG_VP9_DECODER) += x86/vp9intrapred.o \ x86/vp9intrapred_16bpp.o \ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/x86/hpeldsp.asm b/arm/raspi/third_party/ffmpeg/libavcodec/x86/hpeldsp.asm index 7a2b7135..3bc27861 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/x86/hpeldsp.asm +++ b/arm/raspi/third_party/ffmpeg/libavcodec/x86/hpeldsp.asm @@ -165,6 +165,47 @@ cglobal put_no_rnd_pixels8_x2, 4,5 RET +; void ff_put_no_rnd_pixels8_x2_exact(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) +INIT_MMX mmxext +cglobal put_no_rnd_pixels8_x2_exact, 4,5 + lea r4, [r2*3] + pcmpeqb m6, m6 +.loop: + mova m0, [r1] + mova m2, [r1+r2] + mova m1, [r1+1] + mova m3, [r1+r2+1] + pxor m0, m6 + pxor m2, m6 + pxor m1, m6 + pxor m3, m6 + PAVGB m0, m1 + PAVGB m2, m3 + pxor m0, m6 + pxor m2, m6 + mova [r0], m0 + mova [r0+r2], m2 + mova m0, [r1+r2*2] + mova m1, [r1+r2*2+1] + mova m2, [r1+r4] + mova m3, [r1+r4+1] + pxor m0, m6 + pxor m1, m6 + pxor m2, m6 + pxor m3, m6 + PAVGB m0, m1 + PAVGB m2, m3 + pxor m0, m6 + pxor m2, m6 + mova [r0+r2*2], m0 + mova [r0+r4], m2 + lea r1, [r1+r2*4] + lea r0, [r0+r2*4] + sub r3d, 4 + jg .loop + RET + + ; void ff_put_pixels8_y2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) %macro PUT_PIXELS8_Y2 0 %if cpuflag(sse2) @@ -235,6 +276,42 @@ cglobal put_no_rnd_pixels8_y2, 4,5 RET +; void ff_put_no_rnd_pixels8_y2_exact(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) +INIT_MMX mmxext +cglobal put_no_rnd_pixels8_y2_exact, 4,5 + lea r4, [r2*3] + mova m0, [r1] + pcmpeqb m6, m6 + add r1, r2 + pxor m0, m6 +.loop: + mova m1, [r1] + mova m2, [r1+r2] + pxor m1, m6 + pxor m2, m6 + PAVGB m0, m1 + PAVGB m1, m2 + pxor m0, m6 + pxor m1, m6 + mova [r0], m0 + mova [r0+r2], m1 + mova m1, [r1+r2*2] + mova m0, [r1+r4] + pxor m1, m6 + pxor m0, m6 + PAVGB m2, m1 + PAVGB m1, m0 + pxor m2, m6 + pxor m1, m6 + mova [r0+r2*2], m2 + mova [r0+r4], m1 + lea r1, [r1+r2*4] + lea r0, [r0+r2*4] + sub r3d, 4 + jg .loop + RET + + ; void ff_avg_pixels8_x2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) %macro AVG_PIXELS8_X2 0 %if cpuflag(sse2) diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/x86/hpeldsp.h b/arm/raspi/third_party/ffmpeg/libavcodec/x86/hpeldsp.h index fd740da7..ac7e625f 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/x86/hpeldsp.h +++ b/arm/raspi/third_party/ffmpeg/libavcodec/x86/hpeldsp.h @@ -22,8 +22,6 @@ #include #include -#include "libavcodec/hpeldsp.h" - void ff_avg_pixels8_x2_mmx(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); @@ -50,6 +48,4 @@ void ff_put_pixels16_xy2_sse2(uint8_t *block, const uint8_t *pixels, void ff_put_pixels16_xy2_ssse3(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); -void ff_hpeldsp_vp3_init_x86(HpelDSPContext *c, int cpu_flags, int flags); - #endif /* AVCODEC_X86_HPELDSP_H */ diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/x86/hpeldsp_init.c b/arm/raspi/third_party/ffmpeg/libavcodec/x86/hpeldsp_init.c index 09c48c34..f08c66f5 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/x86/hpeldsp_init.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/x86/hpeldsp_init.c @@ -22,8 +22,6 @@ * MMX optimization by Nick Kurshev */ -#include "config_components.h" - #include "libavutil/attributes.h" #include "libavutil/cpu.h" #include "libavutil/x86/cpu.h" @@ -47,10 +45,16 @@ void ff_avg_pixels16_y2_sse2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); void ff_put_no_rnd_pixels8_x2_mmxext(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); +void ff_put_no_rnd_pixels8_x2_exact_mmxext(uint8_t *block, + const uint8_t *pixels, + ptrdiff_t line_size, int h); void ff_put_pixels8_y2_mmxext(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); void ff_put_no_rnd_pixels8_y2_mmxext(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); +void ff_put_no_rnd_pixels8_y2_exact_mmxext(uint8_t *block, + const uint8_t *pixels, + ptrdiff_t line_size, int h); void ff_avg_pixels8_x2_mmxext(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); void ff_avg_pixels8_y2_mmxext(uint8_t *block, const uint8_t *pixels, @@ -183,6 +187,9 @@ static void hpeldsp_init_mmxext(HpelDSPContext *c, int flags) c->avg_pixels_tab[1][2] = ff_avg_pixels8_y2_mmxext; c->avg_pixels_tab[1][3] = ff_avg_pixels8_xy2_mmxext; + 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; + 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; @@ -235,7 +242,4 @@ av_cold void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags) if (EXTERNAL_SSSE3(cpu_flags)) hpeldsp_init_ssse3(c, flags); - - if (CONFIG_VP3_DECODER) - ff_hpeldsp_vp3_init_x86(c, cpu_flags, flags); } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/x86/idctdsp_init.c b/arm/raspi/third_party/ffmpeg/libavcodec/x86/idctdsp_init.c index f28a1ad7..2d165b97 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/x86/idctdsp_init.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/x86/idctdsp_init.c @@ -45,10 +45,12 @@ av_cold int ff_init_scantable_permutation_x86(uint8_t *idct_permutation, int i; switch (perm_type) { +#if ARCH_X86_32 case FF_IDCT_PERM_SIMPLE: for (i = 0; i < 64; i++) idct_permutation[i] = simple_mmx_permutation[i]; return 1; +#endif case FF_IDCT_PERM_SSE2: for (i = 0; i < 64; i++) idct_permutation[i] = (i & 0x38) | idct_sse2_row_perm[i & 7]; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/x86/mpegaudiodsp.c b/arm/raspi/third_party/ffmpeg/libavcodec/x86/mpegaudiodsp.c index 6586fe07..43662cd2 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/x86/mpegaudiodsp.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/x86/mpegaudiodsp.c @@ -45,6 +45,9 @@ void ff_four_imdct36_float_sse(float *out, float *buf, float *in, float *win, void ff_four_imdct36_float_avx(float *out, float *buf, float *in, float *win, float *tmpbuf); +void ff_dct32_float_sse2(float *out, const float *in); +void ff_dct32_float_avx (float *out, const float *in); + DECLARE_ALIGNED(16, static float, mdct_win_sse)[2][4][4*40]; #if HAVE_6REGS && HAVE_SSE_INLINE @@ -267,6 +270,7 @@ av_cold void ff_mpadsp_init_x86(MPADSPContext *s) #if HAVE_SSE if (EXTERNAL_SSE2(cpu_flags)) { s->imdct36_blocks_float = imdct36_blocks_sse2; + s->dct32_float = ff_dct32_float_sse2; } if (EXTERNAL_SSE3(cpu_flags)) { s->imdct36_blocks_float = imdct36_blocks_sse3; @@ -279,6 +283,8 @@ av_cold void ff_mpadsp_init_x86(MPADSPContext *s) if (EXTERNAL_AVX(cpu_flags)) { s->imdct36_blocks_float = imdct36_blocks_avx; } + if (EXTERNAL_AVX_FAST(cpu_flags)) + s->dct32_float = ff_dct32_float_avx; #endif #endif /* HAVE_X86ASM */ } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/x86/mpegvideoenc_template.c b/arm/raspi/third_party/ffmpeg/libavcodec/x86/mpegvideoenc_template.c index b5b0a5ff..5f013be7 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/x86/mpegvideoenc_template.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/x86/mpegvideoenc_template.c @@ -225,7 +225,8 @@ static int RENAME(dct_quantize)(MpegEncContext *s, if(s->mb_intra) block[0]= level; else block[0]= temp_block[0]; - if (s->idsp.perm_type == FF_IDCT_PERM_SIMPLE) { + av_assert2(ARCH_X86_32 || s->idsp.perm_type != FF_IDCT_PERM_SIMPLE); + if (ARCH_X86_32 && s->idsp.perm_type == FF_IDCT_PERM_SIMPLE) { if(last_non_zero_p1 <= 1) goto end; block[0x08] = temp_block[0x01]; block[0x10] = temp_block[0x08]; block[0x20] = temp_block[0x10]; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/x86/proresdsp_init.c b/arm/raspi/third_party/ffmpeg/libavcodec/x86/proresdsp_init.c index bde79ab8..f7abbfa6 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/x86/proresdsp_init.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/x86/proresdsp_init.c @@ -30,12 +30,12 @@ void ff_prores_idct_put_10_sse2(uint16_t *dst, ptrdiff_t linesize, void ff_prores_idct_put_10_avx (uint16_t *dst, ptrdiff_t linesize, int16_t *block, const int16_t *qmat); -av_cold void ff_proresdsp_init_x86(ProresDSPContext *dsp, AVCodecContext *avctx) +av_cold void ff_proresdsp_init_x86(ProresDSPContext *dsp, int bits_per_raw_sample) { #if ARCH_X86_64 int cpu_flags = av_get_cpu_flags(); - if (avctx->bits_per_raw_sample == 10){ + if (bits_per_raw_sample == 10) { if (EXTERNAL_SSE2(cpu_flags)) { dsp->idct_permutation_type = FF_IDCT_PERM_TRANSPOSE; dsp->idct_put = ff_prores_idct_put_10_sse2; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/x86/snowdsp.c b/arm/raspi/third_party/ffmpeg/libavcodec/x86/snowdsp.c index bca1f9bd..bd0aa766 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/x86/snowdsp.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/x86/snowdsp.c @@ -24,7 +24,6 @@ #include "libavutil/attributes.h" #include "libavutil/cpu.h" #include "libavutil/x86/asm.h" -#include "libavcodec/snow.h" #include "libavcodec/snow_dwt.h" #if HAVE_INLINE_ASM diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/xan.c b/arm/raspi/third_party/ffmpeg/libavcodec/xan.c index 14fc2443..cc0ecea5 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/xan.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/xan.c @@ -622,8 +622,7 @@ static int xan_decode_frame(AVCodecContext *avctx, AVFrame *frame, if (xan_wc3_decode_frame(s, frame) < 0) return AVERROR_INVALIDDATA; - av_frame_unref(s->last_frame); - if ((ret = av_frame_ref(s->last_frame, frame)) < 0) + if ((ret = av_frame_replace(s->last_frame, frame)) < 0) return ret; *got_frame = 1; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/xvididct.c b/arm/raspi/third_party/ffmpeg/libavcodec/xvididct.c index f338901a..dcea3221 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/xvididct.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/xvididct.c @@ -69,24 +69,24 @@ static int idct_row(short *in, const int *const tab, int rnd) if (!(right | in[4])) { const int k = c4 * in[0] + rnd; if (left) { - const int a0 = k + c2 * in[2]; - const int a1 = k + c6 * in[2]; - const int a2 = k - c6 * in[2]; - const int a3 = k - c2 * in[2]; + const unsigned a0 = k + c2 * in[2]; + const unsigned a1 = k + c6 * in[2]; + const unsigned a2 = k - c6 * in[2]; + const unsigned a3 = k - c2 * in[2]; const int b0 = c1 * in[1] + c3 * in[3]; const int b1 = c3 * in[1] - c7 * in[3]; const int b2 = c5 * in[1] - c1 * in[3]; const int b3 = c7 * in[1] - c5 * in[3]; - in[0] = (a0 + b0) >> ROW_SHIFT; - in[1] = (a1 + b1) >> ROW_SHIFT; - in[2] = (a2 + b2) >> ROW_SHIFT; - in[3] = (a3 + b3) >> ROW_SHIFT; - in[4] = (a3 - b3) >> ROW_SHIFT; - in[5] = (a2 - b2) >> ROW_SHIFT; - in[6] = (a1 - b1) >> ROW_SHIFT; - in[7] = (a0 - b0) >> ROW_SHIFT; + in[0] = (int)(a0 + b0) >> ROW_SHIFT; + in[1] = (int)(a1 + b1) >> ROW_SHIFT; + in[2] = (int)(a2 + b2) >> ROW_SHIFT; + in[3] = (int)(a3 + b3) >> ROW_SHIFT; + in[4] = (int)(a3 - b3) >> ROW_SHIFT; + in[5] = (int)(a2 - b2) >> ROW_SHIFT; + in[6] = (int)(a1 - b1) >> ROW_SHIFT; + in[7] = (int)(a0 - b0) >> ROW_SHIFT; } else { const int a0 = k >> ROW_SHIFT; if (a0) { @@ -114,7 +114,7 @@ static int idct_row(short *in, const int *const tab, int rnd) in[5] = a1; in[6] = a1; } else { - const int k = c4 * in[0] + rnd; + const unsigned int k = c4 * in[0] + rnd; const unsigned int a0 = k + c2 * in[2] + c4 * in[4] + c6 * in[6]; const unsigned int a1 = k + c6 * in[2] - c4 * in[4] - c2 * in[6]; const unsigned int a2 = k - c6 * in[2] - c4 * in[4] + c2 * in[6]; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/ylc.c b/arm/raspi/third_party/ffmpeg/libavcodec/ylc.c index c0c4d27c..b03df315 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/ylc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/ylc.c @@ -87,7 +87,7 @@ static int build_vlc(AVCodecContext *avctx, VLC *vlc, const uint32_t *table) uint8_t xlat[256]; int cur_node, i, j, pos = 0; - ff_free_vlc(vlc); + ff_vlc_free(vlc); for (i = 0; i < 256; i++) { nodes[i].count = table[i]; @@ -142,7 +142,7 @@ static int build_vlc(AVCodecContext *avctx, VLC *vlc, const uint32_t *table) get_tree_codes(bits, lens, xlat, nodes, cur_node - 1, 0, 0, &pos); - return ff_init_vlc_sparse(vlc, YLC_VLC_BITS, pos, lens, 2, 2, + return ff_vlc_init_sparse(vlc, YLC_VLC_BITS, pos, lens, 2, 2, bits, 4, 4, xlat, 1, 1, 0); } @@ -438,7 +438,7 @@ static av_cold int decode_end(AVCodecContext *avctx) YLCContext *s = avctx->priv_data; for (int i = 0; i < FF_ARRAY_ELEMS(s->vlc); i++) - ff_free_vlc(&s->vlc[i]); + ff_vlc_free(&s->vlc[i]); av_freep(&s->buffer); s->buffer_size = 0; diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/yuv4enc.c b/arm/raspi/third_party/ffmpeg/libavcodec/yuv4enc.c index 8123260d..2a9d3442 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/yuv4enc.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/yuv4enc.c @@ -29,10 +29,10 @@ static int yuv4_encode_frame(AVCodecContext *avctx, AVPacket *pkt, { uint8_t *dst; const uint8_t *y, *u, *v; - int i, j, ret; + int ret; - ret = ff_get_encode_buffer(avctx, pkt, 6 * (avctx->width + 1 >> 1) - * (avctx->height + 1 >> 1), 0); + ret = ff_get_encode_buffer(avctx, pkt, 6 * ((avctx->width + 1) / 2) + * ((avctx->height + 1) / 2), 0); if (ret < 0) return ret; dst = pkt->data; @@ -41,8 +41,8 @@ static int yuv4_encode_frame(AVCodecContext *avctx, AVPacket *pkt, u = pic->data[1]; v = pic->data[2]; - for (i = 0; i < avctx->height + 1 >> 1; i++) { - for (j = 0; j < avctx->width + 1 >> 1; j++) { + for (int i = 0; i < avctx->height / 2; i++) { + for (int j = 0; j < (avctx->width + 1) / 2; j++) { *dst++ = u[j] ^ 0x80; *dst++ = v[j] ^ 0x80; *dst++ = y[ 2 * j ]; @@ -55,6 +55,17 @@ static int yuv4_encode_frame(AVCodecContext *avctx, AVPacket *pkt, v += pic->linesize[2]; } + if (avctx->height & 1) { + for (int j = 0; j < (avctx->width + 1) / 2; j++) { + *dst++ = u[j] ^ 0x80; + *dst++ = v[j] ^ 0x80; + *dst++ = y[2 * j ]; + *dst++ = y[2 * j + 1]; + *dst++ = y[2 * j ]; + *dst++ = y[2 * j + 1]; + } + } + *got_packet = 1; return 0; } diff --git a/arm/raspi/third_party/ffmpeg/libavcodec/zerocodec.c b/arm/raspi/third_party/ffmpeg/libavcodec/zerocodec.c index 6c3bcebc..48f78d1d 100644 --- a/arm/raspi/third_party/ffmpeg/libavcodec/zerocodec.c +++ b/arm/raspi/third_party/ffmpeg/libavcodec/zerocodec.c @@ -93,8 +93,7 @@ static int zerocodec_decode_frame(AVCodecContext *avctx, AVFrame *pic, dst -= pic->linesize[0]; } - av_frame_unref(zc->previous_frame); - if ((ret = av_frame_ref(zc->previous_frame, pic)) < 0) + if ((ret = av_frame_replace(zc->previous_frame, pic)) < 0) return ret; *got_frame = 1; diff --git a/arm/raspi/third_party/ffmpeg/libavutil/Makefile b/arm/raspi/third_party/ffmpeg/libavutil/Makefile index bd9c6f9e..4711f8cd 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/Makefile +++ b/arm/raspi/third_party/ffmpeg/libavutil/Makefile @@ -31,6 +31,7 @@ HEADERS = adler32.h \ encryption_info.h \ error.h \ eval.h \ + executor.h \ fifo.h \ file.h \ frame.h \ @@ -91,6 +92,7 @@ HEADERS = adler32.h \ tea.h \ tx.h \ film_grain_params.h \ + video_hint.h ARCH_HEADERS = bswap.h \ intmath.h \ @@ -126,6 +128,7 @@ OBJS = adler32.o \ encryption_info.o \ error.o \ eval.o \ + executor.o \ fifo.o \ file.o \ file_open.o \ @@ -181,6 +184,7 @@ OBJS = adler32.o \ uuid.o \ version.o \ video_enc_params.o \ + video_hint.o \ film_grain_params.o \ diff --git a/arm/raspi/third_party/ffmpeg/libavutil/aarch64/autorename_libavutil_aarch64_cpu.c b/arm/raspi/third_party/ffmpeg/libavutil/aarch64/autorename_libavutil_aarch64_cpu.c new file mode 100644 index 00000000..3adbdc6f --- /dev/null +++ b/arm/raspi/third_party/ffmpeg/libavutil/aarch64/autorename_libavutil_aarch64_cpu.c @@ -0,0 +1,2 @@ +// File automatically generated. See crbug.com/495833. +#include "cpu.c" diff --git a/arm/raspi/third_party/ffmpeg/libavutil/audio_fifo.c b/arm/raspi/third_party/ffmpeg/libavutil/audio_fifo.c index f4103178..dc2dea9b 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/audio_fifo.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/audio_fifo.c @@ -116,7 +116,7 @@ int av_audio_fifo_realloc(AVAudioFifo *af, int nb_samples) return 0; } -int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples) +int av_audio_fifo_write(AVAudioFifo *af, void * const *data, int nb_samples) { int i, ret, size; @@ -142,12 +142,13 @@ 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 av_audio_fifo_peek(const AVAudioFifo *af, void * const *data, int nb_samples) { return av_audio_fifo_peek_at(af, data, nb_samples, 0); } -int av_audio_fifo_peek_at(AVAudioFifo *af, void **data, int nb_samples, int offset) +int av_audio_fifo_peek_at(const AVAudioFifo *af, void * const *data, + int nb_samples, int offset) { int i, ret, size; @@ -171,7 +172,7 @@ int av_audio_fifo_peek_at(AVAudioFifo *af, void **data, int nb_samples, int offs return nb_samples; } -int av_audio_fifo_read(AVAudioFifo *af, void **data, int nb_samples) +int av_audio_fifo_read(AVAudioFifo *af, void * const *data, int nb_samples) { int i, size; diff --git a/arm/raspi/third_party/ffmpeg/libavutil/audio_fifo.h b/arm/raspi/third_party/ffmpeg/libavutil/audio_fifo.h index d1e4c856..fa5f59a2 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/audio_fifo.h +++ b/arm/raspi/third_party/ffmpeg/libavutil/audio_fifo.h @@ -91,7 +91,7 @@ int av_audio_fifo_realloc(AVAudioFifo *af, int nb_samples); * code on failure. If successful, the number of samples * actually written will always be nb_samples. */ -int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples); +int av_audio_fifo_write(AVAudioFifo *af, void * const *data, int nb_samples); /** * Peek data from an AVAudioFifo. @@ -107,7 +107,7 @@ int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples); * 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); +int av_audio_fifo_peek(const AVAudioFifo *af, void * const *data, int nb_samples); /** * Peek data from an AVAudioFifo. @@ -124,7 +124,8 @@ int av_audio_fifo_peek(AVAudioFifo *af, void **data, int nb_samples); * 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_at(AVAudioFifo *af, void **data, int nb_samples, int offset); +int av_audio_fifo_peek_at(const AVAudioFifo *af, void * const *data, + int nb_samples, int offset); /** * Read data from an AVAudioFifo. @@ -140,7 +141,7 @@ int av_audio_fifo_peek_at(AVAudioFifo *af, void **data, int nb_samples, int offs * 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_read(AVAudioFifo *af, void **data, int nb_samples); +int av_audio_fifo_read(AVAudioFifo *af, void * const *data, int nb_samples); /** * Drain data from an AVAudioFifo. diff --git a/arm/raspi/third_party/ffmpeg/libavutil/avstring.c b/arm/raspi/third_party/ffmpeg/libavutil/avstring.c index e460b5be..8751ce55 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/avstring.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/avstring.c @@ -32,7 +32,6 @@ #include "bprint.h" #include "error.h" #include "macros.h" -#include "version.h" int av_strstart(const char *str, const char *pfx, const char **ptr) { diff --git a/arm/raspi/third_party/ffmpeg/libavutil/avstring.h b/arm/raspi/third_party/ffmpeg/libavutil/avstring.h index ac113d8c..12f8fec9 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/avstring.h +++ b/arm/raspi/third_party/ffmpeg/libavutil/avstring.h @@ -24,7 +24,6 @@ #include #include #include "attributes.h" -#include "version.h" /** * @addtogroup lavu_string @@ -265,7 +264,7 @@ int av_strncasecmp(const char *a, const char *b, size_t n); /** * Locale-independent strings replace. - * @note This means only ASCII-range characters are replace + * @note This means only ASCII-range characters are replaced. */ char *av_strireplace(const char *str, const char *from, const char *to); diff --git a/arm/raspi/third_party/ffmpeg/libavutil/avutil.h b/arm/raspi/third_party/ffmpeg/libavutil/avutil.h index 64b68bdb..a362c8ba 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/avutil.h +++ b/arm/raspi/third_party/ffmpeg/libavutil/avutil.h @@ -257,7 +257,12 @@ const char *av_get_media_type_string(enum AVMediaType media_type); * Internal time base represented as fractional value */ +#ifdef __cplusplus +/* ISO C++ forbids compound-literals. */ +#define AV_TIME_BASE_Q av_make_q(1, AV_TIME_BASE) +#else #define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE} +#endif /** * @} @@ -294,7 +299,6 @@ char av_get_picture_type_char(enum AVPictureType pict_type); */ #include "common.h" -#include "error.h" #include "rational.h" #include "version.h" #include "macros.h" diff --git a/arm/raspi/third_party/ffmpeg/libavutil/bprint.c b/arm/raspi/third_party/ffmpeg/libavutil/bprint.c index 5b540ebc..4e957171 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/bprint.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/bprint.c @@ -71,7 +71,7 @@ void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max) unsigned size_auto = (char *)buf + sizeof(*buf) - buf->reserved_internal_buffer; - if (size_max == 1) + if (size_max == AV_BPRINT_SIZE_AUTOMATIC) size_max = size_auto; buf->str = buf->reserved_internal_buffer; buf->len = 0; @@ -84,6 +84,11 @@ void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max) void av_bprint_init_for_buffer(AVBPrint *buf, char *buffer, unsigned size) { + if (size == 0) { + av_bprint_init(buf, 0, AV_BPRINT_SIZE_COUNT_ONLY); + return; + } + buf->str = buffer; buf->len = 0; buf->size = size; diff --git a/arm/raspi/third_party/ffmpeg/libavutil/bprint.h b/arm/raspi/third_party/ffmpeg/libavutil/bprint.h index f27d30f7..85597454 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/bprint.h +++ b/arm/raspi/third_party/ffmpeg/libavutil/bprint.h @@ -144,6 +144,9 @@ void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max); * Init a print buffer using a pre-existing buffer. * * The buffer will not be reallocated. + * In case size equals zero, the AVBPrint will be initialized to use + * the internal buffer as if using AV_BPRINT_SIZE_COUNT_ONLY with + * av_bprint_init(). * * @param buf buffer structure to init * @param buffer byte buffer to use for the string data diff --git a/arm/raspi/third_party/ffmpeg/libavutil/channel_layout.c b/arm/raspi/third_party/ffmpeg/libavutil/channel_layout.c index e2f75122..9b581ae6 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/channel_layout.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/channel_layout.c @@ -108,7 +108,9 @@ int av_channel_name(char *buf, size_t buf_size, enum AVChannel channel_id) av_bprint_init_for_buffer(&bp, buf, buf_size); av_channel_name_bprint(&bp, channel_id); - return bp.len; + if (bp.len >= INT_MAX) + return AVERROR(ERANGE); + return bp.len + 1; } void av_channel_description_bprint(AVBPrint *bp, enum AVChannel channel_id) @@ -135,7 +137,9 @@ int av_channel_description(char *buf, size_t buf_size, enum AVChannel channel_id av_bprint_init_for_buffer(&bp, buf, buf_size); av_channel_description_bprint(&bp, channel_id); - return bp.len; + if (bp.len >= INT_MAX) + return AVERROR(ERANGE); + return bp.len + 1; } enum AVChannel av_channel_from_string(const char *str) @@ -789,7 +793,9 @@ int av_channel_layout_describe(const AVChannelLayout *channel_layout, if (ret < 0) return ret; - return bp.len; + if (bp.len >= INT_MAX) + return AVERROR(ERANGE); + return bp.len + 1; } enum AVChannel diff --git a/arm/raspi/third_party/ffmpeg/libavutil/channel_layout.h b/arm/raspi/third_party/ffmpeg/libavutil/channel_layout.h index f345415c..ac2ddfa0 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/channel_layout.h +++ b/arm/raspi/third_party/ffmpeg/libavutil/channel_layout.h @@ -358,8 +358,16 @@ typedef struct AVChannelLayout { void *opaque; } AVChannelLayout; +/** + * Macro to define native channel layouts + * + * @note This doesn't use designated initializers for compatibility with C++ 17 and older. + */ #define AV_CHANNEL_LAYOUT_MASK(nb, m) \ - { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = (nb), .u = { .mask = (m) }} + { /* .order */ AV_CHANNEL_ORDER_NATIVE, \ + /* .nb_channels */ (nb), \ + /* .u.mask */ { m }, \ + /* .opaque */ NULL } /** * @name Common pre-defined channel layouts @@ -396,8 +404,12 @@ typedef struct AVChannelLayout { #define AV_CHANNEL_LAYOUT_HEXADECAGONAL AV_CHANNEL_LAYOUT_MASK(16, AV_CH_LAYOUT_HEXADECAGONAL) #define AV_CHANNEL_LAYOUT_STEREO_DOWNMIX AV_CHANNEL_LAYOUT_MASK(2, AV_CH_LAYOUT_STEREO_DOWNMIX) #define AV_CHANNEL_LAYOUT_22POINT2 AV_CHANNEL_LAYOUT_MASK(24, AV_CH_LAYOUT_22POINT2) + #define AV_CHANNEL_LAYOUT_AMBISONIC_FIRST_ORDER \ - { .order = AV_CHANNEL_ORDER_AMBISONIC, .nb_channels = 4, .u = { .mask = 0 }} + { /* .order */ AV_CHANNEL_ORDER_AMBISONIC, \ + /* .nb_channels */ 4, \ + /* .u.mask */ { 0 }, \ + /* .opaque */ NULL } /** @} */ struct AVBPrint; diff --git a/arm/raspi/third_party/ffmpeg/libavutil/common.h b/arm/raspi/third_party/ffmpeg/libavutil/common.h index fd1404be..de2140a6 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/common.h +++ b/arm/raspi/third_party/ffmpeg/libavutil/common.h @@ -40,6 +40,7 @@ #include #include "attributes.h" +#include "error.h" #include "macros.h" //rounded division & shift diff --git a/arm/raspi/third_party/ffmpeg/libavutil/dict.c b/arm/raspi/third_party/ffmpeg/libavutil/dict.c index f673977a..7f23d533 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/dict.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/dict.c @@ -18,13 +18,15 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include +#include #include #include "avassert.h" #include "avstring.h" #include "dict.h" #include "dict_internal.h" -#include "internal.h" +#include "error.h" #include "mem.h" #include "time_internal.h" #include "bprint.h" diff --git a/arm/raspi/third_party/ffmpeg/libavutil/emms.h b/arm/raspi/third_party/ffmpeg/libavutil/emms.h new file mode 100644 index 00000000..4ec01274 --- /dev/null +++ b/arm/raspi/third_party/ffmpeg/libavutil/emms.h @@ -0,0 +1,66 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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_EMMS_H +#define AVUTIL_EMMS_H + +#include "config.h" +#include "libavutil/attributes.h" + +#if ARCH_X86 + +void avpriv_emms_asm(void); + +#if HAVE_MMX_INLINE +#ifndef __MMX__ +#include "libavutil/cpu.h" +#endif + +# define emms_c emms_c +/** + * Empty mmx state. + * this must be called between any dsp function and float/double code. + * for example sin(); dsp->idct_put(); emms_c(); cos() + * Note, *alloc() and *free() also use float code in some libc implementations + * thus this also applies to them or any function using them. + */ +static av_always_inline void emms_c(void) +{ +/* Some inlined functions may also use mmx instructions regardless of + * runtime cpuflags. With that in mind, we unconditionally empty the + * mmx state if the target cpu chosen at configure time supports it. + */ +#if !defined(__MMX__) + if(av_get_cpu_flags() & AV_CPU_FLAG_MMX) +#endif + __asm__ volatile ("emms" ::: "memory"); +} +#elif HAVE_MMX && HAVE_MM_EMPTY +# include +# define emms_c _mm_empty +#elif HAVE_MMX_EXTERNAL +# define emms_c avpriv_emms_asm +#endif /* HAVE_MMX_INLINE */ + +#endif /* ARCH_X86 */ + +#ifndef emms_c +# define emms_c() do {} while(0) +#endif + +#endif /* AVUTIL_EMMS_H */ diff --git a/arm/raspi/third_party/ffmpeg/libavutil/encryption_info.c b/arm/raspi/third_party/ffmpeg/libavutil/encryption_info.c index be7ce38e..8cf51566 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/encryption_info.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/encryption_info.c @@ -16,6 +16,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + #include "encryption_info.h" #include "mem.h" #include "intreadwrite.h" diff --git a/arm/raspi/third_party/ffmpeg/libavutil/executor.c b/arm/raspi/third_party/ffmpeg/libavutil/executor.c new file mode 100644 index 00000000..0da919f4 --- /dev/null +++ b/arm/raspi/third_party/ffmpeg/libavutil/executor.c @@ -0,0 +1,201 @@ +/* + * Copyright (C) 2023 Nuo Mi + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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 "internal.h" +#include "mem.h" +#include "thread.h" + +#include "executor.h" + +#if !HAVE_THREADS + +#define ExecutorThread char + +#define executor_thread_create(t, a, s, ar) 0 +#define executor_thread_join(t, r) do {} while(0) + +#else + +#define ExecutorThread pthread_t + +#define executor_thread_create(t, a, s, ar) pthread_create(t, a, s, ar) +#define executor_thread_join(t, r) pthread_join(t, r) + +#endif //!HAVE_THREADS + +typedef struct ThreadInfo { + AVExecutor *e; + ExecutorThread thread; +} ThreadInfo; + +struct AVExecutor { + AVTaskCallbacks cb; + int thread_count; + + ThreadInfo *threads; + uint8_t *local_contexts; + + AVMutex lock; + AVCond cond; + int die; + + AVTask *tasks; +}; + +static AVTask* remove_task(AVTask **prev, AVTask *t) +{ + *prev = t->next; + t->next = NULL; + return t; +} + +static void add_task(AVTask **prev, AVTask *t) +{ + t->next = *prev; + *prev = t; +} + +static int run_one_task(AVExecutor *e, void *lc) +{ + AVTaskCallbacks *cb = &e->cb; + AVTask **prev; + + for (prev = &e->tasks; *prev && !cb->ready(*prev, cb->user_data); prev = &(*prev)->next) + /* nothing */; + if (*prev) { + AVTask *t = remove_task(prev, *prev); + ff_mutex_unlock(&e->lock); + cb->run(t, lc, cb->user_data); + ff_mutex_lock(&e->lock); + return 1; + } + return 0; +} + +#if HAVE_THREADS +static void *executor_worker_task(void *data) +{ + ThreadInfo *ti = (ThreadInfo*)data; + AVExecutor *e = ti->e; + void *lc = e->local_contexts + (ti - e->threads) * e->cb.local_context_size; + + ff_mutex_lock(&e->lock); + while (1) { + if (e->die) break; + + if (!run_one_task(e, lc)) { + //no task in one loop + ff_cond_wait(&e->cond, &e->lock); + } + } + ff_mutex_unlock(&e->lock); + return NULL; +} +#endif + +static void executor_free(AVExecutor *e, const int has_lock, const int has_cond) +{ + if (e->thread_count) { + //signal die + ff_mutex_lock(&e->lock); + e->die = 1; + ff_cond_broadcast(&e->cond); + ff_mutex_unlock(&e->lock); + + for (int i = 0; i < e->thread_count; i++) + executor_thread_join(e->threads[i].thread, NULL); + } + if (has_cond) + ff_cond_destroy(&e->cond); + if (has_lock) + ff_mutex_destroy(&e->lock); + + av_free(e->threads); + av_free(e->local_contexts); + + av_free(e); +} + +AVExecutor* av_executor_alloc(const AVTaskCallbacks *cb, int thread_count) +{ + AVExecutor *e; + int has_lock = 0, has_cond = 0; + if (!cb || !cb->user_data || !cb->ready || !cb->run || !cb->priority_higher) + return NULL; + + e = av_mallocz(sizeof(*e)); + if (!e) + return NULL; + e->cb = *cb; + + e->local_contexts = av_calloc(thread_count, e->cb.local_context_size); + if (!e->local_contexts) + goto free_executor; + + e->threads = av_calloc(thread_count, sizeof(*e->threads)); + if (!e->threads) + goto free_executor; + + has_lock = !ff_mutex_init(&e->lock, NULL); + has_cond = !ff_cond_init(&e->cond, NULL); + + if (!has_lock || !has_cond) + goto free_executor; + + for (/* nothing */; e->thread_count < thread_count; e->thread_count++) { + ThreadInfo *ti = e->threads + e->thread_count; + ti->e = e; + if (executor_thread_create(&ti->thread, NULL, executor_worker_task, ti)) + goto free_executor; + } + return e; + +free_executor: + executor_free(e, has_lock, has_cond); + return NULL; +} + +void av_executor_free(AVExecutor **executor) +{ + if (!executor || !*executor) + return; + executor_free(*executor, 1, 1); + *executor = NULL; +} + +void av_executor_execute(AVExecutor *e, AVTask *t) +{ + AVTaskCallbacks *cb = &e->cb; + AVTask **prev; + + ff_mutex_lock(&e->lock); + if (t) { + for (prev = &e->tasks; *prev && cb->priority_higher(*prev, t); prev = &(*prev)->next) + /* nothing */; + add_task(prev, t); + } + ff_cond_signal(&e->cond); + ff_mutex_unlock(&e->lock); + +#if !HAVE_THREADS + // We are running in a single-threaded environment, so we must handle all tasks ourselves + while (run_one_task(e, e->local_contexts)) + /* nothing */; +#endif +} diff --git a/arm/raspi/third_party/ffmpeg/libavutil/executor.h b/arm/raspi/third_party/ffmpeg/libavutil/executor.h new file mode 100644 index 00000000..c602bcb6 --- /dev/null +++ b/arm/raspi/third_party/ffmpeg/libavutil/executor.h @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2023 Nuo Mi + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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_EXECUTOR_H +#define AVUTIL_EXECUTOR_H + +typedef struct AVExecutor AVExecutor; +typedef struct AVTask AVTask; + +struct AVTask { + AVTask *next; +}; + +typedef struct AVTaskCallbacks { + void *user_data; + + int local_context_size; + + // return 1 if a's priority > b's priority + int (*priority_higher)(const AVTask *a, const AVTask *b); + + // task is ready for run + int (*ready)(const AVTask *t, void *user_data); + + // run the task + int (*run)(AVTask *t, void *local_context, void *user_data); +} AVTaskCallbacks; + +/** + * Alloc executor + * @param callbacks callback structure for executor + * @param thread_count worker thread number + * @return return the executor + */ +AVExecutor* av_executor_alloc(const AVTaskCallbacks *callbacks, int thread_count); + +/** + * Free executor + * @param e pointer to executor + */ +void av_executor_free(AVExecutor **e); + +/** + * Add task to executor + * @param e pointer to executor + * @param t pointer to task. If NULL, it will wakeup one work thread + */ +void av_executor_execute(AVExecutor *e, AVTask *t); + +#endif //AVUTIL_EXECUTOR_H diff --git a/arm/raspi/third_party/ffmpeg/libavutil/fifo.c b/arm/raspi/third_party/ffmpeg/libavutil/fifo.c index 51a5af6f..b0807abb 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/fifo.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/fifo.c @@ -252,12 +252,12 @@ int av_fifo_read_to_cb(AVFifo *f, AVFifoCB write_cb, return ret; } -int av_fifo_peek(AVFifo *f, void *buf, size_t nb_elems, size_t offset) +int av_fifo_peek(const AVFifo *f, void *buf, size_t nb_elems, size_t offset) { return fifo_peek_common(f, buf, &nb_elems, offset, NULL, NULL); } -int av_fifo_peek_to_cb(AVFifo *f, AVFifoCB write_cb, void *opaque, +int av_fifo_peek_to_cb(const AVFifo *f, AVFifoCB write_cb, void *opaque, size_t *nb_elems, size_t offset) { return fifo_peek_common(f, NULL, nb_elems, offset, write_cb, opaque); @@ -293,6 +293,7 @@ void av_fifo_freep2(AVFifo **f) #if FF_API_FIFO_OLD_API +#include "internal.h" FF_DISABLE_DEPRECATION_WARNINGS #define OLD_FIFO_SIZE_MAX (size_t)FFMIN3(INT_MAX, UINT32_MAX, SIZE_MAX) diff --git a/arm/raspi/third_party/ffmpeg/libavutil/fifo.h b/arm/raspi/third_party/ffmpeg/libavutil/fifo.h index 70f9376d..ce3a2aed 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/fifo.h +++ b/arm/raspi/third_party/ffmpeg/libavutil/fifo.h @@ -200,7 +200,7 @@ int av_fifo_read_to_cb(AVFifo *f, AVFifoCB write_cb, * * @return a non-negative number on success, a negative error code on failure */ -int av_fifo_peek(AVFifo *f, void *buf, size_t nb_elems, size_t offset); +int av_fifo_peek(const AVFifo *f, void *buf, size_t nb_elems, size_t offset); /** * Feed data from a FIFO into a user-provided callback. @@ -217,7 +217,7 @@ int av_fifo_peek(AVFifo *f, void *buf, size_t nb_elems, size_t offset); * * @return a non-negative number on success, a negative error code on failure */ -int av_fifo_peek_to_cb(AVFifo *f, AVFifoCB write_cb, void *opaque, +int av_fifo_peek_to_cb(const AVFifo *f, AVFifoCB write_cb, void *opaque, size_t *nb_elems, size_t offset); /** diff --git a/arm/raspi/third_party/ffmpeg/libavutil/file.c b/arm/raspi/third_party/ffmpeg/libavutil/file.c index 6a2f3aa9..cc17885b 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/file.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/file.c @@ -17,6 +17,7 @@ */ #include "config.h" +#include "error.h" #include "file.h" #include "file_open.h" #include "internal.h" diff --git a/arm/raspi/third_party/ffmpeg/libavutil/frame.c b/arm/raspi/third_party/ffmpeg/libavutil/frame.c index b6cee2d8..a3f07ca0 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/frame.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/frame.c @@ -833,7 +833,6 @@ AVFrameSideData *av_frame_get_side_data(const AVFrame *frame, static int frame_copy_video(AVFrame *dst, const AVFrame *src) { - const uint8_t *src_data[4]; int planes; if (dst->width < src->width || @@ -848,10 +847,9 @@ static int frame_copy_video(AVFrame *dst, const AVFrame *src) if (!dst->data[i] || !src->data[i]) return AVERROR(EINVAL); - memcpy(src_data, src->data, sizeof(src_data)); - av_image_copy(dst->data, dst->linesize, - src_data, src->linesize, - dst->format, src->width, src->height); + av_image_copy2(dst->data, dst->linesize, + src->data, src->linesize, + dst->format, src->width, src->height); return 0; } diff --git a/arm/raspi/third_party/ffmpeg/libavutil/frame.h b/arm/raspi/third_party/ffmpeg/libavutil/frame.h index 575ded3c..516e84d7 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/frame.h +++ b/arm/raspi/third_party/ffmpeg/libavutil/frame.h @@ -214,6 +214,16 @@ enum AVFrameSideDataType { * Ambient viewing environment metadata, as defined by H.274. */ AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT, + + /** + * Provide encoder-specific hinting information about changed/unchanged + * portions of a frame. It can be used to pass information about which + * macroblocks can be skipped because they didn't change from the + * corresponding ones in the previous frame. This could be useful for + * applications which know this information in advance to speed up + * encoding. + */ + AV_FRAME_DATA_VIDEO_HINT, }; enum AVActiveFormatDescription { diff --git a/arm/raspi/third_party/ffmpeg/libavutil/hash.c b/arm/raspi/third_party/ffmpeg/libavutil/hash.c index 9a497481..12333982 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/hash.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/hash.c @@ -20,6 +20,8 @@ #include #include +#include +#include #include "hash.h" #include "adler32.h" diff --git a/arm/raspi/third_party/ffmpeg/libavutil/hmac.c b/arm/raspi/third_party/ffmpeg/libavutil/hmac.c index 7d241fc7..302d7b04 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/hmac.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/hmac.c @@ -23,6 +23,7 @@ #include #include "attributes.h" +#include "error.h" #include "hmac.h" #include "md5.h" #include "sha.h" diff --git a/arm/raspi/third_party/ffmpeg/libavutil/hwcontext.c b/arm/raspi/third_party/ffmpeg/libavutil/hwcontext.c index 33965982..3650d465 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/hwcontext.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/hwcontext.c @@ -819,8 +819,7 @@ int av_hwframe_map(AVFrame *dst, const AVFrame *src, int flags) return AVERROR(EINVAL); } hwmap = (HWMapDescriptor*)src->buf[0]->data; - av_frame_unref(dst); - return av_frame_ref(dst, hwmap->source); + return av_frame_replace(dst, hwmap->source); } } @@ -950,6 +949,5 @@ fail: int ff_hwframe_map_replace(AVFrame *dst, const AVFrame *src) { HWMapDescriptor *hwmap = (HWMapDescriptor*)dst->buf[0]->data; - av_frame_unref(hwmap->source); - return av_frame_ref(hwmap->source, src); + return av_frame_replace(hwmap->source, src); } diff --git a/arm/raspi/third_party/ffmpeg/libavutil/hwcontext_cuda.c b/arm/raspi/third_party/ffmpeg/libavutil/hwcontext_cuda.c index 4b298fa9..0312d3b9 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/hwcontext_cuda.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/hwcontext_cuda.c @@ -290,7 +290,7 @@ static void cuda_device_uninit(AVHWDeviceContext *device_ctx) if (hwctx->internal->is_allocated && hwctx->cuda_ctx) { if (hwctx->internal->flags & AV_CUDA_USE_PRIMARY_CONTEXT) CHECK_CU(cu->cuDevicePrimaryCtxRelease(hwctx->internal->cuda_device)); - else + else if (!(hwctx->internal->flags & AV_CUDA_USE_CURRENT_CONTEXT)) CHECK_CU(cu->cuCtxDestroy(hwctx->cuda_ctx)); hwctx->cuda_ctx = NULL; @@ -361,6 +361,11 @@ static int cuda_context_init(AVHWDeviceContext *device_ctx, int flags) { hwctx->internal->cuda_device)); if (ret < 0) return ret; + } else if (flags & AV_CUDA_USE_CURRENT_CONTEXT) { + ret = CHECK_CU(cu->cuCtxGetCurrent(&hwctx->cuda_ctx)); + if (ret < 0) + return ret; + av_log(device_ctx, AV_LOG_INFO, "Using current CUDA context.\n"); } else { ret = CHECK_CU(cu->cuCtxCreate(&hwctx->cuda_ctx, desired_flags, hwctx->internal->cuda_device)); @@ -382,8 +387,21 @@ static int cuda_flags_from_opts(AVHWDeviceContext *device_ctx, AVDictionary *opts, int *flags) { AVDictionaryEntry *primary_ctx_opt = av_dict_get(opts, "primary_ctx", NULL, 0); + AVDictionaryEntry *current_ctx_opt = av_dict_get(opts, "current_ctx", NULL, 0); - if (primary_ctx_opt && strtol(primary_ctx_opt->value, NULL, 10)) { + int use_primary_ctx = 0, use_current_ctx = 0; + if (primary_ctx_opt) + use_primary_ctx = strtol(primary_ctx_opt->value, NULL, 10); + + if (current_ctx_opt) + use_current_ctx = strtol(current_ctx_opt->value, NULL, 10); + + if (use_primary_ctx && use_current_ctx) { + av_log(device_ctx, AV_LOG_ERROR, "Requested both primary and current CUDA context simultaneously.\n"); + return AVERROR(EINVAL); + } + + if (primary_ctx_opt && use_primary_ctx) { av_log(device_ctx, AV_LOG_VERBOSE, "Using CUDA primary device context\n"); *flags |= AV_CUDA_USE_PRIMARY_CONTEXT; } else if (primary_ctx_opt) { @@ -391,6 +409,14 @@ static int cuda_flags_from_opts(AVHWDeviceContext *device_ctx, *flags &= ~AV_CUDA_USE_PRIMARY_CONTEXT; } + if (current_ctx_opt && use_current_ctx) { + av_log(device_ctx, AV_LOG_VERBOSE, "Using CUDA current device context\n"); + *flags |= AV_CUDA_USE_CURRENT_CONTEXT; + } else if (current_ctx_opt) { + av_log(device_ctx, AV_LOG_VERBOSE, "Disabling use of CUDA current device context\n"); + *flags &= ~AV_CUDA_USE_CURRENT_CONTEXT; + } + return 0; } diff --git a/arm/raspi/third_party/ffmpeg/libavutil/hwcontext_cuda.h b/arm/raspi/third_party/ffmpeg/libavutil/hwcontext_cuda.h index cefbe0ce..cbad434f 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/hwcontext_cuda.h +++ b/arm/raspi/third_party/ffmpeg/libavutil/hwcontext_cuda.h @@ -62,6 +62,11 @@ typedef struct AVCUDADeviceContext { */ #define AV_CUDA_USE_PRIMARY_CONTEXT (1 << 0) +/** + * Use current device context instead of creating a new one. + */ +#define AV_CUDA_USE_CURRENT_CONTEXT (1 << 1) + /** * @} */ diff --git a/arm/raspi/third_party/ffmpeg/libavutil/hwcontext_d3d11va.c b/arm/raspi/third_party/ffmpeg/libavutil/hwcontext_d3d11va.c index aa50538d..cc8c97d2 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/hwcontext_d3d11va.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/hwcontext_d3d11va.c @@ -452,8 +452,8 @@ static int d3d11va_transfer_data(AVHWFramesContext *ctx, AVFrame *dst, fill_texture_ptrs(map_data, map_linesize, ctx, &desc, &map); - av_image_copy(dst->data, dst->linesize, (const uint8_t **)map_data, map_linesize, - ctx->sw_format, w, h); + av_image_copy2(dst->data, dst->linesize, map_data, map_linesize, + ctx->sw_format, w, h); ID3D11DeviceContext_Unmap(device_hwctx->device_context, staging, 0); } else { @@ -464,8 +464,8 @@ static int d3d11va_transfer_data(AVHWFramesContext *ctx, AVFrame *dst, fill_texture_ptrs(map_data, map_linesize, ctx, &desc, &map); - av_image_copy(map_data, map_linesize, (const uint8_t **)src->data, src->linesize, - ctx->sw_format, w, h); + av_image_copy2(map_data, map_linesize, src->data, src->linesize, + ctx->sw_format, w, h); ID3D11DeviceContext_Unmap(device_hwctx->device_context, staging, 0); diff --git a/arm/raspi/third_party/ffmpeg/libavutil/hwcontext_dxva2.c b/arm/raspi/third_party/ffmpeg/libavutil/hwcontext_dxva2.c index ea378df7..2c11f151 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/hwcontext_dxva2.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/hwcontext_dxva2.c @@ -356,8 +356,8 @@ static int dxva2_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst, if (ret < 0) goto fail; - av_image_copy(map->data, map->linesize, (const uint8_t **)src->data, src->linesize, - ctx->sw_format, src->width, src->height); + av_image_copy2(map->data, map->linesize, src->data, src->linesize, + ctx->sw_format, src->width, src->height); fail: av_frame_free(&map); diff --git a/arm/raspi/third_party/ffmpeg/libavutil/hwcontext_qsv.c b/arm/raspi/third_party/ffmpeg/libavutil/hwcontext_qsv.c index d4b564ba..1bfda9e6 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/hwcontext_qsv.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/hwcontext_qsv.c @@ -1902,7 +1902,7 @@ static int qsv_map_to(AVHWFramesContext *dst_ctx, case AV_PIX_FMT_VAAPI: { mfxHDLPair *pair = (mfxHDLPair*)hwctx->surfaces[i].Data.MemId; - if (*(VASurfaceID*)pair->first == (VASurfaceID)src->data[3]) { + if (*(VASurfaceID*)pair->first == (VASurfaceID)(uintptr_t)src->data[3]) { index = i; break; } diff --git a/arm/raspi/third_party/ffmpeg/libavutil/hwcontext_vaapi.c b/arm/raspi/third_party/ffmpeg/libavutil/hwcontext_vaapi.c index 6c3a227d..558fed94 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/hwcontext_vaapi.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/hwcontext_vaapi.c @@ -1048,6 +1048,9 @@ static const struct { #if defined(VA_FOURCC_Y412) && defined(DRM_FORMAT_XVYU12_16161616) DRM_MAP(Y412, 1, DRM_FORMAT_XVYU12_16161616), #endif +#if defined(VA_FOURCC_X2R10G10B10) && defined(DRM_FORMAT_XRGB2101010) + DRM_MAP(X2R10G10B10, 1, DRM_FORMAT_XRGB2101010), +#endif }; #undef DRM_MAP diff --git a/arm/raspi/third_party/ffmpeg/libavutil/hwcontext_vulkan.c b/arm/raspi/third_party/ffmpeg/libavutil/hwcontext_vulkan.c index 75314f14..c676f4fc 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/hwcontext_vulkan.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/hwcontext_vulkan.c @@ -99,6 +99,7 @@ typedef struct VulkanDevicePriv { VkPhysicalDeviceVulkan13Features device_features_1_3; VkPhysicalDeviceDescriptorBufferFeaturesEXT desc_buf_features; VkPhysicalDeviceShaderAtomicFloatFeaturesEXT atomic_float_features; + VkPhysicalDeviceCooperativeMatrixFeaturesKHR coop_matrix_features; /* Queues */ pthread_mutex_t **qf_mutex; @@ -405,6 +406,7 @@ static const VulkanOptExtension optional_device_exts[] = { { VK_EXT_DESCRIPTOR_BUFFER_EXTENSION_NAME, FF_VK_EXT_DESCRIPTOR_BUFFER, }, { VK_EXT_PHYSICAL_DEVICE_DRM_EXTENSION_NAME, FF_VK_EXT_DEVICE_DRM }, { VK_EXT_SHADER_ATOMIC_FLOAT_EXTENSION_NAME, FF_VK_EXT_ATOMIC_FLOAT }, + { VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME, FF_VK_EXT_COOP_MATRIX }, /* Imports/exports */ { VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME, FF_VK_EXT_EXTERNAL_FD_MEMORY }, @@ -1202,9 +1204,13 @@ static int vulkan_device_create_internal(AVHWDeviceContext *ctx, VkPhysicalDeviceTimelineSemaphoreFeatures timeline_features = { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES, }; + VkPhysicalDeviceCooperativeMatrixFeaturesKHR coop_matrix_features = { + .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR, + .pNext = &timeline_features, + }; VkPhysicalDeviceShaderAtomicFloatFeaturesEXT atomic_float_features = { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT, - .pNext = &timeline_features, + .pNext = &coop_matrix_features, }; VkPhysicalDeviceDescriptorBufferFeaturesEXT desc_buf_features = { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT, @@ -1242,7 +1248,9 @@ static int vulkan_device_create_internal(AVHWDeviceContext *ctx, p->desc_buf_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT; p->desc_buf_features.pNext = &p->atomic_float_features; p->atomic_float_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT; - p->atomic_float_features.pNext = NULL; + p->atomic_float_features.pNext = &p->coop_matrix_features; + p->coop_matrix_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR; + p->coop_matrix_features.pNext = NULL; ctx->free = vulkan_device_free; @@ -1304,6 +1312,8 @@ static int vulkan_device_create_internal(AVHWDeviceContext *ctx, p->atomic_float_features.shaderBufferFloat32Atomics = atomic_float_features.shaderBufferFloat32Atomics; p->atomic_float_features.shaderBufferFloat32AtomicAdd = atomic_float_features.shaderBufferFloat32AtomicAdd; + p->coop_matrix_features.cooperativeMatrix = coop_matrix_features.cooperativeMatrix; + dev_info.pNext = &hwctx->device_features; /* Setup queue family */ @@ -1768,19 +1778,18 @@ static void vulkan_free_internal(AVVkFrame *f) av_freep(&f->internal); } -static void vulkan_frame_free(void *opaque, uint8_t *data) +static void vulkan_frame_free(AVHWFramesContext *hwfc, AVVkFrame *f) { - AVVkFrame *f = (AVVkFrame *)data; - AVHWFramesContext *hwfc = opaque; AVVulkanDeviceContext *hwctx = hwfc->device_ctx->hwctx; VulkanDevicePriv *p = hwfc->device_ctx->internal->priv; FFVulkanFunctions *vk = &p->vkctx.vkfn; int nb_images = ff_vk_count_images(f); VkSemaphoreWaitInfo sem_wait = { - .sType = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO, - .pSemaphores = f->sem, - .pValues = f->sem_value, + .sType = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO, + .flags = 0x0, + .pSemaphores = f->sem, + .pValues = f->sem_value, .semaphoreCount = nb_images, }; @@ -1797,6 +1806,11 @@ static void vulkan_frame_free(void *opaque, uint8_t *data) av_free(f); } +static void vulkan_frame_free_cb(void *opaque, uint8_t *data) +{ + vulkan_frame_free(opaque, (AVVkFrame*)data); +} + static int alloc_bind_mem(AVHWFramesContext *hwfc, AVVkFrame *f, void *alloc_pnext, size_t alloc_pnext_stride) { @@ -2077,7 +2091,7 @@ static int create_frame(AVHWFramesContext *hwfc, AVVkFrame **frame, return 0; fail: - vulkan_frame_free(hwfc, (uint8_t *)f); + vulkan_frame_free(hwfc, f); return err; } @@ -2179,7 +2193,8 @@ static AVBufferRef *vulkan_pool_alloc(void *opaque, size_t size) } err = create_frame(hwfc, &f, hwctx->tiling, hwctx->usage, hwctx->img_flags, - hwctx->nb_layers, eiinfo.handleTypes ? &eiinfo : NULL); + hwctx->nb_layers, + eiinfo.handleTypes ? &eiinfo : hwctx->create_pnext); if (err) return NULL; @@ -2198,14 +2213,14 @@ static AVBufferRef *vulkan_pool_alloc(void *opaque, size_t size) goto fail; avbuf = av_buffer_create((uint8_t *)f, sizeof(AVVkFrame), - vulkan_frame_free, hwfc, 0); + vulkan_frame_free_cb, hwfc, 0); if (!avbuf) goto fail; return avbuf; fail: - vulkan_frame_free(hwfc, (uint8_t *)f); + vulkan_frame_free(hwfc, f); return NULL; } @@ -2346,7 +2361,7 @@ static int vulkan_frames_init(AVHWFramesContext *hwfc) if (err) return err; - vulkan_frame_free(hwfc, (uint8_t *)f); + vulkan_frame_free(hwfc, f); /* If user did not specify a pool, hwfc->pool will be set to the internal one * in hwcontext.c just after this gets called */ @@ -2393,31 +2408,7 @@ static int vulkan_transfer_get_formats(AVHWFramesContext *hwfc, #if CONFIG_LIBDRM static void vulkan_unmap_from_drm(AVHWFramesContext *hwfc, HWMapDescriptor *hwmap) { - AVVkFrame *f = hwmap->priv; - AVVulkanDeviceContext *hwctx = hwfc->device_ctx->hwctx; - VulkanDevicePriv *p = hwfc->device_ctx->internal->priv; - FFVulkanFunctions *vk = &p->vkctx.vkfn; - const int nb_images = ff_vk_count_images(f); - - VkSemaphoreWaitInfo wait_info = { - .sType = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO, - .flags = 0x0, - .pSemaphores = f->sem, - .pValues = f->sem_value, - .semaphoreCount = nb_images, - }; - - vk->WaitSemaphores(hwctx->act_dev, &wait_info, UINT64_MAX); - - vulkan_free_internal(f); - - for (int i = 0; i < nb_images; i++) { - vk->DestroyImage(hwctx->act_dev, f->img[i], hwctx->alloc); - vk->FreeMemory(hwctx->act_dev, f->mem[i], hwctx->alloc); - vk->DestroySemaphore(hwctx->act_dev, f->sem[i], hwctx->alloc); - } - - av_free(f); + vulkan_frame_free(hwfc, hwmap->priv); } static const struct { @@ -2755,7 +2746,7 @@ static int vulkan_map_from_drm(AVHWFramesContext *hwfc, AVFrame *dst, return 0; fail: - vulkan_frame_free(hwfc->device_ctx->hwctx, (uint8_t *)f); + vulkan_frame_free(hwfc->device_ctx->hwctx, f); dst->data[0] = NULL; return err; } @@ -3054,7 +3045,6 @@ static int vulkan_transfer_data_from_cuda(AVHWFramesContext *hwfc, fail: CHECK_CU(cu->cuCtxPopCurrent(&dummy)); vulkan_free_internal(dst_f); - dst_f->internal = NULL; av_buffer_unref(&dst->buf[0]); return err; } @@ -3631,7 +3621,6 @@ static int vulkan_transfer_data_to_cuda(AVHWFramesContext *hwfc, AVFrame *dst, fail: CHECK_CU(cu->cuCtxPopCurrent(&dummy)); vulkan_free_internal(dst_f); - dst_f->internal = NULL; av_buffer_unref(&dst->buf[0]); return err; } diff --git a/arm/raspi/third_party/ffmpeg/libavutil/imgutils.c b/arm/raspi/third_party/ffmpeg/libavutil/imgutils.c index 9ab5757c..da381269 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/imgutils.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/imgutils.c @@ -378,8 +378,8 @@ void av_image_copy_plane(uint8_t *dst, int dst_linesize, image_copy_plane(dst, dst_linesize, src, src_linesize, bytewidth, height); } -static void image_copy(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4], - const uint8_t *src_data[4], const ptrdiff_t src_linesizes[4], +static void image_copy(uint8_t *const dst_data[4], const ptrdiff_t dst_linesizes[4], + const uint8_t *const src_data[4], const ptrdiff_t src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height, void (*copy_plane)(uint8_t *, ptrdiff_t, const uint8_t *, ptrdiff_t, ptrdiff_t, int)) @@ -419,8 +419,8 @@ static void image_copy(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4], } } -void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], - const uint8_t *src_data[4], const int src_linesizes[4], +void av_image_copy(uint8_t *const dst_data[4], const int dst_linesizes[4], + const uint8_t * const src_data[4], const int src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height) { ptrdiff_t dst_linesizes1[4], src_linesizes1[4]; @@ -435,8 +435,8 @@ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], width, height, image_copy_plane); } -void av_image_copy_uc_from(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4], - const uint8_t *src_data[4], const ptrdiff_t src_linesizes[4], +void av_image_copy_uc_from(uint8_t * const dst_data[4], const ptrdiff_t dst_linesizes[4], + const uint8_t * const src_data[4], const ptrdiff_t src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height) { image_copy(dst_data, dst_linesizes, src_data, src_linesizes, pix_fmt, @@ -579,7 +579,7 @@ static void memset_bytes(uint8_t *dst, size_t dst_size, uint8_t *clear, // if it's a subsampled packed format). #define MAX_BLOCK_SIZE 32 -int av_image_fill_black(uint8_t *dst_data[4], const ptrdiff_t dst_linesize[4], +int av_image_fill_black(uint8_t * const dst_data[4], const ptrdiff_t dst_linesize[4], enum AVPixelFormat pix_fmt, enum AVColorRange range, int width, int height) { diff --git a/arm/raspi/third_party/ffmpeg/libavutil/imgutils.h b/arm/raspi/third_party/ffmpeg/libavutil/imgutils.h index e10ac149..fa3bb101 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/imgutils.h +++ b/arm/raspi/third_party/ffmpeg/libavutil/imgutils.h @@ -170,10 +170,26 @@ void av_image_copy_plane_uc_from(uint8_t *dst, ptrdiff_t dst_linesize, * @param width width of the image in pixels * @param height height of the image in pixels */ -void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], - const uint8_t *src_data[4], const int src_linesizes[4], +void av_image_copy(uint8_t * const dst_data[4], const int dst_linesizes[4], + const uint8_t * const src_data[4], const int src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height); +/** + * Wrapper around av_image_copy() to workaround the limitation + * that the conversion from uint8_t * const * to const uint8_t * const * + * is not performed automatically in C. + * @see av_image_copy() + */ +static inline +void av_image_copy2(uint8_t * const dst_data[4], const int dst_linesizes[4], + uint8_t * const src_data[4], const int src_linesizes[4], + enum AVPixelFormat pix_fmt, int width, int height) +{ + av_image_copy(dst_data, dst_linesizes, + (const uint8_t * const *)src_data, src_linesizes, + pix_fmt, width, height); +} + /** * Copy image data located in uncacheable (e.g. GPU mapped) memory. Where * available, this function will use special functionality for reading from such @@ -188,8 +204,8 @@ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], * @note On x86, the linesizes currently need to be aligned to the cacheline * size (i.e. 64) to get improved performance. */ -void av_image_copy_uc_from(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4], - const uint8_t *src_data[4], const ptrdiff_t src_linesizes[4], +void av_image_copy_uc_from(uint8_t * const dst_data[4], const ptrdiff_t dst_linesizes[4], + const uint8_t * const src_data[4], const ptrdiff_t src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height); /** @@ -319,7 +335,7 @@ int av_image_check_sar(unsigned int w, unsigned int h, AVRational sar); * @param height the height of the image in pixels * @return 0 if the image data was cleared, a negative AVERROR code otherwise */ -int av_image_fill_black(uint8_t *dst_data[4], const ptrdiff_t dst_linesize[4], +int av_image_fill_black(uint8_t * const dst_data[4], const ptrdiff_t dst_linesize[4], enum AVPixelFormat pix_fmt, enum AVColorRange range, int width, int height); diff --git a/arm/raspi/third_party/ffmpeg/libavutil/internal.h b/arm/raspi/third_party/ffmpeg/libavutil/internal.h index a71c39e0..d612acd2 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/internal.h +++ b/arm/raspi/third_party/ffmpeg/libavutil/internal.h @@ -43,14 +43,6 @@ #include "macros.h" #include "pixfmt.h" -#if ARCH_X86 -# include "x86/emms.h" -#endif - -#ifndef emms_c -# define emms_c() do {} while(0) -#endif - #ifndef attribute_align_arg #if ARCH_X86_32 && AV_GCC_VERSION_AT_LEAST(4,2) # define attribute_align_arg __attribute__((force_align_arg_pointer)) diff --git a/arm/raspi/third_party/ffmpeg/libavutil/intreadwrite.h b/arm/raspi/third_party/ffmpeg/libavutil/intreadwrite.h index 4c8413a5..21df7887 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/intreadwrite.h +++ b/arm/raspi/third_party/ffmpeg/libavutil/intreadwrite.h @@ -72,8 +72,6 @@ typedef union { # include "mips/intreadwrite.h" #elif ARCH_PPC # include "ppc/intreadwrite.h" -#elif ARCH_TOMI -# include "tomi/intreadwrite.h" #elif ARCH_X86 # include "x86/intreadwrite.h" #endif @@ -215,7 +213,7 @@ typedef union { * by per-arch headers. */ -#if defined(__GNUC__) +#if defined(__GNUC__) || defined(__clang__) union unaligned_64 { uint64_t l; } __attribute__((packed)) av_alias; union unaligned_32 { uint32_t l; } __attribute__((packed)) av_alias; diff --git a/arm/raspi/third_party/ffmpeg/libavutil/md5.c b/arm/raspi/third_party/ffmpeg/libavutil/md5.c index 0170d8dd..c01820da 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/md5.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/md5.c @@ -31,9 +31,11 @@ */ #include +#include #include "bswap.h" #include "intreadwrite.h" +#include "macros.h" #include "mem.h" #include "md5.h" diff --git a/arm/raspi/third_party/ffmpeg/libavutil/mem.h b/arm/raspi/third_party/ffmpeg/libavutil/mem.h index 62b4ca6e..ab7648ac 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/mem.h +++ b/arm/raspi/third_party/ffmpeg/libavutil/mem.h @@ -27,12 +27,10 @@ #ifndef AVUTIL_MEM_H #define AVUTIL_MEM_H -#include +#include #include #include "attributes.h" -#include "avutil.h" -#include "version.h" /** * @addtogroup lavu_mem diff --git a/arm/raspi/third_party/ffmpeg/libavutil/murmur3.c b/arm/raspi/third_party/ffmpeg/libavutil/murmur3.c index f2e2a9ea..c88a236a 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/murmur3.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/murmur3.c @@ -20,6 +20,7 @@ #include #include +#include #include "mem.h" #include "intreadwrite.h" #include "murmur3.h" diff --git a/arm/raspi/third_party/ffmpeg/libavutil/pixdesc.c b/arm/raspi/third_party/ffmpeg/libavutil/pixdesc.c index e1e0dd2a..6ded9467 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/pixdesc.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/pixdesc.c @@ -2223,6 +2223,34 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { }, .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE, }, + [AV_PIX_FMT_GBRAP14LE] = { + .name = "gbrap14le", + .nb_components = 4, + .log2_chroma_w = 0, + .log2_chroma_h = 0, + .comp = { + { 2, 2, 0, 0, 14 }, /* R */ + { 0, 2, 0, 0, 14 }, /* G */ + { 1, 2, 0, 0, 14 }, /* B */ + { 3, 2, 0, 0, 14 }, /* A */ + }, + .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB | + AV_PIX_FMT_FLAG_ALPHA, + }, + [AV_PIX_FMT_GBRAP14BE] = { + .name = "gbrap14be", + .nb_components = 4, + .log2_chroma_w = 0, + .log2_chroma_h = 0, + .comp = { + { 2, 2, 0, 0, 14 }, /* R */ + { 0, 2, 0, 0, 14 }, /* G */ + { 1, 2, 0, 0, 14 }, /* B */ + { 3, 2, 0, 0, 14 }, /* A */ + }, + .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | + AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA, + }, [AV_PIX_FMT_GBRAP12LE] = { .name = "gbrap12le", .nb_components = 4, diff --git a/arm/raspi/third_party/ffmpeg/libavutil/pixfmt.h b/arm/raspi/third_party/ffmpeg/libavutil/pixfmt.h index 63e07ba6..a26c72d5 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/pixfmt.h +++ b/arm/raspi/third_party/ffmpeg/libavutil/pixfmt.h @@ -426,6 +426,9 @@ enum AVPixelFormat { AV_PIX_FMT_P412BE, ///< interleaved chroma YUV 4:4:4, 36bpp, data in the high bits, big-endian AV_PIX_FMT_P412LE, ///< interleaved chroma YUV 4:4:4, 36bpp, data in the high bits, little-endian + AV_PIX_FMT_GBRAP14BE, ///< planar GBR 4:4:4:4 56bpp, big-endian + AV_PIX_FMT_GBRAP14LE, ///< planar GBR 4:4:4:4 56bpp, little-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 }; @@ -484,6 +487,7 @@ enum AVPixelFormat { #define AV_PIX_FMT_GBRP16 AV_PIX_FMT_NE(GBRP16BE, GBRP16LE) #define AV_PIX_FMT_GBRAP10 AV_PIX_FMT_NE(GBRAP10BE, GBRAP10LE) #define AV_PIX_FMT_GBRAP12 AV_PIX_FMT_NE(GBRAP12BE, GBRAP12LE) +#define AV_PIX_FMT_GBRAP14 AV_PIX_FMT_NE(GBRAP14BE, GBRAP14LE) #define AV_PIX_FMT_GBRAP16 AV_PIX_FMT_NE(GBRAP16BE, GBRAP16LE) #define AV_PIX_FMT_BAYER_BGGR16 AV_PIX_FMT_NE(BAYER_BGGR16BE, BAYER_BGGR16LE) diff --git a/arm/raspi/third_party/ffmpeg/libavutil/riscv/bswap_rvb.S b/arm/raspi/third_party/ffmpeg/libavutil/riscv/bswap_rvb.S new file mode 100644 index 00000000..3ff53ccb --- /dev/null +++ b/arm/raspi/third_party/ffmpeg/libavutil/riscv/bswap_rvb.S @@ -0,0 +1,65 @@ +/* + * Copyright © 2022 Rémi Denis-Courmont. + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#if (__riscv_xlen >= 64) + .macro bswap32_rvb out, in, count + andi t0, \count, 4 + beqz t0, 1f + /* Align input to 64-bit */ + lwu t0, (\in) + addi \out, \out, 4 + rev8 t0, t0 + addi \count, \count, -1 + srli t0, t0, __riscv_xlen - 32 + addi \in, \in, 4 + sw t0, -4(\out) +1: + andi t3, \count, -2 + sh2add \count, \count, \out + beqz t3, 3f + sh2add t3, t3, \out +2: /* 2 elements (64 bits) at a time on a 64-bit boundary */ + ld t0, (\in) + addi \out, \out, 8 + rev8 t0, t0 +#if (__riscv_xlen == 64) + srli t2, t0, 32 + sw t0, -4(\out) +#else + srli t1, t0, __riscv_xlen - 64 + srli t2, t0, __riscv_xlen - 32 + sw t1, -4(\out) +#endif + addi \in, \in, 8 + sw t2, -8(\out) + bne \out, t3, 2b +3: + beq \out, \count, 5f +4: /* Process last element */ + lwu t0, (\in) + addi \out, \out, 4 + rev8 t0, t0 + addi \in, \in, 4 + srli t0, t0, __riscv_xlen - 32 + sw t0, -4(\out) +5: + ret + .endm +#endif diff --git a/arm/raspi/third_party/ffmpeg/libavutil/riscv/float_dsp_rvv.S b/arm/raspi/third_party/ffmpeg/libavutil/riscv/float_dsp_rvv.S index 7cfc890b..91b70bf1 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/riscv/float_dsp_rvv.S +++ b/arm/raspi/third_party/ffmpeg/libavutil/riscv/float_dsp_rvv.S @@ -75,32 +75,37 @@ endfunc func ff_vector_fmul_window_rvv, zve32f // a0: dst, a1: src0, a2: src1, a3: window, a4: length - addi t0, a4, -1 - add t1, t0, a4 - sh2add a2, t0, a2 - sh2add t0, t1, a0 - sh2add t3, t1, a3 - li t1, -4 // byte stride + vsetvli t0, zero, e16, m4, ta, ma + sh2add a2, a4, a2 + vid.v v0 + sh3add t3, a4, a3 + vadd.vi v0, v0, 1 + sh3add t0, a4, a0 1: - vsetvli t2, a4, e32, m4, ta, ma - vle32.v v16, (a1) + vsetvli t2, a4, e16, m2, ta, ma slli t4, t2, 2 - vlse32.v v20, (a2), t1 - sub a4, a4, t2 - vle32.v v24, (a3) - add a1, a1, t4 - vlse32.v v28, (t3), t1 - sub a2, a2, t4 - vfmul.vv v0, v16, v28 - add a3, a3, t4 - vfmul.vv v8, v16, v24 + vrsub.vx v2, v0, t2 sub t3, t3, t4 - vfnmsac.vv v0, v20, v24 - vfmacc.vv v8, v20, v28 - vse32.v v0, (a0) - add a0, a0, t4 - vsse32.v v8, (t0), t1 + vsetvli zero, zero, e32, m4, ta, ma + sub a2, a2, t4 + vle32.v v8, (t3) sub t0, t0, t4 + vle32.v v4, (a2) + sub a4, a4, t2 + vrgatherei16.vv v28, v8, v2 + vle32.v v16, (a1) + add a1, a1, t4 + vrgatherei16.vv v20, v4, v2 + vle32.v v24, (a3) + add a3, a3, t4 + vfmul.vv v12, v16, v28 + vfmul.vv v16, v16, v24 + vfnmsac.vv v12, v20, v24 + vfmacc.vv v16, v20, v28 + vrgatherei16.vv v8, v16, v2 + vse32.v v12, (a0) + add a0, a0, t4 + vse32.v v8, (t0) bnez a4, 1b ret @@ -125,20 +130,25 @@ func ff_vector_fmul_add_rvv, zve32f ret endfunc +// TODO factor vrsub, separate last iteration? // (a0) = (a1) * reverse(a2) [0..a3-1] func ff_vector_fmul_reverse_rvv, zve32f + vsetvli t0, zero, e16, m4, ta, ma sh2add a2, a3, a2 - li t2, -4 // byte stride - addi a2, a2, -4 + vid.v v0 + vadd.vi v0, v0, 1 1: - vsetvli t0, a3, e32, m8, ta, ma + vsetvli t0, a3, e16, m4, ta, ma slli t1, t0, 2 - vle32.v v16, (a1) - sub a3, a3, t0 - vlse32.v v24, (a2), t2 - add a1, a1, t1 - vfmul.vv v16, v16, v24 + vrsub.vx v4, v0, t0 // v4[i] = [VL-1, VL-2... 1, 0] sub a2, a2, t1 + vsetvli zero, zero, e32, m8, ta, ma + vle32.v v8, (a2) + sub a3, a3, t0 + vle32.v v16, (a1) + add a1, a1, t1 + vrgatherei16.vv v24, v8, v4 // v24 = reverse(v8) + vfmul.vv v16, v16, v24 vse32.v v16, (a0) add a0, a0, t1 bnez a3, 1b diff --git a/arm/raspi/third_party/ffmpeg/libavutil/riscv/timer.h b/arm/raspi/third_party/ffmpeg/libavutil/riscv/timer.h index a34157a5..174b469c 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/riscv/timer.h +++ b/arm/raspi/third_party/ffmpeg/libavutil/riscv/timer.h @@ -24,21 +24,21 @@ #if HAVE_INLINE_ASM #include -static inline uint64_t rdcycle64(void) +static inline uint64_t ff_read_time(void) { #if (__riscv_xlen >= 64) uintptr_t cycles; - __asm__ volatile ("rdcycle %0" : "=r"(cycles)); + __asm__ volatile ("rdtime %0" : "=r" (cycles)); #else uint64_t cycles; uint32_t hi, lo, check; __asm__ volatile ( - "1: rdcycleh %0\n" - " rdcycle %1\n" - " rdcycleh %2\n" + "1: rdtimeh %0\n" + " rdtime %1\n" + " rdtimeh %2\n" " bne %0, %2, 1b\n" : "=r" (hi), "=r" (lo), "=r" (check)); cycles = (((uint64_t)hi) << 32) | lo; @@ -47,7 +47,8 @@ static inline uint64_t rdcycle64(void) return cycles; } -#define AV_READ_TIME rdcycle64 +#define AV_READ_TIME ff_read_time +#define FF_TIMER_UNITS "ticks" #endif #endif /* AVUTIL_RISCV_TIMER_H */ diff --git a/arm/raspi/third_party/ffmpeg/libavutil/samplefmt.c b/arm/raspi/third_party/ffmpeg/libavutil/samplefmt.c index 6d3ec34d..e1be5f05 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/samplefmt.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/samplefmt.c @@ -219,7 +219,7 @@ int av_samples_alloc_array_and_samples(uint8_t ***audio_data, int *linesize, int return ret; } -int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset, +int av_samples_copy(uint8_t * const *dst, uint8_t * const *src, int dst_offset, int src_offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt) { @@ -243,7 +243,7 @@ int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset, return 0; } -int av_samples_set_silence(uint8_t **audio_data, int offset, int nb_samples, +int av_samples_set_silence(uint8_t * const *audio_data, int offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt) { int planar = av_sample_fmt_is_planar(sample_fmt); diff --git a/arm/raspi/third_party/ffmpeg/libavutil/samplefmt.h b/arm/raspi/third_party/ffmpeg/libavutil/samplefmt.h index 6bad0e25..43a57a42 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/samplefmt.h +++ b/arm/raspi/third_party/ffmpeg/libavutil/samplefmt.h @@ -246,7 +246,7 @@ int av_samples_alloc_array_and_samples(uint8_t ***audio_data, int *linesize, int * @param nb_channels number of audio channels * @param sample_fmt audio sample format */ -int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset, +int av_samples_copy(uint8_t * const *dst, uint8_t * const *src, int dst_offset, int src_offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt); @@ -259,7 +259,7 @@ int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset, * @param nb_channels number of audio channels * @param sample_fmt audio sample format */ -int av_samples_set_silence(uint8_t **audio_data, int offset, int nb_samples, +int av_samples_set_silence(uint8_t * const *audio_data, int offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt); /** diff --git a/arm/raspi/third_party/ffmpeg/libavutil/spherical.c b/arm/raspi/third_party/ffmpeg/libavutil/spherical.c index ed66344a..800d3459 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/spherical.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/spherical.c @@ -19,6 +19,7 @@ */ #include "avstring.h" +#include "macros.h" #include "mem.h" #include "spherical.h" diff --git a/arm/raspi/third_party/ffmpeg/libavutil/tests/channel_layout.c b/arm/raspi/third_party/ffmpeg/libavutil/tests/channel_layout.c index 5516db09..c537e7e7 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/tests/channel_layout.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/tests/channel_layout.c @@ -18,33 +18,111 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "libavutil/channel_layout.c" +#include +#include +#include + +#include "libavutil/bprint.h" +#include "libavutil/channel_layout.h" +#include "libavutil/internal.h" +#include "libavutil/mem.h" + +#define BPRINT_ARGS1(bp, ...) (bp), __VA_ARGS__ +#define BPRINT_ARGS0(bp, ...) __VA_ARGS__, (bp) +#define ORD_ARGS1(str, size, ...) (str), (size), __VA_ARGS__ +#define ORD_ARGS0(str, size, ...) __VA_ARGS__, (str), (size) + +// This macro presumes the AVBPrint to have been cleared before usage. +#define CMP_BPRINT_AND_NONBPRINT(bp, func_name, ARG_ORDER, ...) do { \ + char *str; \ + int size; \ + func_name ## _bprint(BPRINT_ARGS ## ARG_ORDER((bp), __VA_ARGS__)); \ + if (strlen((bp)->str) != (bp)->len) { \ + printf("strlen of AVBPrint-string returned by "#func_name"_bprint" \ + " differs from AVBPrint.len: %"SIZE_SPECIFIER" vs. %u\n", \ + strlen((bp)->str), (bp)->len); \ + break; \ + } \ + size = func_name(ORD_ARGS ## ARG_ORDER(NULL, 0, __VA_ARGS__)); \ + if (size <= 0) { \ + printf(#func_name " returned %d\n", size); \ + break; \ + } \ + if ((bp)->len != size - 1) { \ + printf("Return value %d of " #func_name " inconsistent with length"\ + " %u obtained from corresponding bprint version\n", \ + size, (bp)->len); \ + break; \ + } \ + str = av_malloc(size); \ + if (!str) { \ + printf("string of size %d could not be allocated.\n", size); \ + break; \ + } \ + size = func_name(ORD_ARGS ## ARG_ORDER(str, size, __VA_ARGS__)); \ + if (size <= 0 || (bp)->len != size - 1) { \ + printf("Return value %d of " #func_name " inconsistent with length"\ + " %d obtained in first pass.\n", size, (bp)->len); \ + av_free(str); \ + break; \ + } \ + if (strcmp(str, (bp)->str)) { \ + printf("Ordinary and _bprint versions of "#func_name" disagree: " \ + "'%s' vs. '%s'\n", str, (bp)->str); \ + av_free(str); \ + break; \ + } \ + av_free(str); \ + } while (0) + + +static void channel_name(AVBPrint *bp, enum AVChannel channel) +{ + av_bprint_clear(bp); + CMP_BPRINT_AND_NONBPRINT(bp, av_channel_name, 1, channel); +} + +static void channel_description(AVBPrint *bp, enum AVChannel channel) +{ + av_bprint_clear(bp); + CMP_BPRINT_AND_NONBPRINT(bp, av_channel_description, 1, channel); +} + +static void channel_layout_from_mask(AVChannelLayout *layout, + AVBPrint *bp, uint64_t channel_layout) +{ + av_channel_layout_uninit(layout); + av_bprint_clear(bp); + if (!av_channel_layout_from_mask(layout, channel_layout) && + av_channel_layout_check(layout)) + CMP_BPRINT_AND_NONBPRINT(bp, av_channel_layout_describe, 0, layout); + else + av_bprintf(bp, "fail"); +} + +static void channel_layout_from_string(AVChannelLayout *layout, + AVBPrint *bp, const char *channel_layout) +{ + av_channel_layout_uninit(layout); + av_bprint_clear(bp); + if (!av_channel_layout_from_string(layout, channel_layout) && + av_channel_layout_check(layout)) + CMP_BPRINT_AND_NONBPRINT(bp, av_channel_layout_describe, 0, layout); + else + av_bprintf(bp, "fail"); +} #define CHANNEL_NAME(x) \ - av_bprint_clear(&bp); \ - av_channel_name_bprint(&bp, x); + channel_name(&bp, (x)); #define CHANNEL_DESCRIPTION(x) \ - av_bprint_clear(&bp); \ - av_channel_description_bprint(&bp, x); + channel_description(&bp, (x)); #define CHANNEL_LAYOUT_FROM_MASK(x) \ - av_channel_layout_uninit(&layout); \ - av_bprint_clear(&bp); \ - if (!av_channel_layout_from_mask(&layout, x) && \ - av_channel_layout_check(&layout)) \ - av_channel_layout_describe_bprint(&layout, &bp); \ - else \ - av_bprintf(&bp, "fail"); + channel_layout_from_mask(&layout, &bp, (x)); #define CHANNEL_LAYOUT_FROM_STRING(x) \ - av_channel_layout_uninit(&layout); \ - av_bprint_clear(&bp); \ - if (!av_channel_layout_from_string(&layout, x) && \ - av_channel_layout_check(&layout)) \ - av_channel_layout_describe_bprint(&layout, &bp); \ - else \ - av_bprintf(&bp, "fail"); + channel_layout_from_string(&layout, &bp, (x)); #define CHANNEL_LAYOUT_CHANNEL_FROM_INDEX(x) \ ret = av_channel_layout_channel_from_index(&layout, x); \ @@ -72,7 +150,7 @@ int main(void) { const AVChannelLayout *playout; - AVChannelLayout layout = { 0 }; + AVChannelLayout layout = { 0 }, layout2 = { 0 }; AVBPrint bp; void *iter = NULL; uint64_t mask; @@ -246,6 +324,15 @@ int main(void) CHANNEL_LAYOUT_FROM_STRING("FR+FL@Foo+USR63@Foo"); printf("With \"FR+FL@Foo+USR63@Foo\": %33s\n", bp.str); + ret = av_channel_layout_copy(&layout2, &layout); + if (ret < 0) { + printf("Copying channel layout \"FR+FL@Foo+USR63@Foo\" failed; " + "ret %d\n", ret); + } + ret = av_channel_layout_compare(&layout, &layout2); + if (ret) + printf("Channel layout and its copy compare unequal; ret: %d\n", ret); + printf("\nTesting av_channel_layout_index_from_string\n"); CHANNEL_LAYOUT_INDEX_FROM_STRING("FR"); printf("On \"FR+FL@Foo+USR63@Foo\" layout with \"FR\": %18d\n", ret); @@ -347,6 +434,7 @@ int main(void) printf("On \"ambisonic 2+stereo\" layout with AV_CH_LAYOUT_QUAD: 0x%"PRIx64"\n", mask); av_channel_layout_uninit(&layout); + av_channel_layout_uninit(&layout2); av_bprint_finalize(&bp, NULL); return 0; diff --git a/arm/raspi/third_party/ffmpeg/libavutil/tests/lzo.c b/arm/raspi/third_party/ffmpeg/libavutil/tests/lzo.c index a5655dbf..d7a78a16 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/tests/lzo.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/tests/lzo.c @@ -19,6 +19,8 @@ */ #include +#include +#include #include #include "libavutil/log.h" diff --git a/arm/raspi/third_party/ffmpeg/libavutil/tests/murmur3.c b/arm/raspi/third_party/ffmpeg/libavutil/tests/murmur3.c index b8d6b1fe..7a793dac 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/tests/murmur3.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/tests/murmur3.c @@ -18,6 +18,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include +#include + #include "libavutil/intreadwrite.h" #include "libavutil/mem.h" #include "libavutil/murmur3.h" diff --git a/arm/raspi/third_party/ffmpeg/libavutil/tests/pixdesc.c b/arm/raspi/third_party/ffmpeg/libavutil/tests/pixdesc.c index 34e2bea9..b13aba59 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/tests/pixdesc.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/tests/pixdesc.c @@ -19,6 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/log.h" #include "libavutil/pixdesc.c" int main(void){ diff --git a/arm/raspi/third_party/ffmpeg/libavutil/thread.h b/arm/raspi/third_party/ffmpeg/libavutil/thread.h index 2f5e7e1c..2ded498c 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/thread.h +++ b/arm/raspi/third_party/ffmpeg/libavutil/thread.h @@ -163,6 +163,15 @@ static inline int strict_pthread_once(pthread_once_t *once_control, void (*init_ #define ff_mutex_unlock pthread_mutex_unlock #define ff_mutex_destroy pthread_mutex_destroy +#define AVCond pthread_cond_t + +#define ff_cond_init pthread_cond_init +#define ff_cond_destroy pthread_cond_destroy +#define ff_cond_signal pthread_cond_signal +#define ff_cond_broadcast pthread_cond_broadcast +#define ff_cond_wait pthread_cond_wait +#define ff_cond_timedwait pthread_cond_timedwait + #define AVOnce pthread_once_t #define AV_ONCE_INIT PTHREAD_ONCE_INIT @@ -178,6 +187,16 @@ static inline int ff_mutex_lock(AVMutex *mutex){ return 0; } static inline int ff_mutex_unlock(AVMutex *mutex){ return 0; } static inline int ff_mutex_destroy(AVMutex *mutex){ return 0; } +#define AVCond char + +static inline int ff_cond_init(AVCond *cond, const void *attr){ return 0; } +static inline int ff_cond_destroy(AVCond *cond){ return 0; } +static inline int ff_cond_signal(AVCond *cond){ return 0; } +static inline int ff_cond_broadcast(AVCond *cond){ return 0; } +static inline int ff_cond_wait(AVCond *cond, AVMutex *mutex){ return 0; } +static inline int ff_cond_timedwait(AVCond *cond, AVMutex *mutex, + const void *abstime){ return 0; } + #define AVOnce char #define AV_ONCE_INIT 0 diff --git a/arm/raspi/third_party/ffmpeg/libavutil/threadmessage.c b/arm/raspi/third_party/ffmpeg/libavutil/threadmessage.c index f0e23f28..20b38820 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/threadmessage.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/threadmessage.c @@ -19,6 +19,9 @@ */ #include +#include + +#include "error.h" #include "fifo.h" #include "mem.h" #include "threadmessage.h" diff --git a/arm/raspi/third_party/ffmpeg/libavutil/timer.h b/arm/raspi/third_party/ffmpeg/libavutil/timer.h index 861ba7e9..2cd299ec 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/timer.h +++ b/arm/raspi/third_party/ffmpeg/libavutil/timer.h @@ -105,9 +105,9 @@ #if CONFIG_LINUX_PERF #define START_TIMER \ - static int linux_perf_fd; \ + static int linux_perf_fd = -1; \ uint64_t tperf; \ - if (!linux_perf_fd) { \ + if (linux_perf_fd == -1) { \ struct perf_event_attr attr = { \ .type = PERF_TYPE_HARDWARE, \ .size = sizeof(struct perf_event_attr), \ diff --git a/arm/raspi/third_party/ffmpeg/libavutil/timestamp.h b/arm/raspi/third_party/ffmpeg/libavutil/timestamp.h index e082f01b..9ae64da8 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/timestamp.h +++ b/arm/raspi/third_party/ffmpeg/libavutil/timestamp.h @@ -24,7 +24,7 @@ #ifndef AVUTIL_TIMESTAMP_H #define AVUTIL_TIMESTAMP_H -#include "common.h" +#include "avutil.h" #if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS) && !defined(PRId64) #error missing -D__STDC_FORMAT_MACROS / #define __STDC_FORMAT_MACROS diff --git a/arm/raspi/third_party/ffmpeg/libavutil/tx.c b/arm/raspi/third_party/ffmpeg/libavutil/tx.c index 52e8685b..0abfbe0e 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/tx.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/tx.c @@ -439,7 +439,9 @@ int ff_tx_decompose_length(int dst[TX_MAX_DECOMPOSITIONS], enum AVTXType type, /* Check direction for non-orthogonal codelets */ if (((cd->flags & FF_TX_FORWARD_ONLY) && inv) || - ((cd->flags & (FF_TX_INVERSE_ONLY | AV_TX_FULL_IMDCT)) && !inv)) + ((cd->flags & (FF_TX_INVERSE_ONLY | AV_TX_FULL_IMDCT)) && !inv) || + ((cd->flags & (FF_TX_FORWARD_ONLY | AV_TX_REAL_TO_REAL)) && inv) || + ((cd->flags & (FF_TX_FORWARD_ONLY | AV_TX_REAL_TO_IMAGINARY)) && inv)) continue; /* Check if the CPU supports the required ISA */ @@ -562,6 +564,10 @@ static void print_flags(AVBPrint *bp, uint64_t f) av_bprintf(bp, "%spreshuf", prev > 1 ? sep : ""); if ((f & AV_TX_FULL_IMDCT) && ++prev) av_bprintf(bp, "%simdct_full", prev > 1 ? sep : ""); + if ((f & AV_TX_REAL_TO_REAL) && ++prev) + av_bprintf(bp, "%sreal_to_real", prev > 1 ? sep : ""); + if ((f & AV_TX_REAL_TO_IMAGINARY) && ++prev) + av_bprintf(bp, "%sreal_to_imaginary", prev > 1 ? sep : ""); if ((f & FF_TX_ASM_CALL) && ++prev) av_bprintf(bp, "%sasm_call", prev > 1 ? sep : ""); av_bprintf(bp, "]"); @@ -574,18 +580,24 @@ static void print_type(AVBPrint *bp, enum AVTXType type) type == AV_TX_FLOAT_FFT ? "fft_float" : type == AV_TX_FLOAT_MDCT ? "mdct_float" : type == AV_TX_FLOAT_RDFT ? "rdft_float" : + type == AV_TX_FLOAT_DCT_I ? "dctI_float" : + type == AV_TX_FLOAT_DST_I ? "dstI_float" : type == AV_TX_DOUBLE_FFT ? "fft_double" : type == AV_TX_DOUBLE_MDCT ? "mdct_double" : type == AV_TX_DOUBLE_RDFT ? "rdft_double" : + type == AV_TX_DOUBLE_DCT_I ? "dctI_double" : + type == AV_TX_DOUBLE_DST_I ? "dstI_double" : type == AV_TX_INT32_FFT ? "fft_int32" : type == AV_TX_INT32_MDCT ? "mdct_int32" : type == AV_TX_INT32_RDFT ? "rdft_int32" : + type == AV_TX_INT32_DCT_I ? "dctI_int32" : + type == AV_TX_INT32_DST_I ? "dstI_int32" : "unknown"); } static void print_cd_info(const FFTXCodelet *cd, int prio, int len, int print_prio) { - AVBPrint bp = { 0 }; + AVBPrint bp; av_bprint_init(&bp, 0, AV_BPRINT_SIZE_AUTOMATIC); av_bprintf(&bp, "%s - type: ", cd->name); @@ -708,7 +720,7 @@ av_cold int ff_tx_init_subtx(AVTXContext *s, enum AVTXType type, int codelet_list_idx = codelet_list_num; int nb_cd_matches = 0; #if !CONFIG_SMALL - AVBPrint bp = { 0 }; + AVBPrint bp; #endif /* We still accept functions marked with SLOW, even if the CPU is @@ -719,7 +731,11 @@ av_cold int ff_tx_init_subtx(AVTXContext *s, enum AVTXType type, uint64_t req_flags = flags; /* Flags the codelet may require to be present */ - uint64_t inv_req_mask = AV_TX_FULL_IMDCT | FF_TX_PRESHUFFLE | FF_TX_ASM_CALL; + uint64_t inv_req_mask = AV_TX_FULL_IMDCT | + AV_TX_REAL_TO_REAL | + AV_TX_REAL_TO_IMAGINARY | + FF_TX_PRESHUFFLE | + FF_TX_ASM_CALL; /* Unaligned codelets are compatible with the aligned flag */ if (req_flags & FF_TX_ALIGNED) @@ -744,7 +760,9 @@ av_cold int ff_tx_init_subtx(AVTXContext *s, enum AVTXType type, /* Check direction for non-orthogonal codelets */ if (((cd->flags & FF_TX_FORWARD_ONLY) && inv) || - ((cd->flags & (FF_TX_INVERSE_ONLY | AV_TX_FULL_IMDCT)) && !inv)) + ((cd->flags & (FF_TX_INVERSE_ONLY | AV_TX_FULL_IMDCT)) && !inv) || + ((cd->flags & (FF_TX_FORWARD_ONLY | AV_TX_REAL_TO_REAL)) && inv) || + ((cd->flags & (FF_TX_FORWARD_ONLY | AV_TX_REAL_TO_IMAGINARY)) && inv)) continue; /* Check if the requested flags match from both sides */ diff --git a/arm/raspi/third_party/ffmpeg/libavutil/tx.h b/arm/raspi/third_party/ffmpeg/libavutil/tx.h index 064edbc0..4696988c 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/tx.h +++ b/arm/raspi/third_party/ffmpeg/libavutil/tx.h @@ -105,6 +105,30 @@ enum AVTXType { AV_TX_DOUBLE_DCT = 10, AV_TX_INT32_DCT = 11, + /** + * Discrete Cosine Transform I + * + * The forward transform is a DCT-I. + * The inverse transform is a DCT-I multiplied by 2/(N + 1). + * + * The input array is always overwritten. + */ + AV_TX_FLOAT_DCT_I = 12, + AV_TX_DOUBLE_DCT_I = 13, + AV_TX_INT32_DCT_I = 14, + + /** + * Discrete Sine Transform I + * + * The forward transform is a DST-I. + * The inverse transform is a DST-I multiplied by 2/(N + 1). + * + * The input array is always overwritten. + */ + AV_TX_FLOAT_DST_I = 15, + AV_TX_DOUBLE_DST_I = 16, + AV_TX_INT32_DST_I = 17, + /* Not part of the API, do not use */ AV_TX_NB, }; @@ -149,6 +173,16 @@ enum AVTXFlags { * Ignored for all transforms but inverse MDCTs. */ AV_TX_FULL_IMDCT = 1ULL << 2, + + /** + * Perform a real to half-complex RDFT. + * Only the real, or imaginary coefficients will + * be output, depending on the flag used. Only available for forward RDFTs. + * Output array must have enough space to hold N complex values + * (regular size for a real to complex transform). + */ + AV_TX_REAL_TO_REAL = 1ULL << 3, + AV_TX_REAL_TO_IMAGINARY = 1ULL << 4, }; /** diff --git a/arm/raspi/third_party/ffmpeg/libavutil/tx_priv.h b/arm/raspi/third_party/ffmpeg/libavutil/tx_priv.h index d5ff8e14..d3fcdbf5 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/tx_priv.h +++ b/arm/raspi/third_party/ffmpeg/libavutil/tx_priv.h @@ -22,6 +22,7 @@ #include "tx.h" #include "thread.h" #include "mem_internal.h" +#include "common.h" #include "attributes.h" #ifdef TX_FLOAT diff --git a/arm/raspi/third_party/ffmpeg/libavutil/tx_template.c b/arm/raspi/third_party/ffmpeg/libavutil/tx_template.c index 983de75a..8dc3d251 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/tx_template.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/tx_template.c @@ -43,6 +43,10 @@ SR_TABLE(32768) \ SR_TABLE(65536) \ SR_TABLE(131072) \ + SR_TABLE(262144) \ + SR_TABLE(524288) \ + SR_TABLE(1048576) \ + SR_TABLE(2097152) \ #define SR_TABLE(len) \ TABLE_DEF(len, len/4 + 1); @@ -218,8 +222,8 @@ static av_always_inline void NAME(TXComplex *out, TXComplex *in, \ BF(t[3].im, t[2].re, in[2].re, in[3].re); \ BF(t[3].re, t[2].im, in[2].im, in[3].im); \ \ - out[D0*stride].re = dc.re + t[0].re + t[2].re; \ - out[D0*stride].im = dc.im + t[0].im + t[2].im; \ + out[D0*stride].re = dc.re + (TXUSample)t[0].re + t[2].re; \ + out[D0*stride].im = dc.im + (TXUSample)t[0].im + t[2].im; \ \ SMUL(t[4].re, t[0].re, tab[0], tab[2], t[2].re, t[0].re); \ SMUL(t[4].im, t[0].im, tab[0], tab[2], t[2].im, t[0].im); \ @@ -231,14 +235,14 @@ static av_always_inline void NAME(TXComplex *out, TXComplex *in, \ BF(z0[2].re, z0[1].re, t[4].re, t[5].re); \ BF(z0[2].im, z0[1].im, t[4].im, t[5].im); \ \ - out[D1*stride].re = dc.re + z0[3].re; \ - out[D1*stride].im = dc.im + z0[0].im; \ - out[D2*stride].re = dc.re + z0[2].re; \ - out[D2*stride].im = dc.im + z0[1].im; \ - out[D3*stride].re = dc.re + z0[1].re; \ - out[D3*stride].im = dc.im + z0[2].im; \ - out[D4*stride].re = dc.re + z0[0].re; \ - out[D4*stride].im = dc.im + z0[3].im; \ + out[D1*stride].re = dc.re + (TXUSample)z0[3].re; \ + out[D1*stride].im = dc.im + (TXUSample)z0[0].im; \ + out[D2*stride].re = dc.re + (TXUSample)z0[2].re; \ + out[D2*stride].im = dc.im + (TXUSample)z0[1].im; \ + out[D3*stride].re = dc.re + (TXUSample)z0[1].re; \ + out[D3*stride].im = dc.im + (TXUSample)z0[2].im; \ + out[D4*stride].re = dc.re + (TXUSample)z0[0].re; \ + out[D4*stride].im = dc.im + (TXUSample)z0[3].im; \ } DECL_FFT5(fft5, 0, 1, 2, 3, 4) @@ -717,6 +721,10 @@ DECL_SR_CODELET(16384,8192,4096) DECL_SR_CODELET(32768,16384,8192) DECL_SR_CODELET(65536,32768,16384) DECL_SR_CODELET(131072,65536,32768) +DECL_SR_CODELET(262144,131072,65536) +DECL_SR_CODELET(524288,262144,131072) +DECL_SR_CODELET(1048576,524288,262144) +DECL_SR_CODELET(2097152,1048576,524288) static av_cold int TX_NAME(ff_tx_fft_init)(AVTXContext *s, const FFTXCodelet *cd, @@ -1605,14 +1613,18 @@ static av_cold int TX_NAME(ff_tx_rdft_init)(AVTXContext *s, int ret; double f, m; TXSample *tab; + uint64_t r2r = flags & AV_TX_REAL_TO_REAL; + int len4 = FFALIGN(len, 4) / 4; s->scale_d = *((SCALE_TYPE *)scale); s->scale_f = s->scale_d; + flags &= ~(AV_TX_REAL_TO_REAL | AV_TX_REAL_TO_IMAGINARY); + if ((ret = ff_tx_init_subtx(s, TX_TYPE(FFT), flags, NULL, len >> 1, inv, scale))) return ret; - if (!(s->exp = av_mallocz((8 + (len >> 2) - 1)*sizeof(*s->exp)))) + if (!(s->exp = av_mallocz((8 + 2*len4)*sizeof(*s->exp)))) return AVERROR(ENOMEM); tab = (TXSample *)s->exp; @@ -1627,21 +1639,27 @@ static av_cold int TX_NAME(ff_tx_rdft_init)(AVTXContext *s, *tab++ = RESCALE(-m); *tab++ = RESCALE( (0.5 - 0.0) * m); - *tab++ = RESCALE( (0.0 - 0.5) * m); + if (r2r) + *tab++ = 1 / s->scale_f; + else + *tab++ = RESCALE( (0.0 - 0.5) * m); *tab++ = RESCALE( (0.5 - inv) * m); *tab++ = RESCALE(-(0.5 - inv) * m); - for (int i = 0; i < len >> 2; i++) + for (int i = 0; i < len4; i++) *tab++ = RESCALE(cos(i*f)); - for (int i = len >> 2; i >= 0; i--) - *tab++ = RESCALE(cos(i*f) * (inv ? +1.0 : -1.0)); + + tab = ((TXSample *)s->exp) + len4 + 8; + + for (int i = 0; i < len4; i++) + *tab++ = RESCALE(cos(((len - i*4)/4.0)*f)) * (inv ? 1 : -1); return 0; } -#define DECL_RDFT(name, inv) \ -static void TX_NAME(ff_tx_rdft_ ##name)(AVTXContext *s, void *_dst, \ - void *_src, ptrdiff_t stride) \ +#define DECL_RDFT(n, inv) \ +static void TX_NAME(ff_tx_rdft_ ##n)(AVTXContext *s, void *_dst, \ + void *_src, ptrdiff_t stride) \ { \ const int len2 = s->len >> 1; \ const int len4 = s->len >> 2; \ @@ -1690,41 +1708,132 @@ static void TX_NAME(ff_tx_rdft_ ##name)(AVTXContext *s, void *_dst, \ data[len2].re = data[0].im; \ data[ 0].im = data[len2].im = 0; \ } \ -} - -DECL_RDFT(r2c, 0) -DECL_RDFT(c2r, 1) - -static const FFTXCodelet TX_NAME(ff_tx_rdft_r2c_def) = { - .name = TX_NAME_STR("rdft_r2c"), - .function = TX_NAME(ff_tx_rdft_r2c), - .type = TX_TYPE(RDFT), - .flags = AV_TX_UNALIGNED | AV_TX_INPLACE | - FF_TX_OUT_OF_PLACE | FF_TX_FORWARD_ONLY, - .factors = { 2, TX_FACTOR_ANY }, - .nb_factors = 2, - .min_len = 2, - .max_len = TX_LEN_UNLIMITED, - .init = TX_NAME(ff_tx_rdft_init), - .cpu_flags = FF_TX_CPU_FLAGS_ALL, - .prio = FF_TX_PRIO_BASE, +} \ + \ +static const FFTXCodelet TX_NAME(ff_tx_rdft_ ##n## _def) = { \ + .name = TX_NAME_STR("rdft_" #n), \ + .function = TX_NAME(ff_tx_rdft_ ##n), \ + .type = TX_TYPE(RDFT), \ + .flags = AV_TX_UNALIGNED | AV_TX_INPLACE | FF_TX_OUT_OF_PLACE | \ + (inv ? FF_TX_INVERSE_ONLY : FF_TX_FORWARD_ONLY), \ + .factors = { 4, TX_FACTOR_ANY }, \ + .nb_factors = 2, \ + .min_len = 4, \ + .max_len = TX_LEN_UNLIMITED, \ + .init = TX_NAME(ff_tx_rdft_init), \ + .cpu_flags = FF_TX_CPU_FLAGS_ALL, \ + .prio = FF_TX_PRIO_BASE, \ }; -static const FFTXCodelet TX_NAME(ff_tx_rdft_c2r_def) = { - .name = TX_NAME_STR("rdft_c2r"), - .function = TX_NAME(ff_tx_rdft_c2r), - .type = TX_TYPE(RDFT), - .flags = AV_TX_UNALIGNED | AV_TX_INPLACE | - FF_TX_OUT_OF_PLACE | FF_TX_INVERSE_ONLY, - .factors = { 2, TX_FACTOR_ANY }, - .nb_factors = 2, - .min_len = 2, - .max_len = TX_LEN_UNLIMITED, - .init = TX_NAME(ff_tx_rdft_init), - .cpu_flags = FF_TX_CPU_FLAGS_ALL, - .prio = FF_TX_PRIO_BASE, +DECL_RDFT(r2c, 0) +DECL_RDFT(c2r, 1) + +#define DECL_RDFT_HALF(n, mode, mod2) \ +static void TX_NAME(ff_tx_rdft_ ##n)(AVTXContext *s, void *_dst, \ + void *_src, ptrdiff_t stride) \ +{ \ + const int len = s->len; \ + const int len2 = len >> 1; \ + const int len4 = len >> 2; \ + const int aligned_len4 = FFALIGN(len, 4)/4; \ + const TXSample *fact = (void *)s->exp; \ + const TXSample *tcos = fact + 8; \ + const TXSample *tsin = tcos + aligned_len4; \ + TXComplex *data = _dst; \ + TXSample *out = _dst; /* Half-complex is forward-only */ \ + TXSample tmp_dc; \ + av_unused TXSample tmp_mid; \ + TXSample tmp[4]; \ + TXComplex sf, sl; \ + \ + s->fn[0](&s->sub[0], _dst, _src, sizeof(TXComplex)); \ + \ + tmp_dc = data[0].re; \ + data[ 0].re = tmp_dc + data[0].im; \ + tmp_dc = tmp_dc - data[0].im; \ + \ + data[ 0].re = MULT(fact[0], data[ 0].re); \ + tmp_dc = MULT(fact[1], tmp_dc); \ + data[len4].re = MULT(fact[2], data[len4].re); \ + \ + if (!mod2) { \ + data[len4].im = MULT(fact[3], data[len4].im); \ + } else { \ + sf = data[len4]; \ + sl = data[len4 + 1]; \ + if (mode == AV_TX_REAL_TO_REAL) \ + tmp[0] = MULT(fact[4], (sf.re + sl.re)); \ + else \ + tmp[0] = MULT(fact[5], (sf.im - sl.im)); \ + tmp[1] = MULT(fact[6], (sf.im + sl.im)); \ + tmp[2] = MULT(fact[7], (sf.re - sl.re)); \ + \ + if (mode == AV_TX_REAL_TO_REAL) { \ + tmp[3] = tmp[1]*tcos[len4] - tmp[2]*tsin[len4]; \ + tmp_mid = (tmp[0] - tmp[3]); \ + } else { \ + tmp[3] = tmp[1]*tsin[len4] + tmp[2]*tcos[len4]; \ + tmp_mid = (tmp[0] + tmp[3]); \ + } \ + } \ + \ + /* NOTE: unrolling this breaks non-mod8 lengths */ \ + for (int i = 1; i <= len4; i++) { \ + TXSample tmp[4]; \ + TXComplex sf = data[i]; \ + TXComplex sl = data[len2 - i]; \ + \ + if (mode == AV_TX_REAL_TO_REAL) \ + tmp[0] = MULT(fact[4], (sf.re + sl.re)); \ + else \ + tmp[0] = MULT(fact[5], (sf.im - sl.im)); \ + \ + tmp[1] = MULT(fact[6], (sf.im + sl.im)); \ + tmp[2] = MULT(fact[7], (sf.re - sl.re)); \ + \ + if (mode == AV_TX_REAL_TO_REAL) { \ + tmp[3] = tmp[1]*tcos[i] - tmp[2]*tsin[i]; \ + out[i] = (tmp[0] + tmp[3]); \ + out[len - i] = (tmp[0] - tmp[3]); \ + } else { \ + tmp[3] = tmp[1]*tsin[i] + tmp[2]*tcos[i]; \ + out[i - 1] = (tmp[3] - tmp[0]); \ + out[len - i - 1] = (tmp[0] + tmp[3]); \ + } \ + } \ + \ + for (int i = 1; i < (len4 + (mode == AV_TX_REAL_TO_IMAGINARY)); i++) \ + out[len2 - i] = out[len - i]; \ + \ + if (mode == AV_TX_REAL_TO_REAL) { \ + out[len2] = tmp_dc; \ + if (mod2) \ + out[len4 + 1] = tmp_mid * fact[5]; \ + } else if (mod2) { \ + out[len4] = tmp_mid; \ + } \ +} \ + \ +static const FFTXCodelet TX_NAME(ff_tx_rdft_ ##n## _def) = { \ + .name = TX_NAME_STR("rdft_" #n), \ + .function = TX_NAME(ff_tx_rdft_ ##n), \ + .type = TX_TYPE(RDFT), \ + .flags = AV_TX_UNALIGNED | AV_TX_INPLACE | mode | \ + FF_TX_OUT_OF_PLACE | FF_TX_FORWARD_ONLY, \ + .factors = { 2 + 2*(!mod2), TX_FACTOR_ANY }, \ + .nb_factors = 2, \ + .min_len = 2 + 2*(!mod2), \ + .max_len = TX_LEN_UNLIMITED, \ + .init = TX_NAME(ff_tx_rdft_init), \ + .cpu_flags = FF_TX_CPU_FLAGS_ALL, \ + .prio = FF_TX_PRIO_BASE, \ }; +DECL_RDFT_HALF(r2r, AV_TX_REAL_TO_REAL, 0) +DECL_RDFT_HALF(r2r_mod2, AV_TX_REAL_TO_REAL, 1) +DECL_RDFT_HALF(r2i, AV_TX_REAL_TO_IMAGINARY, 0) +DECL_RDFT_HALF(r2i_mod2, AV_TX_REAL_TO_IMAGINARY, 1) + static av_cold int TX_NAME(ff_tx_dct_init)(AVTXContext *s, const FFTXCodelet *cd, uint64_t flags, @@ -1899,6 +2008,107 @@ static const FFTXCodelet TX_NAME(ff_tx_dctIII_def) = { .prio = FF_TX_PRIO_BASE, }; +static av_cold int TX_NAME(ff_tx_dcstI_init)(AVTXContext *s, + const FFTXCodelet *cd, + uint64_t flags, + FFTXCodeletOptions *opts, + int len, int inv, + const void *scale) +{ + int ret; + SCALE_TYPE rsc = *((SCALE_TYPE *)scale); + + if (inv) { + len *= 2; + s->len *= 2; + rsc *= 0.5; + } + + /* We want a half-complex RDFT */ + flags |= cd->type == TX_TYPE(DCT_I) ? AV_TX_REAL_TO_REAL : + AV_TX_REAL_TO_IMAGINARY; + + if ((ret = ff_tx_init_subtx(s, TX_TYPE(RDFT), flags, NULL, + (len - 1 + 2*(cd->type == TX_TYPE(DST_I)))*2, + 0, &rsc))) + return ret; + + s->tmp = av_mallocz((len + 1)*2*sizeof(TXSample)); + if (!s->tmp) + return AVERROR(ENOMEM); + + return 0; +} + +static void TX_NAME(ff_tx_dctI)(AVTXContext *s, void *_dst, + void *_src, ptrdiff_t stride) +{ + TXSample *dst = _dst; + TXSample *src = _src; + const int len = s->len - 1; + TXSample *tmp = (TXSample *)s->tmp; + + stride /= sizeof(TXSample); + + for (int i = 0; i < len; i++) + tmp[i] = tmp[2*len - i] = src[i * stride]; + + tmp[len] = src[len * stride]; /* Middle */ + + s->fn[0](&s->sub[0], dst, tmp, sizeof(TXSample)); +} + +static void TX_NAME(ff_tx_dstI)(AVTXContext *s, void *_dst, + void *_src, ptrdiff_t stride) +{ + TXSample *dst = _dst; + TXSample *src = _src; + const int len = s->len + 1; + TXSample *tmp = (void *)s->tmp; + + stride /= sizeof(TXSample); + + tmp[0] = 0; + + for (int i = 1; i < len; i++) { + TXSample a = src[(i - 1) * stride]; + tmp[i] = -a; + tmp[2*len - i] = a; + } + + tmp[len] = 0; /* i == n, Nyquist */ + + s->fn[0](&s->sub[0], dst, tmp, sizeof(float)); +} + +static const FFTXCodelet TX_NAME(ff_tx_dctI_def) = { + .name = TX_NAME_STR("dctI"), + .function = TX_NAME(ff_tx_dctI), + .type = TX_TYPE(DCT_I), + .flags = AV_TX_UNALIGNED | AV_TX_INPLACE | FF_TX_OUT_OF_PLACE, + .factors = { 2, TX_FACTOR_ANY }, + .nb_factors = 2, + .min_len = 2, + .max_len = TX_LEN_UNLIMITED, + .init = TX_NAME(ff_tx_dcstI_init), + .cpu_flags = FF_TX_CPU_FLAGS_ALL, + .prio = FF_TX_PRIO_BASE, +}; + +static const FFTXCodelet TX_NAME(ff_tx_dstI_def) = { + .name = TX_NAME_STR("dstI"), + .function = TX_NAME(ff_tx_dstI), + .type = TX_TYPE(DST_I), + .flags = AV_TX_UNALIGNED | AV_TX_INPLACE | FF_TX_OUT_OF_PLACE, + .factors = { 2, TX_FACTOR_ANY }, + .nb_factors = 2, + .min_len = 2, + .max_len = TX_LEN_UNLIMITED, + .init = TX_NAME(ff_tx_dcstI_init), + .cpu_flags = FF_TX_CPU_FLAGS_ALL, + .prio = FF_TX_PRIO_BASE, +}; + int TX_TAB(ff_tx_mdct_gen_exp)(AVTXContext *s, int *pre_tab) { int off = 0; @@ -1947,6 +2157,10 @@ const FFTXCodelet * const TX_NAME(ff_tx_codelet_list)[] = { &TX_NAME(ff_tx_fft32768_ns_def), &TX_NAME(ff_tx_fft65536_ns_def), &TX_NAME(ff_tx_fft131072_ns_def), + &TX_NAME(ff_tx_fft262144_ns_def), + &TX_NAME(ff_tx_fft524288_ns_def), + &TX_NAME(ff_tx_fft1048576_ns_def), + &TX_NAME(ff_tx_fft2097152_ns_def), /* Prime factor codelets */ &TX_NAME(ff_tx_fft3_ns_def), @@ -1985,9 +2199,15 @@ const FFTXCodelet * const TX_NAME(ff_tx_codelet_list)[] = { &TX_NAME(ff_tx_mdct_naive_inv_def), &TX_NAME(ff_tx_mdct_inv_full_def), &TX_NAME(ff_tx_rdft_r2c_def), + &TX_NAME(ff_tx_rdft_r2r_def), + &TX_NAME(ff_tx_rdft_r2r_mod2_def), + &TX_NAME(ff_tx_rdft_r2i_def), + &TX_NAME(ff_tx_rdft_r2i_mod2_def), &TX_NAME(ff_tx_rdft_c2r_def), &TX_NAME(ff_tx_dctII_def), &TX_NAME(ff_tx_dctIII_def), + &TX_NAME(ff_tx_dctI_def), + &TX_NAME(ff_tx_dstI_def), NULL, }; diff --git a/arm/raspi/third_party/ffmpeg/libavutil/version.h b/arm/raspi/third_party/ffmpeg/libavutil/version.h index 24af520e..4c0c545d 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/version.h +++ b/arm/raspi/third_party/ffmpeg/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 58 -#define LIBAVUTIL_VERSION_MINOR 14 +#define LIBAVUTIL_VERSION_MINOR 27 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ diff --git a/arm/raspi/third_party/ffmpeg/libavutil/video_hint.c b/arm/raspi/third_party/ffmpeg/libavutil/video_hint.c new file mode 100644 index 00000000..431716ab --- /dev/null +++ b/arm/raspi/third_party/ffmpeg/libavutil/video_hint.c @@ -0,0 +1,81 @@ +/* + * Copyright 2023 Elias Carotti + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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 + +#include "avstring.h" +#include "frame.h" +#include "macros.h" +#include "mem.h" +#include "video_hint.h" + +AVVideoHint *av_video_hint_alloc(size_t nb_rects, + size_t *out_size) +{ + struct TestStruct { + AVVideoHint hint; + AVVideoRect rect; + }; + const size_t rect_offset = offsetof(struct TestStruct, rect); + size_t size = rect_offset; + AVVideoHint *hint; + + *out_size = 0; + if (nb_rects > (SIZE_MAX - size) / sizeof(AVVideoRect)) + return NULL; + size += sizeof(AVVideoRect) * nb_rects; + + hint = av_mallocz(size); + if (!hint) + return NULL; + + hint->nb_rects = nb_rects; + hint->rect_offset = rect_offset; + hint->rect_size = sizeof(AVVideoRect); + + *out_size = size; + + return hint; +} + +AVVideoHint *av_video_hint_create_side_data(AVFrame *frame, + size_t nb_rects) +{ + AVVideoHint *hint; + AVBufferRef *buf; + size_t size = 0; + + hint = av_video_hint_alloc(nb_rects, &size); + if (!hint) + return NULL; + + buf = av_buffer_create((uint8_t *)hint, size, NULL, NULL, 0); + if (!buf) { + av_freep(&hint); + return NULL; + } + + if (!av_frame_new_side_data_from_buf(frame, AV_FRAME_DATA_VIDEO_HINT, buf)) { + av_buffer_unref(&buf); + return NULL; + } + + return hint; +} diff --git a/arm/raspi/third_party/ffmpeg/libavutil/video_hint.h b/arm/raspi/third_party/ffmpeg/libavutil/video_hint.h new file mode 100644 index 00000000..1b219609 --- /dev/null +++ b/arm/raspi/third_party/ffmpeg/libavutil/video_hint.h @@ -0,0 +1,107 @@ +/** + * Copyright 2023 Elias Carotti + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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_VIDEO_HINT_H +#define AVUTIL_VIDEO_HINT_H + +#include +#include +#include "libavutil/avassert.h" +#include "libavutil/frame.h" + +typedef struct AVVideoRect { + uint32_t x, y; + uint32_t width, height; +} AVVideoRect; + +typedef enum AVVideoHintType { + /* rectangled delimit the constant areas (unchanged), default is changed */ + AV_VIDEO_HINT_TYPE_CONSTANT, + + /* rectangled delimit the constant areas (changed), default is not changed */ + AV_VIDEO_HINT_TYPE_CHANGED, +} AVVideoHintType; + +typedef struct AVVideoHint { + /** + * Number of AVVideoRect present. + * + * May be 0, in which case no per-rectangle information is present. In this + * case the values of rect_offset / rect_size are unspecified and should + * not be accessed. + */ + size_t nb_rects; + + /** + * Offset in bytes from the beginning of this structure at which the array + * of AVVideoRect starts. + */ + size_t rect_offset; + + /** + * Size in bytes of AVVideoRect. + */ + size_t rect_size; + + AVVideoHintType type; +} AVVideoHint; + +static av_always_inline AVVideoRect * +av_video_hint_rects(const AVVideoHint *hints) { + return (AVVideoRect *)((uint8_t *)hints + hints->rect_offset); +} + +static av_always_inline AVVideoRect * +av_video_hint_get_rect(const AVVideoHint *hints, size_t idx) { + return (AVVideoRect *)((uint8_t *)hints + hints->rect_offset + idx * hints->rect_size); +} + +/** + * Allocate memory for the AVVideoHint struct along with an nb_rects-sized + * arrays of AVVideoRect. + * + * The side data contains a list of rectangles for the portions of the frame + * which changed from the last encoded one (and the remainder are assumed to be + * changed), or, alternately (depending on the type parameter) the unchanged + * ones (and the remanining ones are those which changed). + * Macroblocks will thus be hinted either to be P_SKIP-ped or go through the + * regular encoding procedure. + * + * It's responsibility of the caller to fill the AVRects accordingly, and to set + * the proper AVVideoHintType field. + * + * @param out_size if non-NULL, the size in bytes of the resulting data array is + * written here + * + * @return newly allocated AVVideoHint struct (must be freed by the caller using + * av_free()) on success, NULL on memory allocation failure + */ +AVVideoHint *av_video_hint_alloc(size_t nb_rects, + size_t *out_size); + +/** + * Same as av_video_hint_alloc(), except newly-allocated AVVideoHint is attached + * as side data of type AV_FRAME_DATA_VIDEO_HINT_INFO to frame. + */ +AVVideoHint *av_video_hint_create_side_data(AVFrame *frame, + size_t nb_rects); + + +#endif /* AVUTIL_VIDEO_HINT_H */ diff --git a/arm/raspi/third_party/ffmpeg/libavutil/vulkan.c b/arm/raspi/third_party/ffmpeg/libavutil/vulkan.c index 48f5f4b5..dec8ccad 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/vulkan.c +++ b/arm/raspi/third_party/ffmpeg/libavutil/vulkan.c @@ -90,9 +90,13 @@ int ff_vk_load_props(FFVulkanContext *s) s->hprops = (VkPhysicalDeviceExternalMemoryHostPropertiesEXT) { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT, }; + s->coop_matrix_props = (VkPhysicalDeviceCooperativeMatrixPropertiesKHR) { + .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_KHR, + .pNext = &s->hprops, + }; s->subgroup_props = (VkPhysicalDeviceSubgroupSizeControlProperties) { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES, - .pNext = &s->hprops, + .pNext = &s->coop_matrix_props, }; s->desc_buf_props = (VkPhysicalDeviceDescriptorBufferPropertiesEXT) { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_PROPERTIES_EXT, @@ -161,6 +165,25 @@ int ff_vk_load_props(FFVulkanContext *s) vk->GetPhysicalDeviceQueueFamilyProperties2(s->hwctx->phys_dev, &s->tot_nb_qfs, s->qf_props); + if (s->extensions & FF_VK_EXT_COOP_MATRIX) { + vk->GetPhysicalDeviceCooperativeMatrixPropertiesKHR(s->hwctx->phys_dev, + &s->coop_mat_props_nb, NULL); + + if (s->coop_mat_props_nb) { + s->coop_mat_props = av_malloc_array(s->coop_mat_props_nb, + sizeof(VkCooperativeMatrixPropertiesKHR)); + for (int i = 0; i < s->coop_mat_props_nb; i++) { + s->coop_mat_props[i] = (VkCooperativeMatrixPropertiesKHR) { + .sType = VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_KHR, + }; + } + + vk->GetPhysicalDeviceCooperativeMatrixPropertiesKHR(s->hwctx->phys_dev, + &s->coop_mat_props_nb, + s->coop_mat_props); + } + } + return 0; } @@ -1861,6 +1884,7 @@ void ff_vk_pipeline_free(FFVulkanContext *s, FFVulkanPipeline *pl) av_freep(&pl->desc_set); av_freep(&pl->desc_bind); + av_freep(&pl->bound_buffer_indices); av_freep(&pl->push_consts); pl->push_consts_num = 0; } @@ -1870,6 +1894,7 @@ void ff_vk_uninit(FFVulkanContext *s) av_freep(&s->query_props); av_freep(&s->qf_props); av_freep(&s->video_props); + av_freep(&s->coop_mat_props); av_buffer_unref(&s->frames_ref); } diff --git a/arm/raspi/third_party/ffmpeg/libavutil/vulkan.h b/arm/raspi/third_party/ffmpeg/libavutil/vulkan.h index 20b81105..25c5ad4b 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/vulkan.h +++ b/arm/raspi/third_party/ffmpeg/libavutil/vulkan.h @@ -236,11 +236,15 @@ typedef struct FFVulkanContext { VkPhysicalDeviceExternalMemoryHostPropertiesEXT hprops; VkPhysicalDeviceDescriptorBufferPropertiesEXT desc_buf_props; VkPhysicalDeviceSubgroupSizeControlProperties subgroup_props; + VkPhysicalDeviceCooperativeMatrixPropertiesKHR coop_matrix_props; VkQueueFamilyQueryResultStatusPropertiesKHR *query_props; VkQueueFamilyVideoPropertiesKHR *video_props; VkQueueFamilyProperties2 *qf_props; int tot_nb_qfs; + VkCooperativeMatrixPropertiesKHR *coop_mat_props; + uint32_t coop_mat_props_nb; + VkPhysicalDeviceShaderAtomicFloatFeaturesEXT atomic_float_feats; VkPhysicalDeviceVulkan12Features feats_12; VkPhysicalDeviceFeatures2 feats; diff --git a/arm/raspi/third_party/ffmpeg/libavutil/vulkan_functions.h b/arm/raspi/third_party/ffmpeg/libavutil/vulkan_functions.h index 58a625dd..65021b04 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/vulkan_functions.h +++ b/arm/raspi/third_party/ffmpeg/libavutil/vulkan_functions.h @@ -45,6 +45,7 @@ typedef enum FFVulkanExtensions { FF_VK_EXT_VIDEO_DECODE_H265 = 1ULL << 13, /* VK_EXT_video_decode_h265 */ FF_VK_EXT_VIDEO_DECODE_AV1 = 1ULL << 14, /* VK_MESA_video_decode_av1 */ FF_VK_EXT_ATOMIC_FLOAT = 1ULL << 15, /* VK_EXT_shader_atomic_float */ + FF_VK_EXT_COOP_MATRIX = 1ULL << 16, /* VK_KHR_cooperative_matrix */ FF_VK_EXT_NO_FLAG = 1ULL << 31, } FFVulkanExtensions; @@ -80,6 +81,7 @@ typedef enum FFVulkanExtensions { MACRO(1, 0, FF_VK_EXT_NO_FLAG, GetPhysicalDeviceImageFormatProperties2) \ MACRO(1, 0, FF_VK_EXT_NO_FLAG, GetPhysicalDeviceQueueFamilyProperties) \ MACRO(1, 0, FF_VK_EXT_NO_FLAG, GetPhysicalDeviceQueueFamilyProperties2) \ + MACRO(1, 0, FF_VK_EXT_COOP_MATRIX, GetPhysicalDeviceCooperativeMatrixPropertiesKHR) \ \ /* Command pool */ \ MACRO(1, 1, FF_VK_EXT_NO_FLAG, CreateCommandPool) \ diff --git a/arm/raspi/third_party/ffmpeg/libavutil/vulkan_loader.h b/arm/raspi/third_party/ffmpeg/libavutil/vulkan_loader.h index c45c674e..f88722f2 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/vulkan_loader.h +++ b/arm/raspi/third_party/ffmpeg/libavutil/vulkan_loader.h @@ -46,6 +46,7 @@ static inline uint64_t ff_vk_extensions_to_mask(const char * const *extensions, { VK_EXT_DEBUG_UTILS_EXTENSION_NAME, FF_VK_EXT_DEBUG_UTILS }, { VK_EXT_PHYSICAL_DEVICE_DRM_EXTENSION_NAME, FF_VK_EXT_DEVICE_DRM }, { VK_EXT_SHADER_ATOMIC_FLOAT_EXTENSION_NAME, FF_VK_EXT_ATOMIC_FLOAT }, + { VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME, FF_VK_EXT_COOP_MATRIX }, #ifdef _WIN32 { VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME, FF_VK_EXT_EXTERNAL_WIN32_MEMORY }, { VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME, FF_VK_EXT_EXTERNAL_WIN32_SEM }, diff --git a/arm/raspi/third_party/ffmpeg/libavutil/wchar_filename.h b/arm/raspi/third_party/ffmpeg/libavutil/wchar_filename.h index fbc0a551..868a30b5 100644 --- a/arm/raspi/third_party/ffmpeg/libavutil/wchar_filename.h +++ b/arm/raspi/third_party/ffmpeg/libavutil/wchar_filename.h @@ -21,7 +21,8 @@ #ifdef _WIN32 -#define WIN32_LEAN_AND_MEAN +#include +#include #include #include "mem.h" diff --git a/infra/THORIUM_DEV_BOOKMARKS.html b/infra/THORIUM_DEV_BOOKMARKS.html index d3c0a94e..b1efe3f5 100644 --- a/infra/THORIUM_DEV_BOOKMARKS.html +++ b/infra/THORIUM_DEV_BOOKMARKS.html @@ -13,205 +13,205 @@
Thorium Flags

THOR1

-

BUILD.gn - Chromium Code Search -
BUILD.gn - Chromium Code Search -
BUILD.gn - Chromium Code Search -
arm.gni - Chromium Code Search -
chromium_strings.grd - Chromium Code Search -
settings_chromium_strings.grdp - Chromium Code Search -
settings_strings.grdp - Chromium Code Search -
shared_settings_strings.grdp - Chromium Code Search -
generated_resources.grd - Chromium Code Search -
ffmpeg_options.gni - Chromium Code Search -
background_mode_manager.cc - Chromium Code Search -
floc_id_provider_factory.cc - Chromium Code Search -
stub_resolver_config_reader.cc - Chromium Code Search -
browser_ui_prefs.cc - Chromium Code Search -
google_api_keys_infobar_delegate.cc - Chromium Code Search -
infobar_utils.cc - Chromium Code Search -
default_browser_infobar_delegate.cc - Chromium Code Search -
chrome_constants.cc - Chromium Code Search -
installer/linux - Chromium Code Search -
chrome.release - Chromium Code Search -
mini_installer_exe_main.cc - Chromium Code Search -
download_features.cc - Chromium Code Search -
privacy_sandbox_settings.cc - Chromium Code Search -
tracking_protection_prefs.cc - Chromium Code Search -
prepopulated_engines.json - Chromium Code Search -
template_url_prepopulate_data.cc - Chromium Code Search +
BUILD.gn - Chromium Code Search +
BUILD.gn - Chromium Code Search +
BUILD.gn - Chromium Code Search +
arm.gni - Chromium Code Search +
chromium_strings.grd - Chromium Code Search +
settings_chromium_strings.grdp - Chromium Code Search +
settings_strings.grdp - Chromium Code Search +
shared_settings_strings.grdp - Chromium Code Search +
generated_resources.grd - Chromium Code Search +
ffmpeg_options.gni - Chromium Code Search +
background_mode_manager.cc - Chromium Code Search +
floc_id_provider_factory.cc - Chromium Code Search +
stub_resolver_config_reader.cc - Chromium Code Search +
browser_ui_prefs.cc - Chromium Code Search +
google_api_keys_infobar_delegate.cc - Chromium Code Search +
infobar_utils.cc - Chromium Code Search +
default_browser_infobar_delegate.cc - Chromium Code Search +
chrome_constants.cc - Chromium Code Search +
installer/linux - Chromium Code Search +
chrome.release - Chromium Code Search +
mini_installer_exe_main.cc - Chromium Code Search +
download_features.cc - Chromium Code Search +
privacy_sandbox_settings.cc - Chromium Code Search +
tracking_protection_prefs.cc - Chromium Code Search +
prepopulated_engines.json - Chromium Code Search +
template_url_prepopulate_data.cc - Chromium Code Search

THOR2

-

BUILD.gn - Chromium Code Search -
theme - Chromium Code Search -
theme - Chromium Code Search -
BUILD.gn - Chromium Code Search -
media_switches.cc - Chromium Code Search -
ffmpeg_video_decoder.cc - Chromium Code Search -
ffmpeg_glue.cc - Chromium Code Search -
gpu_video_decode_accelerator_factory.cc - Chromium Code Search -
gpu_video_decode_accelerator.cc - Chromium Code Search -
vaapi_video_decode_accelerator.cc - Chromium Code Search -
vaapi_video_decode_accelerator.h - Chromium Code Search -
vaapi_wrapper.cc - Chromium Code Search -
vaapi_wrapper.h - Chromium Code Search -
load_flags_list.h - Chromium Code Search -
dns_transaction.cc - Chromium Code Search -
dns_client.cc - Chromium Code Search -
url_request_http_job.cc - Chromium Code Search -
bpf_audio_policy_linux.cc - Chromium Code Search -
x11_util.cc - Chromium Code Search -
js-display-names.cc - Chromium Code Search -
widevine_cdm_version.h - Chromium Code Search -
cdm_registration.cc - Chromium Code Search -
components.css - Chromium Code Search -
incognito_marker.svg - Chromium Code Search -
incognito.svg - Chromium Code Search -
icon_tabs.svg - Chromium Code Search -
vector_icons - Chromium Code Search -
vector_icons - Chromium Code Search -
vector_icons - Chromium Code Search -
new_incognito_window.icon - Chromium Code Search +
BUILD.gn - Chromium Code Search +
theme - Chromium Code Search +
theme - Chromium Code Search +
BUILD.gn - Chromium Code Search +
media_switches.cc - Chromium Code Search +
ffmpeg_video_decoder.cc - Chromium Code Search +
ffmpeg_glue.cc - Chromium Code Search +
gpu_video_decode_accelerator_factory.cc - Chromium Code Search +
gpu_video_decode_accelerator.cc - Chromium Code Search +
vaapi_video_decode_accelerator.cc - Chromium Code Search +
vaapi_video_decode_accelerator.h - Chromium Code Search +
vaapi_wrapper.cc - Chromium Code Search +
vaapi_wrapper.h - Chromium Code Search +
load_flags_list.h - Chromium Code Search +
dns_transaction.cc - Chromium Code Search +
dns_client.cc - Chromium Code Search +
url_request_http_job.cc - Chromium Code Search +
bpf_audio_policy_linux.cc - Chromium Code Search +
x11_util.cc - Chromium Code Search +
js-display-names.cc - Chromium Code Search +
widevine_cdm_version.h - Chromium Code Search +
cdm_registration.cc - Chromium Code Search +
components.css - Chromium Code Search +
incognito_marker.svg - Chromium Code Search +
incognito.svg - Chromium Code Search +
icon_tabs.svg - Chromium Code Search +
vector_icons - Chromium Code Search +
vector_icons - Chromium Code Search +
vector_icons - Chromium Code Search +
new_incognito_window.icon - Chromium Code Search

THOR3

-

search.cc - Chromium Code Search -
BUILD.gn - Chromium Code Search -
distilledpage.css - Chromium Code Search -
reload_button.cc - Chromium Code Search -
reload_button.h - Chromium Code Search -
features.cc - Chromium Code Search -
profile_shortcut_manager_win.cc - Chromium Code Search -
parser-base.h - Chromium Code Search -
ui_chromeos_strings.grd - Chromium Code Search -
autofill_payments_strings.grdp - Chromium Code Search -
autofill_strings.grdp - Chromium Code Search -
components_chromium_strings.grd - Chromium Code Search -
components_settings_strings.grdp - Chromium Code Search -
error_page_strings.grdp - Chromium Code Search -
flags_strings.grdp - Chromium Code Search -
heavy_ad_intervention_strings.grdp - Chromium Code Search -
management_strings.grdp - Chromium Code Search -
new_or_sad_tab_strings.grdp - Chromium Code Search -
ntp_snippets_strings.grdp - Chromium Code Search -
page_info_strings.grdp - Chromium Code Search -
reset_password_strings.grdp - Chromium Code Search -
security_interstitials_strings.grdp - Chromium Code Search -
ssl_errors_strings.grdp - Chromium Code Search -
ssl_errors_strings.grdp - Chromium Code Search -
user_data_dir_win_unittest.cc - Chromium Code Search -
chromium_install_modes.cc - Chromium Code Search -
chrome_paths_linux.cc - Chromium Code Search -
chrome_paths_mac.mm - Chromium Code Search -
ui_util.cc - Chromium Code Search -
ui_features.cc - Chromium Code Search -
x509_util.cc - Chromium Code Search +
search.cc - Chromium Code Search +
BUILD.gn - Chromium Code Search +
distilledpage.css - Chromium Code Search +
reload_button.cc - Chromium Code Search +
reload_button.h - Chromium Code Search +
features.cc - Chromium Code Search +
profile_shortcut_manager_win.cc - Chromium Code Search +
parser-base.h - Chromium Code Search +
ui_chromeos_strings.grd - Chromium Code Search +
autofill_payments_strings.grdp - Chromium Code Search +
autofill_strings.grdp - Chromium Code Search +
components_chromium_strings.grd - Chromium Code Search +
components_settings_strings.grdp - Chromium Code Search +
error_page_strings.grdp - Chromium Code Search +
flags_strings.grdp - Chromium Code Search +
heavy_ad_intervention_strings.grdp - Chromium Code Search +
management_strings.grdp - Chromium Code Search +
new_or_sad_tab_strings.grdp - Chromium Code Search +
ntp_snippets_strings.grdp - Chromium Code Search +
page_info_strings.grdp - Chromium Code Search +
reset_password_strings.grdp - Chromium Code Search +
security_interstitials_strings.grdp - Chromium Code Search +
ssl_errors_strings.grdp - Chromium Code Search +
ssl_errors_strings.grdp - Chromium Code Search +
user_data_dir_win_unittest.cc - Chromium Code Search +
chromium_install_modes.cc - Chromium Code Search +
chrome_paths_linux.cc - Chromium Code Search +
chrome_paths_mac.mm - Chromium Code Search +
ui_util.cc - Chromium Code Search +
ui_features.cc - Chromium Code Search +
x509_util.cc - Chromium Code Search

THOR4

-

BUILD.gn - Chromium Code Search -
BUILD.gn - Chromium Code Search -
memory_details_linux.cc - Chromium Code Search -
gtk_util.cc - Chromium Code Search -
chrome_proxy_main_win.cc - Chromium Code Search -
chrome_exe.ver - Chromium Code Search -
chrome_exe.vsprops - Chromium Code Search -
util_constants.cc - Chromium Code Search -
BUILD.gn - Chromium Code Search -
shell_main_delegate.cc - Chromium Code Search -
channel_info_posix.cc - Chromium Code Search -
shell_integration_linux.cc - Chromium Code Search -
BUILD.gn - Chromium Code Search -
mini_installer_exe_version.rc.version - Chromium Code Search -
launch_as_mojo_client_browsertest.cc - Chromium Code Search -
reorder-imports.py - Chromium Code Search -
vs_toolchain.py - Chromium Code Search -
install-build-deps.py - Chromium Code Search -
scheme_constants.cc - Chromium Code Search -
about_ui.cc - Chromium Code Search -
app_management_strings.grdp - Chromium Code Search -
neterror - Chromium Code Search -
resources - Chromium Code Search -
flags_state.cc - Chromium Code Search -
shell_platform_delegate_views.cc - Chromium Code Search -
BUILD.gn - Chromium Code Search -
quiet_notification_permission_ui_state.cc - Chromium Code Search +
BUILD.gn - Chromium Code Search +
BUILD.gn - Chromium Code Search +
memory_details_linux.cc - Chromium Code Search +
gtk_util.cc - Chromium Code Search +
chrome_proxy_main_win.cc - Chromium Code Search +
chrome_exe.ver - Chromium Code Search +
chrome_exe.vsprops - Chromium Code Search +
util_constants.cc - Chromium Code Search +
BUILD.gn - Chromium Code Search +
shell_main_delegate.cc - Chromium Code Search +
channel_info_posix.cc - Chromium Code Search +
shell_integration_linux.cc - Chromium Code Search +
BUILD.gn - Chromium Code Search +
mini_installer_exe_version.rc.version - Chromium Code Search +
launch_as_mojo_client_browsertest.cc - Chromium Code Search +
reorder-imports.py - Chromium Code Search +
vs_toolchain.py - Chromium Code Search +
install-build-deps.py - Chromium Code Search +
scheme_constants.cc - Chromium Code Search +
about_ui.cc - Chromium Code Search +
app_management_strings.grdp - Chromium Code Search +
neterror - Chromium Code Search +
resources - Chromium Code Search +
flags_state.cc - Chromium Code Search +
shell_platform_delegate_views.cc - Chromium Code Search +
BUILD.gn - Chromium Code Search +
quiet_notification_permission_ui_state.cc - Chromium Code Search

THOR5

-

install_worker.cc - Chromium Code Search -
setup_util.cc - Chromium Code Search -
chrome_content_browser_client.cc - Chromium Code Search -
omnibox_view.cc - Chromium Code Search -
about_flags.cc - Chromium Code Search -
browser_commands.cc - Chromium Code Search -
offline_page_model.cc - Chromium Code Search -
url_schemes.cc - Chromium Code Search -
url_utils.cc - Chromium Code Search -
dom_distiller_features.cc - Chromium Code Search -
examples_window.cc - Chromium Code Search -
BUILD.gn - Chromium Code Search -
BUILD.gn - Chromium Code Search -
build.py - Chromium Code Search -
configure.ac - Chromium Code Search -
build_ffmpeg.py - Chromium Code Search -
bookmark_utils.cc - Chromium Code Search -
BUILD.gn - Chromium Code Search -
runtime_enabled_features.json5 - Chromium Code Search -
images - Chromium Code Search -
chromeos_strings.grd - Chromium Code Search +
install_worker.cc - Chromium Code Search +
setup_util.cc - Chromium Code Search +
chrome_content_browser_client.cc - Chromium Code Search +
omnibox_view.cc - Chromium Code Search +
about_flags.cc - Chromium Code Search +
browser_commands.cc - Chromium Code Search +
offline_page_model.cc - Chromium Code Search +
url_schemes.cc - Chromium Code Search +
url_utils.cc - Chromium Code Search +
dom_distiller_features.cc - Chromium Code Search +
examples_window.cc - Chromium Code Search +
BUILD.gn - Chromium Code Search +
BUILD.gn - Chromium Code Search +
build.py - Chromium Code Search +
configure.ac - Chromium Code Search +
build_ffmpeg.py - Chromium Code Search +
bookmark_utils.cc - Chromium Code Search +
BUILD.gn - Chromium Code Search +
runtime_enabled_features.json5 - Chromium Code Search +
images - Chromium Code Search +
chromeos_strings.grd - Chromium Code Search

QUARANTINE_PATCH

-

base_file.cc - Chromium Code Search -
BUILD.gn - Chromium Code Search -
toolbar_view.cc - Chromium Code Search -
pepper_file_io_host.cc - Chromium Code Search -
pepper_file_io_host.h - Chromium Code Search -
chrome_location_bar_model_delegate.cc - Chromium Code Search -
file_system_access_safe_move_helper.cc - Chromium Code Search -
file_system_access_safe_move_helper.h - Chromium Code Search -
os_crypt_win.cc - Chromium Code Search -
os_crypt_linux.cc - Chromium Code Search -
machine_id_provider_nonwin.cc - Chromium Code Search -
machine_id_provider_win.cc - Chromium Code Search -
device_id_win.cc - Chromium Code Search -
accelerator_table.cc - Chromium Code Search -
browser.cc - Chromium Code Search -
browser.h - Chromium Code Search +
base_file.cc - Chromium Code Search +
BUILD.gn - Chromium Code Search +
toolbar_view.cc - Chromium Code Search +
pepper_file_io_host.cc - Chromium Code Search +
pepper_file_io_host.h - Chromium Code Search +
chrome_location_bar_model_delegate.cc - Chromium Code Search +
file_system_access_safe_move_helper.cc - Chromium Code Search +
file_system_access_safe_move_helper.h - Chromium Code Search +
os_crypt_win.cc - Chromium Code Search +
os_crypt_linux.cc - Chromium Code Search +
machine_id_provider_nonwin.cc - Chromium Code Search +
machine_id_provider_win.cc - Chromium Code Search +
device_id_win.cc - Chromium Code Search +
accelerator_table.cc - Chromium Code Search +
browser.cc - Chromium Code Search +
browser.h - Chromium Code Search

Android

-

java - Chromium Code Search -
BUILD.gn - Chromium Code Search -
chrome_public_apk_tmpl.gni - Chromium Code Search -
android_chrome_strings.grd - Chromium Code Search -
native_theme_gtk.cc - Chromium Code Search -
about_version.html - Chromium Code Search -
supported_types.cc - Chromium Code Search -
bad_flags_prompt.cc - Chromium Code Search -
variations_service.cc - Chromium Code Search -
ffmpeg_common.cc - Chromium Code Search -
BUILD.gn - Chromium Code Search -
media_options.gni - Chromium Code Search -
ignores.txt - Chromium Code Search +
java - Chromium Code Search +
BUILD.gn - Chromium Code Search +
chrome_public_apk_tmpl.gni - Chromium Code Search +
android_chrome_strings.grd - Chromium Code Search +
native_theme_gtk.cc - Chromium Code Search +
about_version.html - Chromium Code Search +
supported_types.cc - Chromium Code Search +
bad_flags_prompt.cc - Chromium Code Search +
variations_service.cc - Chromium Code Search +
ffmpeg_common.cc - Chromium Code Search +
BUILD.gn - Chromium Code Search +
media_options.gni - Chromium Code Search +
ignores.txt - Chromium Code Search

Th23

-

tab.cc - Chromium Code Search -
tab_strip.cc - Chromium Code Search -
tab_style_views.cc - Chromium Code Search -
tab_style_views.h - Chromium Code Search -
tab_strip_model.cc - Chromium Code Search -
history_backend.cc - Chromium Code Search -
browser_root_view.h - Chromium Code Search -
browser_root_view.cc - Chromium Code Search -
new_tab_page_feed_v2_expandable_header.xml - Chromium Code Search -
new_tab_page_multi_feed_header.xml - Chromium Code Search -
pref_names.cc - Chromium Code Search -
theme_helper_win.cc - Chromium Code Search -
libaom - Chromium Code Search -
obsolete_system_linux.cc - Chromium Code Search +
tab.cc - Chromium Code Search +
tab_strip.cc - Chromium Code Search +
tab_style_views.cc - Chromium Code Search +
tab_style_views.h - Chromium Code Search +
tab_strip_model.cc - Chromium Code Search +
history_backend.cc - Chromium Code Search +
browser_root_view.h - Chromium Code Search +
browser_root_view.cc - Chromium Code Search +
new_tab_page_feed_v2_expandable_header.xml - Chromium Code Search +
new_tab_page_multi_feed_header.xml - Chromium Code Search +
pref_names.cc - Chromium Code Search +
theme_helper_win.cc - Chromium Code Search +
libaom - Chromium Code Search +
obsolete_system_linux.cc - Chromium Code Search

Chromium Code Search
overlay-amd64-generic - Chromium Code Search diff --git a/infra/portable/THORIUM_SHELL.BAT b/infra/portable/THORIUM_SHELL.BAT index 7e806618..393df897 100644 --- a/infra/portable/THORIUM_SHELL.BAT +++ b/infra/portable/THORIUM_SHELL.BAT @@ -1 +1 @@ -START "" "%cd%\BIN\119.0.6045.214\thorium_shell.exe" --data-path="%~dp0%\USER_DATA\thorium_shell" --allow-outdated-plugins --disable-logging --disable-breakpad --enable-experimental-web-platform-features +START "" "%cd%\BIN\120.0.6099.235\thorium_shell.exe" --data-path="%~dp0%\USER_DATA\thorium_shell" --allow-outdated-plugins --disable-logging --disable-breakpad --enable-experimental-web-platform-features diff --git a/other/add-hevc-ffmpeg-decoder-parser.patch b/other/add-hevc-ffmpeg-decoder-parser.patch index 2c4e28a0..0dc41f4e 100644 --- a/other/add-hevc-ffmpeg-decoder-parser.patch +++ b/other/add-hevc-ffmpeg-decoder-parser.patch @@ -1,6 +1,6 @@ -From 72ac0cb271cac0ff593bf68eba10ee27fa27e424 Mon Sep 17 00:00:00 2001 +From 2b6f49c1d6f52336f99b8bde89377196821c0057 Mon Sep 17 00:00:00 2001 From: Sta Zhu -Date: Sat, 5 Aug 2023 12:26:12 +0800 +Date: Thu, 19 Oct 2023 22:35:51 +0800 Subject: [PATCH] Video: Add HEVC ffmpeg decoder & parser Add ffmpeg software decoder and parser for HEVC, this will make @@ -157,19 +157,19 @@ profiles to have software HEVC decoding ability. create mode 100644 libavcodec/autorename_libavcodec_bswapdsp.c diff --git a/chromium/config/Chrome/ios/arm64/config.h b/chromium/config/Chrome/ios/arm64/config.h -index 664b1ffaa9..7368ff7e5f 100644 +index 3c712fdc06..29ed1efabe 100644 --- a/chromium/config/Chrome/ios/arm64/config.h +++ b/chromium/config/Chrome/ios/arm64/config.h @@ -1,7 +1,7 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H --/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/17/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ -+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/17/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/18/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ ++/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/18/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" -@@ -669,7 +669,7 @@ +@@ -665,7 +665,7 @@ #define CONFIG_AUDIO_FRAME_QUEUE 0 #define CONFIG_AUDIODSP 0 #define CONFIG_BLOCKDSP 0 @@ -178,7 +178,7 @@ index 664b1ffaa9..7368ff7e5f 100644 #define CONFIG_CABAC 1 #define CONFIG_CBS 0 #define CONFIG_CBS_AV1 0 -@@ -682,7 +682,7 @@ +@@ -678,7 +678,7 @@ #define CONFIG_DEFLATE_WRAPPER 0 #define CONFIG_DIRAC_PARSE 1 #define CONFIG_DNN 0 @@ -187,7 +187,7 @@ index 664b1ffaa9..7368ff7e5f 100644 #define CONFIG_DVPROFILE 0 #define CONFIG_EVCPARSE 0 #define CONFIG_EXIF 0 -@@ -701,8 +701,8 @@ +@@ -697,8 +697,8 @@ #define CONFIG_H264PRED 1 #define CONFIG_H264QPEL 1 #define CONFIG_H264_SEI 1 @@ -199,7 +199,7 @@ index 664b1ffaa9..7368ff7e5f 100644 #define CONFIG_HUFFMAN 0 #define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/Chrome/ios/arm64/config_components.h b/chromium/config/Chrome/ios/arm64/config_components.h -index 1beef521b5..5ad65d1e66 100644 +index cc7e540c24..74d256a0f6 100644 --- a/chromium/config/Chrome/ios/arm64/config_components.h +++ b/chromium/config/Chrome/ios/arm64/config_components.h @@ -137,7 +137,7 @@ @@ -211,7 +211,7 @@ index 1beef521b5..5ad65d1e66 100644 #define CONFIG_HEVC_QSV_DECODER 0 #define CONFIG_HEVC_RKMPP_DECODER 0 #define CONFIG_HEVC_V4L2M2M_DECODER 0 -@@ -973,7 +973,7 @@ +@@ -975,7 +975,7 @@ #define CONFIG_H261_PARSER 0 #define CONFIG_H263_PARSER 0 #define CONFIG_H264_PARSER 1 @@ -241,19 +241,19 @@ index 50acddb28e..1269282a87 100644 + &ff_hevc_parser, NULL }; diff --git a/chromium/config/Chrome/linux/arm-neon/config.h b/chromium/config/Chrome/linux/arm-neon/config.h -index 071fa3186e..1736979278 100644 +index a0823f8731..96c88e3ef2 100644 --- a/chromium/config/Chrome/linux/arm-neon/config.h +++ b/chromium/config/Chrome/linux/arm-neon/config.h @@ -1,7 +1,7 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H --/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ -+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ ++/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" -@@ -668,7 +668,7 @@ +@@ -664,7 +664,7 @@ #define CONFIG_AUDIO_FRAME_QUEUE 0 #define CONFIG_AUDIODSP 0 #define CONFIG_BLOCKDSP 0 @@ -262,7 +262,7 @@ index 071fa3186e..1736979278 100644 #define CONFIG_CABAC 1 #define CONFIG_CBS 0 #define CONFIG_CBS_AV1 0 -@@ -681,7 +681,7 @@ +@@ -677,7 +677,7 @@ #define CONFIG_DEFLATE_WRAPPER 0 #define CONFIG_DIRAC_PARSE 1 #define CONFIG_DNN 0 @@ -271,7 +271,7 @@ index 071fa3186e..1736979278 100644 #define CONFIG_DVPROFILE 0 #define CONFIG_EVCPARSE 0 #define CONFIG_EXIF 0 -@@ -700,8 +700,8 @@ +@@ -696,8 +696,8 @@ #define CONFIG_H264PRED 1 #define CONFIG_H264QPEL 1 #define CONFIG_H264_SEI 1 @@ -283,7 +283,7 @@ index 071fa3186e..1736979278 100644 #define CONFIG_HUFFMAN 0 #define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/Chrome/linux/arm-neon/config_components.h b/chromium/config/Chrome/linux/arm-neon/config_components.h -index 1beef521b5..5ad65d1e66 100644 +index cc7e540c24..74d256a0f6 100644 --- a/chromium/config/Chrome/linux/arm-neon/config_components.h +++ b/chromium/config/Chrome/linux/arm-neon/config_components.h @@ -137,7 +137,7 @@ @@ -295,7 +295,7 @@ index 1beef521b5..5ad65d1e66 100644 #define CONFIG_HEVC_QSV_DECODER 0 #define CONFIG_HEVC_RKMPP_DECODER 0 #define CONFIG_HEVC_V4L2M2M_DECODER 0 -@@ -973,7 +973,7 @@ +@@ -975,7 +975,7 @@ #define CONFIG_H261_PARSER 0 #define CONFIG_H263_PARSER 0 #define CONFIG_H264_PARSER 1 @@ -325,19 +325,19 @@ index 50acddb28e..1269282a87 100644 + &ff_hevc_parser, NULL }; diff --git a/chromium/config/Chrome/linux/arm/config.h b/chromium/config/Chrome/linux/arm/config.h -index 6780330321..a1db8f69f9 100644 +index e3b65757d3..69704027b6 100644 --- a/chromium/config/Chrome/linux/arm/config.h +++ b/chromium/config/Chrome/linux/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 --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ -+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ ++/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" -@@ -668,7 +668,7 @@ +@@ -664,7 +664,7 @@ #define CONFIG_AUDIO_FRAME_QUEUE 0 #define CONFIG_AUDIODSP 0 #define CONFIG_BLOCKDSP 0 @@ -346,7 +346,7 @@ index 6780330321..a1db8f69f9 100644 #define CONFIG_CABAC 1 #define CONFIG_CBS 0 #define CONFIG_CBS_AV1 0 -@@ -681,7 +681,7 @@ +@@ -677,7 +677,7 @@ #define CONFIG_DEFLATE_WRAPPER 0 #define CONFIG_DIRAC_PARSE 1 #define CONFIG_DNN 0 @@ -355,7 +355,7 @@ index 6780330321..a1db8f69f9 100644 #define CONFIG_DVPROFILE 0 #define CONFIG_EVCPARSE 0 #define CONFIG_EXIF 0 -@@ -700,8 +700,8 @@ +@@ -696,8 +696,8 @@ #define CONFIG_H264PRED 1 #define CONFIG_H264QPEL 1 #define CONFIG_H264_SEI 1 @@ -367,7 +367,7 @@ index 6780330321..a1db8f69f9 100644 #define CONFIG_HUFFMAN 0 #define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/Chrome/linux/arm/config_components.h b/chromium/config/Chrome/linux/arm/config_components.h -index 1beef521b5..5ad65d1e66 100644 +index cc7e540c24..74d256a0f6 100644 --- a/chromium/config/Chrome/linux/arm/config_components.h +++ b/chromium/config/Chrome/linux/arm/config_components.h @@ -137,7 +137,7 @@ @@ -379,7 +379,7 @@ index 1beef521b5..5ad65d1e66 100644 #define CONFIG_HEVC_QSV_DECODER 0 #define CONFIG_HEVC_RKMPP_DECODER 0 #define CONFIG_HEVC_V4L2M2M_DECODER 0 -@@ -973,7 +973,7 @@ +@@ -975,7 +975,7 @@ #define CONFIG_H261_PARSER 0 #define CONFIG_H263_PARSER 0 #define CONFIG_H264_PARSER 1 @@ -409,19 +409,19 @@ index 50acddb28e..1269282a87 100644 + &ff_hevc_parser, NULL }; diff --git a/chromium/config/Chrome/linux/arm64/config.h b/chromium/config/Chrome/linux/arm64/config.h -index 6a8dd2d015..7c3cc691ed 100644 +index d886390f1a..f6e4d95ccb 100644 --- a/chromium/config/Chrome/linux/arm64/config.h +++ b/chromium/config/Chrome/linux/arm64/config.h @@ -1,7 +1,7 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H --/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --target-os=linux --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_arm64-sysroot --disable-dotprod --disable-i8mm --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ -+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --target-os=linux --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_arm64-sysroot --disable-dotprod --disable-i8mm --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --target-os=linux --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_arm64-sysroot --disable-dotprod --disable-i8mm --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ ++/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --target-os=linux --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_arm64-sysroot --disable-dotprod --disable-i8mm --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" -@@ -669,7 +669,7 @@ +@@ -665,7 +665,7 @@ #define CONFIG_AUDIO_FRAME_QUEUE 0 #define CONFIG_AUDIODSP 0 #define CONFIG_BLOCKDSP 0 @@ -430,7 +430,7 @@ index 6a8dd2d015..7c3cc691ed 100644 #define CONFIG_CABAC 1 #define CONFIG_CBS 0 #define CONFIG_CBS_AV1 0 -@@ -682,7 +682,7 @@ +@@ -678,7 +678,7 @@ #define CONFIG_DEFLATE_WRAPPER 0 #define CONFIG_DIRAC_PARSE 1 #define CONFIG_DNN 0 @@ -439,7 +439,7 @@ index 6a8dd2d015..7c3cc691ed 100644 #define CONFIG_DVPROFILE 0 #define CONFIG_EVCPARSE 0 #define CONFIG_EXIF 0 -@@ -701,8 +701,8 @@ +@@ -697,8 +697,8 @@ #define CONFIG_H264PRED 1 #define CONFIG_H264QPEL 1 #define CONFIG_H264_SEI 1 @@ -451,7 +451,7 @@ index 6a8dd2d015..7c3cc691ed 100644 #define CONFIG_HUFFMAN 0 #define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/Chrome/linux/arm64/config_components.h b/chromium/config/Chrome/linux/arm64/config_components.h -index 1beef521b5..5ad65d1e66 100644 +index cc7e540c24..74d256a0f6 100644 --- a/chromium/config/Chrome/linux/arm64/config_components.h +++ b/chromium/config/Chrome/linux/arm64/config_components.h @@ -137,7 +137,7 @@ @@ -463,7 +463,7 @@ index 1beef521b5..5ad65d1e66 100644 #define CONFIG_HEVC_QSV_DECODER 0 #define CONFIG_HEVC_RKMPP_DECODER 0 #define CONFIG_HEVC_V4L2M2M_DECODER 0 -@@ -973,7 +973,7 @@ +@@ -975,7 +975,7 @@ #define CONFIG_H261_PARSER 0 #define CONFIG_H263_PARSER 0 #define CONFIG_H264_PARSER 1 @@ -493,19 +493,19 @@ index 50acddb28e..1269282a87 100644 + &ff_hevc_parser, NULL }; diff --git a/chromium/config/Chrome/linux/ia32/config.h b/chromium/config/Chrome/linux/ia32/config.h -index 72032e42c5..3240ff65f2 100644 +index ae062a84d1..9c92dd31c9 100644 --- a/chromium/config/Chrome/linux/ia32/config.h +++ b/chromium/config/Chrome/linux/ia32/config.h @@ -1,7 +1,7 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H --/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ -+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ ++/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" -@@ -668,7 +668,7 @@ +@@ -664,7 +664,7 @@ #define CONFIG_AUDIO_FRAME_QUEUE 0 #define CONFIG_AUDIODSP 0 #define CONFIG_BLOCKDSP 0 @@ -514,7 +514,7 @@ index 72032e42c5..3240ff65f2 100644 #define CONFIG_CABAC 1 #define CONFIG_CBS 0 #define CONFIG_CBS_AV1 0 -@@ -681,7 +681,7 @@ +@@ -677,7 +677,7 @@ #define CONFIG_DEFLATE_WRAPPER 0 #define CONFIG_DIRAC_PARSE 1 #define CONFIG_DNN 0 @@ -523,7 +523,7 @@ index 72032e42c5..3240ff65f2 100644 #define CONFIG_DVPROFILE 0 #define CONFIG_EVCPARSE 0 #define CONFIG_EXIF 0 -@@ -700,8 +700,8 @@ +@@ -696,8 +696,8 @@ #define CONFIG_H264PRED 1 #define CONFIG_H264QPEL 1 #define CONFIG_H264_SEI 1 @@ -535,7 +535,7 @@ index 72032e42c5..3240ff65f2 100644 #define CONFIG_HUFFMAN 0 #define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/Chrome/linux/ia32/config_components.h b/chromium/config/Chrome/linux/ia32/config_components.h -index 1beef521b5..5ad65d1e66 100644 +index cc7e540c24..74d256a0f6 100644 --- a/chromium/config/Chrome/linux/ia32/config_components.h +++ b/chromium/config/Chrome/linux/ia32/config_components.h @@ -137,7 +137,7 @@ @@ -547,7 +547,7 @@ index 1beef521b5..5ad65d1e66 100644 #define CONFIG_HEVC_QSV_DECODER 0 #define CONFIG_HEVC_RKMPP_DECODER 0 #define CONFIG_HEVC_V4L2M2M_DECODER 0 -@@ -973,7 +973,7 @@ +@@ -975,7 +975,7 @@ #define CONFIG_H261_PARSER 0 #define CONFIG_H263_PARSER 0 #define CONFIG_H264_PARSER 1 @@ -577,19 +577,19 @@ index 50acddb28e..1269282a87 100644 + &ff_hevc_parser, NULL }; diff --git a/chromium/config/Chrome/linux/x64/config.h b/chromium/config/Chrome/linux/x64/config.h -index bca1d8963f..8af77b0288 100644 +index 39f07d51b0..12a4ce2715 100644 --- a/chromium/config/Chrome/linux/x64/config.h +++ b/chromium/config/Chrome/linux/x64/config.h @@ -1,7 +1,7 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H --/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ -+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ ++/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" -@@ -668,7 +668,7 @@ +@@ -664,7 +664,7 @@ #define CONFIG_AUDIO_FRAME_QUEUE 0 #define CONFIG_AUDIODSP 0 #define CONFIG_BLOCKDSP 0 @@ -598,7 +598,7 @@ index bca1d8963f..8af77b0288 100644 #define CONFIG_CABAC 1 #define CONFIG_CBS 0 #define CONFIG_CBS_AV1 0 -@@ -681,7 +681,7 @@ +@@ -677,7 +677,7 @@ #define CONFIG_DEFLATE_WRAPPER 0 #define CONFIG_DIRAC_PARSE 1 #define CONFIG_DNN 0 @@ -607,7 +607,7 @@ index bca1d8963f..8af77b0288 100644 #define CONFIG_DVPROFILE 0 #define CONFIG_EVCPARSE 0 #define CONFIG_EXIF 0 -@@ -700,8 +700,8 @@ +@@ -696,8 +696,8 @@ #define CONFIG_H264PRED 1 #define CONFIG_H264QPEL 1 #define CONFIG_H264_SEI 1 @@ -619,7 +619,7 @@ index bca1d8963f..8af77b0288 100644 #define CONFIG_HUFFMAN 0 #define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/Chrome/linux/x64/config_components.h b/chromium/config/Chrome/linux/x64/config_components.h -index 1beef521b5..5ad65d1e66 100644 +index cc7e540c24..74d256a0f6 100644 --- a/chromium/config/Chrome/linux/x64/config_components.h +++ b/chromium/config/Chrome/linux/x64/config_components.h @@ -137,7 +137,7 @@ @@ -631,7 +631,7 @@ index 1beef521b5..5ad65d1e66 100644 #define CONFIG_HEVC_QSV_DECODER 0 #define CONFIG_HEVC_RKMPP_DECODER 0 #define CONFIG_HEVC_V4L2M2M_DECODER 0 -@@ -973,7 +973,7 @@ +@@ -975,7 +975,7 @@ #define CONFIG_H261_PARSER 0 #define CONFIG_H263_PARSER 0 #define CONFIG_H264_PARSER 1 @@ -661,19 +661,19 @@ index 50acddb28e..1269282a87 100644 + &ff_hevc_parser, NULL }; diff --git a/chromium/config/Chrome/mac/arm64/config.h b/chromium/config/Chrome/mac/arm64/config.h -index 664b1ffaa9..7368ff7e5f 100644 +index 3c712fdc06..29ed1efabe 100644 --- a/chromium/config/Chrome/mac/arm64/config.h +++ b/chromium/config/Chrome/mac/arm64/config.h @@ -1,7 +1,7 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H --/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/17/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ -+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/17/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/18/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ ++/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/18/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" -@@ -669,7 +669,7 @@ +@@ -665,7 +665,7 @@ #define CONFIG_AUDIO_FRAME_QUEUE 0 #define CONFIG_AUDIODSP 0 #define CONFIG_BLOCKDSP 0 @@ -682,7 +682,7 @@ index 664b1ffaa9..7368ff7e5f 100644 #define CONFIG_CABAC 1 #define CONFIG_CBS 0 #define CONFIG_CBS_AV1 0 -@@ -682,7 +682,7 @@ +@@ -678,7 +678,7 @@ #define CONFIG_DEFLATE_WRAPPER 0 #define CONFIG_DIRAC_PARSE 1 #define CONFIG_DNN 0 @@ -691,7 +691,7 @@ index 664b1ffaa9..7368ff7e5f 100644 #define CONFIG_DVPROFILE 0 #define CONFIG_EVCPARSE 0 #define CONFIG_EXIF 0 -@@ -701,8 +701,8 @@ +@@ -697,8 +697,8 @@ #define CONFIG_H264PRED 1 #define CONFIG_H264QPEL 1 #define CONFIG_H264_SEI 1 @@ -703,7 +703,7 @@ index 664b1ffaa9..7368ff7e5f 100644 #define CONFIG_HUFFMAN 0 #define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/Chrome/mac/arm64/config_components.h b/chromium/config/Chrome/mac/arm64/config_components.h -index 1beef521b5..5ad65d1e66 100644 +index cc7e540c24..74d256a0f6 100644 --- a/chromium/config/Chrome/mac/arm64/config_components.h +++ b/chromium/config/Chrome/mac/arm64/config_components.h @@ -137,7 +137,7 @@ @@ -715,7 +715,7 @@ index 1beef521b5..5ad65d1e66 100644 #define CONFIG_HEVC_QSV_DECODER 0 #define CONFIG_HEVC_RKMPP_DECODER 0 #define CONFIG_HEVC_V4L2M2M_DECODER 0 -@@ -973,7 +973,7 @@ +@@ -975,7 +975,7 @@ #define CONFIG_H261_PARSER 0 #define CONFIG_H263_PARSER 0 #define CONFIG_H264_PARSER 1 @@ -745,10 +745,10 @@ index 50acddb28e..1269282a87 100644 + &ff_hevc_parser, NULL }; diff --git a/chromium/config/Chrome/mac/x64/config.asm b/chromium/config/Chrome/mac/x64/config.asm -index d9bdaeecd2..624a8e541e 100644 +index 152bc873d1..12ef0724b1 100644 --- a/chromium/config/Chrome/mac/x64/config.asm +++ b/chromium/config/Chrome/mac/x64/config.asm -@@ -652,7 +652,7 @@ +@@ -648,7 +648,7 @@ %define CONFIG_AUDIO_FRAME_QUEUE 0 %define CONFIG_AUDIODSP 0 %define CONFIG_BLOCKDSP 0 @@ -757,7 +757,7 @@ index d9bdaeecd2..624a8e541e 100644 %define CONFIG_CABAC 1 %define CONFIG_CBS 0 %define CONFIG_CBS_AV1 0 -@@ -665,7 +665,7 @@ +@@ -661,7 +661,7 @@ %define CONFIG_DEFLATE_WRAPPER 0 %define CONFIG_DIRAC_PARSE 1 %define CONFIG_DNN 0 @@ -766,7 +766,7 @@ index d9bdaeecd2..624a8e541e 100644 %define CONFIG_DVPROFILE 0 %define CONFIG_EVCPARSE 0 %define CONFIG_EXIF 0 -@@ -684,8 +684,8 @@ +@@ -680,8 +680,8 @@ %define CONFIG_H264PRED 1 %define CONFIG_H264QPEL 1 %define CONFIG_H264_SEI 1 @@ -778,19 +778,19 @@ index d9bdaeecd2..624a8e541e 100644 %define CONFIG_HUFFMAN 0 %define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/Chrome/mac/x64/config.h b/chromium/config/Chrome/mac/x64/config.h -index bb6d3694b2..cd4a0b7bc4 100644 +index 5b648b58db..36e1e861db 100644 --- a/chromium/config/Chrome/mac/x64/config.h +++ b/chromium/config/Chrome/mac/x64/config.h @@ -1,7 +1,7 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H --/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=x86_64-apple-macosx' --extra-cflags=-F/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/17/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags='-arch x86_64' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ -+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=x86_64-apple-macosx' --extra-cflags=-F/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/17/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags='-arch x86_64' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=x86_64-apple-macosx' --extra-cflags=-F/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/18/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags='-arch x86_64' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ ++/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=x86_64-apple-macosx' --extra-cflags=-F/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/18/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags='-arch x86_64' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" -@@ -668,7 +668,7 @@ +@@ -664,7 +664,7 @@ #define CONFIG_AUDIO_FRAME_QUEUE 0 #define CONFIG_AUDIODSP 0 #define CONFIG_BLOCKDSP 0 @@ -799,7 +799,7 @@ index bb6d3694b2..cd4a0b7bc4 100644 #define CONFIG_CABAC 1 #define CONFIG_CBS 0 #define CONFIG_CBS_AV1 0 -@@ -681,7 +681,7 @@ +@@ -677,7 +677,7 @@ #define CONFIG_DEFLATE_WRAPPER 0 #define CONFIG_DIRAC_PARSE 1 #define CONFIG_DNN 0 @@ -808,7 +808,7 @@ index bb6d3694b2..cd4a0b7bc4 100644 #define CONFIG_DVPROFILE 0 #define CONFIG_EVCPARSE 0 #define CONFIG_EXIF 0 -@@ -700,8 +700,8 @@ +@@ -696,8 +696,8 @@ #define CONFIG_H264PRED 1 #define CONFIG_H264QPEL 1 #define CONFIG_H264_SEI 1 @@ -820,7 +820,7 @@ index bb6d3694b2..cd4a0b7bc4 100644 #define CONFIG_HUFFMAN 0 #define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/Chrome/mac/x64/config_components.h b/chromium/config/Chrome/mac/x64/config_components.h -index 1beef521b5..5ad65d1e66 100644 +index cc7e540c24..74d256a0f6 100644 --- a/chromium/config/Chrome/mac/x64/config_components.h +++ b/chromium/config/Chrome/mac/x64/config_components.h @@ -137,7 +137,7 @@ @@ -832,7 +832,7 @@ index 1beef521b5..5ad65d1e66 100644 #define CONFIG_HEVC_QSV_DECODER 0 #define CONFIG_HEVC_RKMPP_DECODER 0 #define CONFIG_HEVC_V4L2M2M_DECODER 0 -@@ -973,7 +973,7 @@ +@@ -975,7 +975,7 @@ #define CONFIG_H261_PARSER 0 #define CONFIG_H263_PARSER 0 #define CONFIG_H264_PARSER 1 @@ -1080,19 +1080,19 @@ index 19d670aa24..f55c2ca459 100644 + &ff_hevc_parser, NULL }; diff --git a/chromium/config/Chrome/win/arm64/config.h b/chromium/config/Chrome/win/arm64/config.h -index 3da64dbb66..50cb0da05a 100644 +index 90d0307afe..94f43b62a2 100644 --- a/chromium/config/Chrome/win/arm64/config.h +++ b/chromium/config/Chrome/win/arm64/config.h @@ -1,7 +1,7 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H --/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --arch=aarch64 --as=clang-cl --extra-cflags='--target=arm64-windows' --extra-cflags=/winsysroot/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ -+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --arch=aarch64 --as=clang-cl --extra-cflags='--target=arm64-windows' --extra-cflags=/winsysroot/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --arch=aarch64 --as=clang-cl --extra-cflags='--target=arm64-windows' --extra-cflags=/winsysroot/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ ++/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --arch=aarch64 --as=clang-cl --extra-cflags='--target=arm64-windows' --extra-cflags=/winsysroot/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" -@@ -669,7 +669,7 @@ +@@ -665,7 +665,7 @@ #define CONFIG_AUDIO_FRAME_QUEUE 0 #define CONFIG_AUDIODSP 0 #define CONFIG_BLOCKDSP 0 @@ -1101,7 +1101,7 @@ index 3da64dbb66..50cb0da05a 100644 #define CONFIG_CABAC 1 #define CONFIG_CBS 0 #define CONFIG_CBS_AV1 0 -@@ -682,7 +682,7 @@ +@@ -678,7 +678,7 @@ #define CONFIG_DEFLATE_WRAPPER 0 #define CONFIG_DIRAC_PARSE 1 #define CONFIG_DNN 0 @@ -1110,7 +1110,7 @@ index 3da64dbb66..50cb0da05a 100644 #define CONFIG_DVPROFILE 0 #define CONFIG_EVCPARSE 0 #define CONFIG_EXIF 0 -@@ -701,8 +701,8 @@ +@@ -697,8 +697,8 @@ #define CONFIG_H264PRED 1 #define CONFIG_H264QPEL 1 #define CONFIG_H264_SEI 1 @@ -1122,7 +1122,7 @@ index 3da64dbb66..50cb0da05a 100644 #define CONFIG_HUFFMAN 0 #define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/Chrome/win/arm64/config_components.h b/chromium/config/Chrome/win/arm64/config_components.h -index 1beef521b5..5ad65d1e66 100644 +index cc7e540c24..74d256a0f6 100644 --- a/chromium/config/Chrome/win/arm64/config_components.h +++ b/chromium/config/Chrome/win/arm64/config_components.h @@ -137,7 +137,7 @@ @@ -1134,7 +1134,7 @@ index 1beef521b5..5ad65d1e66 100644 #define CONFIG_HEVC_QSV_DECODER 0 #define CONFIG_HEVC_RKMPP_DECODER 0 #define CONFIG_HEVC_V4L2M2M_DECODER 0 -@@ -973,7 +973,7 @@ +@@ -975,7 +975,7 @@ #define CONFIG_H261_PARSER 0 #define CONFIG_H263_PARSER 0 #define CONFIG_H264_PARSER 1 @@ -1164,10 +1164,10 @@ index 50acddb28e..1269282a87 100644 + &ff_hevc_parser, NULL }; diff --git a/chromium/config/Chrome/win/ia32/config.asm b/chromium/config/Chrome/win/ia32/config.asm -index a8c3c0bc14..a035258dbd 100644 +index cd5eb2d639..d94bf5724b 100644 --- a/chromium/config/Chrome/win/ia32/config.asm +++ b/chromium/config/Chrome/win/ia32/config.asm -@@ -652,7 +652,7 @@ +@@ -648,7 +648,7 @@ %define CONFIG_AUDIO_FRAME_QUEUE 0 %define CONFIG_AUDIODSP 0 %define CONFIG_BLOCKDSP 0 @@ -1176,7 +1176,7 @@ index a8c3c0bc14..a035258dbd 100644 %define CONFIG_CABAC 1 %define CONFIG_CBS 0 %define CONFIG_CBS_AV1 0 -@@ -665,7 +665,7 @@ +@@ -661,7 +661,7 @@ %define CONFIG_DEFLATE_WRAPPER 0 %define CONFIG_DIRAC_PARSE 1 %define CONFIG_DNN 0 @@ -1185,7 +1185,7 @@ index a8c3c0bc14..a035258dbd 100644 %define CONFIG_DVPROFILE 0 %define CONFIG_EVCPARSE 0 %define CONFIG_EXIF 0 -@@ -684,8 +684,8 @@ +@@ -680,8 +680,8 @@ %define CONFIG_H264PRED 1 %define CONFIG_H264QPEL 1 %define CONFIG_H264_SEI 1 @@ -1197,19 +1197,19 @@ index a8c3c0bc14..a035258dbd 100644 %define CONFIG_HUFFMAN 0 %define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/Chrome/win/ia32/config.h b/chromium/config/Chrome/win/ia32/config.h -index 2ea7098e2a..0269bee9c4 100644 +index b7124eda1f..a5deb7972f 100644 --- a/chromium/config/Chrome/win/ia32/config.h +++ b/chromium/config/Chrome/win/ia32/config.h @@ -1,7 +1,7 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H --/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=-m32 --extra-cflags=/winsysroot/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ -+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=-m32 --extra-cflags=/winsysroot/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=-m32 --extra-cflags=/winsysroot/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ ++/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=-m32 --extra-cflags=/winsysroot/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" -@@ -668,7 +668,7 @@ +@@ -664,7 +664,7 @@ #define CONFIG_AUDIO_FRAME_QUEUE 0 #define CONFIG_AUDIODSP 0 #define CONFIG_BLOCKDSP 0 @@ -1218,7 +1218,7 @@ index 2ea7098e2a..0269bee9c4 100644 #define CONFIG_CABAC 1 #define CONFIG_CBS 0 #define CONFIG_CBS_AV1 0 -@@ -681,7 +681,7 @@ +@@ -677,7 +677,7 @@ #define CONFIG_DEFLATE_WRAPPER 0 #define CONFIG_DIRAC_PARSE 1 #define CONFIG_DNN 0 @@ -1227,7 +1227,7 @@ index 2ea7098e2a..0269bee9c4 100644 #define CONFIG_DVPROFILE 0 #define CONFIG_EVCPARSE 0 #define CONFIG_EXIF 0 -@@ -700,8 +700,8 @@ +@@ -696,8 +696,8 @@ #define CONFIG_H264PRED 1 #define CONFIG_H264QPEL 1 #define CONFIG_H264_SEI 1 @@ -1239,7 +1239,7 @@ index 2ea7098e2a..0269bee9c4 100644 #define CONFIG_HUFFMAN 0 #define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/Chrome/win/ia32/config_components.h b/chromium/config/Chrome/win/ia32/config_components.h -index 1beef521b5..5ad65d1e66 100644 +index cc7e540c24..74d256a0f6 100644 --- a/chromium/config/Chrome/win/ia32/config_components.h +++ b/chromium/config/Chrome/win/ia32/config_components.h @@ -137,7 +137,7 @@ @@ -1251,7 +1251,7 @@ index 1beef521b5..5ad65d1e66 100644 #define CONFIG_HEVC_QSV_DECODER 0 #define CONFIG_HEVC_RKMPP_DECODER 0 #define CONFIG_HEVC_V4L2M2M_DECODER 0 -@@ -973,7 +973,7 @@ +@@ -975,7 +975,7 @@ #define CONFIG_H261_PARSER 0 #define CONFIG_H263_PARSER 0 #define CONFIG_H264_PARSER 1 @@ -1281,10 +1281,10 @@ index 50acddb28e..1269282a87 100644 + &ff_hevc_parser, NULL }; diff --git a/chromium/config/Chrome/win/x64/config.asm b/chromium/config/Chrome/win/x64/config.asm -index 2254be524c..d3e747bb3e 100644 +index 372d47a4c9..2df49631f0 100644 --- a/chromium/config/Chrome/win/x64/config.asm +++ b/chromium/config/Chrome/win/x64/config.asm -@@ -652,7 +652,7 @@ +@@ -648,7 +648,7 @@ %define CONFIG_AUDIO_FRAME_QUEUE 0 %define CONFIG_AUDIODSP 0 %define CONFIG_BLOCKDSP 0 @@ -1293,7 +1293,7 @@ index 2254be524c..d3e747bb3e 100644 %define CONFIG_CABAC 1 %define CONFIG_CBS 0 %define CONFIG_CBS_AV1 0 -@@ -665,7 +665,7 @@ +@@ -661,7 +661,7 @@ %define CONFIG_DEFLATE_WRAPPER 0 %define CONFIG_DIRAC_PARSE 1 %define CONFIG_DNN 0 @@ -1302,7 +1302,7 @@ index 2254be524c..d3e747bb3e 100644 %define CONFIG_DVPROFILE 0 %define CONFIG_EVCPARSE 0 %define CONFIG_EXIF 0 -@@ -684,8 +684,8 @@ +@@ -680,8 +680,8 @@ %define CONFIG_H264PRED 1 %define CONFIG_H264QPEL 1 %define CONFIG_H264_SEI 1 @@ -1314,19 +1314,19 @@ index 2254be524c..d3e747bb3e 100644 %define CONFIG_HUFFMAN 0 %define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/Chrome/win/x64/config.h b/chromium/config/Chrome/win/x64/config.h -index f2c5b85814..9987b87d32 100644 +index e0837daeb9..e524c62f9c 100644 --- a/chromium/config/Chrome/win/x64/config.h +++ b/chromium/config/Chrome/win/x64/config.h @@ -1,7 +1,7 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H --/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/ffmpeg/chromium/include/win --target-os=win64 --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=/winsysroot/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ -+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/ffmpeg/chromium/include/win --target-os=win64 --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=/winsysroot/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/ffmpeg/chromium/include/win --target-os=win64 --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=/winsysroot/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ ++/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/ffmpeg/chromium/include/win --target-os=win64 --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=/winsysroot/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" -@@ -668,7 +668,7 @@ +@@ -664,7 +664,7 @@ #define CONFIG_AUDIO_FRAME_QUEUE 0 #define CONFIG_AUDIODSP 0 #define CONFIG_BLOCKDSP 0 @@ -1335,7 +1335,7 @@ index f2c5b85814..9987b87d32 100644 #define CONFIG_CABAC 1 #define CONFIG_CBS 0 #define CONFIG_CBS_AV1 0 -@@ -681,7 +681,7 @@ +@@ -677,7 +677,7 @@ #define CONFIG_DEFLATE_WRAPPER 0 #define CONFIG_DIRAC_PARSE 1 #define CONFIG_DNN 0 @@ -1344,7 +1344,7 @@ index f2c5b85814..9987b87d32 100644 #define CONFIG_DVPROFILE 0 #define CONFIG_EVCPARSE 0 #define CONFIG_EXIF 0 -@@ -700,8 +700,8 @@ +@@ -696,8 +696,8 @@ #define CONFIG_H264PRED 1 #define CONFIG_H264QPEL 1 #define CONFIG_H264_SEI 1 @@ -1356,7 +1356,7 @@ index f2c5b85814..9987b87d32 100644 #define CONFIG_HUFFMAN 0 #define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/Chrome/win/x64/config_components.h b/chromium/config/Chrome/win/x64/config_components.h -index 1beef521b5..5ad65d1e66 100644 +index cc7e540c24..74d256a0f6 100644 --- a/chromium/config/Chrome/win/x64/config_components.h +++ b/chromium/config/Chrome/win/x64/config_components.h @@ -137,7 +137,7 @@ @@ -1368,7 +1368,7 @@ index 1beef521b5..5ad65d1e66 100644 #define CONFIG_HEVC_QSV_DECODER 0 #define CONFIG_HEVC_RKMPP_DECODER 0 #define CONFIG_HEVC_V4L2M2M_DECODER 0 -@@ -973,7 +973,7 @@ +@@ -975,7 +975,7 @@ #define CONFIG_H261_PARSER 0 #define CONFIG_H263_PARSER 0 #define CONFIG_H264_PARSER 1 @@ -1398,19 +1398,19 @@ index 50acddb28e..1269282a87 100644 + &ff_hevc_parser, NULL }; diff --git a/chromium/config/ChromeOS/linux-noasm/x64/config.h b/chromium/config/ChromeOS/linux-noasm/x64/config.h -index be6511a4e5..5131d16820 100644 +index 85c83de35b..0146247ad1 100644 --- a/chromium/config/ChromeOS/linux-noasm/x64/config.h +++ b/chromium/config/ChromeOS/linux-noasm/x64/config.h @@ -1,7 +1,7 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H --/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --disable-asm --disable-inline-asm --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ -+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --disable-asm --disable-inline-asm --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ +-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --disable-asm --disable-inline-asm --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ ++/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --disable-asm --disable-inline-asm --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" -@@ -668,7 +668,7 @@ +@@ -664,7 +664,7 @@ #define CONFIG_AUDIO_FRAME_QUEUE 0 #define CONFIG_AUDIODSP 0 #define CONFIG_BLOCKDSP 1 @@ -1419,7 +1419,7 @@ index be6511a4e5..5131d16820 100644 #define CONFIG_CABAC 1 #define CONFIG_CBS 0 #define CONFIG_CBS_AV1 0 -@@ -681,7 +681,7 @@ +@@ -677,7 +677,7 @@ #define CONFIG_DEFLATE_WRAPPER 0 #define CONFIG_DIRAC_PARSE 1 #define CONFIG_DNN 0 @@ -1428,7 +1428,7 @@ index be6511a4e5..5131d16820 100644 #define CONFIG_DVPROFILE 0 #define CONFIG_EVCPARSE 0 #define CONFIG_EXIF 1 -@@ -700,8 +700,8 @@ +@@ -696,8 +696,8 @@ #define CONFIG_H264PRED 1 #define CONFIG_H264QPEL 1 #define CONFIG_H264_SEI 1 @@ -1440,7 +1440,7 @@ index be6511a4e5..5131d16820 100644 #define CONFIG_HUFFMAN 0 #define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/ChromeOS/linux-noasm/x64/config_components.h b/chromium/config/ChromeOS/linux-noasm/x64/config_components.h -index 7fc077903b..de993a6688 100644 +index 2ea71092f9..5942ac4d28 100644 --- a/chromium/config/ChromeOS/linux-noasm/x64/config_components.h +++ b/chromium/config/ChromeOS/linux-noasm/x64/config_components.h @@ -137,7 +137,7 @@ @@ -1452,7 +1452,7 @@ index 7fc077903b..de993a6688 100644 #define CONFIG_HEVC_QSV_DECODER 0 #define CONFIG_HEVC_RKMPP_DECODER 0 #define CONFIG_HEVC_V4L2M2M_DECODER 0 -@@ -973,7 +973,7 @@ +@@ -975,7 +975,7 @@ #define CONFIG_H261_PARSER 0 #define CONFIG_H263_PARSER 1 #define CONFIG_H264_PARSER 1 @@ -1482,19 +1482,19 @@ index e1652f8b9d..bb61b337a0 100644 + &ff_hevc_parser, NULL }; diff --git a/chromium/config/ChromeOS/linux/arm-neon/config.h b/chromium/config/ChromeOS/linux/arm-neon/config.h -index 2404da38cd..fe3eed5bd2 100644 +index fe46300902..cc54cf6094 100644 --- a/chromium/config/ChromeOS/linux/arm-neon/config.h +++ b/chromium/config/ChromeOS/linux/arm-neon/config.h @@ -1,7 +1,7 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H --/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ -+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ +-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ ++/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" -@@ -668,7 +668,7 @@ +@@ -664,7 +664,7 @@ #define CONFIG_AUDIO_FRAME_QUEUE 0 #define CONFIG_AUDIODSP 0 #define CONFIG_BLOCKDSP 1 @@ -1503,7 +1503,7 @@ index 2404da38cd..fe3eed5bd2 100644 #define CONFIG_CABAC 1 #define CONFIG_CBS 0 #define CONFIG_CBS_AV1 0 -@@ -681,7 +681,7 @@ +@@ -677,7 +677,7 @@ #define CONFIG_DEFLATE_WRAPPER 0 #define CONFIG_DIRAC_PARSE 1 #define CONFIG_DNN 0 @@ -1512,7 +1512,7 @@ index 2404da38cd..fe3eed5bd2 100644 #define CONFIG_DVPROFILE 0 #define CONFIG_EVCPARSE 0 #define CONFIG_EXIF 1 -@@ -700,8 +700,8 @@ +@@ -696,8 +696,8 @@ #define CONFIG_H264PRED 1 #define CONFIG_H264QPEL 1 #define CONFIG_H264_SEI 1 @@ -1524,7 +1524,7 @@ index 2404da38cd..fe3eed5bd2 100644 #define CONFIG_HUFFMAN 0 #define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/ChromeOS/linux/arm-neon/config_components.h b/chromium/config/ChromeOS/linux/arm-neon/config_components.h -index 7fc077903b..de993a6688 100644 +index 2ea71092f9..5942ac4d28 100644 --- a/chromium/config/ChromeOS/linux/arm-neon/config_components.h +++ b/chromium/config/ChromeOS/linux/arm-neon/config_components.h @@ -137,7 +137,7 @@ @@ -1536,7 +1536,7 @@ index 7fc077903b..de993a6688 100644 #define CONFIG_HEVC_QSV_DECODER 0 #define CONFIG_HEVC_RKMPP_DECODER 0 #define CONFIG_HEVC_V4L2M2M_DECODER 0 -@@ -973,7 +973,7 @@ +@@ -975,7 +975,7 @@ #define CONFIG_H261_PARSER 0 #define CONFIG_H263_PARSER 1 #define CONFIG_H264_PARSER 1 @@ -1566,19 +1566,19 @@ index e1652f8b9d..bb61b337a0 100644 + &ff_hevc_parser, NULL }; diff --git a/chromium/config/ChromeOS/linux/arm/config.h b/chromium/config/ChromeOS/linux/arm/config.h -index c997835db3..8487aab58b 100644 +index 6d4b09c734..bbbb6a03d4 100644 --- a/chromium/config/ChromeOS/linux/arm/config.h +++ b/chromium/config/ChromeOS/linux/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 --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ -+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ +-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ ++/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" -@@ -668,7 +668,7 @@ +@@ -664,7 +664,7 @@ #define CONFIG_AUDIO_FRAME_QUEUE 0 #define CONFIG_AUDIODSP 0 #define CONFIG_BLOCKDSP 1 @@ -1587,7 +1587,7 @@ index c997835db3..8487aab58b 100644 #define CONFIG_CABAC 1 #define CONFIG_CBS 0 #define CONFIG_CBS_AV1 0 -@@ -681,7 +681,7 @@ +@@ -677,7 +677,7 @@ #define CONFIG_DEFLATE_WRAPPER 0 #define CONFIG_DIRAC_PARSE 1 #define CONFIG_DNN 0 @@ -1596,7 +1596,7 @@ index c997835db3..8487aab58b 100644 #define CONFIG_DVPROFILE 0 #define CONFIG_EVCPARSE 0 #define CONFIG_EXIF 1 -@@ -700,8 +700,8 @@ +@@ -696,8 +696,8 @@ #define CONFIG_H264PRED 1 #define CONFIG_H264QPEL 1 #define CONFIG_H264_SEI 1 @@ -1608,7 +1608,7 @@ index c997835db3..8487aab58b 100644 #define CONFIG_HUFFMAN 0 #define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/ChromeOS/linux/arm/config_components.h b/chromium/config/ChromeOS/linux/arm/config_components.h -index 7fc077903b..de993a6688 100644 +index 2ea71092f9..5942ac4d28 100644 --- a/chromium/config/ChromeOS/linux/arm/config_components.h +++ b/chromium/config/ChromeOS/linux/arm/config_components.h @@ -137,7 +137,7 @@ @@ -1620,7 +1620,7 @@ index 7fc077903b..de993a6688 100644 #define CONFIG_HEVC_QSV_DECODER 0 #define CONFIG_HEVC_RKMPP_DECODER 0 #define CONFIG_HEVC_V4L2M2M_DECODER 0 -@@ -973,7 +973,7 @@ +@@ -975,7 +975,7 @@ #define CONFIG_H261_PARSER 0 #define CONFIG_H263_PARSER 1 #define CONFIG_H264_PARSER 1 @@ -1650,19 +1650,19 @@ index e1652f8b9d..bb61b337a0 100644 + &ff_hevc_parser, NULL }; diff --git a/chromium/config/ChromeOS/linux/arm64/config.h b/chromium/config/ChromeOS/linux/arm64/config.h -index 30baaf7a17..2685c43a9c 100644 +index 307c759747..c8964972d9 100644 --- a/chromium/config/ChromeOS/linux/arm64/config.h +++ b/chromium/config/ChromeOS/linux/arm64/config.h @@ -1,7 +1,7 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H --/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --target-os=linux --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_arm64-sysroot --disable-dotprod --disable-i8mm --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ -+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --target-os=linux --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_arm64-sysroot --disable-dotprod --disable-i8mm --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ +-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --target-os=linux --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_arm64-sysroot --disable-dotprod --disable-i8mm --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ ++/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --target-os=linux --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_arm64-sysroot --disable-dotprod --disable-i8mm --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" -@@ -669,7 +669,7 @@ +@@ -665,7 +665,7 @@ #define CONFIG_AUDIO_FRAME_QUEUE 0 #define CONFIG_AUDIODSP 0 #define CONFIG_BLOCKDSP 1 @@ -1671,7 +1671,7 @@ index 30baaf7a17..2685c43a9c 100644 #define CONFIG_CABAC 1 #define CONFIG_CBS 0 #define CONFIG_CBS_AV1 0 -@@ -682,7 +682,7 @@ +@@ -678,7 +678,7 @@ #define CONFIG_DEFLATE_WRAPPER 0 #define CONFIG_DIRAC_PARSE 1 #define CONFIG_DNN 0 @@ -1680,7 +1680,7 @@ index 30baaf7a17..2685c43a9c 100644 #define CONFIG_DVPROFILE 0 #define CONFIG_EVCPARSE 0 #define CONFIG_EXIF 1 -@@ -701,8 +701,8 @@ +@@ -697,8 +697,8 @@ #define CONFIG_H264PRED 1 #define CONFIG_H264QPEL 1 #define CONFIG_H264_SEI 1 @@ -1692,7 +1692,7 @@ index 30baaf7a17..2685c43a9c 100644 #define CONFIG_HUFFMAN 0 #define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/ChromeOS/linux/arm64/config_components.h b/chromium/config/ChromeOS/linux/arm64/config_components.h -index 7fc077903b..de993a6688 100644 +index 2ea71092f9..5942ac4d28 100644 --- a/chromium/config/ChromeOS/linux/arm64/config_components.h +++ b/chromium/config/ChromeOS/linux/arm64/config_components.h @@ -137,7 +137,7 @@ @@ -1704,7 +1704,7 @@ index 7fc077903b..de993a6688 100644 #define CONFIG_HEVC_QSV_DECODER 0 #define CONFIG_HEVC_RKMPP_DECODER 0 #define CONFIG_HEVC_V4L2M2M_DECODER 0 -@@ -973,7 +973,7 @@ +@@ -975,7 +975,7 @@ #define CONFIG_H261_PARSER 0 #define CONFIG_H263_PARSER 1 #define CONFIG_H264_PARSER 1 @@ -1734,19 +1734,19 @@ index e1652f8b9d..bb61b337a0 100644 + &ff_hevc_parser, NULL }; diff --git a/chromium/config/ChromeOS/linux/ia32/config.h b/chromium/config/ChromeOS/linux/ia32/config.h -index 6c1e5ed6d9..c77ccd04aa 100644 +index ba317e7ce6..ede9813837 100644 --- a/chromium/config/ChromeOS/linux/ia32/config.h +++ b/chromium/config/ChromeOS/linux/ia32/config.h @@ -1,7 +1,7 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H --/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ -+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ +-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ ++/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" -@@ -668,7 +668,7 @@ +@@ -664,7 +664,7 @@ #define CONFIG_AUDIO_FRAME_QUEUE 0 #define CONFIG_AUDIODSP 0 #define CONFIG_BLOCKDSP 1 @@ -1755,7 +1755,7 @@ index 6c1e5ed6d9..c77ccd04aa 100644 #define CONFIG_CABAC 1 #define CONFIG_CBS 0 #define CONFIG_CBS_AV1 0 -@@ -681,7 +681,7 @@ +@@ -677,7 +677,7 @@ #define CONFIG_DEFLATE_WRAPPER 0 #define CONFIG_DIRAC_PARSE 1 #define CONFIG_DNN 0 @@ -1764,7 +1764,7 @@ index 6c1e5ed6d9..c77ccd04aa 100644 #define CONFIG_DVPROFILE 0 #define CONFIG_EVCPARSE 0 #define CONFIG_EXIF 1 -@@ -700,8 +700,8 @@ +@@ -696,8 +696,8 @@ #define CONFIG_H264PRED 1 #define CONFIG_H264QPEL 1 #define CONFIG_H264_SEI 1 @@ -1776,7 +1776,7 @@ index 6c1e5ed6d9..c77ccd04aa 100644 #define CONFIG_HUFFMAN 0 #define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/ChromeOS/linux/ia32/config_components.h b/chromium/config/ChromeOS/linux/ia32/config_components.h -index 7fc077903b..de993a6688 100644 +index 2ea71092f9..5942ac4d28 100644 --- a/chromium/config/ChromeOS/linux/ia32/config_components.h +++ b/chromium/config/ChromeOS/linux/ia32/config_components.h @@ -137,7 +137,7 @@ @@ -1788,7 +1788,7 @@ index 7fc077903b..de993a6688 100644 #define CONFIG_HEVC_QSV_DECODER 0 #define CONFIG_HEVC_RKMPP_DECODER 0 #define CONFIG_HEVC_V4L2M2M_DECODER 0 -@@ -973,7 +973,7 @@ +@@ -975,7 +975,7 @@ #define CONFIG_H261_PARSER 0 #define CONFIG_H263_PARSER 1 #define CONFIG_H264_PARSER 1 @@ -1818,19 +1818,19 @@ index e1652f8b9d..bb61b337a0 100644 + &ff_hevc_parser, NULL }; diff --git a/chromium/config/ChromeOS/linux/x64/config.h b/chromium/config/ChromeOS/linux/x64/config.h -index 415f4c519b..0a614b1a34 100644 +index 5b8e1a462c..ca1ee8dbee 100644 --- a/chromium/config/ChromeOS/linux/x64/config.h +++ b/chromium/config/ChromeOS/linux/x64/config.h @@ -1,7 +1,7 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H --/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ -+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ +-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ ++/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" -@@ -668,7 +668,7 @@ +@@ -664,7 +664,7 @@ #define CONFIG_AUDIO_FRAME_QUEUE 0 #define CONFIG_AUDIODSP 0 #define CONFIG_BLOCKDSP 1 @@ -1839,7 +1839,7 @@ index 415f4c519b..0a614b1a34 100644 #define CONFIG_CABAC 1 #define CONFIG_CBS 0 #define CONFIG_CBS_AV1 0 -@@ -681,7 +681,7 @@ +@@ -677,7 +677,7 @@ #define CONFIG_DEFLATE_WRAPPER 0 #define CONFIG_DIRAC_PARSE 1 #define CONFIG_DNN 0 @@ -1848,7 +1848,7 @@ index 415f4c519b..0a614b1a34 100644 #define CONFIG_DVPROFILE 0 #define CONFIG_EVCPARSE 0 #define CONFIG_EXIF 1 -@@ -700,8 +700,8 @@ +@@ -696,8 +696,8 @@ #define CONFIG_H264PRED 1 #define CONFIG_H264QPEL 1 #define CONFIG_H264_SEI 1 @@ -1860,7 +1860,7 @@ index 415f4c519b..0a614b1a34 100644 #define CONFIG_HUFFMAN 0 #define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/ChromeOS/linux/x64/config_components.h b/chromium/config/ChromeOS/linux/x64/config_components.h -index 7fc077903b..de993a6688 100644 +index 2ea71092f9..5942ac4d28 100644 --- a/chromium/config/ChromeOS/linux/x64/config_components.h +++ b/chromium/config/ChromeOS/linux/x64/config_components.h @@ -137,7 +137,7 @@ @@ -1872,7 +1872,7 @@ index 7fc077903b..de993a6688 100644 #define CONFIG_HEVC_QSV_DECODER 0 #define CONFIG_HEVC_RKMPP_DECODER 0 #define CONFIG_HEVC_V4L2M2M_DECODER 0 -@@ -973,7 +973,7 @@ +@@ -975,7 +975,7 @@ #define CONFIG_H261_PARSER 0 #define CONFIG_H263_PARSER 1 #define CONFIG_H264_PARSER 1 @@ -1902,10 +1902,10 @@ index e1652f8b9d..bb61b337a0 100644 + &ff_hevc_parser, NULL }; diff --git a/chromium/config/Chromium/ios/arm64/config.h b/chromium/config/Chromium/ios/arm64/config.h -index 55412afe8a..1ea6a410c9 100644 +index fedc0bd5b8..81b7c89244 100644 --- a/chromium/config/Chromium/ios/arm64/config.h +++ b/chromium/config/Chromium/ios/arm64/config.h -@@ -669,7 +669,7 @@ +@@ -665,7 +665,7 @@ #define CONFIG_AUDIO_FRAME_QUEUE 0 #define CONFIG_AUDIODSP 0 #define CONFIG_BLOCKDSP 0 @@ -1914,7 +1914,7 @@ index 55412afe8a..1ea6a410c9 100644 #define CONFIG_CABAC 0 #define CONFIG_CBS 0 #define CONFIG_CBS_AV1 0 -@@ -682,7 +682,7 @@ +@@ -678,7 +678,7 @@ #define CONFIG_DEFLATE_WRAPPER 0 #define CONFIG_DIRAC_PARSE 1 #define CONFIG_DNN 0 @@ -1923,7 +1923,7 @@ index 55412afe8a..1ea6a410c9 100644 #define CONFIG_DVPROFILE 0 #define CONFIG_EVCPARSE 0 #define CONFIG_EXIF 0 -@@ -701,8 +701,8 @@ +@@ -697,8 +697,8 @@ #define CONFIG_H264PRED 1 #define CONFIG_H264QPEL 0 #define CONFIG_H264_SEI 0 @@ -1935,7 +1935,7 @@ index 55412afe8a..1ea6a410c9 100644 #define CONFIG_HUFFMAN 0 #define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/Chromium/ios/arm64/config_components.h b/chromium/config/Chromium/ios/arm64/config_components.h -index 21fcd6e8fc..4190b27fcd 100644 +index 9989b9246a..a761e839d4 100644 --- a/chromium/config/Chromium/ios/arm64/config_components.h +++ b/chromium/config/Chromium/ios/arm64/config_components.h @@ -137,7 +137,7 @@ @@ -1947,7 +1947,7 @@ index 21fcd6e8fc..4190b27fcd 100644 #define CONFIG_HEVC_QSV_DECODER 0 #define CONFIG_HEVC_RKMPP_DECODER 0 #define CONFIG_HEVC_V4L2M2M_DECODER 0 -@@ -973,7 +973,7 @@ +@@ -975,7 +975,7 @@ #define CONFIG_H261_PARSER 0 #define CONFIG_H263_PARSER 0 #define CONFIG_H264_PARSER 0 @@ -1977,10 +1977,10 @@ index f81fbe8bbc..2d65b7d8ad 100644 + &ff_hevc_parser, NULL }; diff --git a/chromium/config/Chromium/linux-noasm/x64/config.h b/chromium/config/Chromium/linux-noasm/x64/config.h -index 36752bea4a..d71113bcdd 100644 +index 586e2b2365..3ce5ca8702 100644 --- a/chromium/config/Chromium/linux-noasm/x64/config.h +++ b/chromium/config/Chromium/linux-noasm/x64/config.h -@@ -668,7 +668,7 @@ +@@ -664,7 +664,7 @@ #define CONFIG_AUDIO_FRAME_QUEUE 0 #define CONFIG_AUDIODSP 0 #define CONFIG_BLOCKDSP 0 @@ -1989,7 +1989,7 @@ index 36752bea4a..d71113bcdd 100644 #define CONFIG_CABAC 0 #define CONFIG_CBS 0 #define CONFIG_CBS_AV1 0 -@@ -681,7 +681,7 @@ +@@ -677,7 +677,7 @@ #define CONFIG_DEFLATE_WRAPPER 0 #define CONFIG_DIRAC_PARSE 1 #define CONFIG_DNN 0 @@ -1998,7 +1998,7 @@ index 36752bea4a..d71113bcdd 100644 #define CONFIG_DVPROFILE 0 #define CONFIG_EVCPARSE 0 #define CONFIG_EXIF 0 -@@ -700,8 +700,8 @@ +@@ -696,8 +696,8 @@ #define CONFIG_H264PRED 1 #define CONFIG_H264QPEL 0 #define CONFIG_H264_SEI 0 @@ -2010,7 +2010,7 @@ index 36752bea4a..d71113bcdd 100644 #define CONFIG_HUFFMAN 0 #define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/Chromium/linux-noasm/x64/config_components.h b/chromium/config/Chromium/linux-noasm/x64/config_components.h -index 21fcd6e8fc..4190b27fcd 100644 +index 9989b9246a..a761e839d4 100644 --- a/chromium/config/Chromium/linux-noasm/x64/config_components.h +++ b/chromium/config/Chromium/linux-noasm/x64/config_components.h @@ -137,7 +137,7 @@ @@ -2022,7 +2022,7 @@ index 21fcd6e8fc..4190b27fcd 100644 #define CONFIG_HEVC_QSV_DECODER 0 #define CONFIG_HEVC_RKMPP_DECODER 0 #define CONFIG_HEVC_V4L2M2M_DECODER 0 -@@ -973,7 +973,7 @@ +@@ -975,7 +975,7 @@ #define CONFIG_H261_PARSER 0 #define CONFIG_H263_PARSER 0 #define CONFIG_H264_PARSER 0 @@ -2052,10 +2052,10 @@ index f81fbe8bbc..2d65b7d8ad 100644 + &ff_hevc_parser, NULL }; diff --git a/chromium/config/Chromium/linux/arm-neon/config.h b/chromium/config/Chromium/linux/arm-neon/config.h -index 624d983f25..fc4d6a73ee 100644 +index 427fb37e1a..83d9b656ea 100644 --- a/chromium/config/Chromium/linux/arm-neon/config.h +++ b/chromium/config/Chromium/linux/arm-neon/config.h -@@ -668,7 +668,7 @@ +@@ -664,7 +664,7 @@ #define CONFIG_AUDIO_FRAME_QUEUE 0 #define CONFIG_AUDIODSP 0 #define CONFIG_BLOCKDSP 0 @@ -2064,7 +2064,7 @@ index 624d983f25..fc4d6a73ee 100644 #define CONFIG_CABAC 0 #define CONFIG_CBS 0 #define CONFIG_CBS_AV1 0 -@@ -681,7 +681,7 @@ +@@ -677,7 +677,7 @@ #define CONFIG_DEFLATE_WRAPPER 0 #define CONFIG_DIRAC_PARSE 1 #define CONFIG_DNN 0 @@ -2073,7 +2073,7 @@ index 624d983f25..fc4d6a73ee 100644 #define CONFIG_DVPROFILE 0 #define CONFIG_EVCPARSE 0 #define CONFIG_EXIF 0 -@@ -700,8 +700,8 @@ +@@ -696,8 +696,8 @@ #define CONFIG_H264PRED 1 #define CONFIG_H264QPEL 0 #define CONFIG_H264_SEI 0 @@ -2085,7 +2085,7 @@ index 624d983f25..fc4d6a73ee 100644 #define CONFIG_HUFFMAN 0 #define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/Chromium/linux/arm-neon/config_components.h b/chromium/config/Chromium/linux/arm-neon/config_components.h -index 21fcd6e8fc..4190b27fcd 100644 +index 9989b9246a..a761e839d4 100644 --- a/chromium/config/Chromium/linux/arm-neon/config_components.h +++ b/chromium/config/Chromium/linux/arm-neon/config_components.h @@ -137,7 +137,7 @@ @@ -2097,7 +2097,7 @@ index 21fcd6e8fc..4190b27fcd 100644 #define CONFIG_HEVC_QSV_DECODER 0 #define CONFIG_HEVC_RKMPP_DECODER 0 #define CONFIG_HEVC_V4L2M2M_DECODER 0 -@@ -973,7 +973,7 @@ +@@ -975,7 +975,7 @@ #define CONFIG_H261_PARSER 0 #define CONFIG_H263_PARSER 0 #define CONFIG_H264_PARSER 0 @@ -2127,10 +2127,10 @@ index f81fbe8bbc..2d65b7d8ad 100644 + &ff_hevc_parser, NULL }; diff --git a/chromium/config/Chromium/linux/arm/config.h b/chromium/config/Chromium/linux/arm/config.h -index a6977743f8..da119ecaae 100644 +index b8228ab760..7244b86ddc 100644 --- a/chromium/config/Chromium/linux/arm/config.h +++ b/chromium/config/Chromium/linux/arm/config.h -@@ -668,7 +668,7 @@ +@@ -664,7 +664,7 @@ #define CONFIG_AUDIO_FRAME_QUEUE 0 #define CONFIG_AUDIODSP 0 #define CONFIG_BLOCKDSP 0 @@ -2139,7 +2139,7 @@ index a6977743f8..da119ecaae 100644 #define CONFIG_CABAC 0 #define CONFIG_CBS 0 #define CONFIG_CBS_AV1 0 -@@ -681,7 +681,7 @@ +@@ -677,7 +677,7 @@ #define CONFIG_DEFLATE_WRAPPER 0 #define CONFIG_DIRAC_PARSE 1 #define CONFIG_DNN 0 @@ -2148,7 +2148,7 @@ index a6977743f8..da119ecaae 100644 #define CONFIG_DVPROFILE 0 #define CONFIG_EVCPARSE 0 #define CONFIG_EXIF 0 -@@ -700,8 +700,8 @@ +@@ -696,8 +696,8 @@ #define CONFIG_H264PRED 1 #define CONFIG_H264QPEL 0 #define CONFIG_H264_SEI 0 @@ -2160,7 +2160,7 @@ index a6977743f8..da119ecaae 100644 #define CONFIG_HUFFMAN 0 #define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/Chromium/linux/arm/config_components.h b/chromium/config/Chromium/linux/arm/config_components.h -index 21fcd6e8fc..4190b27fcd 100644 +index 9989b9246a..a761e839d4 100644 --- a/chromium/config/Chromium/linux/arm/config_components.h +++ b/chromium/config/Chromium/linux/arm/config_components.h @@ -137,7 +137,7 @@ @@ -2172,7 +2172,7 @@ index 21fcd6e8fc..4190b27fcd 100644 #define CONFIG_HEVC_QSV_DECODER 0 #define CONFIG_HEVC_RKMPP_DECODER 0 #define CONFIG_HEVC_V4L2M2M_DECODER 0 -@@ -973,7 +973,7 @@ +@@ -975,7 +975,7 @@ #define CONFIG_H261_PARSER 0 #define CONFIG_H263_PARSER 0 #define CONFIG_H264_PARSER 0 @@ -2202,10 +2202,10 @@ index f81fbe8bbc..2d65b7d8ad 100644 + &ff_hevc_parser, NULL }; diff --git a/chromium/config/Chromium/linux/arm64/config.h b/chromium/config/Chromium/linux/arm64/config.h -index 258b87bb95..7ef0177951 100644 +index 4cbed2de67..b0cb35cd41 100644 --- a/chromium/config/Chromium/linux/arm64/config.h +++ b/chromium/config/Chromium/linux/arm64/config.h -@@ -669,7 +669,7 @@ +@@ -665,7 +665,7 @@ #define CONFIG_AUDIO_FRAME_QUEUE 0 #define CONFIG_AUDIODSP 0 #define CONFIG_BLOCKDSP 0 @@ -2214,7 +2214,7 @@ index 258b87bb95..7ef0177951 100644 #define CONFIG_CABAC 0 #define CONFIG_CBS 0 #define CONFIG_CBS_AV1 0 -@@ -682,7 +682,7 @@ +@@ -678,7 +678,7 @@ #define CONFIG_DEFLATE_WRAPPER 0 #define CONFIG_DIRAC_PARSE 1 #define CONFIG_DNN 0 @@ -2223,7 +2223,7 @@ index 258b87bb95..7ef0177951 100644 #define CONFIG_DVPROFILE 0 #define CONFIG_EVCPARSE 0 #define CONFIG_EXIF 0 -@@ -701,8 +701,8 @@ +@@ -697,8 +697,8 @@ #define CONFIG_H264PRED 1 #define CONFIG_H264QPEL 0 #define CONFIG_H264_SEI 0 @@ -2235,7 +2235,7 @@ index 258b87bb95..7ef0177951 100644 #define CONFIG_HUFFMAN 0 #define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/Chromium/linux/arm64/config_components.h b/chromium/config/Chromium/linux/arm64/config_components.h -index 21fcd6e8fc..4190b27fcd 100644 +index 9989b9246a..a761e839d4 100644 --- a/chromium/config/Chromium/linux/arm64/config_components.h +++ b/chromium/config/Chromium/linux/arm64/config_components.h @@ -137,7 +137,7 @@ @@ -2247,7 +2247,7 @@ index 21fcd6e8fc..4190b27fcd 100644 #define CONFIG_HEVC_QSV_DECODER 0 #define CONFIG_HEVC_RKMPP_DECODER 0 #define CONFIG_HEVC_V4L2M2M_DECODER 0 -@@ -973,7 +973,7 @@ +@@ -975,7 +975,7 @@ #define CONFIG_H261_PARSER 0 #define CONFIG_H263_PARSER 0 #define CONFIG_H264_PARSER 0 @@ -2277,10 +2277,10 @@ index f81fbe8bbc..2d65b7d8ad 100644 + &ff_hevc_parser, NULL }; diff --git a/chromium/config/Chromium/linux/ia32/config.h b/chromium/config/Chromium/linux/ia32/config.h -index 9e273d1899..8aff558dee 100644 +index fee5bc9a00..b4b36a0f99 100644 --- a/chromium/config/Chromium/linux/ia32/config.h +++ b/chromium/config/Chromium/linux/ia32/config.h -@@ -668,7 +668,7 @@ +@@ -664,7 +664,7 @@ #define CONFIG_AUDIO_FRAME_QUEUE 0 #define CONFIG_AUDIODSP 0 #define CONFIG_BLOCKDSP 0 @@ -2289,7 +2289,7 @@ index 9e273d1899..8aff558dee 100644 #define CONFIG_CABAC 0 #define CONFIG_CBS 0 #define CONFIG_CBS_AV1 0 -@@ -681,7 +681,7 @@ +@@ -677,7 +677,7 @@ #define CONFIG_DEFLATE_WRAPPER 0 #define CONFIG_DIRAC_PARSE 1 #define CONFIG_DNN 0 @@ -2298,7 +2298,7 @@ index 9e273d1899..8aff558dee 100644 #define CONFIG_DVPROFILE 0 #define CONFIG_EVCPARSE 0 #define CONFIG_EXIF 0 -@@ -700,8 +700,8 @@ +@@ -696,8 +696,8 @@ #define CONFIG_H264PRED 1 #define CONFIG_H264QPEL 0 #define CONFIG_H264_SEI 0 @@ -2310,7 +2310,7 @@ index 9e273d1899..8aff558dee 100644 #define CONFIG_HUFFMAN 0 #define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/Chromium/linux/ia32/config_components.h b/chromium/config/Chromium/linux/ia32/config_components.h -index 21fcd6e8fc..4190b27fcd 100644 +index 9989b9246a..a761e839d4 100644 --- a/chromium/config/Chromium/linux/ia32/config_components.h +++ b/chromium/config/Chromium/linux/ia32/config_components.h @@ -137,7 +137,7 @@ @@ -2322,7 +2322,7 @@ index 21fcd6e8fc..4190b27fcd 100644 #define CONFIG_HEVC_QSV_DECODER 0 #define CONFIG_HEVC_RKMPP_DECODER 0 #define CONFIG_HEVC_V4L2M2M_DECODER 0 -@@ -973,7 +973,7 @@ +@@ -975,7 +975,7 @@ #define CONFIG_H261_PARSER 0 #define CONFIG_H263_PARSER 0 #define CONFIG_H264_PARSER 0 @@ -2352,10 +2352,10 @@ index f81fbe8bbc..2d65b7d8ad 100644 + &ff_hevc_parser, NULL }; diff --git a/chromium/config/Chromium/linux/x64/config.h b/chromium/config/Chromium/linux/x64/config.h -index 50800252a3..e10b48dc12 100644 +index b2d24a080c..85423097b3 100644 --- a/chromium/config/Chromium/linux/x64/config.h +++ b/chromium/config/Chromium/linux/x64/config.h -@@ -668,7 +668,7 @@ +@@ -664,7 +664,7 @@ #define CONFIG_AUDIO_FRAME_QUEUE 0 #define CONFIG_AUDIODSP 0 #define CONFIG_BLOCKDSP 0 @@ -2364,7 +2364,7 @@ index 50800252a3..e10b48dc12 100644 #define CONFIG_CABAC 0 #define CONFIG_CBS 0 #define CONFIG_CBS_AV1 0 -@@ -681,7 +681,7 @@ +@@ -677,7 +677,7 @@ #define CONFIG_DEFLATE_WRAPPER 0 #define CONFIG_DIRAC_PARSE 1 #define CONFIG_DNN 0 @@ -2373,7 +2373,7 @@ index 50800252a3..e10b48dc12 100644 #define CONFIG_DVPROFILE 0 #define CONFIG_EVCPARSE 0 #define CONFIG_EXIF 0 -@@ -700,8 +700,8 @@ +@@ -696,8 +696,8 @@ #define CONFIG_H264PRED 1 #define CONFIG_H264QPEL 0 #define CONFIG_H264_SEI 0 @@ -2385,7 +2385,7 @@ index 50800252a3..e10b48dc12 100644 #define CONFIG_HUFFMAN 0 #define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/Chromium/linux/x64/config_components.h b/chromium/config/Chromium/linux/x64/config_components.h -index 21fcd6e8fc..4190b27fcd 100644 +index 9989b9246a..a761e839d4 100644 --- a/chromium/config/Chromium/linux/x64/config_components.h +++ b/chromium/config/Chromium/linux/x64/config_components.h @@ -137,7 +137,7 @@ @@ -2397,7 +2397,7 @@ index 21fcd6e8fc..4190b27fcd 100644 #define CONFIG_HEVC_QSV_DECODER 0 #define CONFIG_HEVC_RKMPP_DECODER 0 #define CONFIG_HEVC_V4L2M2M_DECODER 0 -@@ -973,7 +973,7 @@ +@@ -975,7 +975,7 @@ #define CONFIG_H261_PARSER 0 #define CONFIG_H263_PARSER 0 #define CONFIG_H264_PARSER 0 @@ -2427,10 +2427,10 @@ index f81fbe8bbc..2d65b7d8ad 100644 + &ff_hevc_parser, NULL }; diff --git a/chromium/config/Chromium/mac/arm64/config.h b/chromium/config/Chromium/mac/arm64/config.h -index 55412afe8a..1ea6a410c9 100644 +index fedc0bd5b8..81b7c89244 100644 --- a/chromium/config/Chromium/mac/arm64/config.h +++ b/chromium/config/Chromium/mac/arm64/config.h -@@ -669,7 +669,7 @@ +@@ -665,7 +665,7 @@ #define CONFIG_AUDIO_FRAME_QUEUE 0 #define CONFIG_AUDIODSP 0 #define CONFIG_BLOCKDSP 0 @@ -2439,7 +2439,7 @@ index 55412afe8a..1ea6a410c9 100644 #define CONFIG_CABAC 0 #define CONFIG_CBS 0 #define CONFIG_CBS_AV1 0 -@@ -682,7 +682,7 @@ +@@ -678,7 +678,7 @@ #define CONFIG_DEFLATE_WRAPPER 0 #define CONFIG_DIRAC_PARSE 1 #define CONFIG_DNN 0 @@ -2448,7 +2448,7 @@ index 55412afe8a..1ea6a410c9 100644 #define CONFIG_DVPROFILE 0 #define CONFIG_EVCPARSE 0 #define CONFIG_EXIF 0 -@@ -701,8 +701,8 @@ +@@ -697,8 +697,8 @@ #define CONFIG_H264PRED 1 #define CONFIG_H264QPEL 0 #define CONFIG_H264_SEI 0 @@ -2460,7 +2460,7 @@ index 55412afe8a..1ea6a410c9 100644 #define CONFIG_HUFFMAN 0 #define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/Chromium/mac/arm64/config_components.h b/chromium/config/Chromium/mac/arm64/config_components.h -index 21fcd6e8fc..4190b27fcd 100644 +index 9989b9246a..a761e839d4 100644 --- a/chromium/config/Chromium/mac/arm64/config_components.h +++ b/chromium/config/Chromium/mac/arm64/config_components.h @@ -137,7 +137,7 @@ @@ -2472,7 +2472,7 @@ index 21fcd6e8fc..4190b27fcd 100644 #define CONFIG_HEVC_QSV_DECODER 0 #define CONFIG_HEVC_RKMPP_DECODER 0 #define CONFIG_HEVC_V4L2M2M_DECODER 0 -@@ -973,7 +973,7 @@ +@@ -975,7 +975,7 @@ #define CONFIG_H261_PARSER 0 #define CONFIG_H263_PARSER 0 #define CONFIG_H264_PARSER 0 @@ -2502,10 +2502,10 @@ index f81fbe8bbc..2d65b7d8ad 100644 + &ff_hevc_parser, NULL }; diff --git a/chromium/config/Chromium/mac/x64/config.asm b/chromium/config/Chromium/mac/x64/config.asm -index a853fb1031..11813e742c 100644 +index c34ea5ab67..492a5a8196 100644 --- a/chromium/config/Chromium/mac/x64/config.asm +++ b/chromium/config/Chromium/mac/x64/config.asm -@@ -652,7 +652,7 @@ +@@ -648,7 +648,7 @@ %define CONFIG_AUDIO_FRAME_QUEUE 0 %define CONFIG_AUDIODSP 0 %define CONFIG_BLOCKDSP 0 @@ -2514,7 +2514,7 @@ index a853fb1031..11813e742c 100644 %define CONFIG_CABAC 0 %define CONFIG_CBS 0 %define CONFIG_CBS_AV1 0 -@@ -665,7 +665,7 @@ +@@ -661,7 +661,7 @@ %define CONFIG_DEFLATE_WRAPPER 0 %define CONFIG_DIRAC_PARSE 1 %define CONFIG_DNN 0 @@ -2523,7 +2523,7 @@ index a853fb1031..11813e742c 100644 %define CONFIG_DVPROFILE 0 %define CONFIG_EVCPARSE 0 %define CONFIG_EXIF 0 -@@ -684,8 +684,8 @@ +@@ -680,8 +680,8 @@ %define CONFIG_H264PRED 1 %define CONFIG_H264QPEL 0 %define CONFIG_H264_SEI 0 @@ -2535,10 +2535,10 @@ index a853fb1031..11813e742c 100644 %define CONFIG_HUFFMAN 0 %define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/Chromium/mac/x64/config.h b/chromium/config/Chromium/mac/x64/config.h -index c727314c52..1e2489a4ba 100644 +index d7d2b75871..0d226f54bf 100644 --- a/chromium/config/Chromium/mac/x64/config.h +++ b/chromium/config/Chromium/mac/x64/config.h -@@ -668,7 +668,7 @@ +@@ -664,7 +664,7 @@ #define CONFIG_AUDIO_FRAME_QUEUE 0 #define CONFIG_AUDIODSP 0 #define CONFIG_BLOCKDSP 0 @@ -2547,7 +2547,7 @@ index c727314c52..1e2489a4ba 100644 #define CONFIG_CABAC 0 #define CONFIG_CBS 0 #define CONFIG_CBS_AV1 0 -@@ -681,7 +681,7 @@ +@@ -677,7 +677,7 @@ #define CONFIG_DEFLATE_WRAPPER 0 #define CONFIG_DIRAC_PARSE 1 #define CONFIG_DNN 0 @@ -2556,7 +2556,7 @@ index c727314c52..1e2489a4ba 100644 #define CONFIG_DVPROFILE 0 #define CONFIG_EVCPARSE 0 #define CONFIG_EXIF 0 -@@ -700,8 +700,8 @@ +@@ -696,8 +696,8 @@ #define CONFIG_H264PRED 1 #define CONFIG_H264QPEL 0 #define CONFIG_H264_SEI 0 @@ -2568,7 +2568,7 @@ index c727314c52..1e2489a4ba 100644 #define CONFIG_HUFFMAN 0 #define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/Chromium/mac/x64/config_components.h b/chromium/config/Chromium/mac/x64/config_components.h -index 21fcd6e8fc..4190b27fcd 100644 +index 9989b9246a..a761e839d4 100644 --- a/chromium/config/Chromium/mac/x64/config_components.h +++ b/chromium/config/Chromium/mac/x64/config_components.h @@ -137,7 +137,7 @@ @@ -2580,7 +2580,7 @@ index 21fcd6e8fc..4190b27fcd 100644 #define CONFIG_HEVC_QSV_DECODER 0 #define CONFIG_HEVC_RKMPP_DECODER 0 #define CONFIG_HEVC_V4L2M2M_DECODER 0 -@@ -973,7 +973,7 @@ +@@ -975,7 +975,7 @@ #define CONFIG_H261_PARSER 0 #define CONFIG_H263_PARSER 0 #define CONFIG_H264_PARSER 0 @@ -2810,10 +2810,10 @@ index 4c59b89cdf..8629776838 100644 + &ff_hevc_parser, NULL }; diff --git a/chromium/config/Chromium/win/arm64/config.h b/chromium/config/Chromium/win/arm64/config.h -index 08830eb27e..75f13c4390 100644 +index 3602e2a668..0c38849828 100644 --- a/chromium/config/Chromium/win/arm64/config.h +++ b/chromium/config/Chromium/win/arm64/config.h -@@ -669,7 +669,7 @@ +@@ -665,7 +665,7 @@ #define CONFIG_AUDIO_FRAME_QUEUE 0 #define CONFIG_AUDIODSP 0 #define CONFIG_BLOCKDSP 0 @@ -2822,7 +2822,7 @@ index 08830eb27e..75f13c4390 100644 #define CONFIG_CABAC 0 #define CONFIG_CBS 0 #define CONFIG_CBS_AV1 0 -@@ -682,7 +682,7 @@ +@@ -678,7 +678,7 @@ #define CONFIG_DEFLATE_WRAPPER 0 #define CONFIG_DIRAC_PARSE 1 #define CONFIG_DNN 0 @@ -2831,7 +2831,7 @@ index 08830eb27e..75f13c4390 100644 #define CONFIG_DVPROFILE 0 #define CONFIG_EVCPARSE 0 #define CONFIG_EXIF 0 -@@ -701,8 +701,8 @@ +@@ -697,8 +697,8 @@ #define CONFIG_H264PRED 1 #define CONFIG_H264QPEL 0 #define CONFIG_H264_SEI 0 @@ -2843,7 +2843,7 @@ index 08830eb27e..75f13c4390 100644 #define CONFIG_HUFFMAN 0 #define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/Chromium/win/arm64/config_components.h b/chromium/config/Chromium/win/arm64/config_components.h -index 21fcd6e8fc..4190b27fcd 100644 +index 9989b9246a..a761e839d4 100644 --- a/chromium/config/Chromium/win/arm64/config_components.h +++ b/chromium/config/Chromium/win/arm64/config_components.h @@ -137,7 +137,7 @@ @@ -2855,7 +2855,7 @@ index 21fcd6e8fc..4190b27fcd 100644 #define CONFIG_HEVC_QSV_DECODER 0 #define CONFIG_HEVC_RKMPP_DECODER 0 #define CONFIG_HEVC_V4L2M2M_DECODER 0 -@@ -973,7 +973,7 @@ +@@ -975,7 +975,7 @@ #define CONFIG_H261_PARSER 0 #define CONFIG_H263_PARSER 0 #define CONFIG_H264_PARSER 0 @@ -2885,10 +2885,10 @@ index f81fbe8bbc..2d65b7d8ad 100644 + &ff_hevc_parser, NULL }; diff --git a/chromium/config/Chromium/win/ia32/config.asm b/chromium/config/Chromium/win/ia32/config.asm -index 287b6e9622..b3e84b2e62 100644 +index 4493c7faad..3d6b2793af 100644 --- a/chromium/config/Chromium/win/ia32/config.asm +++ b/chromium/config/Chromium/win/ia32/config.asm -@@ -652,7 +652,7 @@ +@@ -648,7 +648,7 @@ %define CONFIG_AUDIO_FRAME_QUEUE 0 %define CONFIG_AUDIODSP 0 %define CONFIG_BLOCKDSP 0 @@ -2897,7 +2897,7 @@ index 287b6e9622..b3e84b2e62 100644 %define CONFIG_CABAC 0 %define CONFIG_CBS 0 %define CONFIG_CBS_AV1 0 -@@ -665,7 +665,7 @@ +@@ -661,7 +661,7 @@ %define CONFIG_DEFLATE_WRAPPER 0 %define CONFIG_DIRAC_PARSE 1 %define CONFIG_DNN 0 @@ -2906,7 +2906,7 @@ index 287b6e9622..b3e84b2e62 100644 %define CONFIG_DVPROFILE 0 %define CONFIG_EVCPARSE 0 %define CONFIG_EXIF 0 -@@ -684,8 +684,8 @@ +@@ -680,8 +680,8 @@ %define CONFIG_H264PRED 1 %define CONFIG_H264QPEL 0 %define CONFIG_H264_SEI 0 @@ -2918,10 +2918,10 @@ index 287b6e9622..b3e84b2e62 100644 %define CONFIG_HUFFMAN 0 %define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/Chromium/win/ia32/config.h b/chromium/config/Chromium/win/ia32/config.h -index 6e0f6dd395..790f5c8eaa 100644 +index b4ad69285f..59ae306217 100644 --- a/chromium/config/Chromium/win/ia32/config.h +++ b/chromium/config/Chromium/win/ia32/config.h -@@ -668,7 +668,7 @@ +@@ -664,7 +664,7 @@ #define CONFIG_AUDIO_FRAME_QUEUE 0 #define CONFIG_AUDIODSP 0 #define CONFIG_BLOCKDSP 0 @@ -2930,7 +2930,7 @@ index 6e0f6dd395..790f5c8eaa 100644 #define CONFIG_CABAC 0 #define CONFIG_CBS 0 #define CONFIG_CBS_AV1 0 -@@ -681,7 +681,7 @@ +@@ -677,7 +677,7 @@ #define CONFIG_DEFLATE_WRAPPER 0 #define CONFIG_DIRAC_PARSE 1 #define CONFIG_DNN 0 @@ -2939,7 +2939,7 @@ index 6e0f6dd395..790f5c8eaa 100644 #define CONFIG_DVPROFILE 0 #define CONFIG_EVCPARSE 0 #define CONFIG_EXIF 0 -@@ -700,8 +700,8 @@ +@@ -696,8 +696,8 @@ #define CONFIG_H264PRED 1 #define CONFIG_H264QPEL 0 #define CONFIG_H264_SEI 0 @@ -2951,7 +2951,7 @@ index 6e0f6dd395..790f5c8eaa 100644 #define CONFIG_HUFFMAN 0 #define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/Chromium/win/ia32/config_components.h b/chromium/config/Chromium/win/ia32/config_components.h -index 21fcd6e8fc..4190b27fcd 100644 +index 9989b9246a..a761e839d4 100644 --- a/chromium/config/Chromium/win/ia32/config_components.h +++ b/chromium/config/Chromium/win/ia32/config_components.h @@ -137,7 +137,7 @@ @@ -2963,7 +2963,7 @@ index 21fcd6e8fc..4190b27fcd 100644 #define CONFIG_HEVC_QSV_DECODER 0 #define CONFIG_HEVC_RKMPP_DECODER 0 #define CONFIG_HEVC_V4L2M2M_DECODER 0 -@@ -973,7 +973,7 @@ +@@ -975,7 +975,7 @@ #define CONFIG_H261_PARSER 0 #define CONFIG_H263_PARSER 0 #define CONFIG_H264_PARSER 0 @@ -2993,10 +2993,10 @@ index f81fbe8bbc..2d65b7d8ad 100644 + &ff_hevc_parser, NULL }; diff --git a/chromium/config/Chromium/win/x64/config.asm b/chromium/config/Chromium/win/x64/config.asm -index 7e139c1d42..36f8b6675e 100644 +index 386586e36f..3748166921 100644 --- a/chromium/config/Chromium/win/x64/config.asm +++ b/chromium/config/Chromium/win/x64/config.asm -@@ -652,7 +652,7 @@ +@@ -648,7 +648,7 @@ %define CONFIG_AUDIO_FRAME_QUEUE 0 %define CONFIG_AUDIODSP 0 %define CONFIG_BLOCKDSP 0 @@ -3005,7 +3005,7 @@ index 7e139c1d42..36f8b6675e 100644 %define CONFIG_CABAC 0 %define CONFIG_CBS 0 %define CONFIG_CBS_AV1 0 -@@ -665,7 +665,7 @@ +@@ -661,7 +661,7 @@ %define CONFIG_DEFLATE_WRAPPER 0 %define CONFIG_DIRAC_PARSE 1 %define CONFIG_DNN 0 @@ -3014,7 +3014,7 @@ index 7e139c1d42..36f8b6675e 100644 %define CONFIG_DVPROFILE 0 %define CONFIG_EVCPARSE 0 %define CONFIG_EXIF 0 -@@ -684,8 +684,8 @@ +@@ -680,8 +680,8 @@ %define CONFIG_H264PRED 1 %define CONFIG_H264QPEL 0 %define CONFIG_H264_SEI 0 @@ -3026,10 +3026,10 @@ index 7e139c1d42..36f8b6675e 100644 %define CONFIG_HUFFMAN 0 %define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/Chromium/win/x64/config.h b/chromium/config/Chromium/win/x64/config.h -index e3f13d4052..c8588609d6 100644 +index cf3284802e..8f31620146 100644 --- a/chromium/config/Chromium/win/x64/config.h +++ b/chromium/config/Chromium/win/x64/config.h -@@ -668,7 +668,7 @@ +@@ -664,7 +664,7 @@ #define CONFIG_AUDIO_FRAME_QUEUE 0 #define CONFIG_AUDIODSP 0 #define CONFIG_BLOCKDSP 0 @@ -3038,7 +3038,7 @@ index e3f13d4052..c8588609d6 100644 #define CONFIG_CABAC 0 #define CONFIG_CBS 0 #define CONFIG_CBS_AV1 0 -@@ -681,7 +681,7 @@ +@@ -677,7 +677,7 @@ #define CONFIG_DEFLATE_WRAPPER 0 #define CONFIG_DIRAC_PARSE 1 #define CONFIG_DNN 0 @@ -3047,7 +3047,7 @@ index e3f13d4052..c8588609d6 100644 #define CONFIG_DVPROFILE 0 #define CONFIG_EVCPARSE 0 #define CONFIG_EXIF 0 -@@ -700,8 +700,8 @@ +@@ -696,8 +696,8 @@ #define CONFIG_H264PRED 1 #define CONFIG_H264QPEL 0 #define CONFIG_H264_SEI 0 @@ -3059,7 +3059,7 @@ index e3f13d4052..c8588609d6 100644 #define CONFIG_HUFFMAN 0 #define CONFIG_HUFFYUVDSP 0 diff --git a/chromium/config/Chromium/win/x64/config_components.h b/chromium/config/Chromium/win/x64/config_components.h -index 21fcd6e8fc..4190b27fcd 100644 +index 9989b9246a..a761e839d4 100644 --- a/chromium/config/Chromium/win/x64/config_components.h +++ b/chromium/config/Chromium/win/x64/config_components.h @@ -137,7 +137,7 @@ @@ -3071,7 +3071,7 @@ index 21fcd6e8fc..4190b27fcd 100644 #define CONFIG_HEVC_QSV_DECODER 0 #define CONFIG_HEVC_RKMPP_DECODER 0 #define CONFIG_HEVC_V4L2M2M_DECODER 0 -@@ -973,7 +973,7 @@ +@@ -975,7 +975,7 @@ #define CONFIG_H261_PARSER 0 #define CONFIG_H263_PARSER 0 #define CONFIG_H264_PARSER 0 @@ -3101,10 +3101,10 @@ index f81fbe8bbc..2d65b7d8ad 100644 + &ff_hevc_parser, NULL }; diff --git a/chromium/scripts/build_ffmpeg.py b/chromium/scripts/build_ffmpeg.py -index 44739f5d72..17ace16075 100755 +index f1ed4ce144..bd87ea065a 100755 --- a/chromium/scripts/build_ffmpeg.py +++ b/chromium/scripts/build_ffmpeg.py -@@ -1015,9 +1015,9 @@ def ConfigureAndBuild(target_arch, target_os, host_os, host_arch, parallel_jobs, +@@ -1013,9 +1013,9 @@ def ConfigureAndBuild(target_arch, target_os, host_os, host_arch, parallel_jobs, # Google Chrome & ChromeOS specific configuration. configure_flags['Chrome'].extend([ @@ -3117,10 +3117,10 @@ index 44739f5d72..17ace16075 100755 # Google ChromeOS specific configuration. diff --git a/ffmpeg_generated.gni b/ffmpeg_generated.gni -index 375489c10e..df7a100404 100644 +index 05965c3aff..d933edfdf0 100644 --- a/ffmpeg_generated.gni +++ b/ffmpeg_generated.gni -@@ -242,6 +242,25 @@ if (use_linux_config && ffmpeg_branding == "ChromeOS") { +@@ -239,6 +239,25 @@ if (use_linux_config && ffmpeg_branding == "ChromeOS") { } if ((is_apple && ffmpeg_branding == "Chrome") || (is_win && ffmpeg_branding == "Chrome") || (use_linux_config && ffmpeg_branding == "Chrome") || (use_linux_config && ffmpeg_branding == "ChromeOS")) { @@ -3146,7 +3146,7 @@ index 375489c10e..df7a100404 100644 ffmpeg_c_sources += [ "libavcodec/atsc_a53.c", "libavcodec/cabac.c", -@@ -338,6 +357,22 @@ if ((use_linux_config && current_cpu == "arm" && arm_use_neon && ffmpeg_branding +@@ -313,6 +332,22 @@ if ((use_linux_config && current_cpu == "arm" && arm_use_neon && ffmpeg_branding } if ((is_apple && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (use_linux_config && current_cpu == "x64" && ffmpeg_branding == "Chrome") || (use_linux_config && current_cpu == "x64" && ffmpeg_branding == "ChromeOS") || (use_linux_config && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (use_linux_config && current_cpu == "x86" && ffmpeg_branding == "ChromeOS")) { @@ -3169,7 +3169,7 @@ index 375489c10e..df7a100404 100644 ffmpeg_c_sources += [ "libavcodec/x86/h264_qpel.c", "libavcodec/x86/h264chroma_init.c", -@@ -504,6 +539,19 @@ if ((is_apple && current_cpu == "arm64") || (is_win && current_cpu == "arm64") | +@@ -491,6 +526,19 @@ if ((is_apple && current_cpu == "arm64") || (is_win && current_cpu == "arm64") | } if ((is_apple && current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (use_linux_config && current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (use_linux_config && current_cpu == "arm64" && ffmpeg_branding == "ChromeOS")) { @@ -3183,13 +3183,13 @@ index 375489c10e..df7a100404 100644 + "libavcodec/aarch64/autorename_libavcodec_aarch64_hevcdsp_sao_neon.S", + "libavcodec/aarch64/hevcdsp_deblock_neon.S", + "libavcodec/aarch64/hevcdsp_epel_neon.S", -+ "libavcodec/aarch64/hevcdsp_qpel_neon.S", ++ "libavcodec/aarch64/hevcdsp_qpel_neon.S" + ] + ffmpeg_c_sources += [ "libavcodec/aarch64/h264chroma_init_aarch64.c", "libavcodec/aarch64/h264dsp_init_aarch64.c", -@@ -568,6 +616,11 @@ if (use_linux_config && current_cpu == "arm64" && ffmpeg_branding == "ChromeOS") +@@ -543,6 +591,11 @@ if (use_linux_config && current_cpu == "arm64" && ffmpeg_branding == "ChromeOS") } if ((use_linux_config && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "Chrome") || (use_linux_config && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "ChromeOS") || (use_linux_config && current_cpu == "arm" && ffmpeg_branding == "Chrome") || (use_linux_config && current_cpu == "arm" && ffmpeg_branding == "ChromeOS")) { @@ -3201,7 +3201,7 @@ index 375489c10e..df7a100404 100644 ffmpeg_c_sources += [ "libavcodec/arm/h264chroma_init_arm.c", "libavcodec/arm/h264dsp_init_arm.c", -@@ -579,6 +632,18 @@ if ((use_linux_config && current_cpu == "arm" && arm_use_neon && ffmpeg_branding +@@ -554,6 +607,18 @@ if ((use_linux_config && current_cpu == "arm" && arm_use_neon && ffmpeg_branding } if ((use_linux_config && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "Chrome") || (use_linux_config && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "ChromeOS")) { @@ -3248,5 +3248,5 @@ index 0000000000..3accbac3e4 +#include "bswapdsp.c" \ No newline at end of file -- -2.39.2 (Apple Git-143) +2.37.2.windows.2 diff --git a/src/chrome/browser/thorium_flag_entries.h b/src/chrome/browser/thorium_flag_entries.h index 573a3d9c..ee60b7f8 100644 --- a/src/chrome/browser/thorium_flag_entries.h +++ b/src/chrome/browser/thorium_flag_entries.h @@ -98,6 +98,11 @@ "Enable Native GPU Memory Buffers", "Enables native CPU-mappable GPU memory buffer support on Linux.", kOsLinux, SINGLE_VALUE_TYPE(switches::kEnableNativeGpuMemoryBuffers)}, + {"vaapi-video-decode-linux-gl", + "GL Vaapi Video Decode", + "Toggle whether the GL backend is used for VAAPI video decode acceleration. " + "Enabled by default, but may break some configurations. Thorium flag.", + kOsLinux, FEATURE_VALUE_TYPE(kVaapiVideoDecodeLinuxGL)}, #endif // BUILDFLAG(IS_LINUX) {"gpu-no-context-lost", diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/config.h b/src/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/config.h index 73bca51c..d759f81d 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/arm-linux-androideabi --extra-cflags='--target=arm-linux-androideabi24' --extra-ldflags='--target=arm-linux-androideabi24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/arm-linux-androideabi --extra-ldflags='--gcc-toolchain=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-neon --extra-cflags='-mtune=generic-armv7-a' --extra-cflags='-mfloat-abi=softfp' --extra-cflags='-mfpu=neon' --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/arm-linux-androideabi --extra-cflags='--target=arm-linux-androideabi24' --extra-ldflags='--target=arm-linux-androideabi24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/arm-linux-androideabi --extra-ldflags='--gcc-toolchain=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-neon --extra-cflags='-mtune=generic-armv7-a' --extra-cflags='-mfloat-abi=softfp' --extra-cflags='-mfpu=neon' --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME android #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/config_components.h b/src/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/config_components.h index 7e09d5f5..941ec3c9 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/android/arm64/config.h b/src/third_party/ffmpeg/chromium/config/Chrome/android/arm64/config.h index eadd0284..c32cd7b0 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/android/arm64/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/android/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/aarch64-linux-android --extra-cflags='--target=aarch64-linux-android24' --extra-ldflags='--target=aarch64-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/aarch64-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/aarch64-linux-android --extra-cflags='--target=aarch64-linux-android24' --extra-ldflags='--target=aarch64-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/aarch64-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME android #define av_restrict restrict #define EXTERN_PREFIX "" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/android/arm64/config_components.h b/src/third_party/ffmpeg/chromium/config/Chrome/android/arm64/config_components.h index 7e09d5f5..941ec3c9 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/android/arm64/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/android/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/android/arm64/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chrome/android/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/android/arm64/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/android/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config.h b/src/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config.h index 12e20871..8f7c6ee4 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/i686-linux-android --extra-cflags='--target=i686-linux-android24' --extra-ldflags='--target=i686-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/i686-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --disable-x86asm --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/i686-linux-android --extra-cflags='--target=i686-linux-android24' --extra-ldflags='--target=i686-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/i686-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --disable-x86asm --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME android #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -199,7 +198,7 @@ #define HAVE_ALIGNED_STACK 1 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CLZ 1 -#define HAVE_FAST_CMOV 0 +#define HAVE_FAST_CMOV 1 #define HAVE_FAST_FLOAT16 0 #define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 1 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config_components.h b/src/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config_components.h index 7e09d5f5..941ec3c9 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/android/ia32/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chrome/android/ia32/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/android/ia32/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/android/ia32/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.asm b/src/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.asm index ed8bef71..7edacd19 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.asm +++ b/src/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.h b/src/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.h index 3ba83b04..0989111b 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/x86_64-linux-android --extra-cflags='--target=x86_64-linux-android24' --extra-ldflags='--target=x86_64-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/x86_64-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=x86_64 --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/x86_64-linux-android --extra-cflags='--target=x86_64-linux-android24' --extra-ldflags='--target=x86_64-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/x86_64-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=x86_64 --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME android #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/android/x64/config_components.h b/src/third_party/ffmpeg/chromium/config/Chrome/android/x64/config_components.h index 7e09d5f5..941ec3c9 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/android/x64/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/android/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/android/x64/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chrome/android/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/android/x64/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/android/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/config.h b/src/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/config.h index 7368ff7e..29ed1efa 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/17/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/18/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME darwin #define av_restrict restrict #define EXTERN_PREFIX "_" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/config_components.h b/src/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/config_components.h index 5ad65d1e..74d256a0 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/ios/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config.asm b/src/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config.asm index d9bdaeec..152bc873 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config.asm +++ b/src/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config.h b/src/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config.h index bb6d3694..5b648b58 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=x86_64-apple-macosx' --extra-cflags=-F/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/17/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags='-arch x86_64' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=x86_64-apple-macosx' --extra-cflags=-F/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/18/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags='-arch x86_64' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME darwin #define av_restrict restrict #define EXTERN_PREFIX "_" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config_components.h b/src/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config_components.h index 1beef521..cc7e540c 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/ios/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/ios/x64/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chrome/ios/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/ios/x64/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/ios/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config.h b/src/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config.h index bc2366cd..9ca5c18b 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --disable-asm --disable-inline-asm --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --disable-asm --disable-inline-asm --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -199,7 +198,7 @@ #define HAVE_ALIGNED_STACK 0 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CLZ 0 -#define HAVE_FAST_CMOV 0 +#define HAVE_FAST_CMOV 1 #define HAVE_FAST_FLOAT16 0 #define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 0 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 0 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config_components.h b/src/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config_components.h index 1beef521..cc7e540c 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/config.h b/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/config.h index 17369792..96c88e3e 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/config_components.h b/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/config_components.h index 5ad65d1e..74d256a0 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm/config.h b/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm/config.h index a1db8f69..69704027 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm/config_components.h b/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm/config_components.h index 5ad65d1e..74d256a0 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/config.h b/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/config.h index 7c3cc691..f6e4d95c 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --target-os=linux --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_arm64-sysroot --disable-dotprod --disable-i8mm --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --target-os=linux --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_arm64-sysroot --disable-dotprod --disable-i8mm --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/config_components.h b/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/config_components.h index 5ad65d1e..74d256a0 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.asm b/src/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.asm index abcd3716..baff8fea 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.asm +++ b/src/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.asm @@ -23,7 +23,6 @@ %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 @@ -183,7 +182,7 @@ %define HAVE_ALIGNED_STACK 1 %define HAVE_FAST_64BIT 0 %define HAVE_FAST_CLZ 1 -%define HAVE_FAST_CMOV 0 +%define HAVE_FAST_CMOV 1 %define HAVE_FAST_FLOAT16 0 %define HAVE_LOCAL_ALIGNED 1 %define HAVE_SIMD_ALIGN_16 1 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.h b/src/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.h index 3240ff65..9c92dd31 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -199,7 +198,7 @@ #define HAVE_ALIGNED_STACK 1 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CLZ 1 -#define HAVE_FAST_CMOV 0 +#define HAVE_FAST_CMOV 1 #define HAVE_FAST_FLOAT16 0 #define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 1 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config_components.h b/src/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config_components.h index 5ad65d1e..74d256a0 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.asm b/src/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.asm index f5f4935e..f58c6865 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.asm +++ b/src/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 @@ -646,13 +642,13 @@ %define CONFIG_MUXERS 0 %define CONFIG_PROTOCOLS 0 %define CONFIG_AANDCTTABLES 0 -%define CONFIG_AC3DSP 1 +%define CONFIG_AC3DSP 0 %define CONFIG_ADTS_HEADER 1 %define CONFIG_ATSC_A53 1 %define CONFIG_AUDIO_FRAME_QUEUE 0 %define CONFIG_AUDIODSP 0 %define CONFIG_BLOCKDSP 0 -%define CONFIG_BSWAPDSP 1 +%define CONFIG_BSWAPDSP 0 %define CONFIG_CABAC 1 %define CONFIG_CBS 0 %define CONFIG_CBS_AV1 0 @@ -660,12 +656,12 @@ %define CONFIG_CBS_H265 0 %define CONFIG_CBS_H266 0 %define CONFIG_CBS_JPEG 0 -%define CONFIG_CBS_MPEG2 1 +%define CONFIG_CBS_MPEG2 0 %define CONFIG_CBS_VP9 0 %define CONFIG_DEFLATE_WRAPPER 0 %define CONFIG_DIRAC_PARSE 1 %define CONFIG_DNN 0 -%define CONFIG_DOVI_RPU 1 +%define CONFIG_DOVI_RPU 0 %define CONFIG_DVPROFILE 0 %define CONFIG_EVCPARSE 0 %define CONFIG_EXIF 0 @@ -684,7 +680,7 @@ %define CONFIG_H264PRED 1 %define CONFIG_H264QPEL 1 %define CONFIG_H264_SEI 1 -%define CONFIG_HEVCPARSE 1 +%define CONFIG_HEVCPARSE 0 %define CONFIG_HEVC_SEI 0 %define CONFIG_HPELDSP 1 %define CONFIG_HUFFMAN 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.h b/src/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.h index d3b37560..12a4ce27 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 @@ -662,7 +658,7 @@ #define CONFIG_MUXERS 0 #define CONFIG_PROTOCOLS 0 #define CONFIG_AANDCTTABLES 0 -#define CONFIG_AC3DSP 1 +#define CONFIG_AC3DSP 0 #define CONFIG_ADTS_HEADER 1 #define CONFIG_ATSC_A53 1 #define CONFIG_AUDIO_FRAME_QUEUE 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config_components.h b/src/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config_components.h index 5e682ef7..74d256a0 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config_components.h @@ -10,7 +10,7 @@ #define CONFIG_DCA_CORE_BSF 0 #define CONFIG_DTS2PTS_BSF 0 #define CONFIG_DV_ERROR_MARKER_BSF 0 -#define CONFIG_EAC3_CORE_BSF 1 +#define CONFIG_EAC3_CORE_BSF 0 #define CONFIG_EXTRACT_EXTRADATA_BSF 0 #define CONFIG_FILTER_UNITS_BSF 0 #define CONFIG_H264_METADATA_BSF 0 @@ -343,8 +343,8 @@ #define CONFIG_AAC_DECODER 1 #define CONFIG_AAC_FIXED_DECODER 0 #define CONFIG_AAC_LATM_DECODER 0 -#define CONFIG_AC3_DECODER 1 -#define CONFIG_AC3_FIXED_DECODER 1 +#define CONFIG_AC3_DECODER 0 +#define CONFIG_AC3_FIXED_DECODER 0 #define CONFIG_ACELP_KELVIN_DECODER 0 #define CONFIG_ALAC_DECODER 0 #define CONFIG_ALS_DECODER 0 @@ -375,7 +375,7 @@ #define CONFIG_DSICINAUDIO_DECODER 0 #define CONFIG_DSS_SP_DECODER 0 #define CONFIG_DST_DECODER 0 -#define CONFIG_EAC3_DECODER 1 +#define CONFIG_EAC3_DECODER 0 #define CONFIG_EVRC_DECODER 0 #define CONFIG_FASTAUDIO_DECODER 0 #define CONFIG_FFWAVESYNTH_DECODER 0 @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -562,11 +563,11 @@ #define CONFIG_WEBVTT_DECODER 0 #define CONFIG_XSUB_DECODER 0 #define CONFIG_AAC_AT_DECODER 0 -#define CONFIG_AC3_AT_DECODER 1 +#define CONFIG_AC3_AT_DECODER 0 #define CONFIG_ADPCM_IMA_QT_AT_DECODER 0 #define CONFIG_ALAC_AT_DECODER 0 #define CONFIG_AMR_NB_AT_DECODER 0 -#define CONFIG_EAC3_AT_DECODER 1 +#define CONFIG_EAC3_AT_DECODER 0 #define CONFIG_GSM_MS_AT_DECODER 0 #define CONFIG_ILBC_AT_DECODER 0 #define CONFIG_MP1_AT_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -944,7 +946,7 @@ #define CONFIG_WMV3_VDPAU_HWACCEL 0 #define CONFIG_AAC_PARSER 1 #define CONFIG_AAC_LATM_PARSER 0 -#define CONFIG_AC3_PARSER 1 +#define CONFIG_AC3_PARSER 0 #define CONFIG_ADX_PARSER 0 #define CONFIG_AMR_PARSER 0 #define CONFIG_AV1_PARSER 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1601,7 +1608,7 @@ #define CONFIG_AA_DEMUXER 0 #define CONFIG_AAC_DEMUXER 1 #define CONFIG_AAX_DEMUXER 0 -#define CONFIG_AC3_DEMUXER 1 +#define CONFIG_AC3_DEMUXER 0 #define CONFIG_AC4_DEMUXER 0 #define CONFIG_ACE_DEMUXER 0 #define CONFIG_ACM_DEMUXER 0 @@ -1684,7 +1691,7 @@ #define CONFIG_DXA_DEMUXER 0 #define CONFIG_EA_DEMUXER 0 #define CONFIG_EA_CDATA_DEMUXER 0 -#define CONFIG_EAC3_DEMUXER 1 +#define CONFIG_EAC3_DEMUXER 0 #define CONFIG_EPAF_DEMUXER 0 #define CONFIG_EVC_DEMUXER 0 #define CONFIG_FFMETADATA_DEMUXER 0 @@ -1713,7 +1720,7 @@ #define CONFIG_H264_DEMUXER 0 #define CONFIG_HCA_DEMUXER 0 #define CONFIG_HCOM_DEMUXER 0 -#define CONFIG_HEVC_DEMUXER 1 +#define CONFIG_HEVC_DEMUXER 0 #define CONFIG_HLS_DEMUXER 0 #define CONFIG_HNM_DEMUXER 0 #define CONFIG_ICO_DEMUXER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavcodec/codec_list.c b/src/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavcodec/codec_list.c index 0924c3f8..80d0456b 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavcodec/codec_list.c +++ b/src/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavcodec/codec_list.c @@ -17,8 +17,5 @@ static const FFCodec * const codec_list[] = { &ff_pcm_s32le_decoder, &ff_pcm_u8_decoder, &ff_libopus_decoder, - &ff_ac3_decoder, - &ff_eac3_decoder, - &ff_ac3_fixed_decoder, &ff_hevc_decoder, NULL }; diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavcodec/parser_list.c b/src/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavcodec/parser_list.c index 353b88c6..1269282a 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavcodec/parser_list.c +++ b/src/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavcodec/parser_list.c @@ -8,6 +8,5 @@ static const AVCodecParser * const parser_list[] = { &ff_vp3_parser, &ff_vp8_parser, &ff_vp9_parser, - &ff_ac3_parser, &ff_hevc_parser, NULL }; diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavformat/demuxer_list.c b/src/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavformat/demuxer_list.c index d6d293dc..920b22bf 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavformat/demuxer_list.c +++ b/src/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavformat/demuxer_list.c @@ -6,6 +6,4 @@ static const AVInputFormat * const demuxer_list[] = { &ff_mp3_demuxer, &ff_ogg_demuxer, &ff_wav_demuxer, - &ff_ac3_demuxer, - &ff_eac3_demuxer, NULL }; diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/config.h b/src/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/config.h index 7368ff7e..29ed1efa 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/17/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/18/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME darwin #define av_restrict restrict #define EXTERN_PREFIX "_" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/config_components.h b/src/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/config_components.h index 5ad65d1e..74d256a0 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/mac/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.asm b/src/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.asm index 72fdcd98..12ef0724 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.asm +++ b/src/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 @@ -646,7 +642,7 @@ %define CONFIG_MUXERS 0 %define CONFIG_PROTOCOLS 0 %define CONFIG_AANDCTTABLES 0 -%define CONFIG_AC3DSP 1 +%define CONFIG_AC3DSP 0 %define CONFIG_ADTS_HEADER 1 %define CONFIG_ATSC_A53 1 %define CONFIG_AUDIO_FRAME_QUEUE 0 @@ -660,7 +656,7 @@ %define CONFIG_CBS_H265 0 %define CONFIG_CBS_H266 0 %define CONFIG_CBS_JPEG 0 -%define CONFIG_CBS_MPEG2 1 +%define CONFIG_CBS_MPEG2 0 %define CONFIG_CBS_VP9 0 %define CONFIG_DEFLATE_WRAPPER 0 %define CONFIG_DIRAC_PARSE 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.h b/src/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.h index 795105b9..36e1e861 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=x86_64-apple-macosx' --extra-cflags=-F/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/17/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags='-arch x86_64' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=x86_64-apple-macosx' --extra-cflags=-F/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/18/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags='-arch x86_64' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME darwin #define av_restrict restrict #define EXTERN_PREFIX "_" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 @@ -662,7 +658,7 @@ #define CONFIG_MUXERS 0 #define CONFIG_PROTOCOLS 0 #define CONFIG_AANDCTTABLES 0 -#define CONFIG_AC3DSP 1 +#define CONFIG_AC3DSP 0 #define CONFIG_ADTS_HEADER 1 #define CONFIG_ATSC_A53 1 #define CONFIG_AUDIO_FRAME_QUEUE 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config_components.h b/src/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config_components.h index 5e682ef7..74d256a0 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config_components.h @@ -10,7 +10,7 @@ #define CONFIG_DCA_CORE_BSF 0 #define CONFIG_DTS2PTS_BSF 0 #define CONFIG_DV_ERROR_MARKER_BSF 0 -#define CONFIG_EAC3_CORE_BSF 1 +#define CONFIG_EAC3_CORE_BSF 0 #define CONFIG_EXTRACT_EXTRADATA_BSF 0 #define CONFIG_FILTER_UNITS_BSF 0 #define CONFIG_H264_METADATA_BSF 0 @@ -343,8 +343,8 @@ #define CONFIG_AAC_DECODER 1 #define CONFIG_AAC_FIXED_DECODER 0 #define CONFIG_AAC_LATM_DECODER 0 -#define CONFIG_AC3_DECODER 1 -#define CONFIG_AC3_FIXED_DECODER 1 +#define CONFIG_AC3_DECODER 0 +#define CONFIG_AC3_FIXED_DECODER 0 #define CONFIG_ACELP_KELVIN_DECODER 0 #define CONFIG_ALAC_DECODER 0 #define CONFIG_ALS_DECODER 0 @@ -375,7 +375,7 @@ #define CONFIG_DSICINAUDIO_DECODER 0 #define CONFIG_DSS_SP_DECODER 0 #define CONFIG_DST_DECODER 0 -#define CONFIG_EAC3_DECODER 1 +#define CONFIG_EAC3_DECODER 0 #define CONFIG_EVRC_DECODER 0 #define CONFIG_FASTAUDIO_DECODER 0 #define CONFIG_FFWAVESYNTH_DECODER 0 @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -562,11 +563,11 @@ #define CONFIG_WEBVTT_DECODER 0 #define CONFIG_XSUB_DECODER 0 #define CONFIG_AAC_AT_DECODER 0 -#define CONFIG_AC3_AT_DECODER 1 +#define CONFIG_AC3_AT_DECODER 0 #define CONFIG_ADPCM_IMA_QT_AT_DECODER 0 #define CONFIG_ALAC_AT_DECODER 0 #define CONFIG_AMR_NB_AT_DECODER 0 -#define CONFIG_EAC3_AT_DECODER 1 +#define CONFIG_EAC3_AT_DECODER 0 #define CONFIG_GSM_MS_AT_DECODER 0 #define CONFIG_ILBC_AT_DECODER 0 #define CONFIG_MP1_AT_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -944,7 +946,7 @@ #define CONFIG_WMV3_VDPAU_HWACCEL 0 #define CONFIG_AAC_PARSER 1 #define CONFIG_AAC_LATM_PARSER 0 -#define CONFIG_AC3_PARSER 1 +#define CONFIG_AC3_PARSER 0 #define CONFIG_ADX_PARSER 0 #define CONFIG_AMR_PARSER 0 #define CONFIG_AV1_PARSER 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1601,7 +1608,7 @@ #define CONFIG_AA_DEMUXER 0 #define CONFIG_AAC_DEMUXER 1 #define CONFIG_AAX_DEMUXER 0 -#define CONFIG_AC3_DEMUXER 1 +#define CONFIG_AC3_DEMUXER 0 #define CONFIG_AC4_DEMUXER 0 #define CONFIG_ACE_DEMUXER 0 #define CONFIG_ACM_DEMUXER 0 @@ -1684,7 +1691,7 @@ #define CONFIG_DXA_DEMUXER 0 #define CONFIG_EA_DEMUXER 0 #define CONFIG_EA_CDATA_DEMUXER 0 -#define CONFIG_EAC3_DEMUXER 1 +#define CONFIG_EAC3_DEMUXER 0 #define CONFIG_EPAF_DEMUXER 0 #define CONFIG_EVC_DEMUXER 0 #define CONFIG_FFMETADATA_DEMUXER 0 @@ -1713,7 +1720,7 @@ #define CONFIG_H264_DEMUXER 0 #define CONFIG_HCA_DEMUXER 0 #define CONFIG_HCOM_DEMUXER 0 -#define CONFIG_HEVC_DEMUXER 1 +#define CONFIG_HEVC_DEMUXER 0 #define CONFIG_HLS_DEMUXER 0 #define CONFIG_HNM_DEMUXER 0 #define CONFIG_ICO_DEMUXER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavcodec/codec_list.c b/src/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavcodec/codec_list.c index 0924c3f8..80d0456b 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavcodec/codec_list.c +++ b/src/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavcodec/codec_list.c @@ -17,8 +17,5 @@ static const FFCodec * const codec_list[] = { &ff_pcm_s32le_decoder, &ff_pcm_u8_decoder, &ff_libopus_decoder, - &ff_ac3_decoder, - &ff_eac3_decoder, - &ff_ac3_fixed_decoder, &ff_hevc_decoder, NULL }; diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavcodec/parser_list.c b/src/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavcodec/parser_list.c index 353b88c6..1269282a 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavcodec/parser_list.c +++ b/src/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavcodec/parser_list.c @@ -8,6 +8,5 @@ static const AVCodecParser * const parser_list[] = { &ff_vp3_parser, &ff_vp8_parser, &ff_vp9_parser, - &ff_ac3_parser, &ff_hevc_parser, NULL }; diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavformat/demuxer_list.c b/src/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavformat/demuxer_list.c index d6d293dc..920b22bf 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavformat/demuxer_list.c +++ b/src/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavformat/demuxer_list.c @@ -6,6 +6,4 @@ static const AVInputFormat * const demuxer_list[] = { &ff_mp3_demuxer, &ff_ogg_demuxer, &ff_wav_demuxer, - &ff_ac3_demuxer, - &ff_eac3_demuxer, NULL }; diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/win/arm64/config.h b/src/third_party/ffmpeg/chromium/config/Chrome/win/arm64/config.h index 50cb0da0..94f43b62 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/win/arm64/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/win/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --arch=aarch64 --as=clang-cl --extra-cflags='--target=arm64-windows' --extra-cflags=/winsysroot/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --arch=aarch64 --as=clang-cl --extra-cflags='--target=arm64-windows' --extra-cflags=/winsysroot/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME win32 #define av_restrict restrict #define EXTERN_PREFIX "" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/win/arm64/config_components.h b/src/third_party/ffmpeg/chromium/config/Chrome/win/arm64/config_components.h index 5ad65d1e..74d256a0 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/win/arm64/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/win/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/win/arm64/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chrome/win/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/win/arm64/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/win/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.asm b/src/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.asm index a035258d..d94bf572 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.asm +++ b/src/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.asm @@ -23,7 +23,6 @@ %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 @@ -183,7 +182,7 @@ %define HAVE_ALIGNED_STACK 0 %define HAVE_FAST_64BIT 0 %define HAVE_FAST_CLZ 1 -%define HAVE_FAST_CMOV 0 +%define HAVE_FAST_CMOV 1 %define HAVE_FAST_FLOAT16 0 %define HAVE_LOCAL_ALIGNED 1 %define HAVE_SIMD_ALIGN_16 1 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.h b/src/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.h index 0269bee9..a5deb797 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=-m32 --extra-cflags=/winsysroot/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=-m32 --extra-cflags=/winsysroot/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME win32 #define av_restrict restrict #define EXTERN_PREFIX "_" @@ -39,7 +39,6 @@ #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 @@ -199,7 +198,7 @@ #define HAVE_ALIGNED_STACK 0 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CLZ 1 -#define HAVE_FAST_CMOV 0 +#define HAVE_FAST_CMOV 1 #define HAVE_FAST_FLOAT16 0 #define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 1 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config_components.h b/src/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config_components.h index 5ad65d1e..74d256a0 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/win/ia32/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chrome/win/ia32/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/win/ia32/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/win/ia32/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.asm b/src/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.asm index 83483214..2df49631 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.asm +++ b/src/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 @@ -646,7 +642,7 @@ %define CONFIG_MUXERS 0 %define CONFIG_PROTOCOLS 0 %define CONFIG_AANDCTTABLES 0 -%define CONFIG_AC3DSP 1 +%define CONFIG_AC3DSP 0 %define CONFIG_ADTS_HEADER 1 %define CONFIG_ATSC_A53 1 %define CONFIG_AUDIO_FRAME_QUEUE 0 @@ -660,7 +656,7 @@ %define CONFIG_CBS_H265 0 %define CONFIG_CBS_H266 0 %define CONFIG_CBS_JPEG 0 -%define CONFIG_CBS_MPEG2 1 +%define CONFIG_CBS_MPEG2 0 %define CONFIG_CBS_VP9 0 %define CONFIG_DEFLATE_WRAPPER 0 %define CONFIG_DIRAC_PARSE 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.h b/src/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.h index 18ddfa1c..e524c62f 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/ffmpeg/chromium/include/win --target-os=win64 --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=/winsysroot/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/ffmpeg/chromium/include/win --target-os=win64 --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=/winsysroot/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME win64 #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 @@ -662,7 +658,7 @@ #define CONFIG_MUXERS 0 #define CONFIG_PROTOCOLS 0 #define CONFIG_AANDCTTABLES 0 -#define CONFIG_AC3DSP 1 +#define CONFIG_AC3DSP 0 #define CONFIG_ADTS_HEADER 1 #define CONFIG_ATSC_A53 1 #define CONFIG_AUDIO_FRAME_QUEUE 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/win/x64/config_components.h b/src/third_party/ffmpeg/chromium/config/Chrome/win/x64/config_components.h index 5e682ef7..74d256a0 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/win/x64/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/win/x64/config_components.h @@ -10,7 +10,7 @@ #define CONFIG_DCA_CORE_BSF 0 #define CONFIG_DTS2PTS_BSF 0 #define CONFIG_DV_ERROR_MARKER_BSF 0 -#define CONFIG_EAC3_CORE_BSF 1 +#define CONFIG_EAC3_CORE_BSF 0 #define CONFIG_EXTRACT_EXTRADATA_BSF 0 #define CONFIG_FILTER_UNITS_BSF 0 #define CONFIG_H264_METADATA_BSF 0 @@ -343,8 +343,8 @@ #define CONFIG_AAC_DECODER 1 #define CONFIG_AAC_FIXED_DECODER 0 #define CONFIG_AAC_LATM_DECODER 0 -#define CONFIG_AC3_DECODER 1 -#define CONFIG_AC3_FIXED_DECODER 1 +#define CONFIG_AC3_DECODER 0 +#define CONFIG_AC3_FIXED_DECODER 0 #define CONFIG_ACELP_KELVIN_DECODER 0 #define CONFIG_ALAC_DECODER 0 #define CONFIG_ALS_DECODER 0 @@ -375,7 +375,7 @@ #define CONFIG_DSICINAUDIO_DECODER 0 #define CONFIG_DSS_SP_DECODER 0 #define CONFIG_DST_DECODER 0 -#define CONFIG_EAC3_DECODER 1 +#define CONFIG_EAC3_DECODER 0 #define CONFIG_EVRC_DECODER 0 #define CONFIG_FASTAUDIO_DECODER 0 #define CONFIG_FFWAVESYNTH_DECODER 0 @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -562,11 +563,11 @@ #define CONFIG_WEBVTT_DECODER 0 #define CONFIG_XSUB_DECODER 0 #define CONFIG_AAC_AT_DECODER 0 -#define CONFIG_AC3_AT_DECODER 1 +#define CONFIG_AC3_AT_DECODER 0 #define CONFIG_ADPCM_IMA_QT_AT_DECODER 0 #define CONFIG_ALAC_AT_DECODER 0 #define CONFIG_AMR_NB_AT_DECODER 0 -#define CONFIG_EAC3_AT_DECODER 1 +#define CONFIG_EAC3_AT_DECODER 0 #define CONFIG_GSM_MS_AT_DECODER 0 #define CONFIG_ILBC_AT_DECODER 0 #define CONFIG_MP1_AT_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -944,7 +946,7 @@ #define CONFIG_WMV3_VDPAU_HWACCEL 0 #define CONFIG_AAC_PARSER 1 #define CONFIG_AAC_LATM_PARSER 0 -#define CONFIG_AC3_PARSER 1 +#define CONFIG_AC3_PARSER 0 #define CONFIG_ADX_PARSER 0 #define CONFIG_AMR_PARSER 0 #define CONFIG_AV1_PARSER 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1601,7 +1608,7 @@ #define CONFIG_AA_DEMUXER 0 #define CONFIG_AAC_DEMUXER 1 #define CONFIG_AAX_DEMUXER 0 -#define CONFIG_AC3_DEMUXER 1 +#define CONFIG_AC3_DEMUXER 0 #define CONFIG_AC4_DEMUXER 0 #define CONFIG_ACE_DEMUXER 0 #define CONFIG_ACM_DEMUXER 0 @@ -1684,7 +1691,7 @@ #define CONFIG_DXA_DEMUXER 0 #define CONFIG_EA_DEMUXER 0 #define CONFIG_EA_CDATA_DEMUXER 0 -#define CONFIG_EAC3_DEMUXER 1 +#define CONFIG_EAC3_DEMUXER 0 #define CONFIG_EPAF_DEMUXER 0 #define CONFIG_EVC_DEMUXER 0 #define CONFIG_FFMETADATA_DEMUXER 0 @@ -1713,7 +1720,7 @@ #define CONFIG_H264_DEMUXER 0 #define CONFIG_HCA_DEMUXER 0 #define CONFIG_HCOM_DEMUXER 0 -#define CONFIG_HEVC_DEMUXER 1 +#define CONFIG_HEVC_DEMUXER 0 #define CONFIG_HLS_DEMUXER 0 #define CONFIG_HNM_DEMUXER 0 #define CONFIG_ICO_DEMUXER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavcodec/codec_list.c b/src/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavcodec/codec_list.c index 0924c3f8..80d0456b 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavcodec/codec_list.c +++ b/src/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavcodec/codec_list.c @@ -17,8 +17,5 @@ static const FFCodec * const codec_list[] = { &ff_pcm_s32le_decoder, &ff_pcm_u8_decoder, &ff_libopus_decoder, - &ff_ac3_decoder, - &ff_eac3_decoder, - &ff_ac3_fixed_decoder, &ff_hevc_decoder, NULL }; diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavcodec/parser_list.c b/src/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavcodec/parser_list.c index 353b88c6..1269282a 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavcodec/parser_list.c +++ b/src/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavcodec/parser_list.c @@ -8,6 +8,5 @@ static const AVCodecParser * const parser_list[] = { &ff_vp3_parser, &ff_vp8_parser, &ff_vp9_parser, - &ff_ac3_parser, &ff_hevc_parser, NULL }; diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavformat/demuxer_list.c b/src/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavformat/demuxer_list.c index d6d293dc..920b22bf 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavformat/demuxer_list.c +++ b/src/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavformat/demuxer_list.c @@ -6,6 +6,4 @@ static const AVInputFormat * const demuxer_list[] = { &ff_mp3_demuxer, &ff_ogg_demuxer, &ff_wav_demuxer, - &ff_ac3_demuxer, - &ff_eac3_demuxer, NULL }; diff --git a/src/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/config.h b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/config.h index 5131d168..0146247a 100644 --- a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/config.h +++ b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --disable-asm --disable-inline-asm --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --disable-asm --disable-inline-asm --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -199,7 +198,7 @@ #define HAVE_ALIGNED_STACK 0 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CLZ 0 -#define HAVE_FAST_CMOV 0 +#define HAVE_FAST_CMOV 1 #define HAVE_FAST_FLOAT16 0 #define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 0 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 1 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 0 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/config_components.h b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/config_components.h index de993a66..5942ac4d 100644 --- a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/config.h b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/config.h index fe3eed5b..cc54cf60 100644 --- a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/config.h +++ b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 1 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/config_components.h b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/config_components.h index de993a66..5942ac4d 100644 --- a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/config.h b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/config.h index 8487aab5..bbbb6a03 100644 --- a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/config.h +++ b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 1 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/config_components.h b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/config_components.h index de993a66..5942ac4d 100644 --- a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/config.h b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/config.h index 2685c43a..c8964972 100644 --- a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/config.h +++ b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --target-os=linux --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_arm64-sysroot --disable-dotprod --disable-i8mm --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --target-os=linux --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_arm64-sysroot --disable-dotprod --disable-i8mm --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 1 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/config_components.h b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/config_components.h index de993a66..5942ac4d 100644 --- a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.asm b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.asm index 81e9a599..1cf35ddc 100644 --- a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.asm +++ b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.asm @@ -23,7 +23,6 @@ %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 @@ -183,7 +182,7 @@ %define HAVE_ALIGNED_STACK 1 %define HAVE_FAST_64BIT 0 %define HAVE_FAST_CLZ 1 -%define HAVE_FAST_CMOV 0 +%define HAVE_FAST_CMOV 1 %define HAVE_FAST_FLOAT16 0 %define HAVE_LOCAL_ALIGNED 1 %define HAVE_SIMD_ALIGN_16 1 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 1 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.h b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.h index c77ccd04..ede98138 100644 --- a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.h +++ b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -199,7 +198,7 @@ #define HAVE_ALIGNED_STACK 1 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CLZ 1 -#define HAVE_FAST_CMOV 0 +#define HAVE_FAST_CMOV 1 #define HAVE_FAST_FLOAT16 0 #define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 1 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 1 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config_components.h b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config_components.h index de993a66..5942ac4d 100644 --- a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.asm b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.asm index e9fe6fa8..3d71bee0 100644 --- a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.asm +++ b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 1 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.h b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.h index 0a614b1a..ca1ee8db 100644 --- a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.h +++ b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264,hevc' --enable-demuxer=aac --enable-decoder='aac,h264,hevc' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 1 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config_components.h b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config_components.h index de993a66..5942ac4d 100644 --- a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/config.h b/src/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/config.h index d8d80900..fc761975 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/arm-linux-androideabi --extra-cflags='--target=arm-linux-androideabi24' --extra-ldflags='--target=arm-linux-androideabi24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/arm-linux-androideabi --extra-ldflags='--gcc-toolchain=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-neon --extra-cflags='-mtune=generic-armv7-a' --extra-cflags='-mfloat-abi=softfp' --extra-cflags='-mfpu=neon'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/arm-linux-androideabi --extra-cflags='--target=arm-linux-androideabi24' --extra-ldflags='--target=arm-linux-androideabi24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/arm-linux-androideabi --extra-ldflags='--gcc-toolchain=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-neon --extra-cflags='-mtune=generic-armv7-a' --extra-cflags='-mfloat-abi=softfp' --extra-cflags='-mfpu=neon'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME android #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/config_components.h b/src/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/config_components.h index 01c9180a..0f131a30 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/android/arm64/config.h b/src/third_party/ffmpeg/chromium/config/Chromium/android/arm64/config.h index 85ab27b0..0d51c602 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/android/arm64/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/android/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/aarch64-linux-android --extra-cflags='--target=aarch64-linux-android24' --extra-ldflags='--target=aarch64-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/aarch64-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/aarch64-linux-android --extra-cflags='--target=aarch64-linux-android24' --extra-ldflags='--target=aarch64-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/aarch64-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME android #define av_restrict restrict #define EXTERN_PREFIX "" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/android/arm64/config_components.h b/src/third_party/ffmpeg/chromium/config/Chromium/android/arm64/config_components.h index 01c9180a..0f131a30 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/android/arm64/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/android/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/android/arm64/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chromium/android/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/android/arm64/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/android/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config.h b/src/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config.h index dc245d96..2905f63e 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/i686-linux-android --extra-cflags='--target=i686-linux-android24' --extra-ldflags='--target=i686-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/i686-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --disable-x86asm" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/i686-linux-android --extra-cflags='--target=i686-linux-android24' --extra-ldflags='--target=i686-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/i686-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --disable-x86asm" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME android #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -199,7 +198,7 @@ #define HAVE_ALIGNED_STACK 1 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CLZ 1 -#define HAVE_FAST_CMOV 0 +#define HAVE_FAST_CMOV 1 #define HAVE_FAST_FLOAT16 0 #define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 1 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config_components.h b/src/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config_components.h index 01c9180a..0f131a30 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/android/ia32/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chromium/android/ia32/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/android/ia32/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/android/ia32/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.asm b/src/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.asm index d89a8d7d..af65909a 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.asm +++ b/src/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.h b/src/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.h index af721ef9..9cabe944 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/x86_64-linux-android --extra-cflags='--target=x86_64-linux-android24' --extra-ldflags='--target=x86_64-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/x86_64-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/tguilbert/Code/chromium/src/third_party/android_toolchain/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=x86_64" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --sysroot=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/x86_64-linux-android --extra-cflags='--target=x86_64-linux-android24' --extra-ldflags='--target=x86_64-linux-android24' --extra-ldflags=-L/tmp/fakelinkerscripts --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/x86_64-linux-android --extra-ldflags='--gcc-toolchain=/usr/local/google/home/jrummell/chromium/src/third_party/android_toolchain/ndk/toolchains/llvm/prebuilt/linux-x86_64/' --target-os=android --arch=x86_64" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME android #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/android/x64/config_components.h b/src/third_party/ffmpeg/chromium/config/Chromium/android/x64/config_components.h index 01c9180a..0f131a30 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/android/x64/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/android/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/android/x64/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chromium/android/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/android/x64/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/android/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/config.h b/src/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/config.h index 1ea6a410..81b7c892 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/17/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/18/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME darwin #define av_restrict restrict #define EXTERN_PREFIX "_" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/config_components.h b/src/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/config_components.h index 4190b27f..a761e839 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/ios/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config.asm b/src/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config.asm index a853fb10..c34ea5ab 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config.asm +++ b/src/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config.h b/src/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config.h index c727314c..d7d2b758 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=x86_64-apple-macosx' --extra-cflags=-F/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/17/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags='-arch x86_64'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=x86_64-apple-macosx' --extra-cflags=-F/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/18/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags='-arch x86_64'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME darwin #define av_restrict restrict #define EXTERN_PREFIX "_" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config_components.h b/src/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config_components.h index 21fcd6e8..9989b924 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/ios/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/ios/x64/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chromium/ios/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/ios/x64/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/ios/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config.h b/src/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config.h index d71113bc..3ce5ca87 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --disable-asm --disable-inline-asm --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --disable-asm --disable-inline-asm --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -199,7 +198,7 @@ #define HAVE_ALIGNED_STACK 0 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CLZ 0 -#define HAVE_FAST_CMOV 0 +#define HAVE_FAST_CMOV 1 #define HAVE_FAST_FLOAT16 0 #define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 0 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 0 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config_components.h b/src/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config_components.h index 4190b27f..a761e839 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/config.h b/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/config.h index fc4d6a73..83d9b656 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/config_components.h b/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/config_components.h index 4190b27f..a761e839 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm/config.h b/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm/config.h index da119eca..7244b86d 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_armhf-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm/config_components.h b/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm/config_components.h index 4190b27f..a761e839 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/config.h b/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/config.h index 7ef01779..b0cb35cd 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --target-os=linux --sysroot=/usr/local/google/home/tguilbert/Code/chromium/src/build/linux/debian_bullseye_arm64-sysroot --disable-dotprod --disable-i8mm --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --target-os=linux --sysroot=/usr/local/google/home/jrummell/chromium/src/build/linux/debian_bullseye_arm64-sysroot --disable-dotprod --disable-i8mm --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/config_components.h b/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/config_components.h index 4190b27f..a761e839 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.asm b/src/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.asm index 1721ad67..6247ebfb 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.asm +++ b/src/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.asm @@ -23,7 +23,6 @@ %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 @@ -183,7 +182,7 @@ %define HAVE_ALIGNED_STACK 1 %define HAVE_FAST_64BIT 0 %define HAVE_FAST_CLZ 1 -%define HAVE_FAST_CMOV 0 +%define HAVE_FAST_CMOV 1 %define HAVE_FAST_FLOAT16 0 %define HAVE_LOCAL_ALIGNED 1 %define HAVE_SIMD_ALIGN_16 1 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.h b/src/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.h index 8aff558d..b4b36a0f 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -199,7 +198,7 @@ #define HAVE_ALIGNED_STACK 1 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CLZ 1 -#define HAVE_FAST_CMOV 0 +#define HAVE_FAST_CMOV 1 #define HAVE_FAST_FLOAT16 0 #define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 1 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config_components.h b/src/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config_components.h index 4190b27f..a761e839 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.asm b/src/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.asm index 1c5a80d7..761a2ada 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.asm +++ b/src/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.h b/src/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.h index e10b48dc..85423097 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --arch=x86_64 --target-os=linux --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME linux #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config_components.h b/src/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config_components.h index 4190b27f..a761e839 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/linux/x64/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chromium/linux/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/linux/x64/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/linux/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/config.h b/src/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/config.h index 1ea6a410..81b7c892 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/17/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=arm64-apple-macosx' --extra-cflags=-F/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/18/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=arm64 --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME darwin #define av_restrict restrict #define EXTERN_PREFIX "_" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/config_components.h b/src/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/config_components.h index 4190b27f..a761e839 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/mac/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.asm b/src/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.asm index 11813e74..492a5a81 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.asm +++ b/src/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.h b/src/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.h index 1e2489a4..0d226f54 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=x86_64-apple-macosx' --extra-cflags=-F/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/tguilbert/Code/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/17/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/tguilbert/Code/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags='-arch x86_64'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=x86_64-apple-macosx' --extra-cflags=-F/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include --extra-cflags=-isystem/usr/local/google/home/jrummell/chromium/src/third_party/llvm-build/Release+Asserts/lib/clang/18/include --extra-ldflags=-syslibroot --extra-ldflags=/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --extra-ldflags=-L/usr/local/google/home/jrummell/chromium/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --extra-ldflags=-platform_version --extra-ldflags=macos --extra-ldflags=10.10 --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags='-arch x86_64'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME darwin #define av_restrict restrict #define EXTERN_PREFIX "_" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config_components.h b/src/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config_components.h index 4190b27f..a761e839 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/mac/x64/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chromium/mac/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/mac/x64/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/mac/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/win/arm64/config.h b/src/third_party/ffmpeg/chromium/config/Chromium/win/arm64/config.h index 75f13c43..0c388498 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/win/arm64/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/win/arm64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --arch=aarch64 --as=clang-cl --extra-cflags='--target=arm64-windows' --extra-cflags=/winsysroot/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --arch=aarch64 --as=clang-cl --extra-cflags='--target=arm64-windows' --extra-cflags=/winsysroot/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME win32 #define av_restrict restrict #define EXTERN_PREFIX "" @@ -40,7 +40,6 @@ #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 @@ -431,6 +430,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -627,17 +627,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/win/arm64/config_components.h b/src/third_party/ffmpeg/chromium/config/Chromium/win/arm64/config_components.h index 4190b27f..a761e839 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/win/arm64/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/win/arm64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/win/arm64/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chromium/win/arm64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/win/arm64/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/win/arm64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.asm b/src/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.asm index b3e84b2e..3d6b2793 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.asm +++ b/src/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.asm @@ -23,7 +23,6 @@ %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 @@ -183,7 +182,7 @@ %define HAVE_ALIGNED_STACK 0 %define HAVE_FAST_64BIT 0 %define HAVE_FAST_CLZ 1 -%define HAVE_FAST_CMOV 0 +%define HAVE_FAST_CMOV 1 %define HAVE_FAST_FLOAT16 0 %define HAVE_LOCAL_ALIGNED 1 %define HAVE_SIMD_ALIGN_16 1 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.h b/src/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.h index 790f5c8e..59ae3062 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=-m32 --extra-cflags=/winsysroot/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=-m32 --extra-cflags=/winsysroot/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME win32 #define av_restrict restrict #define EXTERN_PREFIX "_" @@ -39,7 +39,6 @@ #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 @@ -199,7 +198,7 @@ #define HAVE_ALIGNED_STACK 0 #define HAVE_FAST_64BIT 0 #define HAVE_FAST_CLZ 1 -#define HAVE_FAST_CMOV 0 +#define HAVE_FAST_CMOV 1 #define HAVE_FAST_FLOAT16 0 #define HAVE_LOCAL_ALIGNED 1 #define HAVE_SIMD_ALIGN_16 1 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config_components.h b/src/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config_components.h index 4190b27f..a761e839 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/win/ia32/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chromium/win/ia32/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/win/ia32/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/win/ia32/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.asm b/src/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.asm index 36f8b667..37481669 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.asm +++ b/src/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.asm @@ -23,7 +23,6 @@ %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 @@ -414,6 +413,7 @@ %define HAVE_TEXI2HTML 0 %define HAVE_XMLLINT 1 %define HAVE_ZLIB_GZIP 0 +%define HAVE_OPENVINO2 0 %define CONFIG_DOC 0 %define CONFIG_HTMLPAGES 0 %define CONFIG_MANPAGES 0 @@ -610,17 +610,13 @@ %define CONFIG_FFPLAY 0 %define CONFIG_FFPROBE 0 %define CONFIG_FFMPEG 0 -%define CONFIG_DCT 1 %define CONFIG_DWT 0 %define CONFIG_ERROR_RESILIENCE 0 %define CONFIG_FAAN 0 %define CONFIG_FAST_UNALIGNED 1 -%define CONFIG_FFT 1 %define CONFIG_LSP 0 -%define CONFIG_MDCT 0 %define CONFIG_PIXELUTILS 0 %define CONFIG_NETWORK 0 -%define CONFIG_RDFT 1 %define CONFIG_AUTODETECT 0 %define CONFIG_FONTCONFIG 0 %define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.h b/src/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.h index c8588609..8f316201 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.h @@ -1,12 +1,12 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/tguilbert/Code/chromium/src/third_party/ffmpeg/chromium/include/win --target-os=win64 --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=/winsysroot/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/tguilbert/Code/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7'" -- elide long configuration string from binary */ +/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/usr/local/google/home/jrummell/chromium/src/third_party/ffmpeg/chromium/include/win --target-os=win64 --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=/winsysroot/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7 --extra-ldflags='/winsysroot:/usr/local/google/home/jrummell/chromium/src/third_party/depot_tools/win_toolchain/vs_files/27370823e7'" -- elide long configuration string from binary */ #define FFMPEG_LICENSE "LGPL version 2.1 or later" #define CONFIG_THIS_YEAR 2023 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg" #define AVCONV_DATADIR "/usr/local/share/ffmpeg" -#define CC_IDENT "clang version 17.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 0c545a441285a73e00b859dd52f1a85cb9eeeefc)" +#define CC_IDENT "clang version 18.0.0 (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project d50b56d18c96e0ce462d7236eb268c54098cbaf9)" #define OS_NAME win64 #define av_restrict restrict #define EXTERN_PREFIX "" @@ -39,7 +39,6 @@ #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 @@ -430,6 +429,7 @@ #define HAVE_TEXI2HTML 0 #define HAVE_XMLLINT 1 #define HAVE_ZLIB_GZIP 0 +#define HAVE_OPENVINO2 0 #define CONFIG_DOC 0 #define CONFIG_HTMLPAGES 0 #define CONFIG_MANPAGES 0 @@ -626,17 +626,13 @@ #define CONFIG_FFPLAY 0 #define CONFIG_FFPROBE 0 #define CONFIG_FFMPEG 0 -#define CONFIG_DCT 1 #define CONFIG_DWT 0 #define CONFIG_ERROR_RESILIENCE 0 #define CONFIG_FAAN 0 #define CONFIG_FAST_UNALIGNED 1 -#define CONFIG_FFT 1 #define CONFIG_LSP 0 -#define CONFIG_MDCT 0 #define CONFIG_PIXELUTILS 0 #define CONFIG_NETWORK 0 -#define CONFIG_RDFT 1 #define CONFIG_AUTODETECT 0 #define CONFIG_FONTCONFIG 0 #define CONFIG_LARGE_TESTS 1 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/win/x64/config_components.h b/src/third_party/ffmpeg/chromium/config/Chromium/win/x64/config_components.h index 4190b27f..a761e839 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/win/x64/config_components.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/win/x64/config_components.h @@ -413,6 +413,7 @@ #define CONFIG_NELLYMOSER_DECODER 0 #define CONFIG_ON2AVC_DECODER 0 #define CONFIG_OPUS_DECODER 0 +#define CONFIG_OSQ_DECODER 0 #define CONFIG_PAF_AUDIO_DECODER 0 #define CONFIG_QCELP_DECODER 0 #define CONFIG_QDM2_DECODER 0 @@ -844,6 +845,7 @@ #define CONFIG_AV1_NVENC_ENCODER 0 #define CONFIG_AV1_QSV_ENCODER 0 #define CONFIG_AV1_AMF_ENCODER 0 +#define CONFIG_AV1_VAAPI_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -911,8 +913,8 @@ #define CONFIG_MPEG1_VIDEOTOOLBOX_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA_HWACCEL 0 #define CONFIG_MPEG2_D3D11VA2_HWACCEL 0 -#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_DXVA2_HWACCEL 0 +#define CONFIG_MPEG2_NVDEC_HWACCEL 0 #define CONFIG_MPEG2_VAAPI_HWACCEL 0 #define CONFIG_MPEG2_VDPAU_HWACCEL 0 #define CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL 0 @@ -977,6 +979,7 @@ #define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 +#define CONFIG_JPEGXL_PARSER 0 #define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 @@ -987,8 +990,7 @@ #define CONFIG_PNG_PARSER 0 #define CONFIG_PNM_PARSER 0 #define CONFIG_QOI_PARSER 0 -#define CONFIG_RV30_PARSER 0 -#define CONFIG_RV40_PARSER 0 +#define CONFIG_RV34_PARSER 0 #define CONFIG_SBC_PARSER 0 #define CONFIG_SIPR_PARSER 0 #define CONFIG_TAK_PARSER 0 @@ -1084,6 +1086,7 @@ #define CONFIG_APERMS_FILTER 0 #define CONFIG_APHASER_FILTER 0 #define CONFIG_APHASESHIFT_FILTER 0 +#define CONFIG_APSNR_FILTER 0 #define CONFIG_APSYCLIP_FILTER 0 #define CONFIG_APULSATOR_FILTER 0 #define CONFIG_AREALTIME_FILTER 0 @@ -1101,6 +1104,7 @@ #define CONFIG_ASETTB_FILTER 0 #define CONFIG_ASHOWINFO_FILTER 0 #define CONFIG_ASIDEDATA_FILTER 0 +#define CONFIG_ASISDR_FILTER 0 #define CONFIG_ASOFTCLIP_FILTER 0 #define CONFIG_ASPECTRALSTATS_FILTER 0 #define CONFIG_ASPLIT_FILTER 0 @@ -1348,6 +1352,7 @@ #define CONFIG_LENSFUN_FILTER 0 #define CONFIG_LIBPLACEBO_FILTER 0 #define CONFIG_LIBVMAF_FILTER 0 +#define CONFIG_LIBVMAF_CUDA_FILTER 0 #define CONFIG_LIMITDIFF_FILTER 0 #define CONFIG_LIMITER_FILTER 0 #define CONFIG_LOOP_FILTER 0 @@ -1438,6 +1443,7 @@ #define CONFIG_SCALE_NPP_FILTER 0 #define CONFIG_SCALE_QSV_FILTER 0 #define CONFIG_SCALE_VAAPI_FILTER 0 +#define CONFIG_SCALE_VT_FILTER 0 #define CONFIG_SCALE_VULKAN_FILTER 0 #define CONFIG_SCALE2REF_FILTER 0 #define CONFIG_SCALE2REF_NPP_FILTER 0 @@ -1502,6 +1508,7 @@ #define CONFIG_TRANSPOSE_NPP_FILTER 0 #define CONFIG_TRANSPOSE_OPENCL_FILTER 0 #define CONFIG_TRANSPOSE_VAAPI_FILTER 0 +#define CONFIG_TRANSPOSE_VT_FILTER 0 #define CONFIG_TRANSPOSE_VULKAN_FILTER 0 #define CONFIG_TRIM_FILTER 0 #define CONFIG_UNPREMULTIPLY_FILTER 0 @@ -1791,6 +1798,7 @@ #define CONFIG_OBU_DEMUXER 0 #define CONFIG_OGG_DEMUXER 1 #define CONFIG_OMA_DEMUXER 0 +#define CONFIG_OSQ_DEMUXER 0 #define CONFIG_PAF_DEMUXER 0 #define CONFIG_PCM_ALAW_DEMUXER 0 #define CONFIG_PCM_MULAW_DEMUXER 0 @@ -1878,6 +1886,7 @@ #define CONFIG_TXD_DEMUXER 0 #define CONFIG_TTY_DEMUXER 0 #define CONFIG_TY_DEMUXER 0 +#define CONFIG_USM_DEMUXER 0 #define CONFIG_V210_DEMUXER 0 #define CONFIG_V210X_DEMUXER 0 #define CONFIG_VAG_DEMUXER 0 diff --git a/src/third_party/ffmpeg/chromium/config/Chromium/win/x64/libavutil/ffversion.h b/src/third_party/ffmpeg/chromium/config/Chromium/win/x64/libavutil/ffversion.h index fbfd9d39..4081c2af 100644 --- a/src/third_party/ffmpeg/chromium/config/Chromium/win/x64/libavutil/ffversion.h +++ b/src/third_party/ffmpeg/chromium/config/Chromium/win/x64/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "N-112775-g14f06e9b98" +#define FFMPEG_VERSION "N-113527-gbed545c148" #endif /* AVUTIL_FFVERSION_H */ diff --git a/src/third_party/ffmpeg/chromium/ffmpeg.sigs b/src/third_party/ffmpeg/chromium/ffmpeg.sigs old mode 100755 new mode 100644 index 83c90539..4286e63a --- a/src/third_party/ffmpeg/chromium/ffmpeg.sigs +++ b/src/third_party/ffmpeg/chromium/ffmpeg.sigs @@ -66,6 +66,7 @@ void *av_buffer_get_opaque(const AVBufferRef *buf); int av_get_cpu_flags(void); void av_force_cpu_flags(int flags); void av_max_alloc(size_t max); +char *av_strdup(const char *s); int av_strerror(int errnum, char *errbuf, size_t errbuf_size); AVFrame *av_frame_clone(const AVFrame *src); void av_frame_unref(AVFrame *frame); diff --git a/src/third_party/ffmpeg/chromium/patches/README b/src/third_party/ffmpeg/chromium/patches/README index ebc9c346..85ad6f19 100644 --- a/src/third_party/ffmpeg/chromium/patches/README +++ b/src/third_party/ffmpeg/chromium/patches/README @@ -3,112 +3,6 @@ --------------------------------------------------------------------- ------------------------------------------------------------------- -commit 35a9efdd9ee40dff4a5e45f0039328cd893c1264 -Author: Dale Curtis -Date: Fri Feb 3 16:12:21 2012 -0800 - - Remove old patches, apply existing patches. - - Deleted, since from upstream: - deleted: from_upstream/36_theora_flush.patch - deleted: from_upstream/38_webm_cues_before_first_cluster.patch - deleted: from_upstream/51_vp3_coefficient_overflow.patch - - Deleted, since non-working according to rbultje: - deleted: to_upstream/15_webp_ffmpeg.patch - - Deleted, since get_bits upstreamed: - deleted: ugly/07_get_bits_overrun.patch - deleted: ugly/08_enforce_theora_oob.patch - deleted: ugly/09_enforce_vorbis_oob_divzero.patch - deleted: ugly/10_aac_oob_read.patch - deleted: ugly/30_enforce_mp3_oob.patch - - Deleted, since upstreamed: - deleted: to_upstream/14_vp8_encode_options.patch - deleted: to_upstream/34_ogg_memcpy.patch - deleted: to_upstream/37_VP8_armv6_optimizations.patch - deleted: to_upstream/39_VP8_fix_oob_read_writes.patch - deleted: to_upstream/40_MKV_fix_oob_write.patch - deleted: to_upstream/42_vp8_fix_segmentation_maps.patch - deleted: to_upstream/43_mkv_seekahead_revalidate.patch - deleted: to_upstream/44_vorbis_oob_read.patch - deleted: to_upstream/45_mkv_fix_segmap_cache_overflow.patch - deleted: to_upstream/46_vp3_fix_double_free_invalid_read.patch - deleted: to_upstream/47_vp3_fix_infloop_and_memleak.patch - deleted: to_upstream/48_vorbis_residue_buffer.patch - deleted: to_upstream/49_vorbis_buffer_defense.patch - deleted: to_upstream/50_vp8_fix_frame_size_changes.patch - deleted: to_upstream/52_vorbis_fix_floor1_vector_int_overflow.patch - - Deleted, for now, but will be fixed w/ merge: - modified: ugly/31_remove_attribute_deprecated.patch - - Not applied, since no longer necessary (will be deleted after testing): - skipped: to_upstream/01_static_pthread_O2.patch - - Also disables unchecked bitstream reading per rbultje. - - BUG=none - TEST=ffmpeg_regression_tests - -Affects: - libavformat/matroskadec.c - ------------------------------------------------------------------- -commit 87b9d8e5781b28ae6f27b454605d8dbdf325d7e9 -Merge: 3a9bce0eec c39916bc2f -Author: Dale Curtis -Date: Mon Oct 1 10:30:25 2012 -0700 - - FFmpeg merge for M24. - - Merges FFmpeg from c39916bc2f43eed86f9822b7d6802b8a4f2a86c8 - - Conflicts: - libavcodec/vorbisdec.c - libavformat/matroskadec.c - libavformat/mov.c - libavformat/oggdec.c - -Affects: - libavformat/matroskadec.c - ------------------------------------------------------------------- -commit 67a3d8459c78a653192631c84611cf300c0c9b19 -Merge: 82ae69cc47 d91388367f -Author: Dale Curtis -Date: Mon Dec 3 14:22:52 2012 -0800 - - Merge FFmpeg from upstream for M25. - - Merged from d91388367fa64b98a09b45e2b7fb8435a62b7609. - - Conflicts: - configure - libavcodec/aacdec.c - libavcodec/ac3tab.h - libavcodec/dca.h - libavcodec/dnxhddata.h - libavcodec/mjpeg.h - libavcodec/mpeg4audio.h - libavcodec/mpegaudiodata.h - libavcodec/raw.h - libavformat/matroskadec.c - libavformat/mp3dec.c - libavutil/aes.h - libavutil/common.h - libavutil/intmath.h - libavutil/md5.h - libavutil/pixdesc.h - libavutil/sha.h - libavutil/tree.h - library.mak - -Affects: - libavformat/matroskadec.c - ------------------------------------------------------------------ commit 3a43b481b78e54009e293c6c6172fc6c68990d8c Author: Will Harris @@ -126,23 +20,6 @@ Date: Wed Jan 21 20:33:15 2015 -0800 Affects: libavutil/mem.c ------------------------------------------------------------------- -commit 967e4da013f8997d4cc34f1008f082a9c55e191f -Author: Dan Sanders -Date: Thu Jan 29 14:10:48 2015 -0800 - - Update patches and configs for M42. - - - Adds ffversion.h. - - Fixes to build with win8.1 SDK and for linux-noasm. - - Removed ugly patches and replaced with descriptions; - the patches were not being kept up to date. - - Change-Id: Ie0eab2bf3ab6c52cd088e54172792175ab7cb2de - -Affects: - libavformat/matroskadec.c - ------------------------------------------------------------------ commit f3299330654ac1b40c50b3cbcae619f42eb7d838 Author: Scott Graham @@ -246,27 +123,6 @@ Date: Fri Oct 21 15:49:44 2016 -0700 Affects: configure ------------------------------------------------------------------- -commit e4decbe7fd3f49d90f296e83bcbf2beb8edf202a -Merge: b4d337e668 134233972e -Author: Matt Wolenetz -Date: Tue Oct 25 14:31:38 2016 -0700 - - Merge FFmpeg for M56. - - Conflicts: - .gitignore - configure - libavcodec/h264.c - libavcodec/h264_parser.c - libavformat/matroskadec.c - libavformat/mov.c - libavformat/movenc.c - libavformat/utils.c - -Affects: - libavformat/matroskadec.c - ------------------------------------------------------------------ commit b281073a7b1ccff67b2cd8ec636facceeeb82327 Author: Matt Wolenetz @@ -433,19 +289,6 @@ Affects: libavutil/log.c libavutil/log.h ------------------------------------------------------------------- -commit 4a74bbe9c6a37e7cadd7fa3b4e9fb943b57e3f00 -Merge: bb424af97f 6a50a8f340 -Author: Dale Curtis -Date: Fri Nov 3 12:06:55 2017 -0700 - - Merge remote-tracking branch 'upstream/master' into merge-m64 - - Synced from upstream/6a50a8f340161a0b65feb3537591b0381a6a6b38 - -Affects: - configure - ------------------------------------------------------------------ commit 76b57e9f808de42f6f1bb7df97531aa4b5cb7bb0 Author: Dale Curtis @@ -608,21 +451,6 @@ Date: Thu Nov 8 10:55:58 2018 -0800 Affects: libavutil/x86/x86inc.asm ------------------------------------------------------------------- -commit d7ba23c23434eb938c6fcae4fe77ca1e2a2fbeff -Author: liberato@chromium.org -Date: Thu Aug 22 10:52:09 2019 -0700 - - Fail matroska parsing with an error rather than assert. - - Bug: 995706 - Change-Id: I6f9865e0fdf44def6cc40e369954e66a7e0ad1d1 - Reviewed-on: https://chromium-review.googlesource.com/c/chromium/third_party/ffmpeg/+/1765951 - Reviewed-by: Matthew Wolenetz - -Affects: - libavformat/matroskadec.c - ------------------------------------------------------------------ commit 6a44f89787a6103bf85825aac5b7bcfdba0dde5f Merge: c5003c8e13 acbd950ed2 @@ -849,7 +677,6 @@ Affects: libavcodec/mpeg4video_parser.c libavcodec/smacker.c libavcodec/utvideodec.c - libavformat/matroskadec.c ------------------------------------------------------------------ commit 1bc7749f096fc98032fc3206217b4fc47047258f @@ -954,17 +781,18 @@ Affects: libavutil/frame.h ------------------------------------------------------------------ -commit 881c5c3f6412020c37e97e178e0f5da9ddd2ae90 -Author: Frank Liberato -Date: Thu Jun 1 18:20:23 2023 +0000 +commit 125536d78f103ff44efeb26c4d7c98413a5a618f +Merge: 0d75f366d5 9240035c0e +Author: John Rummell +Date: Wed Oct 4 10:12:40 2023 -0700 - FFMpeg roll for M116 + Merge remote-tracking branch 'upstream/master' into sushi-2023-10-04-10-06-42 - Bug: 1449369 - Change-Id: Icb1bf9347dcf6ec71e61f552ab060cd8ba7504d2 - Reviewed-on: https://chromium-review.googlesource.com/c/chromium/third_party/ffmpeg/+/4581055 - Reviewed-by: Thomas Guilbert + Conflicts: + both modified: configure + both modified: libavformat/matroskadec.c + deleted by us: libavutil/macos_kperf.c Affects: - libavcodec/vp8data.c + configure diff --git a/src/third_party/ffmpeg/chromium/patches/config_flag_changes.txt b/src/third_party/ffmpeg/chromium/patches/config_flag_changes.txt index e69de29b..f3061930 100644 --- a/src/third_party/ffmpeg/chromium/patches/config_flag_changes.txt +++ b/src/third_party/ffmpeg/chromium/patches/config_flag_changes.txt @@ -0,0 +1,23 @@ ++ CONFIG_APSNR_FILTER 0 ++ CONFIG_ASISDR_FILTER 0 ++ CONFIG_AV1_VAAPI_ENCODER 0 ++ CONFIG_JPEGXL_PARSER 0 ++ CONFIG_LIBVMAF_CUDA_FILTER 0 ++ CONFIG_MPEG2_NVDEC_HWACCEL 0 ++ CONFIG_OSQ_DECODER 0 ++ CONFIG_OSQ_DEMUXER 0 ++ CONFIG_RV34_PARSER 0 ++ CONFIG_SCALE_VT_FILTER 0 ++ CONFIG_TRANSPOSE_VT_FILTER 0 ++ CONFIG_USM_DEMUXER 0 ++ HAVE_FAST_CMOV 1 ++ HAVE_OPENVINO2 0 +- ARCH_TOMI 0 +- CONFIG_DCT 1 +- CONFIG_FFT 1 +- CONFIG_MDCT 0 +- CONFIG_MPEG2_NVDEC_HWACCEL 0 +- CONFIG_RDFT 1 +- CONFIG_RV30_PARSER 0 +- CONFIG_RV40_PARSER 0 +- HAVE_FAST_CMOV 0 diff --git a/src/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py b/src/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py index c92ade12..69643556 100755 --- a/src/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py +++ b/src/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright 2023 The Chromium Authors, Alex313031, and Midzer. All rights reserved. +# Copyright 2024 The Chromium Authors, Alex313031, and Midzer. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -26,7 +26,7 @@ ROBO_CONFIGURATION = config.RoboConfiguration() FFMPEG_DIR = ROBO_CONFIGURATION.ffmpeg_home() CHROMIUM_ROOT_DIR = ROBO_CONFIGURATION.chrome_src() NDK_ROOT_DIR = os.path.abspath( - os.path.join(CHROMIUM_ROOT_DIR, 'third_party', 'android_toolchain')) + os.path.join(CHROMIUM_ROOT_DIR, 'third_party', 'android_toolchain', 'ndk')) # Token to indicate that a build has completed successfully, so that we can # skip it with `--fast`. SUCCESS_TOKEN = 'THIS_BUILD_WORKED' @@ -683,8 +683,6 @@ def ConfigureAndBuild(target_arch, target_os, host_os, host_arch, parallel_jobs, '--enable-avcodec', '--enable-avformat', '--enable-avutil', - '--enable-fft', - '--enable-rdft', '--enable-static', '--enable-libopus', diff --git a/src/third_party/ffmpeg/ffmpeg_generated.gni b/src/third_party/ffmpeg/ffmpeg_generated.gni index 2ccad035..d933edfd 100644 --- a/src/third_party/ffmpeg/ffmpeg_generated.gni +++ b/src/third_party/ffmpeg/ffmpeg_generated.gni @@ -33,16 +33,12 @@ if ((is_android && current_cpu == "arm" && arm_use_neon) || (is_android && curre "libavcodec/codec_desc.c", "libavcodec/codec_par.c", "libavcodec/d3d11va.c", - "libavcodec/dct.c", "libavcodec/dct32_fixed.c", "libavcodec/dct32_float.c", "libavcodec/decode.c", "libavcodec/dirac.c", "libavcodec/dv_profile.c", "libavcodec/encode.c", - "libavcodec/fft_fixed_32.c", - "libavcodec/fft_float.c", - "libavcodec/fft_init_table.c", "libavcodec/flac.c", "libavcodec/flac_parser.c", "libavcodec/flacdata.c", @@ -80,7 +76,6 @@ if ((is_android && current_cpu == "arm" && arm_use_neon) || (is_android && curre "libavcodec/pthread_slice.c", "libavcodec/qsv_api.c", "libavcodec/raw.c", - "libavcodec/rdft.c", "libavcodec/to_upper4.c", "libavcodec/utils.c", "libavcodec/version.c", @@ -166,6 +161,7 @@ if ((is_android && current_cpu == "arm" && arm_use_neon) || (is_android && curre "libavutil/encryption_info.c", "libavutil/error.c", "libavutil/eval.c", + "libavutil/executor.c", "libavutil/fifo.c", "libavutil/file_open.c", "libavutil/film_grain_params.c", @@ -204,6 +200,7 @@ if ((is_android && current_cpu == "arm" && arm_use_neon) || (is_android && curre "libavutil/tx.c", "libavutil/uuid.c", "libavutil/video_enc_params.c", + "libavutil/video_hint.c", ] } @@ -312,28 +309,6 @@ if ((current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (current_cpu == " ] } -if ((is_apple && current_cpu == "x64") || (is_win && current_cpu == "x64") || (is_win && current_cpu == "x86") || (use_linux_config && current_cpu == "x64") || (use_linux_config && current_cpu == "x86")) { - ffmpeg_c_sources += [ - "libavcodec/x86/autorename_libavcodec_x86_videodsp_init.c", - "libavcodec/x86/h264_intrapred_init.c", - "libavcodec/x86/hpeldsp_init.c", - "libavcodec/x86/hpeldsp_vp3_init.c", - "libavcodec/x86/vp3dsp_init.c", - "libavcodec/x86/vp8dsp_init.c", - ] - ffmpeg_asm_sources += [ - "libavcodec/x86/autorename_libavcodec_x86_hpeldsp.asm", - "libavcodec/x86/autorename_libavcodec_x86_videodsp.asm", - "libavcodec/x86/autorename_libavcodec_x86_vp3dsp.asm", - "libavcodec/x86/autorename_libavcodec_x86_vp8dsp.asm", - "libavcodec/x86/fpel.asm", - "libavcodec/x86/h264_intrapred.asm", - "libavcodec/x86/h264_intrapred_10bit.asm", - "libavcodec/x86/hpeldsp_vp3.asm", - "libavcodec/x86/vp8dsp_loopfilter.asm", - ] -} - if ((use_linux_config && current_cpu == "arm" && arm_use_neon && ffmpeg_branding == "ChromeOS") || (use_linux_config && current_cpu == "arm" && ffmpeg_branding == "ChromeOS")) { ffmpeg_c_sources += [ "libavcodec/arm/blockdsp_init_arm.c", @@ -414,6 +389,26 @@ if ((use_linux_config && current_cpu == "x64" && ffmpeg_branding == "ChromeOS") ] } +if ((is_apple && current_cpu == "x64") || (is_win && current_cpu == "x64") || (is_win && current_cpu == "x86") || (use_linux_config && current_cpu == "x64") || (use_linux_config && current_cpu == "x86")) { + ffmpeg_c_sources += [ + "libavcodec/x86/autorename_libavcodec_x86_videodsp_init.c", + "libavcodec/x86/h264_intrapred_init.c", + "libavcodec/x86/hpeldsp_init.c", + "libavcodec/x86/vp3dsp_init.c", + "libavcodec/x86/vp8dsp_init.c", + ] + ffmpeg_asm_sources += [ + "libavcodec/x86/autorename_libavcodec_x86_hpeldsp.asm", + "libavcodec/x86/autorename_libavcodec_x86_videodsp.asm", + "libavcodec/x86/autorename_libavcodec_x86_vp3dsp.asm", + "libavcodec/x86/autorename_libavcodec_x86_vp8dsp.asm", + "libavcodec/x86/fpel.asm", + "libavcodec/x86/h264_intrapred.asm", + "libavcodec/x86/h264_intrapred_10bit.asm", + "libavcodec/x86/vp8dsp_loopfilter.asm", + ] +} + if ((use_linux_config && current_cpu == "arm" && arm_use_neon) || (use_linux_config && current_cpu == "arm")) { ffmpeg_c_sources += [ "libavcodec/arm/h264pred_init_arm.c", @@ -434,44 +429,6 @@ if ((use_linux_config && current_cpu == "arm" && arm_use_neon) || (use_linux_con ] } -if ((is_android && current_cpu == "x64") || (is_apple && current_cpu == "x64") || (is_win && current_cpu == "x64") || (is_win && current_cpu == "x86") || (use_linux_config && current_cpu == "x64") || (use_linux_config && current_cpu == "x86")) { - ffmpeg_c_sources += [ - "libavutil/x86/autorename_libavutil_x86_tx_float_init.c", - ] - ffmpeg_asm_sources += [ - "libavcodec/x86/dct32.asm", - "libavcodec/x86/fft.asm", - "libavcodec/x86/flacdsp.asm", - "libavcodec/x86/imdct36.asm", - "libavcodec/x86/vorbisdsp.asm", - "libavutil/x86/cpuid.asm", - "libavutil/x86/fixed_dsp.asm", - "libavutil/x86/float_dsp.asm", - "libavutil/x86/imgutils.asm", - "libavutil/x86/lls.asm", - "libavutil/x86/tx_float.asm", - ] -} - -if ((is_android && current_cpu == "arm" && arm_use_neon) || (use_linux_config && current_cpu == "arm" && arm_use_neon) || (use_linux_config && current_cpu == "arm")) { - ffmpeg_c_sources += [ - "libavcodec/arm/fft_init_arm.c", - "libavcodec/arm/flacdsp_init_arm.c", - "libavcodec/arm/mpegaudiodsp_init_arm.c", - "libavcodec/arm/rdft_init_arm.c", - "libavcodec/arm/vorbisdsp_init_arm.c", - "libavutil/arm/autorename_libavutil_arm_cpu.c", - "libavutil/arm/float_dsp_init_arm.c", - "libavutil/arm/float_dsp_init_vfp.c", - ] - ffmpeg_gas_sources += [ - "libavcodec/arm/fft_vfp.S", - "libavcodec/arm/flacdsp_arm.S", - "libavcodec/arm/mpegaudiodsp_fixed_armv6.S", - "libavutil/arm/float_dsp_vfp.S", - ] -} - if ((is_apple) || (is_win) || (use_linux_config)) { ffmpeg_c_sources += [ "libavcodec/autorename_libavcodec_videodsp.c", @@ -486,33 +443,31 @@ if ((is_apple) || (is_win) || (use_linux_config)) { "libavcodec/vp8data.c", "libavcodec/vp8dsp.c", "libavcodec/vpx_rac.c", - "libavformat/avc.c", - "libavcodec/x86/ac3dsp_init.c", - "libavcodec/ac3dsp.c", - "libavcodec/fmtconvert.c", - "libavcodec/ac3tab.c", - "libavcodec/ac3dec_float.c", - "libavcodec/ac3.c", - "libavcodec/x86/fmtconvert_init.c", - "libavcodec/ac3dec_data.c", - "libavcodec/eac3dec.c", - "libavcodec/eac3_data.c", - "libavcodec/ac3dec_fixed.c", - "libavformat/ac3dec.c", - ] - ffmpeg_asm_sources += [ - "libavcodec/x86/ac3dsp.asm", - "libavcodec/x86/ac3dsp_downmix.asm", - "libavcodec/x86/fmtconvert.asm", - ] + ] +} + +if ((is_android && current_cpu == "x64") || (is_apple && current_cpu == "x64") || (is_win && current_cpu == "x64") || (is_win && current_cpu == "x86") || (use_linux_config && current_cpu == "x64") || (use_linux_config && current_cpu == "x86")) { + ffmpeg_c_sources += [ + "libavutil/x86/autorename_libavutil_x86_tx_float_init.c", + ] + ffmpeg_asm_sources += [ + "libavcodec/x86/dct32.asm", + "libavcodec/x86/flacdsp.asm", + "libavcodec/x86/imdct36.asm", + "libavcodec/x86/vorbisdsp.asm", + "libavutil/x86/cpuid.asm", + "libavutil/x86/fixed_dsp.asm", + "libavutil/x86/float_dsp.asm", + "libavutil/x86/imgutils.asm", + "libavutil/x86/lls.asm", + "libavutil/x86/tx_float.asm", + ] } if ((is_android && current_cpu == "x64") || (is_android && current_cpu == "x86") || (is_apple && current_cpu == "x64") || (is_win && current_cpu == "x64") || (is_win && current_cpu == "x86") || (use_linux_config && current_cpu == "x64") || (use_linux_config && current_cpu == "x86")) { ffmpeg_c_sources += [ "libavcodec/x86/autorename_libavcodec_x86_vorbisdsp_init.c", "libavcodec/x86/constants.c", - "libavcodec/x86/dct_init.c", - "libavcodec/x86/fft_init.c", "libavcodec/x86/flacdsp_init.c", "libavcodec/x86/mpegaudiodsp.c", "libavutil/x86/autorename_libavutil_x86_cpu.c", @@ -525,15 +480,13 @@ if ((is_android && current_cpu == "x64") || (is_android && current_cpu == "x86") if ((is_android && current_cpu == "arm64") || (is_apple && current_cpu == "arm64") || (is_win && current_cpu == "arm64") || (use_linux_config && current_cpu == "arm64")) { ffmpeg_c_sources += [ - "libavcodec/aarch64/fft_init_aarch64.c", "libavcodec/aarch64/mpegaudiodsp_init.c", "libavcodec/aarch64/vorbisdsp_init.c", - "libavutil/aarch64/cpu.c", + "libavutil/aarch64/autorename_libavutil_aarch64_cpu.c", "libavutil/aarch64/float_dsp_init.c", "libavutil/aarch64/tx_float_init.c", ] ffmpeg_gas_sources += [ - "libavcodec/aarch64/autorename_libavcodec_aarch64_fft_neon.S", "libavcodec/aarch64/autorename_libavcodec_aarch64_vorbisdsp_neon.S", "libavcodec/aarch64/mpegaudiodsp_neon.S", "libavutil/aarch64/autorename_libavutil_aarch64_float_dsp_neon.S", @@ -541,6 +494,22 @@ if ((is_android && current_cpu == "arm64") || (is_apple && current_cpu == "arm64 ] } +if ((is_android && current_cpu == "arm" && arm_use_neon) || (use_linux_config && current_cpu == "arm" && arm_use_neon) || (use_linux_config && current_cpu == "arm")) { + ffmpeg_c_sources += [ + "libavcodec/arm/flacdsp_init_arm.c", + "libavcodec/arm/mpegaudiodsp_init_arm.c", + "libavcodec/arm/vorbisdsp_init_arm.c", + "libavutil/arm/cpu.c", + "libavutil/arm/float_dsp_init_arm.c", + "libavutil/arm/float_dsp_init_vfp.c", + ] + ffmpeg_gas_sources += [ + "libavcodec/arm/flacdsp_arm.S", + "libavcodec/arm/mpegaudiodsp_fixed_armv6.S", + "libavutil/arm/float_dsp_vfp.S", + ] +} + if ((is_apple && current_cpu == "arm64") || (is_win && current_cpu == "arm64") || (use_linux_config && current_cpu == "arm64")) { ffmpeg_c_sources += [ "libavcodec/aarch64/h264pred_init.c", @@ -567,7 +536,7 @@ if ((is_apple && current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (is_w "libavcodec/aarch64/autorename_libavcodec_aarch64_hevcdsp_sao_neon.S", "libavcodec/aarch64/hevcdsp_deblock_neon.S", "libavcodec/aarch64/hevcdsp_epel_neon.S", - "libavcodec/aarch64/hevcdsp_qpel_neon.S", + "libavcodec/aarch64/hevcdsp_qpel_neon.S" ] ffmpeg_c_sources += [ @@ -609,18 +578,6 @@ if (use_linux_config && current_cpu == "arm" && arm_use_neon) { ] } -if ((is_android && current_cpu == "arm" && arm_use_neon) || (use_linux_config && current_cpu == "arm" && arm_use_neon)) { - ffmpeg_c_sources += [ - "libavutil/arm/float_dsp_init_neon.c", - ] - ffmpeg_gas_sources += [ - "libavcodec/arm/fft_neon.S", - "libavcodec/arm/rdft_neon.S", - "libavcodec/arm/vorbisdsp_neon.S", - "libavutil/arm/float_dsp_neon.S", - ] -} - if (use_linux_config && current_cpu == "arm64" && ffmpeg_branding == "ChromeOS") { ffmpeg_c_sources += [ "libavcodec/aarch64/idctdsp_init_aarch64.c", @@ -681,6 +638,16 @@ if ((current_cpu == "arm64" && ffmpeg_branding == "Chrome") || (use_linux_config ] } +if ((is_android && current_cpu == "arm" && arm_use_neon) || (use_linux_config && current_cpu == "arm" && arm_use_neon)) { + ffmpeg_c_sources += [ + "libavutil/arm/float_dsp_init_neon.c", + ] + ffmpeg_gas_sources += [ + "libavcodec/arm/vorbisdsp_neon.S", + "libavutil/arm/float_dsp_neon.S", + ] +} + if ((current_cpu == "x64" && ffmpeg_branding == "Chrome") || (is_android && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (is_win && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (use_linux_config && current_cpu == "x64" && ffmpeg_branding == "ChromeOS") || (use_linux_config && current_cpu == "x86" && ffmpeg_branding == "Chrome") || (use_linux_config && current_cpu == "x86" && ffmpeg_branding == "ChromeOS")) { ffmpeg_c_sources += [ "libavcodec/x86/aacpsdsp_init.c", diff --git a/src/third_party/ffmpeg/ffmpeg_options.gni b/src/third_party/ffmpeg/ffmpeg_options.gni index ad858d42..26046bf7 100644 --- a/src/third_party/ffmpeg/ffmpeg_options.gni +++ b/src/third_party/ffmpeg/ffmpeg_options.gni @@ -1,4 +1,4 @@ -# Copyright 2023 The Chromium Authors and Alex313031. All rights reserved. +# Copyright 2024 The Chromium Authors and Alex313031. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -7,7 +7,7 @@ import("//build/config/chrome_build.gni") import("//build/config/chromecast_build.gni") import("//build/config/sanitizers/sanitizers.gni") -if (is_chrome_branded) { +if (is_chrome_branded || is_chrome_for_testing_branded) { _default_ffmpeg_branding = "Chrome" } else { _default_ffmpeg_branding = "Chrome" diff --git a/src/third_party/ffmpeg/libavcodec/4xm.c b/src/third_party/ffmpeg/libavcodec/4xm.c index 411e50da..c3e3a45d 100644 --- a/src/third_party/ffmpeg/libavcodec/4xm.c +++ b/src/third_party/ffmpeg/libavcodec/4xm.c @@ -257,10 +257,10 @@ static av_cold void init_vlcs(void) for (j = 0; j < 4; j++) { block_type_vlc[i][j].table = table[i][j]; block_type_vlc[i][j].table_allocated = 32; - init_vlc(&block_type_vlc[i][j], BLOCK_TYPE_VLC_BITS, 7, + vlc_init(&block_type_vlc[i][j], BLOCK_TYPE_VLC_BITS, 7, &block_type_tab[i][j][0][1], 2, 1, &block_type_tab[i][j][0][0], 2, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); } } } @@ -706,8 +706,8 @@ static const uint8_t *read_huffman_tables(FourXContext *f, len_tab[j] = len; } - ff_free_vlc(&f->pre_vlc); - if (init_vlc(&f->pre_vlc, ACDC_VLC_BITS, 257, len_tab, 1, 1, + ff_vlc_free(&f->pre_vlc); + if (vlc_init(&f->pre_vlc, ACDC_VLC_BITS, 257, len_tab, 1, 1, bits_tab, 4, 4, 0)) return NULL; @@ -985,7 +985,7 @@ static av_cold int decode_end(AVCodecContext *avctx) av_freep(&f->cfrm[i].data); f->cfrm[i].allocated_size = 0; } - ff_free_vlc(&f->pre_vlc); + ff_vlc_free(&f->pre_vlc); return 0; } diff --git a/src/third_party/ffmpeg/libavcodec/8bps.c b/src/third_party/ffmpeg/libavcodec/8bps.c index af98f62f..0becaa93 100644 --- a/src/third_party/ffmpeg/libavcodec/8bps.c +++ b/src/third_party/ffmpeg/libavcodec/8bps.c @@ -26,27 +26,23 @@ * http://www.pcisys.net/~melanson/codecs/ * * Supports: PAL8 (RGB 8bpp, paletted) - * : BGR24 (RGB 24bpp) (can also output it as RGB32) - * : RGB32 (RGB 32bpp, 4th plane is alpha) + * : GBRP (RGB 24bpp) + * : GBRAP (RGB 32bpp, 4th plane is alpha) */ #include -#include "libavutil/bswap.h" +#include "libavutil/intreadwrite.h" #include "libavutil/internal.h" #include "avcodec.h" #include "codec_internal.h" #include "decode.h" - -static const enum AVPixelFormat pixfmt_rgb24[] = { - AV_PIX_FMT_BGR24, AV_PIX_FMT_0RGB32, AV_PIX_FMT_NONE }; - typedef struct EightBpsContext { AVCodecContext *avctx; - unsigned char planes; - unsigned char planemap[4]; + uint8_t planes; + uint8_t planemap[4]; } EightBpsContext; static int decode_frame(AVCodecContext *avctx, AVFrame *frame, @@ -55,15 +51,14 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; EightBpsContext * const c = avctx->priv_data; - const unsigned char *encoded = buf; - unsigned char *pixptr, *pixptr_end; + const uint8_t *encoded = buf; + uint8_t *pixptr, *pixptr_end; unsigned int height = avctx->height; // Real image height unsigned int dlen, p, row; - const unsigned char *lp, *dp, *ep; - unsigned char count; - unsigned int px_inc; - unsigned int planes = c->planes; - unsigned char *planemap = c->planemap; + const uint8_t *lp, *dp, *ep; + uint8_t count; + const uint8_t *planemap = c->planemap; + unsigned int planes = c->planes; int ret; if (buf_size < planes * height * 2) @@ -77,19 +72,18 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, /* Set data pointer after line lengths */ dp = encoded + planes * (height << 1); - px_inc = planes + (avctx->pix_fmt == AV_PIX_FMT_0RGB32); - for (p = 0; p < planes; p++) { + const int pi = planemap[p]; /* Lines length pointer for this plane */ lp = encoded + p * (height << 1); /* Decode a plane */ for (row = 0; row < height; row++) { - pixptr = frame->data[0] + row * frame->linesize[0] + planemap[p]; - pixptr_end = pixptr + frame->linesize[0]; + pixptr = frame->data[pi] + row * frame->linesize[pi]; + pixptr_end = pixptr + frame->linesize[pi]; if (ep - lp < row * 2 + 2) return AVERROR_INVALIDDATA; - dlen = av_be2ne16(*(const unsigned short *)(lp + row * 2)); + dlen = AV_RB16(lp + row * 2); /* Decode a row of this plane */ while (dlen > 0) { if (ep - dp <= 1) @@ -97,22 +91,19 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, if ((count = *dp++) <= 127) { count++; dlen -= count + 1; - if (pixptr_end - pixptr < count * px_inc) + if (pixptr_end - pixptr < count) break; if (ep - dp < count) return AVERROR_INVALIDDATA; - while (count--) { - *pixptr = *dp++; - pixptr += px_inc; - } + memcpy(pixptr, dp, count); + pixptr += count; + dp += count; } else { count = 257 - count; - if (pixptr_end - pixptr < count * px_inc) + if (pixptr_end - pixptr < count) break; - while (count--) { - *pixptr = *dp; - pixptr += px_inc; - } + memset(pixptr, dp[0], count); + pixptr += count; dp++; dlen -= 2; } @@ -150,16 +141,15 @@ static av_cold int decode_init(AVCodecContext *avctx) c->planemap[0] = 0; // 1st plane is palette indexes break; case 24: - avctx->pix_fmt = ff_get_format(avctx, pixfmt_rgb24); + avctx->pix_fmt = AV_PIX_FMT_GBRP; c->planes = 3; c->planemap[0] = 2; // 1st plane is red - c->planemap[1] = 1; // 2nd plane is green - c->planemap[2] = 0; // 3rd plane is blue + c->planemap[1] = 0; // 2nd plane is green + c->planemap[2] = 1; // 3rd plane is blue break; case 32: - avctx->pix_fmt = AV_PIX_FMT_RGB32; + avctx->pix_fmt = AV_PIX_FMT_GBRAP; c->planes = 4; - /* handle planemap setup later for decoding rgb24 data as rbg32 */ break; default: av_log(avctx, AV_LOG_ERROR, "Error: Unsupported color depth: %u.\n", @@ -167,11 +157,11 @@ static av_cold int decode_init(AVCodecContext *avctx) return AVERROR_INVALIDDATA; } - if (avctx->pix_fmt == AV_PIX_FMT_RGB32) { - c->planemap[0] = HAVE_BIGENDIAN ? 1 : 2; // 1st plane is red - c->planemap[1] = HAVE_BIGENDIAN ? 2 : 1; // 2nd plane is green - c->planemap[2] = HAVE_BIGENDIAN ? 3 : 0; // 3rd plane is blue - c->planemap[3] = HAVE_BIGENDIAN ? 0 : 3; // 4th plane is alpha + if (avctx->pix_fmt == AV_PIX_FMT_GBRAP) { + c->planemap[0] = 2; // 1st plane is red + c->planemap[1] = 0; // 2nd plane is green + c->planemap[2] = 1; // 3rd plane is blue + c->planemap[3] = 3; // 4th plane is alpha } return 0; } diff --git a/src/third_party/ffmpeg/libavcodec/Makefile b/src/third_party/ffmpeg/libavcodec/Makefile index 1b0226c0..42af4e49 100644 --- a/src/third_party/ffmpeg/libavcodec/Makefile +++ b/src/third_party/ffmpeg/libavcodec/Makefile @@ -32,6 +32,7 @@ OBJS = ac3_parser.o \ allcodecs.o \ avcodec.o \ avdct.o \ + avfft.o \ avpacket.o \ bitstream.o \ bitstream_filters.o \ @@ -81,7 +82,6 @@ OBJS-$(CONFIG_CBS_JPEG) += cbs_jpeg.o OBJS-$(CONFIG_CBS_MPEG2) += cbs_mpeg2.o OBJS-$(CONFIG_CBS_VP9) += cbs_vp9.o OBJS-$(CONFIG_CRYSTALHD) += crystalhd.o -OBJS-$(CONFIG_DCT) += dct.o dct32_fixed.o dct32_float.o OBJS-$(CONFIG_DEFLATE_WRAPPER) += zlib_wrapper.o OBJS-$(CONFIG_DOVI_RPU) += dovi_rpu.o OBJS-$(CONFIG_ERROR_RESILIENCE) += error_resilience.o @@ -90,9 +90,6 @@ OBJS-$(CONFIG_EXIF) += exif.o tiff_common.o OBJS-$(CONFIG_FAANDCT) += faandct.o OBJS-$(CONFIG_FAANIDCT) += faanidct.o OBJS-$(CONFIG_FDCTDSP) += fdctdsp.o jfdctfst.o jfdctint.o -FFT-OBJS-$(CONFIG_HARDCODED_TABLES) += cos_tables.o -OBJS-$(CONFIG_FFT) += avfft.o fft_float.o fft_fixed_32.o \ - fft_init_table.o $(FFT-OBJS-yes) OBJS-$(CONFIG_FMTCONVERT) += fmtconvert.o OBJS-$(CONFIG_GOLOMB) += golomb.o OBJS-$(CONFIG_H263DSP) += h263dsp.o @@ -125,7 +122,6 @@ OBJS-$(CONFIG_LLVIDENCDSP) += lossless_videoencdsp.o OBJS-$(CONFIG_LPC) += lpc.o OBJS-$(CONFIG_LSP) += lsp.o OBJS-$(CONFIG_LZF) += lzf.o -OBJS-$(CONFIG_MDCT) += mdct_float.o mdct_fixed_32.o OBJS-$(CONFIG_ME_CMP) += me_cmp.o OBJS-$(CONFIG_MEDIACODEC) += mediacodecdec_common.o mediacodec_surface.o mediacodec_wrapper.o mediacodec_sw_buffer.o OBJS-$(CONFIG_MPEG_ER) += mpeg_er.o @@ -134,7 +130,8 @@ OBJS-$(CONFIG_MPEGAUDIO) += mpegaudio.o mpegaudiodec_common.o \ OBJS-$(CONFIG_MPEGAUDIODSP) += mpegaudiodsp.o \ mpegaudiodsp_data.o \ mpegaudiodsp_fixed.o \ - mpegaudiodsp_float.o + mpegaudiodsp_float.o \ + dct32_fixed.o dct32_float.o OBJS-$(CONFIG_MPEGAUDIOHEADER) += mpegaudiodecheader.o mpegaudiotabs.o OBJS-$(CONFIG_MPEG4AUDIO) += mpeg4audio.o mpeg4audio_sample_rates.o OBJS-$(CONFIG_MPEGVIDEO) += mpegvideo.o rl.o \ @@ -156,7 +153,6 @@ OBJS-$(CONFIG_QSV) += qsv.o OBJS-$(CONFIG_QSVDEC) += qsvdec.o OBJS-$(CONFIG_QSVENC) += qsvenc.o OBJS-$(CONFIG_RANGECODER) += rangecoder.o -OBJS-$(CONFIG_RDFT) += rdft.o OBJS-$(CONFIG_RV34DSP) += rv34dsp.o OBJS-$(CONFIG_SINEWIN) += sinewin.o OBJS-$(CONFIG_SNAPPY) += snappy.o @@ -258,6 +254,7 @@ OBJS-$(CONFIG_AV1_MEDIACODEC_DECODER) += mediacodecdec.o OBJS-$(CONFIG_AV1_MEDIACODEC_ENCODER) += mediacodecenc.o OBJS-$(CONFIG_AV1_NVENC_ENCODER) += nvenc_av1.o nvenc.o OBJS-$(CONFIG_AV1_QSV_ENCODER) += qsvenc_av1.o +OBJS-$(CONFIG_AV1_VAAPI_ENCODER) += vaapi_encode_av1.o av1_levels.o OBJS-$(CONFIG_AVRN_DECODER) += avrndec.o OBJS-$(CONFIG_AVRP_DECODER) += r210dec.o OBJS-$(CONFIG_AVRP_ENCODER) += r210enc.o @@ -579,6 +576,7 @@ OBJS-$(CONFIG_OPUS_DECODER) += opusdec.o opusdec_celt.o opus_celt.o \ opusdsp.o opus_parse.o opus_rc.o OBJS-$(CONFIG_OPUS_ENCODER) += opusenc.o opusenc_psy.o opus_celt.o \ opus_pvq.o opus_rc.o opustab.o +OBJS-$(CONFIG_OSQ_DECODER) += osq.o OBJS-$(CONFIG_PAF_AUDIO_DECODER) += pafaudio.o OBJS-$(CONFIG_PAF_VIDEO_DECODER) += pafvideo.o OBJS-$(CONFIG_PAM_DECODER) += pnmdec.o pnm.o @@ -1056,6 +1054,8 @@ STLIBOBJS-$(CONFIG_AVFORMAT) += to_upper4.o STLIBOBJS-$(CONFIG_ISO_MEDIA) += mpegaudiotabs.o STLIBOBJS-$(CONFIG_FLV_MUXER) += mpeg4audio_sample_rates.o STLIBOBJS-$(CONFIG_HLS_DEMUXER) += ac3_channel_layout_tab.o +STLIBOBJS-$(CONFIG_IMAGE_JPEGXL_PIPE_DEMUXER) += jpegxl_parse.o +STLIBOBJS-$(CONFIG_JPEGXL_ANIM_DEMUXER) += jpegxl_parse.o STLIBOBJS-$(CONFIG_MATROSKA_DEMUXER) += mpeg4audio_sample_rates.o STLIBOBJS-$(CONFIG_MOV_DEMUXER) += ac3_channel_layout_tab.o STLIBOBJS-$(CONFIG_MXF_MUXER) += golomb.o @@ -1185,6 +1185,7 @@ OBJS-$(CONFIG_HEVC_PARSER) += hevc_parser.o hevc_data.o OBJS-$(CONFIG_HDR_PARSER) += hdr_parser.o OBJS-$(CONFIG_IPU_PARSER) += ipu_parser.o OBJS-$(CONFIG_JPEG2000_PARSER) += jpeg2000_parser.o +OBJS-$(CONFIG_JPEGXL_PARSER) += jpegxl_parser.o jpegxl_parse.o OBJS-$(CONFIG_MISC4_PARSER) += misc4_parser.o OBJS-$(CONFIG_MJPEG_PARSER) += mjpeg_parser.o OBJS-$(CONFIG_MLP_PARSER) += mlp_parse.o mlp_parser.o mlp.o @@ -1199,8 +1200,7 @@ OBJS-$(CONFIG_OPUS_PARSER) += opus_parser.o opus_parse.o \ OBJS-$(CONFIG_PNG_PARSER) += png_parser.o OBJS-$(CONFIG_PNM_PARSER) += pnm_parser.o pnm.o OBJS-$(CONFIG_QOI_PARSER) += qoi_parser.o -OBJS-$(CONFIG_RV30_PARSER) += rv34_parser.o -OBJS-$(CONFIG_RV40_PARSER) += rv34_parser.o +OBJS-$(CONFIG_RV34_PARSER) += rv34_parser.o OBJS-$(CONFIG_SBC_PARSER) += sbc_parser.o OBJS-$(CONFIG_SIPR_PARSER) += sipr_parser.o OBJS-$(CONFIG_TAK_PARSER) += tak_parser.o tak.o @@ -1283,6 +1283,7 @@ SKIPHEADERS += %_tablegen.h \ aacenc_quantization.h \ aacenc_quantization_misc.h \ bitstream_template.h \ + vulkan_video_codec_av1std.h \ $(ARCH)/vpx_arith.h \ SKIPHEADERS-$(CONFIG_AMF) += amfenc.h @@ -1304,7 +1305,7 @@ SKIPHEADERS-$(CONFIG_XVMC) += xvmc.h SKIPHEADERS-$(CONFIG_VAAPI) += vaapi_decode.h vaapi_hevc.h vaapi_encode.h SKIPHEADERS-$(CONFIG_VDPAU) += vdpau.h vdpau_internal.h SKIPHEADERS-$(CONFIG_VIDEOTOOLBOX) += videotoolbox.h vt_internal.h -SKIPHEADERS-$(CONFIG_VULKAN) += vulkan.h vulkan_video.h vulkan_decode.h vulkan_video_codec_av1std.h vulkan_video_codec_av1std_decode.h +SKIPHEADERS-$(CONFIG_VULKAN) += vulkan.h vulkan_video.h vulkan_decode.h vulkan_video_codec_av1std_decode.h SKIPHEADERS-$(CONFIG_V4L2_M2M) += v4l2_buffers.h v4l2_context.h v4l2_m2m.h SKIPHEADERS-$(CONFIG_ZLIB) += zlib_wrapper.h @@ -1318,9 +1319,8 @@ TESTPROGS = avcodec \ jpeg2000dwt \ mathops \ +TESTPROGS-$(CONFIG_AV1_VAAPI_ENCODER) += av1_levels TESTPROGS-$(CONFIG_CABAC) += cabac -TESTPROGS-$(CONFIG_DCT) += avfft -TESTPROGS-$(CONFIG_FFT) += fft fft-fixed32 TESTPROGS-$(CONFIG_GOLOMB) += golomb TESTPROGS-$(CONFIG_IDCTDSP) += dct TESTPROGS-$(CONFIG_IIRFILTER) += iirfilter @@ -1340,7 +1340,6 @@ HOSTPROGS = aacps_tablegen \ aacps_fixed_tablegen \ cbrt_tablegen \ cbrt_fixed_tablegen \ - cos_tablegen \ dv_tablegen \ motionpixels_tablegen \ mpegaudio_tablegen \ @@ -1355,12 +1354,6 @@ CLEANFILES = *_tables.c *_tables.h *_tablegen$(HOSTEXESUF) $(SUBDIR)tests/dct$(EXESUF): $(SUBDIR)dctref.o $(SUBDIR)aandcttab.o $(SUBDIR)dv_tablegen$(HOSTEXESUF): $(SUBDIR)dvdata_host.o -TRIG_TABLES = cos cos_fixed sin -TRIG_TABLES := $(TRIG_TABLES:%=$(SUBDIR)%_tables.c) - -$(TRIG_TABLES): $(SUBDIR)%_tables.c: $(SUBDIR)cos_tablegen$(HOSTEXESUF) - $(M)./$< $* > $@ - ifdef CONFIG_SMALL $(SUBDIR)%_tablegen$(HOSTEXESUF): HOSTCFLAGS += -DCONFIG_SMALL=1 else diff --git a/src/third_party/ffmpeg/libavcodec/aacdec_template.c b/src/third_party/ffmpeg/libavcodec/aacdec_template.c index 444dc4fa..954399f8 100644 --- a/src/third_party/ffmpeg/libavcodec/aacdec_template.c +++ b/src/third_party/ffmpeg/libavcodec/aacdec_template.c @@ -1133,14 +1133,14 @@ static av_cold void aac_static_table_init(void) for (unsigned i = 0, offset = 0; i < 11; i++) { vlc_spectral[i].table = &vlc_buf[offset]; vlc_spectral[i].table_allocated = FF_ARRAY_ELEMS(vlc_buf) - offset; - ff_init_vlc_sparse(&vlc_spectral[i], 8, ff_aac_spectral_sizes[i], + ff_vlc_init_sparse(&vlc_spectral[i], 8, ff_aac_spectral_sizes[i], ff_aac_spectral_bits[i], sizeof(ff_aac_spectral_bits[i][0]), sizeof(ff_aac_spectral_bits[i][0]), ff_aac_spectral_codes[i], sizeof(ff_aac_spectral_codes[i][0]), sizeof(ff_aac_spectral_codes[i][0]), ff_aac_codebook_vector_idx[i], sizeof(ff_aac_codebook_vector_idx[i][0]), sizeof(ff_aac_codebook_vector_idx[i][0]), - INIT_VLC_STATIC_OVERLONG); + VLC_INIT_STATIC_OVERLONG); offset += vlc_spectral[i].table_size; } @@ -1148,7 +1148,7 @@ static av_cold void aac_static_table_init(void) ff_aac_tableinit(); - INIT_VLC_STATIC(&vlc_scalefactors, 7, + VLC_INIT_STATIC(&vlc_scalefactors, 7, FF_ARRAY_ELEMS(ff_aac_scalefactor_code), ff_aac_scalefactor_bits, sizeof(ff_aac_scalefactor_bits[0]), @@ -1159,8 +1159,8 @@ static av_cold void aac_static_table_init(void) 352); // window initialization - AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(aac_kbd_long_960), 4.0, 960); - AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(aac_kbd_short_120), 6.0, 120); + AAC_RENAME(avpriv_kbd_window_init)(AAC_RENAME(aac_kbd_long_960), 4.0, 960); + AAC_RENAME(avpriv_kbd_window_init)(AAC_RENAME(aac_kbd_short_120), 6.0, 120); #if !USE_FIXED AAC_RENAME(ff_sine_window_init)(AAC_RENAME(sine_960), 960); @@ -1168,8 +1168,8 @@ static av_cold void aac_static_table_init(void) AAC_RENAME(ff_init_ff_sine_windows)(9); ff_aac_float_common_init(); #else - AAC_RENAME(ff_kbd_window_init)(AAC_RENAME2(aac_kbd_long_1024), 4.0, 1024); - AAC_RENAME(ff_kbd_window_init)(AAC_RENAME2(aac_kbd_short_128), 6.0, 128); + AAC_RENAME(avpriv_kbd_window_init)(AAC_RENAME2(aac_kbd_long_1024), 4.0, 1024); + AAC_RENAME(avpriv_kbd_window_init)(AAC_RENAME2(aac_kbd_short_128), 6.0, 128); init_sine_windows_fixed(); #endif @@ -2486,12 +2486,12 @@ static int decode_extension_payload(AACContext *ac, GetBitContext *gb, int cnt, ac->avctx->ch_layout.nb_channels == 1) { ac->oc[1].m4ac.sbr = 1; ac->oc[1].m4ac.ps = 1; - ac->avctx->profile = FF_PROFILE_AAC_HE_V2; + ac->avctx->profile = AV_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; + ac->avctx->profile = AV_PROFILE_AAC_HE; } res = AAC_RENAME(ff_decode_sbr_extension)(ac, &che->sbr, gb, crc_flag, cnt, elem_type); if (ac->oc[1].m4ac.ps == 1 && !ac->warned_he_aac_mono) { @@ -2856,8 +2856,8 @@ static void imdct_and_windowing_eld(AACContext *ac, SingleChannelElement *sce) ac->mdct512_fn(ac->mdct512, buf, in, sizeof(INTFLOAT)); for (i = 0; i < n; i+=2) { - buf[i + 0] = -(USE_FIXED + 1)*buf[i + 0]; - buf[i + 1] = (USE_FIXED + 1)*buf[i + 1]; + buf[i + 0] = -(UINTFLOAT)(USE_FIXED + 1)*buf[i + 0]; + buf[i + 1] = (UINTFLOAT)(USE_FIXED + 1)*buf[i + 1]; } // 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 @@ -3080,7 +3080,7 @@ static int aac_decode_er_frame(AVCodecContext *avctx, void *data, if ((err = frame_configure_elements(avctx)) < 0) return err; - // The FF_PROFILE_AAC_* defines are all object_type - 1 + // The AV_PROFILE_AAC_* defines are all object_type - 1 // This may lead to an undefined profile being signaled ac->avctx->profile = aot - 1; @@ -3163,7 +3163,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, AVFrame *frame, if ((err = frame_configure_elements(avctx)) < 0) goto fail; - // The FF_PROFILE_AAC_* defines are all object_type - 1 + // The AV_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; diff --git a/src/third_party/ffmpeg/libavcodec/aacenc.c b/src/third_party/ffmpeg/libavcodec/aacenc.c index f48f0570..2a34685a 100644 --- a/src/third_party/ffmpeg/libavcodec/aacenc.c +++ b/src/third_party/ffmpeg/libavcodec/aacenc.c @@ -1307,13 +1307,13 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) avctx->bit_rate); /* Profile and option setting */ - avctx->profile = avctx->profile == FF_PROFILE_UNKNOWN ? FF_PROFILE_AAC_LOW : + avctx->profile = avctx->profile == AV_PROFILE_UNKNOWN ? AV_PROFILE_AAC_LOW : avctx->profile; for (i = 0; i < FF_ARRAY_ELEMS(aacenc_profiles); i++) if (avctx->profile == aacenc_profiles[i]) break; - if (avctx->profile == FF_PROFILE_MPEG2_AAC_LOW) { - avctx->profile = FF_PROFILE_AAC_LOW; + if (avctx->profile == AV_PROFILE_MPEG2_AAC_LOW) { + avctx->profile = AV_PROFILE_AAC_LOW; ERROR_IF(s->options.pred, "Main prediction unavailable in the \"mpeg2_aac_low\" profile\n"); ERROR_IF(s->options.ltp, @@ -1321,22 +1321,22 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) WARN_IF(s->options.pns, "PNS unavailable in the \"mpeg2_aac_low\" profile, turning off\n"); s->options.pns = 0; - } else if (avctx->profile == FF_PROFILE_AAC_LTP) { + } else if (avctx->profile == AV_PROFILE_AAC_LTP) { s->options.ltp = 1; ERROR_IF(s->options.pred, "Main prediction unavailable in the \"aac_ltp\" profile\n"); - } else if (avctx->profile == FF_PROFILE_AAC_MAIN) { + } else if (avctx->profile == AV_PROFILE_AAC_MAIN) { s->options.pred = 1; ERROR_IF(s->options.ltp, "LTP prediction unavailable in the \"aac_main\" profile\n"); } else if (s->options.ltp) { - avctx->profile = FF_PROFILE_AAC_LTP; + avctx->profile = AV_PROFILE_AAC_LTP; WARN_IF(1, "Chainging profile to \"aac_ltp\"\n"); ERROR_IF(s->options.pred, "Main prediction unavailable in the \"aac_ltp\" profile\n"); } else if (s->options.pred) { - avctx->profile = FF_PROFILE_AAC_MAIN; + avctx->profile = AV_PROFILE_AAC_MAIN; WARN_IF(1, "Chainging profile to \"aac_main\"\n"); ERROR_IF(s->options.ltp, diff --git a/src/third_party/ffmpeg/libavcodec/aacenc_ltp.c b/src/third_party/ffmpeg/libavcodec/aacenc_ltp.c index f7fb85bb..f3075f0e 100644 --- a/src/third_party/ffmpeg/libavcodec/aacenc_ltp.c +++ b/src/third_party/ffmpeg/libavcodec/aacenc_ltp.c @@ -37,7 +37,7 @@ void ff_aac_encode_ltp_info(AACEncContext *s, SingleChannelElement *sce, { int i; IndividualChannelStream *ics = &sce->ics; - if (s->profile != FF_PROFILE_AAC_LTP || !ics->predictor_present) + if (s->profile != AV_PROFILE_AAC_LTP || !ics->predictor_present) return; if (common_window) put_bits(&s->pb, 1, 0); @@ -119,7 +119,7 @@ void ff_aac_update_ltp(AACEncContext *s, SingleChannelElement *sce) float *pred_signal = &sce->ltp_state[0]; const float *samples = &s->planar_samples[s->cur_channel][1024]; - if (s->profile != FF_PROFILE_AAC_LTP) + if (s->profile != AV_PROFILE_AAC_LTP) return; /* Calculate lag */ diff --git a/src/third_party/ffmpeg/libavcodec/aacenc_pred.c b/src/third_party/ffmpeg/libavcodec/aacenc_pred.c index 447444cb..f87fcd5a 100644 --- a/src/third_party/ffmpeg/libavcodec/aacenc_pred.c +++ b/src/third_party/ffmpeg/libavcodec/aacenc_pred.c @@ -335,7 +335,7 @@ void ff_aac_encode_main_pred(AACEncContext *s, SingleChannelElement *sce) IndividualChannelStream *ics = &sce->ics; const int pmax = FFMIN(ics->max_sfb, ff_aac_pred_sfb_max[s->samplerate_index]); - if (s->profile != FF_PROFILE_AAC_MAIN || + if (s->profile != AV_PROFILE_AAC_MAIN || !ics->predictor_present) return; diff --git a/src/third_party/ffmpeg/libavcodec/aacenc_tns.c b/src/third_party/ffmpeg/libavcodec/aacenc_tns.c index 195ff5e2..8dc6dfcf 100644 --- a/src/third_party/ffmpeg/libavcodec/aacenc_tns.c +++ b/src/third_party/ffmpeg/libavcodec/aacenc_tns.c @@ -167,7 +167,7 @@ void ff_aac_search_for_tns(AACEncContext *s, SingleChannelElement *sce) const int c_bits = is8 ? TNS_Q_BITS_IS8 == 4 : TNS_Q_BITS == 4; const int sfb_start = av_clip(tns_min_sfb[is8][s->samplerate_index], 0, mmm); const int sfb_end = av_clip(sce->ics.num_swb, 0, mmm); - const int order = is8 ? 7 : s->profile == FF_PROFILE_AAC_LOW ? 12 : TNS_MAX_ORDER; + const int order = is8 ? 7 : s->profile == AV_PROFILE_AAC_LOW ? 12 : TNS_MAX_ORDER; const int slant = sce->ics.window_sequence[0] == LONG_STOP_SEQUENCE ? 1 : sce->ics.window_sequence[0] == LONG_START_SEQUENCE ? 0 : 2; const int sfb_len = sfb_end - sfb_start; diff --git a/src/third_party/ffmpeg/libavcodec/aacenctab.h b/src/third_party/ffmpeg/libavcodec/aacenctab.h index 2d966219..20e47ea9 100644 --- a/src/third_party/ffmpeg/libavcodec/aacenctab.h +++ b/src/third_party/ffmpeg/libavcodec/aacenctab.h @@ -124,10 +124,10 @@ static const unsigned char aac_maxval_cb[] = { }; static const int aacenc_profiles[] = { - FF_PROFILE_AAC_MAIN, - FF_PROFILE_AAC_LOW, - FF_PROFILE_AAC_LTP, - FF_PROFILE_MPEG2_AAC_LOW, + AV_PROFILE_AAC_MAIN, + AV_PROFILE_AAC_LOW, + AV_PROFILE_AAC_LTP, + AV_PROFILE_MPEG2_AAC_LOW, }; #endif /* AVCODEC_AACENCTAB_H */ diff --git a/src/third_party/ffmpeg/libavcodec/aacps_common.c b/src/third_party/ffmpeg/libavcodec/aacps_common.c index c388d5b9..bee07b5f 100644 --- a/src/third_party/ffmpeg/libavcodec/aacps_common.c +++ b/src/third_party/ffmpeg/libavcodec/aacps_common.c @@ -290,7 +290,7 @@ err: } #define PS_INIT_VLC_STATIC(num, nb_bits, size) \ - INIT_VLC_STATIC(&vlc_ps[num], nb_bits, ps_tmp[num].table_size / ps_tmp[num].elem_size, \ + VLC_INIT_STATIC(&vlc_ps[num], nb_bits, ps_tmp[num].table_size / ps_tmp[num].elem_size, \ ps_tmp[num].ps_bits, 1, 1, \ ps_tmp[num].ps_codes, ps_tmp[num].elem_size, ps_tmp[num].elem_size, \ size); diff --git a/src/third_party/ffmpeg/libavcodec/aacsbr.h b/src/third_party/ffmpeg/libavcodec/aacsbr.h index d70b19e1..09f9eb1d 100644 --- a/src/third_party/ffmpeg/libavcodec/aacsbr.h +++ b/src/third_party/ffmpeg/libavcodec/aacsbr.h @@ -70,7 +70,7 @@ 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, \ + VLC_INIT_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) diff --git a/src/third_party/ffmpeg/libavcodec/aacsbr_template.c b/src/third_party/ffmpeg/libavcodec/aacsbr_template.c index cdca402f..b33ffd42 100644 --- a/src/third_party/ffmpeg/libavcodec/aacsbr_template.c +++ b/src/third_party/ffmpeg/libavcodec/aacsbr_template.c @@ -973,7 +973,7 @@ static void read_sbr_extension(AACContext *ac, SpectralBandReplication *sbr, *num_bits_left = 0; } else { *num_bits_left -= ff_ps_read_data(ac->avctx, gb, &sbr->ps.common, *num_bits_left); - ac->avctx->profile = FF_PROFILE_AAC_HE_V2; + ac->avctx->profile = AV_PROFILE_AAC_HE_V2; // ensure the warning is not printed if PS extension is present ac->warned_he_aac_mono = 1; } diff --git a/src/third_party/ffmpeg/libavcodec/aacsbrdata.h b/src/third_party/ffmpeg/libavcodec/aacsbrdata.h index 7bb45b22..af86af01 100644 --- a/src/third_party/ffmpeg/libavcodec/aacsbrdata.h +++ b/src/third_party/ffmpeg/libavcodec/aacsbrdata.h @@ -29,7 +29,6 @@ #define AVCODEC_AACSBRDATA_H #include -#include "libavutil/attributes_internal.h" #include "libavutil/mem_internal.h" #include "aac_defines.h" @@ -268,271 +267,6 @@ static const int8_t sbr_offset[6][16] = { {-2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20, 24}, // 64000 Hz < fs_sbr }; -/* First eight entries repeated at end to simplify SIMD implementations. */ -const attribute_visibility_hidden 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 -{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)}, -}; - ///< window coefficients for analysis/synthesis QMF banks static DECLARE_ALIGNED(32, INTFLOAT, sbr_qmf_window_ds)[320]; /* This table contains redundancy: It is symmetric about the entry #320 diff --git a/src/third_party/ffmpeg/libavcodec/aactab.c b/src/third_party/ffmpeg/libavcodec/aactab.c index 0f4941d5..d0006eac 100644 --- a/src/third_party/ffmpeg/libavcodec/aactab.c +++ b/src/third_party/ffmpeg/libavcodec/aactab.c @@ -48,8 +48,8 @@ DECLARE_ALIGNED(32, float, ff_aac_kbd_short_128)[128]; static av_cold void aac_float_common_init(void) { - ff_kbd_window_init(ff_aac_kbd_long_1024, 4.0, 1024); - ff_kbd_window_init(ff_aac_kbd_short_128, 6.0, 128); + avpriv_kbd_window_init(ff_aac_kbd_long_1024, 4.0, 1024); + avpriv_kbd_window_init(ff_aac_kbd_short_128, 6.0, 128); ff_init_ff_sine_windows(10); ff_init_ff_sine_windows(7); } diff --git a/src/third_party/ffmpeg/libavcodec/aarch64/Makefile b/src/third_party/ffmpeg/libavcodec/aarch64/Makefile index cb428b49..beb6a02f 100644 --- a/src/third_party/ffmpeg/libavcodec/aarch64/Makefile +++ b/src/third_party/ffmpeg/libavcodec/aarch64/Makefile @@ -1,5 +1,4 @@ # subsystems -OBJS-$(CONFIG_FFT) += aarch64/fft_init_aarch64.o OBJS-$(CONFIG_FMTCONVERT) += aarch64/fmtconvert_init.o OBJS-$(CONFIG_H264CHROMA) += aarch64/h264chroma_init_aarch64.o OBJS-$(CONFIG_H264DSP) += aarch64/h264dsp_init_aarch64.o @@ -36,7 +35,6 @@ ARMV8-OBJS-$(CONFIG_VIDEODSP) += aarch64/videodsp.o # subsystems NEON-OBJS-$(CONFIG_AAC_DECODER) += aarch64/sbrdsp_neon.o -NEON-OBJS-$(CONFIG_FFT) += aarch64/fft_neon.o NEON-OBJS-$(CONFIG_FMTCONVERT) += aarch64/fmtconvert_neon.o NEON-OBJS-$(CONFIG_H264CHROMA) += aarch64/h264cmc_neon.o NEON-OBJS-$(CONFIG_H264DSP) += aarch64/h264dsp_neon.o \ @@ -47,7 +45,6 @@ NEON-OBJS-$(CONFIG_H264QPEL) += aarch64/h264qpel_neon.o \ NEON-OBJS-$(CONFIG_HPELDSP) += aarch64/hpeldsp_neon.o NEON-OBJS-$(CONFIG_IDCTDSP) += aarch64/idctdsp_neon.o \ aarch64/simple_idct_neon.o -NEON-OBJS-$(CONFIG_MDCT) += aarch64/mdct_neon.o NEON-OBJS-$(CONFIG_ME_CMP) += aarch64/me_cmp_neon.o NEON-OBJS-$(CONFIG_MPEGAUDIODSP) += aarch64/mpegaudiodsp_neon.o NEON-OBJS-$(CONFIG_PIXBLOCKDSP) += aarch64/pixblockdsp_neon.o diff --git a/src/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_epel_neon.S b/src/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_epel_neon.S index a8d69463..edaf39ed 100644 --- a/src/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_epel_neon.S +++ b/src/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_epel_neon.S @@ -32,6 +32,312 @@ const epel_filters, align=4 .byte -2, 10, 58, -2 endconst +const epel_filters_abs, align=4 + .byte 0, 0, 0, 0 + .byte 2, 58, 10, 2 + .byte 4, 54, 16, 2 + .byte 6, 46, 28, 4 + .byte 4, 36, 36, 4 + .byte 4, 28, 46, 6 + .byte 2, 16, 54, 4 + .byte 2, 10, 58, 2 +endconst + + +.macro load_epel_filterb freg, xreg + movrel \xreg, epel_filters_abs + add \xreg, \xreg, \freg, lsl #2 + ld4r {v0.16b, v1.16b, v2.16b, v3.16b}, [\xreg] // filter +.endm + +.macro calc_epelb dst, src0, src1, src2, src3 + umull \dst\().8h, \src1\().8b, v1.8b + umlsl \dst\().8h, \src0\().8b, v0.8b + umlal \dst\().8h, \src2\().8b, v2.8b + umlsl \dst\().8h, \src3\().8b, v3.8b +.endm + +.macro calc_epelb2 dst, src0, src1, src2, src3 + umull2 \dst\().8h, \src1\().16b, v1.16b + umlsl2 \dst\().8h, \src0\().16b, v0.16b + umlal2 \dst\().8h, \src2\().16b, v2.16b + umlsl2 \dst\().8h, \src3\().16b, v3.16b +.endm + +.macro load_epel_filterh freg, xreg + movrel \xreg, epel_filters + add \xreg, \xreg, \freg, lsl #2 + ld1 {v0.8b}, [\xreg] + sxtl v0.8h, v0.8b +.endm + +.macro calc_epelh dst, src0, src1, src2, src3 + smull \dst\().4s, \src0\().4h, v0.h[0] + smlal \dst\().4s, \src1\().4h, v0.h[1] + smlal \dst\().4s, \src2\().4h, v0.h[2] + smlal \dst\().4s, \src3\().4h, v0.h[3] + sqshrn \dst\().4h, \dst\().4s, #6 +.endm + +.macro calc_epelh2 dst, tmp, src0, src1, src2, src3 + smull2 \tmp\().4s, \src0\().8h, v0.h[0] + smlal2 \tmp\().4s, \src1\().8h, v0.h[1] + smlal2 \tmp\().4s, \src2\().8h, v0.h[2] + smlal2 \tmp\().4s, \src3\().8h, v0.h[3] + sqshrn2 \dst\().8h, \tmp\().4s, #6 +.endm + +.macro calc_all4 + calc v16, v17, v18, v19 + b.eq 2f + calc v17, v18, v19, v16 + b.eq 2f + calc v18, v19, v16, v17 + b.eq 2f + calc v19, v16, v17, v18 + b.ne 1b +.endm + +.macro calc_all8 + calc v16, v17, v18, v19, v20, v21, v22, v23 + b.eq 2f + calc v18, v19, v20, v21, v22, v23, v16, v17 + b.eq 2f + calc v20, v21, v22, v23, v16, v17, v18, v19 + b.eq 2f + calc v22, v23, v16, v17, v18, v19, v20, v21 + b.ne 1b +.endm + +.macro calc_all12 + calc v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27 + b.eq 2f + calc v19, v20, v21, v22, v23, v24, v25, v26, v27, v16, v17, v18 + b.eq 2f + calc v22, v23, v24, v25, v26, v27, v16, v17, v18, v19, v20, v21 + b.eq 2f + calc v25, v26, v27, v16, v17, v18, v19, v20, v21, v22, v23, v24 + b.ne 1b +.endm + +.macro calc_all16 + calc v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31 + b.eq 2f + calc v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v16, v17, v18, v19 + b.eq 2f + calc v24, v25, v26, v27, v28, v29, v30, v31, v16, v17, v18, v19, v20, v21, v22, v23 + b.eq 2f + calc v28, v29, v30, v31, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27 + b.ne 1b +.endm + +function ff_hevc_put_hevc_epel_uni_v4_8_neon, export=1 + load_epel_filterb x6, x5 + sub x2, x2, x3 + ld1 {v16.s}[0], [x2], x3 + ld1 {v17.s}[0], [x2], x3 + ld1 {v18.s}[0], [x2], x3 +.macro calc src0, src1, src2, src3 + ld1 {\src3\().s}[0], [x2], x3 + calc_epelb v4, \src0, \src1, \src2, \src3 + sqrshrun v4.8b, v4.8h, #6 + subs w4, w4, #1 + st1 {v4.s}[0], [x0], x1 +.endm +1: calc_all4 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_v6_8_neon, export=1 + load_epel_filterb x6, x5 + sub x2, x2, x3 + sub x1, x1, #4 + ld1 {v16.8b}, [x2], x3 + ld1 {v17.8b}, [x2], x3 + ld1 {v18.8b}, [x2], x3 +.macro calc src0, src1, src2, src3 + ld1 {\src3\().8b}, [x2], x3 + calc_epelb v4, \src0, \src1, \src2, \src3 + sqrshrun v4.8b, v4.8h, #6 + st1 {v4.s}[0], [x0], #4 + subs w4, w4, #1 + st1 {v4.h}[2], [x0], x1 +.endm +1: calc_all4 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_v8_8_neon, export=1 + load_epel_filterb x6, x5 + sub x2, x2, x3 + ld1 {v16.8b}, [x2], x3 + ld1 {v17.8b}, [x2], x3 + ld1 {v18.8b}, [x2], x3 +.macro calc src0, src1, src2, src3 + ld1 {\src3\().8b}, [x2], x3 + calc_epelb v4, \src0, \src1, \src2, \src3 + sqrshrun v4.8b, v4.8h, #6 + subs w4, w4, #1 + st1 {v4.8b}, [x0], x1 +.endm +1: calc_all4 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_v12_8_neon, export=1 + load_epel_filterb x6, x5 + sub x2, x2, x3 + sub x1, x1, #8 + ld1 {v16.16b}, [x2], x3 + ld1 {v17.16b}, [x2], x3 + ld1 {v18.16b}, [x2], x3 +.macro calc src0, src1, src2, src3 + ld1 {\src3\().16b}, [x2], x3 + calc_epelb v4, \src0, \src1, \src2, \src3 + calc_epelb2 v5, \src0, \src1, \src2, \src3 + sqrshrun v4.8b, v4.8h, #6 + sqrshrun2 v4.16b, v5.8h, #6 + subs w4, w4, #1 + st1 {v4.8b}, [x0], #8 + st1 {v4.s}[2], [x0], x1 +.endm +1: calc_all4 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_v16_8_neon, export=1 + load_epel_filterb x6, x5 + sub x2, x2, x3 + ld1 {v16.16b}, [x2], x3 + ld1 {v17.16b}, [x2], x3 + ld1 {v18.16b}, [x2], x3 +.macro calc src0, src1, src2, src3 + ld1 {\src3\().16b}, [x2], x3 + calc_epelb v4, \src0, \src1, \src2, \src3 + calc_epelb2 v5, \src0, \src1, \src2, \src3 + sqrshrun v4.8b, v4.8h, #6 + sqrshrun2 v4.16b, v5.8h, #6 + subs w4, w4, #1 + st1 {v4.16b}, [x0], x1 +.endm +1: calc_all4 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_v24_8_neon, export=1 + load_epel_filterb x6, x5 + sub x2, x2, x3 + ld1 {v16.8b, v17.8b, v18.8b}, [x2], x3 + ld1 {v19.8b, v20.8b, v21.8b}, [x2], x3 + ld1 {v22.8b, v23.8b, v24.8b}, [x2], x3 +.macro calc src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10, src11 + ld1 {\src9\().8b, \src10\().8b, \src11\().8b}, [x2], x3 + calc_epelb v4, \src0, \src3, \src6, \src9 + calc_epelb v5, \src1, \src4, \src7, \src10 + calc_epelb v6, \src2, \src5, \src8, \src11 + sqrshrun v4.8b, v4.8h, #6 + sqrshrun v5.8b, v5.8h, #6 + sqrshrun v6.8b, v6.8h, #6 + subs w4, w4, #1 + st1 {v4.8b-v6.8b}, [x0], x1 +.endm +1: calc_all12 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_v32_8_neon, export=1 + load_epel_filterb x6, x5 + sub x2, x2, x3 + ld1 {v16.16b, v17.16b}, [x2], x3 + ld1 {v18.16b, v19.16b}, [x2], x3 + ld1 {v20.16b, v21.16b}, [x2], x3 +.macro calc src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\src6\().16b, \src7\().16b}, [x2], x3 + calc_epelb v4, \src0, \src2, \src4, \src6 + calc_epelb2 v5, \src0, \src2, \src4, \src6 + calc_epelb v6, \src1, \src3, \src5, \src7 + calc_epelb2 v7, \src1, \src3, \src5, \src7 + sqrshrun v4.8b, v4.8h, #6 + sqrshrun2 v4.16b, v5.8h, #6 + sqrshrun v5.8b, v6.8h, #6 + sqrshrun2 v5.16b, v7.8h, #6 + subs w4, w4, #1 + st1 {v4.16b, v5.16b}, [x0], x1 +.endm +1: calc_all8 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_v48_8_neon, export=1 + load_epel_filterb x6, x5 + sub x2, x2, x3 + ld1 {v16.16b, v17.16b, v18.16b}, [x2], x3 + ld1 {v19.16b, v20.16b, v21.16b}, [x2], x3 + ld1 {v22.16b, v23.16b, v24.16b}, [x2], x3 +.macro calc src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10, src11 + ld1 {\src9\().16b, \src10\().16b, \src11\().16b}, [x2], x3 + calc_epelb v4, \src0, \src3, \src6, \src9 + calc_epelb2 v5, \src0, \src3, \src6, \src9 + calc_epelb v6, \src1, \src4, \src7, \src10 + calc_epelb2 v7, \src1, \src4, \src7, \src10 + calc_epelb v28, \src2, \src5, \src8, \src11 + calc_epelb2 v29, \src2, \src5, \src8, \src11 + sqrshrun v4.8b, v4.8h, #6 + sqrshrun2 v4.16b, v5.8h, #6 + sqrshrun v5.8b, v6.8h, #6 + sqrshrun2 v5.16b, v7.8h, #6 + sqrshrun v6.8b, v28.8h, #6 + sqrshrun2 v6.16b, v29.8h, #6 + subs w4, w4, #1 + st1 {v4.16b, v5.16b, v6.16b}, [x0], x1 +.endm +1: calc_all12 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_v64_8_neon, export=1 + load_epel_filterb x6, x5 + sub sp, sp, #32 + st1 {v8.8b-v11.8b}, [sp] + sub x2, x2, x3 + ld1 {v16.16b, v17.16b, v18.16b, v19.16b}, [x2], x3 + ld1 {v20.16b, v21.16b, v22.16b, v23.16b}, [x2], x3 + ld1 {v24.16b, v25.16b, v26.16b, v27.16b}, [x2], x3 +.macro calc src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10, src11, src12, src13, src14, src15 + ld1 {\src12\().16b, \src13\().16b, \src14\().16b, \src15\().16b}, [x2], x3 + calc_epelb v10, \src3, \src7, \src11, \src15 + calc_epelb2 v11, \src3, \src7, \src11, \src15 + calc_epelb v4, \src0, \src4, \src8, \src12 + calc_epelb2 v5, \src0, \src4, \src8, \src12 + calc_epelb v6, \src1, \src5, \src9, \src13 + calc_epelb2 v7, \src1, \src5, \src9, \src13 + calc_epelb v8, \src2, \src6, \src10, \src14 + calc_epelb2 v9, \src2, \src6, \src10, \src14 + sqrshrun v4.8b, v4.8h, #6 + sqrshrun2 v4.16b, v5.8h, #6 + sqrshrun v5.8b, v6.8h, #6 + sqrshrun2 v5.16b, v7.8h, #6 + sqrshrun v6.8b, v8.8h, #6 + sqrshrun2 v6.16b, v9.8h, #6 + sqrshrun v7.8b, v10.8h, #6 + sqrshrun2 v7.16b, v11.8h, #6 + subs w4, w4, #1 + st1 {v4.16b, v5.16b, v6.16b, v7.16b}, [x0], x1 +.endm +1: calc_all16 +.purgem calc +2: ld1 {v8.8b-v11.8b}, [sp], #32 + ret +endfunc + #if HAVE_I8MM .macro EPEL_H_HEADER @@ -376,6 +682,300 @@ function ff_hevc_put_hevc_epel_h64_8_neon_i8mm, export=1 ret endfunc +function ff_hevc_put_hevc_epel_uni_hv4_8_neon_i8mm, export=1 + add w10, w4, #3 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + str x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + add x0, sp, #48 + sub x1, x2, x3 + mov x2, x3 + add w3, w4, #3 + mov x4, x5 + bl X(ff_hevc_put_hevc_epel_h4_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldr x30, [sp], #48 + load_epel_filterh x6, x5 + mov x10, #(MAX_PB_SIZE * 2) + ld1 {v16.4h}, [sp], x10 + ld1 {v17.4h}, [sp], x10 + ld1 {v18.4h}, [sp], x10 +.macro calc src0, src1, src2, src3 + ld1 {\src3\().4h}, [sp], x10 + calc_epelh v4, \src0, \src1, \src2, \src3 + sqrshrun v4.8b, v4.8h, #6 + subs w4, w4, #1 + st1 {v4.s}[0], [x0], x1 +.endm +1: calc_all4 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_hv6_8_neon_i8mm, export=1 + add w10, w4, #3 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + str x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + add x0, sp, #48 + sub x1, x2, x3 + mov x2, x3 + add w3, w4, #3 + mov x4, x5 + bl X(ff_hevc_put_hevc_epel_h6_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldr x30, [sp], #48 + load_epel_filterh x6, x5 + sub x1, x1, #4 + mov x10, #(MAX_PB_SIZE * 2) + ld1 {v16.8h}, [sp], x10 + ld1 {v17.8h}, [sp], x10 + ld1 {v18.8h}, [sp], x10 +.macro calc src0, src1, src2, src3 + ld1 {\src3\().8h}, [sp], x10 + calc_epelh v4, \src0, \src1, \src2, \src3 + calc_epelh2 v4, v5, \src0, \src1, \src2, \src3 + sqrshrun v4.8b, v4.8h, #6 + st1 {v4.s}[0], [x0], #4 + subs w4, w4, #1 + st1 {v4.h}[2], [x0], x1 +.endm +1: calc_all4 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_hv8_8_neon_i8mm, export=1 + add w10, w4, #3 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + str x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + add x0, sp, #48 + sub x1, x2, x3 + mov x2, x3 + add w3, w4, #3 + mov x4, x5 + bl X(ff_hevc_put_hevc_epel_h8_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldr x30, [sp], #48 + load_epel_filterh x6, x5 + mov x10, #(MAX_PB_SIZE * 2) + ld1 {v16.8h}, [sp], x10 + ld1 {v17.8h}, [sp], x10 + ld1 {v18.8h}, [sp], x10 +.macro calc src0, src1, src2, src3 + ld1 {\src3\().8h}, [sp], x10 + calc_epelh v4, \src0, \src1, \src2, \src3 + calc_epelh2 v4, v5, \src0, \src1, \src2, \src3 + sqrshrun v4.8b, v4.8h, #6 + subs w4, w4, #1 + st1 {v4.8b}, [x0], x1 +.endm +1: calc_all4 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_hv12_8_neon_i8mm, export=1 + add w10, w4, #3 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + str x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + add x0, sp, #48 + sub x1, x2, x3 + mov x2, x3 + add w3, w4, #3 + mov x4, x5 + bl X(ff_hevc_put_hevc_epel_h12_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldr x30, [sp], #48 + load_epel_filterh x6, x5 + sub x1, x1, #8 + mov x10, #(MAX_PB_SIZE * 2) + ld1 {v16.8h, v17.8h}, [sp], x10 + ld1 {v18.8h, v19.8h}, [sp], x10 + ld1 {v20.8h, v21.8h}, [sp], x10 +.macro calc src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\src6\().8h, \src7\().8h}, [sp], x10 + calc_epelh v4, \src0, \src2, \src4, \src6 + calc_epelh2 v4, v5, \src0, \src2, \src4, \src6 + calc_epelh v5, \src1, \src3, \src5, \src7 + sqrshrun v4.8b, v4.8h, #6 + sqrshrun2 v4.16b, v5.8h, #6 + st1 {v4.8b}, [x0], #8 + st1 {v4.s}[2], [x0], x1 + subs w4, w4, #1 +.endm +1: calc_all8 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_hv16_8_neon_i8mm, export=1 + add w10, w4, #3 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + str x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + add x0, sp, #48 + sub x1, x2, x3 + mov x2, x3 + add w3, w4, #3 + mov x4, x5 + bl X(ff_hevc_put_hevc_epel_h16_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldr x30, [sp], #48 + load_epel_filterh x6, x5 + mov x10, #(MAX_PB_SIZE * 2) + ld1 {v16.8h, v17.8h}, [sp], x10 + ld1 {v18.8h, v19.8h}, [sp], x10 + ld1 {v20.8h, v21.8h}, [sp], x10 +.macro calc src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\src6\().8h, \src7\().8h}, [sp], x10 + calc_epelh v4, \src0, \src2, \src4, \src6 + calc_epelh2 v4, v5, \src0, \src2, \src4, \src6 + calc_epelh v5, \src1, \src3, \src5, \src7 + calc_epelh2 v5, v6, \src1, \src3, \src5, \src7 + sqrshrun v4.8b, v4.8h, #6 + sqrshrun2 v4.16b, v5.8h, #6 + subs w4, w4, #1 + st1 {v4.16b}, [x0], x1 +.endm +1: calc_all8 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_hv24_8_neon_i8mm, export=1 + add w10, w4, #3 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + str x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + add x0, sp, #48 + sub x1, x2, x3 + mov x2, x3 + add w3, w4, #3 + mov x4, x5 + bl X(ff_hevc_put_hevc_epel_h24_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldr x30, [sp], #48 + load_epel_filterh x6, x5 + mov x10, #(MAX_PB_SIZE * 2) + ld1 {v16.8h, v17.8h, v18.8h}, [sp], x10 + ld1 {v19.8h, v20.8h, v21.8h}, [sp], x10 + ld1 {v22.8h, v23.8h, v24.8h}, [sp], x10 +.macro calc src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10, src11 + ld1 {\src9\().8h, \src10\().8h, \src11\().8h}, [sp], x10 + calc_epelh v4, \src0, \src3, \src6, \src9 + calc_epelh2 v4, v5, \src0, \src3, \src6, \src9 + calc_epelh v5, \src1, \src4, \src7, \src10 + calc_epelh2 v5, v6, \src1, \src4, \src7, \src10 + calc_epelh v6, \src2, \src5, \src8, \src11 + calc_epelh2 v6, v7, \src2, \src5, \src8, \src11 + sqrshrun v4.8b, v4.8h, #6 + sqrshrun v5.8b, v5.8h, #6 + sqrshrun v6.8b, v6.8h, #6 + subs w4, w4, #1 + st1 {v4.8b, v5.8b, v6.8b}, [x0], x1 +.endm +1: calc_all12 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_epel_uni_hv32_8_neon_i8mm, export=1 + stp x5, x6, [sp, #-64]! + stp x3, x4, [sp, #16] + stp x1, x2, [sp, #32] + stp x0, x30, [sp, #48] + mov x7, #16 + bl X(ff_hevc_put_hevc_epel_uni_hv16_8_neon_i8mm) + ldp x5, x6, [sp] + ldp x3, x4, [sp, #16] + ldp x1, x2, [sp, #32] + ldr x0, [sp, #48] + add x0, x0, #16 + add x2, x2, #16 + mov x7, #16 + bl X(ff_hevc_put_hevc_epel_uni_hv16_8_neon_i8mm) + ldr x30, [sp, #56] + add sp, sp, #64 + ret +endfunc + +function ff_hevc_put_hevc_epel_uni_hv48_8_neon_i8mm, export=1 + stp x5, x6, [sp, #-64]! + stp x3, x4, [sp, #16] + stp x1, x2, [sp, #32] + stp x0, x30, [sp, #48] + mov x7, #24 + bl X(ff_hevc_put_hevc_epel_uni_hv24_8_neon_i8mm) + ldp x5, x6, [sp] + ldp x3, x4, [sp, #16] + ldp x1, x2, [sp, #32] + ldr x0, [sp, #48] + add x0, x0, #24 + add x2, x2, #24 + mov x7, #24 + bl X(ff_hevc_put_hevc_epel_uni_hv24_8_neon_i8mm) + ldr x30, [sp, #56] + add sp, sp, #64 + ret +endfunc + +function ff_hevc_put_hevc_epel_uni_hv64_8_neon_i8mm, export=1 + stp x5, x6, [sp, #-64]! + stp x3, x4, [sp, #16] + stp x1, x2, [sp, #32] + stp x0, x30, [sp, #48] + mov x7, #16 + bl X(ff_hevc_put_hevc_epel_uni_hv16_8_neon_i8mm) + ldp x5, x6, [sp] + ldp x3, x4, [sp, #16] + ldp x1, x2, [sp, #32] + ldr x0, [sp, #48] + add x0, x0, #16 + add x2, x2, #16 + mov x7, #16 + bl X(ff_hevc_put_hevc_epel_uni_hv16_8_neon_i8mm) + ldp x5, x6, [sp] + ldp x3, x4, [sp, #16] + ldp x1, x2, [sp, #32] + ldr x0, [sp, #48] + add x0, x0, #32 + add x2, x2, #32 + mov x7, #16 + bl X(ff_hevc_put_hevc_epel_uni_hv16_8_neon_i8mm) + ldp x5, x6, [sp] + ldp x3, x4, [sp, #16] + ldp x1, x2, [sp, #32] + ldr x0, [sp, #48] + add x0, x0, #48 + add x2, x2, #48 + mov x7, #16 + bl X(ff_hevc_put_hevc_epel_uni_hv16_8_neon_i8mm) + ldr x30, [sp, #56] + add sp, sp, #64 + ret +endfunc + .macro EPEL_UNI_W_H_HEADER ldr x12, [sp] sub x2, x2, #1 @@ -818,28 +1418,7 @@ endfunc sqxtn2 v6.8h, v31.4s .endm -.macro calc_epelh dst, src0, src1, src2, src3 - smull \dst\().4s, \src0\().4h, v0.h[0] - smlal \dst\().4s, \src1\().4h, v0.h[1] - smlal \dst\().4s, \src2\().4h, v0.h[2] - smlal \dst\().4s, \src3\().4h, v0.h[3] - sqshrn \dst\().4h, \dst\().4s, #6 -.endm -.macro calc_epelh2 dst, tmp, src0, src1, src2, src3 - smull2 \tmp\().4s, \src0\().8h, v0.h[0] - smlal2 \tmp\().4s, \src1\().8h, v0.h[1] - smlal2 \tmp\().4s, \src2\().8h, v0.h[2] - smlal2 \tmp\().4s, \src3\().8h, v0.h[3] - sqshrn2 \dst\().8h, \tmp\().4s, #6 -.endm - -.macro load_epel_filterh freg, xreg - movrel \xreg, epel_filters - add \xreg, \xreg, \freg, lsl #2 - ld1 {v0.8b}, [\xreg] - sxtl v0.8h, v0.8b -.endm function ff_hevc_put_hevc_epel_uni_w_hv4_8_neon_i8mm, export=1 epel_uni_w_hv_start diff --git a/src/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_idct_neon.S b/src/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_idct_neon.S index b7f23386..ba8a1eba 100644 --- a/src/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_idct_neon.S +++ b/src/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_idct_neon.S @@ -617,8 +617,7 @@ function ff_hevc_idct_16x16_\bitdepth\()_neon, export=1 add sp, sp, #640 - mov x30, x15 - ret + ret x15 endfunc .endm @@ -791,7 +790,7 @@ function func_tr_32x4_\name add x3, x11, #(32 + 3 * 64) scale_store \shift - br x10 + ret x10 endfunc .endm @@ -814,8 +813,7 @@ function ff_hevc_idct_32x32_\bitdepth\()_neon, export=1 .endr add sp, sp, #2432 - mov x30, x15 - ret + ret x15 endfunc .endm diff --git a/src/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_init_aarch64.c b/src/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_init_aarch64.c index e125b0cf..782cf802 100644 --- a/src/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_init_aarch64.c +++ b/src/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_init_aarch64.c @@ -161,6 +161,14 @@ NEON8_FNPROTO(pel_uni_w_pixels, (uint8_t *_dst, ptrdiff_t _dststride, int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width),); +NEON8_FNPROTO(epel_uni_v, (uint8_t *dst, ptrdiff_t dststride, + const uint8_t *src, ptrdiff_t srcstride, + int height, intptr_t mx, intptr_t my, int width),); + +NEON8_FNPROTO(epel_uni_hv, (uint8_t *dst, ptrdiff_t _dststride, + const uint8_t *src, ptrdiff_t srcstride, + int height, intptr_t mx, intptr_t my, int width), _i8mm); + NEON8_FNPROTO(epel_uni_w_v, (uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, int height, int denom, int wx, int ox, @@ -184,6 +192,14 @@ NEON8_FNPROTO(qpel_h, (int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width), _i8mm); +NEON8_FNPROTO(qpel_uni_v, (uint8_t *dst, ptrdiff_t dststride, + const uint8_t *src, ptrdiff_t srcstride, + int height, intptr_t mx, intptr_t my, int width),); + +NEON8_FNPROTO(qpel_uni_hv, (uint8_t *dst, ptrdiff_t dststride, + const uint8_t *src, ptrdiff_t srcstride, + int height, intptr_t mx, intptr_t my, int width), _i8mm); + NEON8_FNPROTO(qpel_uni_w_h, (uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, int height, int denom, int wx, int ox, @@ -285,7 +301,9 @@ av_cold void ff_hevc_dsp_init_aarch64(HEVCDSPContext *c, const int bit_depth) c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_qpel_bi_h16_8_neon; NEON8_FNASSIGN(c->put_hevc_epel_uni, 0, 0, pel_uni_pixels,); + NEON8_FNASSIGN(c->put_hevc_epel_uni, 1, 0, epel_uni_v,); NEON8_FNASSIGN(c->put_hevc_qpel_uni, 0, 0, pel_uni_pixels,); + NEON8_FNASSIGN(c->put_hevc_qpel_uni, 1, 0, qpel_uni_v,); NEON8_FNASSIGN(c->put_hevc_epel_uni_w, 0, 0, pel_uni_w_pixels,); NEON8_FNASSIGN(c->put_hevc_qpel_uni_w, 0, 0, pel_uni_w_pixels,); NEON8_FNASSIGN(c->put_hevc_epel_uni_w, 1, 0, epel_uni_w_v,); @@ -293,8 +311,10 @@ av_cold void ff_hevc_dsp_init_aarch64(HEVCDSPContext *c, const int bit_depth) if (have_i8mm(cpu_flags)) { NEON8_FNASSIGN(c->put_hevc_epel, 0, 1, epel_h, _i8mm); + NEON8_FNASSIGN(c->put_hevc_epel_uni, 1, 1, epel_uni_hv, _i8mm); NEON8_FNASSIGN(c->put_hevc_epel_uni_w, 0, 1, epel_uni_w_h ,_i8mm); NEON8_FNASSIGN(c->put_hevc_qpel, 0, 1, qpel_h, _i8mm); + NEON8_FNASSIGN(c->put_hevc_qpel_uni, 1, 1, qpel_uni_hv, _i8mm); NEON8_FNASSIGN(c->put_hevc_qpel_uni_w, 0, 1, qpel_uni_w_h, _i8mm); NEON8_FNASSIGN(c->put_hevc_epel_uni_w, 1, 1, epel_uni_w_hv, _i8mm); NEON8_FNASSIGN_PARTIAL_5(c->put_hevc_qpel_uni_w, 1, 1, qpel_uni_w_hv, _i8mm); diff --git a/src/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_qpel_neon.S b/src/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_qpel_neon.S index e38dff96..1212eae6 100644 --- a/src/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_qpel_neon.S +++ b/src/third_party/ffmpeg/libavcodec/aarch64/hevcdsp_qpel_neon.S @@ -44,6 +44,74 @@ endconst sxtl v0.8h, v0.8b .endm +.macro load_qpel_filterb freg, xreg + movrel \xreg, qpel_filters_abs + add \xreg, \xreg, \freg, lsl #3 + ld4r {v0.16b, v1.16b, v2.16b, v3.16b}, [\xreg], #4 + ld4r {v4.16b, v5.16b, v6.16b, v7.16b}, [\xreg] +.endm + +.macro calc_qpelb dst, src0, src1, src2, src3, src4, src5, src6, src7 + umull \dst\().8h, \src1\().8b, v1.8b + umlsl \dst\().8h, \src0\().8b, v0.8b + umlsl \dst\().8h, \src2\().8b, v2.8b + umlal \dst\().8h, \src3\().8b, v3.8b + umlal \dst\().8h, \src4\().8b, v4.8b + umlsl \dst\().8h, \src5\().8b, v5.8b + umlal \dst\().8h, \src6\().8b, v6.8b + umlsl \dst\().8h, \src7\().8b, v7.8b +.endm + +.macro calc_qpelb2 dst, src0, src1, src2, src3, src4, src5, src6, src7 + umull2 \dst\().8h, \src1\().16b, v1.16b + umlsl2 \dst\().8h, \src0\().16b, v0.16b + umlsl2 \dst\().8h, \src2\().16b, v2.16b + umlal2 \dst\().8h, \src3\().16b, v3.16b + umlal2 \dst\().8h, \src4\().16b, v4.16b + umlsl2 \dst\().8h, \src5\().16b, v5.16b + umlal2 \dst\().8h, \src6\().16b, v6.16b + umlsl2 \dst\().8h, \src7\().16b, v7.16b +.endm + +.macro load_qpel_filterh freg, xreg + movrel \xreg, qpel_filters + add \xreg, \xreg, \freg, lsl #3 + ld1 {v0.8b}, [\xreg] + sxtl v0.8h, v0.8b +.endm + +.macro calc_qpelh dst, src0, src1, src2, src3, src4, src5, src6, src7, op, shift=6 + smull \dst\().4s, \src0\().4h, v0.h[0] + smlal \dst\().4s, \src1\().4h, v0.h[1] + smlal \dst\().4s, \src2\().4h, v0.h[2] + smlal \dst\().4s, \src3\().4h, v0.h[3] + smlal \dst\().4s, \src4\().4h, v0.h[4] + smlal \dst\().4s, \src5\().4h, v0.h[5] + smlal \dst\().4s, \src6\().4h, v0.h[6] + smlal \dst\().4s, \src7\().4h, v0.h[7] +.ifc \op, sshr + sshr \dst\().4s, \dst\().4s, \shift +.else + \op \dst\().4h, \dst\().4s, \shift +.endif +.endm + +.macro calc_qpelh2 dst, dstt, src0, src1, src2, src3, src4, src5, src6, src7, op, shift=6 + smull2 \dstt\().4s, \src0\().8h, v0.h[0] + smlal2 \dstt\().4s, \src1\().8h, v0.h[1] + smlal2 \dstt\().4s, \src2\().8h, v0.h[2] + smlal2 \dstt\().4s, \src3\().8h, v0.h[3] + smlal2 \dstt\().4s, \src4\().8h, v0.h[4] + smlal2 \dstt\().4s, \src5\().8h, v0.h[5] + smlal2 \dstt\().4s, \src6\().8h, v0.h[6] + smlal2 \dstt\().4s, \src7\().8h, v0.h[7] +.ifc \op, sshr + sshr \dst\().4s, \dstt\().4s, \shift +.else + \op \dst\().8h, \dstt\().4s, \shift +.endif +.endm + .macro put_hevc type .ifc \type, qpel // void put_hevc_qpel_h(int16_t *dst, @@ -595,6 +663,198 @@ function ff_hevc_put_hevc_pel_uni_pixels64_8_neon, export=1 ret endfunc +.macro calc_all + calc v23, v16, v17, v18, v19, v20, v21, v22, v23 + b.eq 2f + calc v16, v17, v18, v19, v20, v21, v22, v23, v16 + b.eq 2f + calc v17, v18, v19, v20, v21, v22, v23, v16, v17 + b.eq 2f + calc v18, v19, v20, v21, v22, v23, v16, v17, v18 + b.eq 2f + calc v19, v20, v21, v22, v23, v16, v17, v18, v19 + b.eq 2f + calc v20, v21, v22, v23, v16, v17, v18, v19, v20 + b.eq 2f + calc v21, v22, v23, v16, v17, v18, v19, v20, v21 + b.eq 2f + calc v22, v23, v16, v17, v18, v19, v20, v21, v22 + b.hi 1b +.endm + +function ff_hevc_put_hevc_qpel_uni_v4_8_neon, export=1 + load_qpel_filterb x6, x5 + sub x2, x2, x3, lsl #1 + sub x2, x2, x3 + ldr s16, [x2] + ldr s17, [x2, x3] + add x2, x2, x3, lsl #1 + ldr s18, [x2] + ldr s19, [x2, x3] + add x2, x2, x3, lsl #1 + ldr s20, [x2] + ldr s21, [x2, x3] + add x2, x2, x3, lsl #1 + ldr s22, [x2] + add x2, x2, x3 +.macro calc tmp, src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\tmp\().s}[0], [x2], x3 + calc_qpelb v24, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7 + sqrshrun v24.8b, v24.8h, #6 + subs w4, w4, #1 + st1 {v24.s}[0], [x0], x1 +.endm +1: calc_all +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_v6_8_neon, export=1 + load_qpel_filterb x6, x5 + sub x2, x2, x3, lsl #1 + sub x1, x1, #4 + sub x2, x2, x3 + ldr d16, [x2] + ldr d17, [x2, x3] + add x2, x2, x3, lsl #1 + ldr d18, [x2] + ldr d19, [x2, x3] + add x2, x2, x3, lsl #1 + ldr d20, [x2] + ldr d21, [x2, x3] + add x2, x2, x3, lsl #1 + ldr d22, [x2] + add x2, x2, x3 +.macro calc tmp, src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\tmp\().8b}, [x2], x3 + calc_qpelb v24, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7 + sqrshrun v24.8b, v24.8h, #6 + st1 {v24.s}[0], [x0], #4 + subs w4, w4, #1 + st1 {v24.h}[2], [x0], x1 +.endm +1: calc_all +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_v8_8_neon, export=1 + load_qpel_filterb x6, x5 + sub x2, x2, x3, lsl #1 + sub x2, x2, x3 + ldr d16, [x2] + ldr d17, [x2, x3] + add x2, x2, x3, lsl #1 + ldr d18, [x2] + ldr d19, [x2, x3] + add x2, x2, x3, lsl #1 + ldr d20, [x2] + ldr d21, [x2, x3] + add x2, x2, x3, lsl #1 + ldr d22, [x2] + add x2, x2, x3 +.macro calc tmp, src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\tmp\().8b}, [x2], x3 + calc_qpelb v24, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7 + sqrshrun v24.8b, v24.8h, #6 + subs w4, w4, #1 + st1 {v24.8b}, [x0], x1 +.endm +1: calc_all +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_v12_8_neon, export=1 + load_qpel_filterb x6, x5 + sub x2, x2, x3, lsl #1 + sub x1, x1, #8 + sub x2, x2, x3 +0: mov x8, x2 // src + mov w11, w4 // height + mov x10, x0 // dst + ldr q16, [x8] + ldr q17, [x8, x3] + add x8, x8, x3, lsl #1 + ldr q18, [x8] + ldr q19, [x8, x3] + add x8, x8, x3, lsl #1 + ldr q20, [x8] + ldr q21, [x8, x3] + add x8, x8, x3, lsl #1 + ldr q22, [x8] + add x8, x8, x3 +.macro calc tmp, src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\tmp\().16b}, [x8], x3 + calc_qpelb v24, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7 + calc_qpelb2 v25, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7 + sqrshrun v24.8b, v24.8h, #6 + sqrshrun2 v24.16b, v25.8h, #6 + st1 {v24.8b}, [x10], #8 + subs x11, x11, #1 + st1 {v24.s}[2], [x10], x1 +.endm +1: calc_all +.purgem calc +2: add x0, x0, #12 + add x2, x2, #12 + subs w7, w7, #12 + b.ne 0b + ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_v16_8_neon, export=1 + load_qpel_filterb x6, x5 + sub x2, x2, x3, lsl #1 + sub x2, x2, x3 +0: mov x8, x2 // src + mov w11, w4 // height + mov x10, x0 // dst + ldr q16, [x8] + ldr q17, [x8, x3] + add x8, x8, x3, lsl #1 + ldr q18, [x8] + ldr q19, [x8, x3] + add x8, x8, x3, lsl #1 + ldr q20, [x8] + ldr q21, [x8, x3] + add x8, x8, x3, lsl #1 + ldr q22, [x8] + add x8, x8, x3 +.macro calc tmp, src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\tmp\().16b}, [x8], x3 + calc_qpelb v24, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7 + calc_qpelb2 v25, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7 + sqrshrun v24.8b, v24.8h, #6 + sqrshrun2 v24.16b, v25.8h, #6 + subs x11, x11, #1 + st1 {v24.16b}, [x10], x1 +.endm +1: calc_all +.purgem calc +2: add x0, x0, #16 + add x2, x2, #16 + subs w7, w7, #16 + b.ne 0b + ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_v24_8_neon, export=1 + b X(ff_hevc_put_hevc_qpel_uni_v12_8_neon) +endfunc + +function ff_hevc_put_hevc_qpel_uni_v32_8_neon, export=1 + b X(ff_hevc_put_hevc_qpel_uni_v16_8_neon) +endfunc + +function ff_hevc_put_hevc_qpel_uni_v48_8_neon, export=1 + b X(ff_hevc_put_hevc_qpel_uni_v16_8_neon) +endfunc + +function ff_hevc_put_hevc_qpel_uni_v64_8_neon, export=1 + b X(ff_hevc_put_hevc_qpel_uni_v16_8_neon) +endfunc + function ff_hevc_put_hevc_pel_uni_w_pixels4_8_neon, export=1 mov w10, #-6 sub w10, w10, w5 @@ -1298,6 +1558,334 @@ function ff_hevc_put_hevc_qpel_uni_w_v64_8_neon, export=1 endfunc #if HAVE_I8MM + +.macro calc_all2 + calc v30, v31, v16, v18, v20, v22, v24, v26, v28, v30, v17, v19, v21, v23, v25, v27, v29, v31 + b.eq 2f + calc v16, v17, v18, v20, v22, v24, v26, v28, v30, v16, v19, v21, v23, v25, v27, v29, v31, v17 + b.eq 2f + calc v18, v19, v20, v22, v24, v26, v28, v30, v16, v18, v21, v23, v25, v27, v29, v31, v17, v19 + b.eq 2f + calc v20, v21, v22, v24, v26, v28, v30, v16, v18, v20, v23, v25, v27, v29, v31, v17, v19, v21 + b.eq 2f + calc v22, v23, v24, v26, v28, v30, v16, v18, v20, v22, v25, v27, v29, v31, v17, v19, v21, v23 + b.eq 2f + calc v24, v25, v26, v28, v30, v16, v18, v20, v22, v24, v27, v29, v31, v17, v19, v21, v23, v25 + b.eq 2f + calc v26, v27, v28, v30, v16, v18, v20, v22, v24, v26, v29, v31, v17, v19, v21, v23, v25, v27 + b.eq 2f + calc v28, v29, v30, v16, v18, v20, v22, v24, v26, v28, v31, v17, v19, v21, v23, v25, v27, v29 + b.hi 1b +.endm + +function ff_hevc_put_hevc_qpel_uni_hv4_8_neon_i8mm, export=1 + add w10, w4, #7 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + str x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + sub x1, x2, x3, lsl #1 + sub x1, x1, x3 + add x0, sp, #48 + mov x2, x3 + add x3, x4, #7 + mov x4, x5 + bl X(ff_hevc_put_hevc_qpel_h4_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldr x30, [sp], #48 + mov x9, #(MAX_PB_SIZE * 2) + load_qpel_filterh x6, x5 + ldr d16, [sp] + ldr d17, [sp, x9] + add sp, sp, x9, lsl #1 + ldr d18, [sp] + ldr d19, [sp, x9] + add sp, sp, x9, lsl #1 + ldr d20, [sp] + ldr d21, [sp, x9] + add sp, sp, x9, lsl #1 + ldr d22, [sp] + add sp, sp, x9 +.macro calc tmp, src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\tmp\().4h}, [sp], x9 + calc_qpelh v1, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sqrshrn, #12 + sqxtun v1.8b, v1.8h + subs w4, w4, #1 + st1 {v1.s}[0], [x0], x1 +.endm +1: calc_all +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_hv6_8_neon_i8mm, export=1 + add w10, w4, #7 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + str x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + sub x1, x2, x3, lsl #1 + sub x1, x1, x3 + add x0, sp, #48 + mov x2, x3 + add w3, w4, #7 + mov x4, x5 + bl X(ff_hevc_put_hevc_qpel_h6_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldr x30, [sp], #48 + mov x9, #(MAX_PB_SIZE * 2) + load_qpel_filterh x6, x5 + sub x1, x1, #4 + ldr q16, [sp] + ldr q17, [sp, x9] + add sp, sp, x9, lsl #1 + ldr q18, [sp] + ldr q19, [sp, x9] + add sp, sp, x9, lsl #1 + ldr q20, [sp] + ldr q21, [sp, x9] + add sp, sp, x9, lsl #1 + ldr q22, [sp] + add sp, sp, x9 +.macro calc tmp, src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\tmp\().8h}, [sp], x9 + calc_qpelh v1, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sqrshrn, #12 + calc_qpelh2 v1, v2, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sqrshrn2, #12 + sqxtun v1.8b, v1.8h + st1 {v1.s}[0], [x0], #4 + subs w4, w4, #1 + st1 {v1.h}[2], [x0], x1 +.endm +1: calc_all +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_hv8_8_neon_i8mm, export=1 + add w10, w4, #7 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + str x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + sub x1, x2, x3, lsl #1 + sub x1, x1, x3 + add x0, sp, #48 + mov x2, x3 + add w3, w4, #7 + mov x4, x5 + bl X(ff_hevc_put_hevc_qpel_h8_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldr x30, [sp], #48 + mov x9, #(MAX_PB_SIZE * 2) + load_qpel_filterh x6, x5 + ldr q16, [sp] + ldr q17, [sp, x9] + add sp, sp, x9, lsl #1 + ldr q18, [sp] + ldr q19, [sp, x9] + add sp, sp, x9, lsl #1 + ldr q20, [sp] + ldr q21, [sp, x9] + add sp, sp, x9, lsl #1 + ldr q22, [sp] + add sp, sp, x9 +.macro calc tmp, src0, src1, src2, src3, src4, src5, src6, src7 + ld1 {\tmp\().8h}, [sp], x9 + calc_qpelh v1, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sqrshrn, #12 + calc_qpelh2 v1, v2, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sqrshrn2, #12 + sqxtun v1.8b, v1.8h + subs w4, w4, #1 + st1 {v1.8b}, [x0], x1 +.endm +1: calc_all +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_hv12_8_neon_i8mm, export=1 + add w10, w4, #7 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + stp x7, x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + sub x1, x2, x3, lsl #1 + sub x1, x1, x3 + mov x2, x3 + add x0, sp, #48 + add w3, w4, #7 + mov x4, x5 + bl X(ff_hevc_put_hevc_qpel_h12_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldp x7, x30, [sp], #48 + mov x9, #(MAX_PB_SIZE * 2) + load_qpel_filterh x6, x5 + sub x1, x1, #8 + ld1 {v16.8h, v17.8h}, [sp], x9 + ld1 {v18.8h, v19.8h}, [sp], x9 + ld1 {v20.8h, v21.8h}, [sp], x9 + ld1 {v22.8h, v23.8h}, [sp], x9 + ld1 {v24.8h, v25.8h}, [sp], x9 + ld1 {v26.8h, v27.8h}, [sp], x9 + ld1 {v28.8h, v29.8h}, [sp], x9 +.macro calc tmp0, tmp1, src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10, src11, src12, src13, src14, src15 + ld1 {\tmp0\().8h, \tmp1\().8h}, [sp], x9 + calc_qpelh v1, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sqrshrn, #12 + calc_qpelh2 v1, v2, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sqrshrn2, #12 + calc_qpelh v2, \src8, \src9, \src10, \src11, \src12, \src13, \src14, \src15, sqrshrn, #12 + sqxtun v1.8b, v1.8h + sqxtun2 v1.16b, v2.8h + st1 {v1.8b}, [x0], #8 + subs w4, w4, #1 + st1 {v1.s}[2], [x0], x1 +.endm +1: calc_all2 +.purgem calc +2: ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_hv16_8_neon_i8mm, export=1 + add w10, w4, #7 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + stp x7, x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + add x0, sp, #48 + sub x1, x2, x3, lsl #1 + sub x1, x1, x3 + mov x2, x3 + add w3, w4, #7 + mov x4, x5 + bl X(ff_hevc_put_hevc_qpel_h16_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldp x7, x30, [sp], #48 +.Lqpel_uni_hv16_loop: + mov x9, #(MAX_PB_SIZE * 2) + load_qpel_filterh x6, x5 + sub w12, w9, w7, lsl #1 +0: mov x8, sp // src + ld1 {v16.8h, v17.8h}, [x8], x9 + mov w11, w4 // height + ld1 {v18.8h, v19.8h}, [x8], x9 + mov x10, x0 // dst + ld1 {v20.8h, v21.8h}, [x8], x9 + ld1 {v22.8h, v23.8h}, [x8], x9 + ld1 {v24.8h, v25.8h}, [x8], x9 + ld1 {v26.8h, v27.8h}, [x8], x9 + ld1 {v28.8h, v29.8h}, [x8], x9 +.macro calc tmp0, tmp1, src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, src10, src11, src12, src13, src14, src15 + ld1 {\tmp0\().8h, \tmp1\().8h}, [x8], x9 + calc_qpelh v1, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sqrshrn, #12 + calc_qpelh2 v1, v2, \src0, \src1, \src2, \src3, \src4, \src5, \src6, \src7, sqrshrn2, #12 + calc_qpelh v2, \src8, \src9, \src10, \src11, \src12, \src13, \src14, \src15, sqrshrn, #12 + calc_qpelh2 v2, v3, \src8, \src9, \src10, \src11, \src12, \src13, \src14, \src15, sqrshrn2, #12 + sqxtun v1.8b, v1.8h + subs x11, x11, #1 + sqxtun2 v1.16b, v2.8h + st1 {v1.16b}, [x10], x1 +.endm +1: calc_all2 +.purgem calc +2: add x0, x0, #16 + add sp, sp, #32 + subs w7, w7, #16 + b.ne 0b + add w10, w4, #6 + add sp, sp, x12 // discard rest of first line + lsl x10, x10, #7 + add sp, sp, x10 // tmp_array without first line + ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_hv24_8_neon_i8mm, export=1 + stp x4, x5, [sp, #-64]! + stp x2, x3, [sp, #16] + stp x0, x1, [sp, #32] + stp x6, x30, [sp, #48] + mov x7, #16 + bl X(ff_hevc_put_hevc_qpel_uni_hv16_8_neon_i8mm) + ldp x2, x3, [sp, #16] + add x2, x2, #16 + ldp x0, x1, [sp, #32] + ldp x4, x5, [sp], #48 + mov x7, #8 + add x0, x0, #16 + ldr x6, [sp] + bl X(ff_hevc_put_hevc_qpel_uni_hv8_8_neon_i8mm) + ldr x30, [sp, #8] + add sp, sp, #16 + ret +endfunc + +function ff_hevc_put_hevc_qpel_uni_hv32_8_neon_i8mm, export=1 + add w10, w4, #7 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + stp x7, x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + sub x1, x2, x3, lsl #1 + add x0, sp, #48 + sub x1, x1, x3 + mov x2, x3 + add w3, w4, #7 + mov x4, x5 + bl X(ff_hevc_put_hevc_qpel_h32_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldp x7, x30, [sp], #48 + b .Lqpel_uni_hv16_loop +endfunc + +function ff_hevc_put_hevc_qpel_uni_hv48_8_neon_i8mm, export=1 + add w10, w4, #7 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + stp x7, x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + sub x1, x2, x3, lsl #1 + sub x1, x1, x3 + mov x2, x3 + add x0, sp, #48 + add w3, w4, #7 + mov x4, x5 + bl X(ff_hevc_put_hevc_qpel_h48_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldp x7, x30, [sp], #48 + b .Lqpel_uni_hv16_loop +endfunc + +function ff_hevc_put_hevc_qpel_uni_hv64_8_neon_i8mm, export=1 + add w10, w4, #7 + lsl x10, x10, #7 + sub sp, sp, x10 // tmp_array + stp x7, x30, [sp, #-48]! + stp x4, x6, [sp, #16] + stp x0, x1, [sp, #32] + add x0, sp, #48 + sub x1, x2, x3, lsl #1 + mov x2, x3 + sub x1, x1, x3 + add w3, w4, #7 + mov x4, x5 + bl X(ff_hevc_put_hevc_qpel_h64_8_neon_i8mm) + ldp x4, x6, [sp, #16] + ldp x0, x1, [sp, #32] + ldp x7, x30, [sp], #48 + b .Lqpel_uni_hv16_loop +endfunc + .macro QPEL_UNI_W_H_HEADER ldr x12, [sp] sub x2, x2, #3 diff --git a/src/third_party/ffmpeg/libavcodec/aarch64/synth_filter_init.c b/src/third_party/ffmpeg/libavcodec/aarch64/synth_filter_init.c index 6b6da35b..aea6aaf4 100644 --- a/src/third_party/ffmpeg/libavcodec/aarch64/synth_filter_init.c +++ b/src/third_party/ffmpeg/libavcodec/aarch64/synth_filter_init.c @@ -23,15 +23,8 @@ #include "libavutil/aarch64/cpu.h" #include "libavutil/attributes.h" #include "libavutil/internal.h" -#include "libavcodec/fft.h" #include "libavcodec/synth_filter.h" -#include "asm-offsets.h" - -#if HAVE_NEON -AV_CHECK_OFFSET(FFTContext, imdct_half, IMDCT_HALF); -#endif - void ff_synth_filter_float_neon(AVTXContext *imdct, float *synth_buf_ptr, int *synth_buf_offset, float synth_buf2[32], const float window[512], diff --git a/src/third_party/ffmpeg/libavcodec/aarch64/synth_filter_neon.S b/src/third_party/ffmpeg/libavcodec/aarch64/synth_filter_neon.S index 259fa6e6..63aefcb5 100644 --- a/src/third_party/ffmpeg/libavcodec/aarch64/synth_filter_neon.S +++ b/src/third_party/ffmpeg/libavcodec/aarch64/synth_filter_neon.S @@ -19,8 +19,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "asm-offsets.h" - #include "libavutil/aarch64/asm.S" .macro inner_loop diff --git a/src/third_party/ffmpeg/libavcodec/ac3dec.c b/src/third_party/ffmpeg/libavcodec/ac3dec.c index fc0cbeb4..ee501386 100644 --- a/src/third_party/ffmpeg/libavcodec/ac3dec.c +++ b/src/third_party/ffmpeg/libavcodec/ac3dec.c @@ -228,7 +228,7 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx) if ((ret = av_tx_init(&s->tx_256, &s->tx_fn_256, IMDCT_TYPE, 1, 256, &scale, 0))) return ret; - AC3_RENAME(ff_kbd_window_init)(s->window, 5.0, 256); + AC3_RENAME(avpriv_kbd_window_init)(s->window, 5.0, 256); ff_bswapdsp_init(&s->bdsp); #if (USE_FIXED) @@ -1714,7 +1714,7 @@ skip: if (!err) { avctx->sample_rate = s->sample_rate; avctx->bit_rate = s->bit_rate + s->prev_bit_rate; - avctx->profile = s->eac3_extension_type_a == 1 ? FF_PROFILE_EAC3_DDP_ATMOS : FF_PROFILE_UNKNOWN; + avctx->profile = s->eac3_extension_type_a == 1 ? AV_PROFILE_EAC3_DDP_ATMOS : AV_PROFILE_UNKNOWN; } if (!avctx->sample_rate) { diff --git a/src/third_party/ffmpeg/libavcodec/ac3enc.c b/src/third_party/ffmpeg/libavcodec/ac3enc.c index 3cb4e5f0..56c8d239 100644 --- a/src/third_party/ffmpeg/libavcodec/ac3enc.c +++ b/src/third_party/ffmpeg/libavcodec/ac3enc.c @@ -33,6 +33,7 @@ #include "libavutil/avstring.h" #include "libavutil/channel_layout.h" #include "libavutil/crc.h" +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "libavutil/mem_internal.h" #include "libavutil/opt.h" diff --git a/src/third_party/ffmpeg/libavcodec/ac3enc_fixed.c b/src/third_party/ffmpeg/libavcodec/ac3enc_fixed.c index 88dfd66b..079a43dc 100644 --- a/src/third_party/ffmpeg/libavcodec/ac3enc_fixed.c +++ b/src/third_party/ffmpeg/libavcodec/ac3enc_fixed.c @@ -82,7 +82,7 @@ static av_cold int ac3_fixed_mdct_init(AC3EncodeContext *s) if (!iwin) return AVERROR(ENOMEM); - ff_kbd_window_init(fwin, 5.0, AC3_BLOCK_SIZE); + avpriv_kbd_window_init(fwin, 5.0, AC3_BLOCK_SIZE); for (int i = 0; i < AC3_BLOCK_SIZE; i++) iwin[i] = lrintf(fwin[i] * (1 << 22)); diff --git a/src/third_party/ffmpeg/libavcodec/ac3enc_float.c b/src/third_party/ffmpeg/libavcodec/ac3enc_float.c index ae351a53..9664adbf 100644 --- a/src/third_party/ffmpeg/libavcodec/ac3enc_float.c +++ b/src/third_party/ffmpeg/libavcodec/ac3enc_float.c @@ -92,7 +92,7 @@ static av_cold int ac3_float_mdct_init(AC3EncodeContext *s) return AVERROR(ENOMEM); } - ff_kbd_window_init(window, 5.0, AC3_BLOCK_SIZE); + avpriv_kbd_window_init(window, 5.0, AC3_BLOCK_SIZE); s->mdct_window = window; return av_tx_init(&s->tx, &s->tx_fn, AV_TX_FLOAT_MDCT, 0, diff --git a/src/third_party/ffmpeg/libavcodec/adx.h b/src/third_party/ffmpeg/libavcodec/adx.h index 8d5e0869..60ce07ad 100644 --- a/src/third_party/ffmpeg/libavcodec/adx.h +++ b/src/third_party/ffmpeg/libavcodec/adx.h @@ -35,9 +35,11 @@ typedef struct ADXChannelState { int s1,s2; } ADXChannelState; +#define MAX_CHANNELS 6 + typedef struct ADXContext { int channels; - ADXChannelState prev[2]; + ADXChannelState prev[MAX_CHANNELS]; int header_parsed; int eof; int cutoff; diff --git a/src/third_party/ffmpeg/libavcodec/adx_parser.c b/src/third_party/ffmpeg/libavcodec/adx_parser.c index 52aa14b7..62b4415b 100644 --- a/src/third_party/ffmpeg/libavcodec/adx_parser.c +++ b/src/third_party/ffmpeg/libavcodec/adx_parser.c @@ -73,6 +73,16 @@ static int adx_parse(AVCodecParserContext *s1, s->remaining = 0; } else s->remaining -= buf_size; + } else if (avctx->ch_layout.nb_channels > 0) { + if (!s->block_size) + s->block_size = avctx->ch_layout.nb_channels * BLOCK_SIZE; + if (!s->remaining) + s->remaining = s->block_size; + if (s->remaining <= buf_size) { + next = s->remaining; + s->remaining = 0; + } else + s->remaining -= buf_size; } if (ff_combine_frame(pc, next, &buf, &buf_size) < 0 || !buf_size) { diff --git a/src/third_party/ffmpeg/libavcodec/adxdec.c b/src/third_party/ffmpeg/libavcodec/adxdec.c index 97a7e596..4300dede 100644 --- a/src/third_party/ffmpeg/libavcodec/adxdec.c +++ b/src/third_party/ffmpeg/libavcodec/adxdec.c @@ -70,7 +70,7 @@ static int adx_decode_header(AVCodecContext *avctx, const uint8_t *buf, /* channels */ channels = buf[7]; - if (channels <= 0 || channels > 2) + if (channels <= 0 || channels > MAX_CHANNELS) return AVERROR_INVALIDDATA; if (avctx->ch_layout.nb_channels != channels) { diff --git a/src/third_party/ffmpeg/libavcodec/agm.c b/src/third_party/ffmpeg/libavcodec/agm.c index 55cf0b47..88272cc3 100644 --- a/src/third_party/ffmpeg/libavcodec/agm.c +++ b/src/third_party/ffmpeg/libavcodec/agm.c @@ -1015,12 +1015,12 @@ static int build_huff(const uint8_t *bitlen, VLC *vlc) } } - ff_free_vlc(vlc); - return ff_init_vlc_sparse(vlc, 13, nb_codes, + ff_vlc_free(vlc); + return ff_vlc_init_sparse(vlc, 13, nb_codes, bits, 1, 1, codes, 4, 4, symbols, 1, 1, - INIT_VLC_LE); + VLC_INIT_LE); } static int decode_huffman2(AVCodecContext *avctx, int header, int size) @@ -1203,8 +1203,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, if (ret < 0) return ret; - av_frame_unref(s->prev_frame); - if ((ret = av_frame_ref(s->prev_frame, frame)) < 0) + if ((ret = av_frame_replace(s->prev_frame, frame)) < 0) return ret; frame->crop_top = avctx->coded_height - avctx->height; @@ -1256,7 +1255,7 @@ static av_cold int decode_close(AVCodecContext *avctx) { AGMContext *s = avctx->priv_data; - ff_free_vlc(&s->vlc); + ff_vlc_free(&s->vlc); av_frame_free(&s->prev_frame); av_freep(&s->mvectors); s->mvectors_size = 0; diff --git a/src/third_party/ffmpeg/libavcodec/alac.c b/src/third_party/ffmpeg/libavcodec/alac.c index d10ecba7..538d1e59 100644 --- a/src/third_party/ffmpeg/libavcodec/alac.c +++ b/src/third_party/ffmpeg/libavcodec/alac.c @@ -112,6 +112,7 @@ static inline unsigned int decode_scalar(GetBitContext *gb, int k, int bps) static int rice_decompress(ALACContext *alac, int32_t *output_buffer, int nb_samples, int bps, int rice_history_mult) { + GetBitContext *gb = &alac->gb; int i; unsigned int history = alac->rice_initial_history; int sign_modifier = 0; @@ -120,13 +121,13 @@ static int rice_decompress(ALACContext *alac, int32_t *output_buffer, int k; unsigned int x; - if(get_bits_left(&alac->gb) <= 0) + if (get_bits_left(gb) <= 0) return AVERROR_INVALIDDATA; /* calculate rice param and decode next value */ k = av_log2((history >> 9) + 3); k = FFMIN(k, alac->rice_limit); - x = decode_scalar(&alac->gb, k, bps); + x = decode_scalar(gb, k, bps); x += sign_modifier; sign_modifier = 0; output_buffer[i] = (x >> 1) ^ -(x & 1); @@ -145,7 +146,7 @@ static int rice_decompress(ALACContext *alac, int32_t *output_buffer, /* calculate rice param and decode block size */ k = 7 - av_log2(history) + ((history + 16) >> 6); k = FFMIN(k, alac->rice_limit); - block_size = decode_scalar(&alac->gb, k, 16); + block_size = decode_scalar(gb, k, 16); if (block_size > 0) { if (block_size >= nb_samples - i) { @@ -168,7 +169,7 @@ static int rice_decompress(ALACContext *alac, int32_t *output_buffer, static inline int sign_only(int v) { - return v ? FFSIGN(v) : 0; + return FFDIFFSIGN(v, 0); } static void lpc_prediction(int32_t *error_buffer, uint32_t *buffer_out, @@ -239,16 +240,17 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index, { ALACContext *alac = avctx->priv_data; int has_size, bps, is_compressed, decorr_shift, decorr_left_weight, ret; + GetBitContext *gb = &alac->gb; uint32_t output_samples; int i, ch; - skip_bits(&alac->gb, 4); /* element instance tag */ - skip_bits(&alac->gb, 12); /* unused header bits */ + skip_bits(gb, 4); /* element instance tag */ + skip_bits(gb, 12); /* unused header bits */ /* the number of output samples is stored in the frame */ - has_size = get_bits1(&alac->gb); + has_size = get_bits1(gb); - alac->extra_bits = get_bits(&alac->gb, 2) << 3; + alac->extra_bits = get_bits(gb, 2) << 3; bps = alac->sample_size - alac->extra_bits + channels - 1; if (bps > 32) { avpriv_report_missing_feature(avctx, "bps %d", bps); @@ -258,10 +260,10 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index, return AVERROR_INVALIDDATA; /* whether the frame is compressed */ - is_compressed = !get_bits1(&alac->gb); + is_compressed = !get_bits1(gb); if (has_size) - output_samples = get_bits_long(&alac->gb, 32); + output_samples = get_bits_long(gb, 32); else output_samples = alac->max_samples_per_frame; if (!output_samples || output_samples > alac->max_samples_per_frame) { @@ -298,39 +300,40 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index, return AVERROR(ENOSYS); } - decorr_shift = get_bits(&alac->gb, 8); - decorr_left_weight = get_bits(&alac->gb, 8); + decorr_shift = get_bits(gb, 8); + decorr_left_weight = get_bits(gb, 8); if (channels == 2 && decorr_left_weight && decorr_shift > 31) return AVERROR_INVALIDDATA; for (ch = 0; ch < channels; ch++) { - prediction_type[ch] = get_bits(&alac->gb, 4); - lpc_quant[ch] = get_bits(&alac->gb, 4); - rice_history_mult[ch] = get_bits(&alac->gb, 3); - lpc_order[ch] = get_bits(&alac->gb, 5); + prediction_type[ch] = get_bits(gb, 4); + lpc_quant[ch] = get_bits(gb, 4); + rice_history_mult[ch] = get_bits(gb, 3); + lpc_order[ch] = get_bits(gb, 5); if (lpc_order[ch] >= alac->max_samples_per_frame || !lpc_quant[ch]) return AVERROR_INVALIDDATA; /* read the predictor table */ for (i = lpc_order[ch] - 1; i >= 0; i--) - lpc_coefs[ch][i] = get_sbits(&alac->gb, 16); + lpc_coefs[ch][i] = get_sbits(gb, 16); } if (alac->extra_bits) { + const int extra_bits = alac->extra_bits; + if (get_bits_left(gb) < (int64_t)alac->nb_samples * channels * extra_bits) + return AVERROR_INVALIDDATA; for (i = 0; i < alac->nb_samples; i++) { - if(get_bits_left(&alac->gb) <= 0) - return AVERROR_INVALIDDATA; for (ch = 0; ch < channels; ch++) - alac->extra_bits_buffer[ch][i] = get_bits(&alac->gb, alac->extra_bits); + alac->extra_bits_buffer[ch][i] = get_bits(gb, extra_bits); } } for (ch = 0; ch < channels; ch++) { - int ret=rice_decompress(alac, alac->predict_error_buffer[ch], + int ret = rice_decompress(alac, alac->predict_error_buffer[ch], alac->nb_samples, bps, rice_history_mult[ch] * alac->rice_history_mult / 4); - if(ret<0) + if (ret < 0) return ret; /* adaptive FIR filter */ @@ -354,13 +357,14 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index, bps, lpc_coefs[ch], lpc_order[ch], lpc_quant[ch]); } } else { + const int sample_size = alac->sample_size; /* not compressed, easy case */ + if (get_bits_left(gb) < (int64_t)alac->nb_samples * channels * sample_size) + return AVERROR_INVALIDDATA; for (i = 0; i < alac->nb_samples; i++) { - if(get_bits_left(&alac->gb) <= 0) - return AVERROR_INVALIDDATA; for (ch = 0; ch < channels; ch++) { alac->output_samples_buffer[ch][i] = - get_sbits_long(&alac->gb, alac->sample_size); + get_sbits_long(gb, sample_size); } } alac->extra_bits = 0; diff --git a/src/third_party/ffmpeg/libavcodec/allcodecs.c b/src/third_party/ffmpeg/libavcodec/allcodecs.c index 8775d15a..5136a566 100644 --- a/src/third_party/ffmpeg/libavcodec/allcodecs.c +++ b/src/third_party/ffmpeg/libavcodec/allcodecs.c @@ -516,6 +516,7 @@ extern const FFCodec ff_nellymoser_decoder; extern const FFCodec ff_on2avc_decoder; extern const FFCodec ff_opus_encoder; extern const FFCodec ff_opus_decoder; +extern const FFCodec ff_osq_decoder; extern const FFCodec ff_paf_audio_decoder; extern const FFCodec ff_qcelp_decoder; extern const FFCodec ff_qdm2_decoder; @@ -844,6 +845,7 @@ extern const FFCodec ff_av1_nvenc_encoder; extern const FFCodec ff_av1_qsv_decoder; extern const FFCodec ff_av1_qsv_encoder; extern const FFCodec ff_av1_amf_encoder; +extern const FFCodec ff_av1_vaapi_encoder; extern const FFCodec ff_libopenh264_encoder; extern const FFCodec ff_libopenh264_decoder; extern const FFCodec ff_h264_amf_encoder; diff --git a/src/third_party/ffmpeg/libavcodec/alpha/idctdsp_alpha.c b/src/third_party/ffmpeg/libavcodec/alpha/idctdsp_alpha.c index bd438425..ff770c15 100644 --- a/src/third_party/ffmpeg/libavcodec/alpha/idctdsp_alpha.c +++ b/src/third_party/ffmpeg/libavcodec/alpha/idctdsp_alpha.c @@ -19,6 +19,7 @@ */ #include "libavutil/attributes.h" +#include "libavcodec/avcodec.h" #include "libavcodec/idctdsp.h" #include "idctdsp_alpha.h" #include "asm.h" diff --git a/src/third_party/ffmpeg/libavcodec/amfenc.c b/src/third_party/ffmpeg/libavcodec/amfenc.c index cb48f8c2..061859f8 100644 --- a/src/third_party/ffmpeg/libavcodec/amfenc.c +++ b/src/third_party/ffmpeg/libavcodec/amfenc.c @@ -430,9 +430,9 @@ static int amf_copy_surface(AVCodecContext *avctx, const AVFrame *frame, dst_data[i] = plane->pVtbl->GetNative(plane); dst_linesize[i] = plane->pVtbl->GetHPitch(plane); } - av_image_copy(dst_data, dst_linesize, - (const uint8_t**)frame->data, frame->linesize, frame->format, - avctx->width, avctx->height); + av_image_copy2(dst_data, dst_linesize, + frame->data, frame->linesize, frame->format, + avctx->width, avctx->height); return 0; } @@ -720,10 +720,10 @@ int ff_amf_receive_packet(AVCodecContext *avctx, AVPacket *avpkt) if (!avpkt->data && !avpkt->buf) { res_query = ctx->encoder->pVtbl->QueryOutput(ctx->encoder, &data); if (data) { - query_output_data_flag = 1; // copy data to packet AMFBuffer *buffer; AMFGuid guid = IID_AMFBuffer(); + query_output_data_flag = 1; data->pVtbl->QueryInterface(data, &guid, (void**)&buffer); // query for buffer interface ret = amf_copy_buffer(avctx, avpkt, buffer); diff --git a/src/third_party/ffmpeg/libavcodec/amfenc_av1.c b/src/third_party/ffmpeg/libavcodec/amfenc_av1.c index 30c0a9fa..8f13aea2 100644 --- a/src/third_party/ffmpeg/libavcodec/amfenc_av1.c +++ b/src/third_party/ffmpeg/libavcodec/amfenc_av1.c @@ -192,7 +192,7 @@ FF_ENABLE_DEPRECATION_WARNINGS AMF_ASSIGN_PROPERTY_RATE(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_FRAMERATE, framerate); switch (avctx->profile) { - case FF_PROFILE_AV1_MAIN: + case AV_PROFILE_AV1_MAIN: profile = AMF_VIDEO_ENCODER_AV1_PROFILE_MAIN; break; default: @@ -204,7 +204,7 @@ FF_ENABLE_DEPRECATION_WARNINGS AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_PROFILE, profile); profile_level = avctx->level; - if (profile_level == FF_LEVEL_UNKNOWN) { + if (profile_level == AV_LEVEL_UNKNOWN) { profile_level = ctx->level; } if (profile_level != 0) { diff --git a/src/third_party/ffmpeg/libavcodec/amfenc_h264.c b/src/third_party/ffmpeg/libavcodec/amfenc_h264.c index 2380aa4e..bd544d12 100644 --- a/src/third_party/ffmpeg/libavcodec/amfenc_h264.c +++ b/src/third_party/ffmpeg/libavcodec/amfenc_h264.c @@ -223,19 +223,19 @@ FF_ENABLE_DEPRECATION_WARNINGS AMF_ASSIGN_PROPERTY_RATE(res, ctx->encoder, AMF_VIDEO_ENCODER_FRAMERATE, framerate); switch (avctx->profile) { - case FF_PROFILE_H264_BASELINE: + case AV_PROFILE_H264_BASELINE: profile = AMF_VIDEO_ENCODER_PROFILE_BASELINE; break; - case FF_PROFILE_H264_MAIN: + case AV_PROFILE_H264_MAIN: profile = AMF_VIDEO_ENCODER_PROFILE_MAIN; break; - case FF_PROFILE_H264_HIGH: + case AV_PROFILE_H264_HIGH: profile = AMF_VIDEO_ENCODER_PROFILE_HIGH; break; - case FF_PROFILE_H264_CONSTRAINED_BASELINE: + case AV_PROFILE_H264_CONSTRAINED_BASELINE: profile = AMF_VIDEO_ENCODER_PROFILE_CONSTRAINED_BASELINE; break; - case (FF_PROFILE_H264_HIGH | FF_PROFILE_H264_CONSTRAINED): + case (AV_PROFILE_H264_HIGH | AV_PROFILE_H264_CONSTRAINED): profile = AMF_VIDEO_ENCODER_PROFILE_CONSTRAINED_HIGH; break; } @@ -246,7 +246,7 @@ FF_ENABLE_DEPRECATION_WARNINGS AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_PROFILE, profile); profile_level = avctx->level; - if (profile_level == FF_LEVEL_UNKNOWN) { + if (profile_level == AV_LEVEL_UNKNOWN) { profile_level = ctx->level; } if (profile_level != 0) { diff --git a/src/third_party/ffmpeg/libavcodec/amfenc_hevc.c b/src/third_party/ffmpeg/libavcodec/amfenc_hevc.c index dd232cc8..352564a3 100644 --- a/src/third_party/ffmpeg/libavcodec/amfenc_hevc.c +++ b/src/third_party/ffmpeg/libavcodec/amfenc_hevc.c @@ -184,7 +184,7 @@ FF_ENABLE_DEPRECATION_WARNINGS AMF_ASSIGN_PROPERTY_RATE(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_FRAMERATE, framerate); switch (avctx->profile) { - case FF_PROFILE_HEVC_MAIN: + case AV_PROFILE_HEVC_MAIN: profile = AMF_VIDEO_ENCODER_HEVC_PROFILE_MAIN; break; default: @@ -198,7 +198,7 @@ FF_ENABLE_DEPRECATION_WARNINGS AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_TIER, ctx->tier); profile_level = avctx->level; - if (profile_level == FF_LEVEL_UNKNOWN) { + if (profile_level == AV_LEVEL_UNKNOWN) { profile_level = ctx->level; } if (profile_level != 0) { diff --git a/src/third_party/ffmpeg/libavcodec/apedec.c b/src/third_party/ffmpeg/libavcodec/apedec.c index 613c76df..8bfbb75b 100644 --- a/src/third_party/ffmpeg/libavcodec/apedec.c +++ b/src/third_party/ffmpeg/libavcodec/apedec.c @@ -145,8 +145,6 @@ typedef struct APEPredictor64 { uint64_t coeffsA[2][4]; ///< adaption coefficients uint64_t coeffsB[2][5]; ///< adaption coefficients int64_t historybuffer[HISTORY_SIZE + PREDICTOR_SIZE]; - - unsigned int sample_pos; } APEPredictor64; /** Decoder context */ @@ -173,6 +171,9 @@ typedef struct APEContext { int32_t *decoded_buffer; int decoded_size; int32_t *decoded[MAX_CHANNELS]; ///< decoded data for each channel + int32_t *interim_buffer; + int interim_size; + int32_t *interim[MAX_CHANNELS]; ///< decoded data for each channel int blocks_per_loop; ///< maximum number of samples to decode for each call int16_t* filterbuf[APE_FILTER_LEVELS]; ///< filter memory @@ -189,6 +190,7 @@ typedef struct APEContext { const uint8_t *ptr; ///< current position in frame data int error; + int interim_mode; void (*entropy_decode_mono)(struct APEContext *ctx, int blockstodecode); void (*entropy_decode_stereo)(struct APEContext *ctx, int blockstodecode); @@ -225,6 +227,7 @@ static av_cold int ape_decode_close(AVCodecContext *avctx) av_freep(&s->filterbuf[i]); av_freep(&s->decoded_buffer); + av_freep(&s->interim_buffer); av_freep(&s->data); s->decoded_size = s->data_size = 0; @@ -250,12 +253,15 @@ static av_cold int ape_decode_init(AVCodecContext *avctx) switch (s->bps) { case 8: avctx->sample_fmt = AV_SAMPLE_FMT_U8P; + s->interim_mode = 0; break; case 16: avctx->sample_fmt = AV_SAMPLE_FMT_S16P; + s->interim_mode = 0; break; case 24: avctx->sample_fmt = AV_SAMPLE_FMT_S32P; + s->interim_mode = -1; break; default: avpriv_request_sample(avctx, @@ -860,8 +866,6 @@ static void init_predictor_decoder(APEContext *ctx) p64->lastA[0] = p64->lastA[1] = 0; p->sample_pos = 0; - - p64->sample_pos = 0; } /** Get inverse sign of integer (-1 for positive, 1 for negative and 0 for zero) */ @@ -1184,7 +1188,8 @@ static void predictor_decode_mono_3930(APEContext *ctx, int count) static av_always_inline int predictor_update_filter(APEPredictor64 *p, const int decoded, const int filter, const int delayA, const int delayB, - const int adaptA, const int adaptB) + const int adaptA, const int adaptB, + int interim_mode) { int64_t predictionA, predictionB; int32_t sign; @@ -1212,7 +1217,13 @@ static av_always_inline int predictor_update_filter(APEPredictor64 *p, p->buf[delayB - 3] * p->coeffsB[filter][3] + p->buf[delayB - 4] * p->coeffsB[filter][4]; - p->lastA[filter] = decoded + ((int64_t)((uint64_t)predictionA + (predictionB >> 1)) >> 10); + if (interim_mode < 1) { + predictionA = (int32_t)predictionA; + predictionB = (int32_t)predictionB; + p->lastA[filter] = (int32_t)(decoded + (unsigned)((int32_t)(predictionA + (predictionB >> 1)) >> 10)); + } else { + p->lastA[filter] = decoded + ((int64_t)((uint64_t)predictionA + (predictionB >> 1)) >> 10); + } p->filterA[filter] = p->lastA[filter] + ((int64_t)(p->filterA[filter] * 31ULL) >> 5); sign = APESIGN(decoded); @@ -1231,30 +1242,73 @@ static av_always_inline int predictor_update_filter(APEPredictor64 *p, static void predictor_decode_stereo_3950(APEContext *ctx, int count) { - APEPredictor64 *p = &ctx->predictor64; - int32_t *decoded0 = ctx->decoded[0]; - int32_t *decoded1 = ctx->decoded[1]; + APEPredictor64 *p_default = &ctx->predictor64; + APEPredictor64 p_interim; + int lcount = count; + int num_passes = 1; ape_apply_filters(ctx, ctx->decoded[0], ctx->decoded[1], count); + if (ctx->interim_mode == -1) { + p_interim = *p_default; + num_passes ++; + memcpy(ctx->interim[0], ctx->decoded[0], sizeof(*ctx->interim[0])*count); + memcpy(ctx->interim[1], ctx->decoded[1], sizeof(*ctx->interim[1])*count); + } - while (count--) { - /* Predictor Y */ - *decoded0 = predictor_update_filter(p, *decoded0, 0, YDELAYA, YDELAYB, - YADAPTCOEFFSA, YADAPTCOEFFSB); - decoded0++; - *decoded1 = predictor_update_filter(p, *decoded1, 1, XDELAYA, XDELAYB, - XADAPTCOEFFSA, XADAPTCOEFFSB); - decoded1++; + for (int pass = 0; pass < num_passes; pass++) { + int32_t *decoded0, *decoded1; + int interim_mode = ctx->interim_mode > 0 || pass; + APEPredictor64 *p; - /* Combined */ - p->buf++; - - /* Have we filled the history buffer? */ - if (p->buf == p->historybuffer + HISTORY_SIZE) { - memmove(p->historybuffer, p->buf, - PREDICTOR_SIZE * sizeof(*p->historybuffer)); - p->buf = p->historybuffer; + if (pass) { + p = &p_interim; + decoded0 = ctx->interim[0]; + decoded1 = ctx->interim[1]; + } else { + p = p_default; + decoded0 = ctx->decoded[0]; + decoded1 = ctx->decoded[1]; } + p->buf = p->historybuffer; + + count = lcount; + while (count--) { + /* Predictor Y */ + int32_t a0 = predictor_update_filter(p, *decoded0, 0, YDELAYA, YDELAYB, + YADAPTCOEFFSA, YADAPTCOEFFSB, + interim_mode); + int32_t a1 = predictor_update_filter(p, *decoded1, 1, XDELAYA, XDELAYB, + XADAPTCOEFFSA, XADAPTCOEFFSB, + interim_mode); + *decoded0++ = a0; + *decoded1++ = a1; + if (num_passes > 1) { + int32_t left = a1 - (unsigned)(a0 / 2); + int32_t right = left + a0; + + if (FFMAX(FFABS(left), FFABS(right)) > (1<<23)) { + ctx->interim_mode = !interim_mode; + av_log(ctx->avctx, AV_LOG_VERBOSE, "Interim mode: %d\n", ctx->interim_mode); + break; + } + } + + /* Combined */ + p->buf++; + + /* Have we filled the history buffer? */ + if (p->buf == p->historybuffer + HISTORY_SIZE) { + memmove(p->historybuffer, p->buf, + PREDICTOR_SIZE * sizeof(*p->historybuffer)); + p->buf = p->historybuffer; + } + } + } + if (num_passes > 1 && ctx->interim_mode > 0) { + memcpy(ctx->decoded[0], ctx->interim[0], sizeof(*ctx->interim[0])*lcount); + memcpy(ctx->decoded[1], ctx->interim[1], sizeof(*ctx->interim[1])*lcount); + *p_default = p_interim; + p_default->buf = p_default->historybuffer; } } @@ -1585,6 +1639,19 @@ static int ape_decode_frame(AVCodecContext *avctx, AVFrame *frame, s->decoded[0] = s->decoded_buffer; s->decoded[1] = s->decoded_buffer + FFALIGN(blockstodecode, 8); + if (s->interim_mode < 0) { + av_fast_malloc(&s->interim_buffer, &s->interim_size, decoded_buffer_size); + if (!s->interim_buffer) + return AVERROR(ENOMEM); + memset(s->interim_buffer, 0, decoded_buffer_size); + s->interim[0] = s->interim_buffer; + s->interim[1] = s->interim_buffer + FFALIGN(blockstodecode, 8); + } else { + av_freep(&s->interim_buffer); + s->interim_size = 0; + memset(s->interim, 0, sizeof(s->interim)); + } + s->error=0; if ((s->channels == 1) || (s->frameflags & APE_FRAMECODE_PSEUDO_STEREO)) @@ -1625,13 +1692,24 @@ static int ape_decode_frame(AVCodecContext *avctx, AVFrame *frame, s->samples -= blockstodecode; if (avctx->err_recognition & AV_EF_CRCCHECK && - s->fileversion >= 3900 && s->bps < 24) { + s->fileversion >= 3900) { uint32_t crc = s->CRC_state; const AVCRC *crc_tab = av_crc_get_table(AV_CRC_32_IEEE_LE); + int stride = s->bps == 24 ? 4 : (s->bps>>3); + int offset = s->bps == 24; + int bytes = s->bps >> 3; + for (i = 0; i < blockstodecode; i++) { for (ch = 0; ch < s->channels; ch++) { - uint8_t *smp = frame->data[ch] + (i*(s->bps >> 3)); - crc = av_crc(crc_tab, crc, smp, s->bps >> 3); +#if HAVE_BIGENDIAN + uint8_t *smp_native = frame->data[ch] + i*stride; + uint8_t smp[4]; + for(int j = 0; jdata[ch] + i*stride; +#endif + crc = av_crc(crc_tab, crc, smp+offset, bytes); } } diff --git a/src/third_party/ffmpeg/libavcodec/arbc.c b/src/third_party/ffmpeg/libavcodec/arbc.c index 1b349f4d..46b0275e 100644 --- a/src/third_party/ffmpeg/libavcodec/arbc.c +++ b/src/third_party/ffmpeg/libavcodec/arbc.c @@ -166,8 +166,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, prev_pixels -= fill_tile4(avctx, fill, frame); } - av_frame_unref(s->prev_frame); - if ((ret = av_frame_ref(s->prev_frame, frame)) < 0) + if ((ret = av_frame_replace(s->prev_frame, frame)) < 0) return ret; frame->pict_type = prev_pixels <= 0 ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P; diff --git a/src/third_party/ffmpeg/libavcodec/arm/Makefile b/src/third_party/ffmpeg/libavcodec/arm/Makefile index 5d284bdc..becf316e 100644 --- a/src/third_party/ffmpeg/libavcodec/arm/Makefile +++ b/src/third_party/ffmpeg/libavcodec/arm/Makefile @@ -5,7 +5,6 @@ OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_init_arm.o \ arm/ac3dsp_arm.o OBJS-$(CONFIG_AUDIODSP) += arm/audiodsp_init_arm.o OBJS-$(CONFIG_BLOCKDSP) += arm/blockdsp_init_arm.o -OBJS-$(CONFIG_FFT) += arm/fft_init_arm.o OBJS-$(CONFIG_FMTCONVERT) += arm/fmtconvert_init_arm.o OBJS-$(CONFIG_G722DSP) += arm/g722dsp_init_arm.o OBJS-$(CONFIG_H264CHROMA) += arm/h264chroma_init_arm.o @@ -25,7 +24,6 @@ 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_RDFT) += arm/rdft_init_arm.o OBJS-$(CONFIG_RV34DSP) += arm/rv34dsp_init_arm.o OBJS-$(CONFIG_VC1DSP) += arm/vc1dsp_init_arm.o OBJS-$(CONFIG_VIDEODSP) += arm/videodsp_init_arm.o @@ -90,9 +88,7 @@ ARMV6-OBJS-$(CONFIG_TRUEHD_DECODER) += arm/mlpdsp_armv6.o # VFP optimizations # subsystems -VFP-OBJS-$(CONFIG_FFT) += arm/fft_vfp.o VFP-OBJS-$(CONFIG_FMTCONVERT) += arm/fmtconvert_vfp.o -VFP-OBJS-$(CONFIG_MDCT) += arm/mdct_vfp.o # decoders/encoders VFP-OBJS-$(CONFIG_DCA_DECODER) += arm/synth_filter_vfp.o @@ -107,7 +103,6 @@ NEON-OBJS-$(CONFIG_AUDIODSP) += arm/audiodsp_init_neon.o \ arm/int_neon.o NEON-OBJS-$(CONFIG_BLOCKDSP) += arm/blockdsp_init_neon.o \ arm/blockdsp_neon.o -NEON-OBJS-$(CONFIG_FFT) += arm/fft_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 @@ -121,10 +116,8 @@ NEON-OBJS-$(CONFIG_HPELDSP) += arm/hpeldsp_init_neon.o \ NEON-OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_neon.o \ arm/idctdsp_neon.o \ arm/simple_idct_neon.o -NEON-OBJS-$(CONFIG_MDCT) += arm/mdct_neon.o NEON-OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_neon.o NEON-OBJS-$(CONFIG_PIXBLOCKDSP) += arm/pixblockdsp_neon.o -NEON-OBJS-$(CONFIG_RDFT) += arm/rdft_neon.o NEON-OBJS-$(CONFIG_VC1DSP) += arm/vc1dsp_init_neon.o \ arm/vc1dsp_neon.o NEON-OBJS-$(CONFIG_VP3DSP) += arm/vp3dsp_neon.o diff --git a/src/third_party/ffmpeg/libavcodec/arm/synth_filter_init_arm.c b/src/third_party/ffmpeg/libavcodec/arm/synth_filter_init_arm.c index 858c117d..10689b62 100644 --- a/src/third_party/ffmpeg/libavcodec/arm/synth_filter_init_arm.c +++ b/src/third_party/ffmpeg/libavcodec/arm/synth_filter_init_arm.c @@ -23,7 +23,6 @@ #include "libavutil/arm/cpu.h" #include "libavutil/attributes.h" #include "libavutil/internal.h" -#include "libavcodec/fft.h" #include "libavcodec/synth_filter.h" void ff_synth_filter_float_vfp(AVTXContext *imdct, diff --git a/src/third_party/ffmpeg/libavcodec/asvdec.c b/src/third_party/ffmpeg/libavcodec/asvdec.c index 62295b2d..7ad4faeb 100644 --- a/src/third_party/ffmpeg/libavcodec/asvdec.c +++ b/src/third_party/ffmpeg/libavcodec/asvdec.c @@ -67,19 +67,19 @@ typedef struct ASVDecContext { static av_cold void init_vlcs(void) { - INIT_VLC_STATIC(&ccp_vlc, CCP_VLC_BITS, 17, + VLC_INIT_STATIC(&ccp_vlc, CCP_VLC_BITS, 17, &ff_asv_ccp_tab[0][1], 2, 1, &ff_asv_ccp_tab[0][0], 2, 1, 32); - INIT_LE_VLC_STATIC(&dc_ccp_vlc, DC_CCP_VLC_BITS, 8, + VLC_INIT_LE_STATIC(&dc_ccp_vlc, DC_CCP_VLC_BITS, 8, &ff_asv_dc_ccp_tab[0][1], 2, 1, &ff_asv_dc_ccp_tab[0][0], 2, 1, 16); - INIT_LE_VLC_STATIC(&ac_ccp_vlc, AC_CCP_VLC_BITS, 16, + VLC_INIT_LE_STATIC(&ac_ccp_vlc, AC_CCP_VLC_BITS, 16, &ff_asv_ac_ccp_tab[0][1], 2, 1, &ff_asv_ac_ccp_tab[0][0], 2, 1, 64); - INIT_VLC_STATIC(&level_vlc, ASV1_LEVEL_VLC_BITS, 7, + VLC_INIT_STATIC(&level_vlc, ASV1_LEVEL_VLC_BITS, 7, &ff_asv_level_tab[0][1], 2, 1, &ff_asv_level_tab[0][0], 2, 1, 16); - INIT_LE_VLC_STATIC(&asv2_level_vlc, ASV2_LEVEL_VLC_BITS, 63, + VLC_INIT_LE_STATIC(&asv2_level_vlc, ASV2_LEVEL_VLC_BITS, 63, &ff_asv2_level_tab[0][1], 4, 2, &ff_asv2_level_tab[0][0], 4, 2, 1024); } diff --git a/src/third_party/ffmpeg/libavcodec/asvenc.c b/src/third_party/ffmpeg/libavcodec/asvenc.c index 4a14bcf8..50da4673 100644 --- a/src/third_party/ffmpeg/libavcodec/asvenc.c +++ b/src/third_party/ffmpeg/libavcodec/asvenc.c @@ -33,7 +33,6 @@ #include "asv.h" #include "avcodec.h" #include "codec_internal.h" -#include "dct.h" #include "encode.h" #include "fdctdsp.h" #include "mpeg12data.h" diff --git a/src/third_party/ffmpeg/libavcodec/atrac3.c b/src/third_party/ffmpeg/libavcodec/atrac3.c index 5851ee02..fad2299a 100644 --- a/src/third_party/ffmpeg/libavcodec/atrac3.c +++ b/src/third_party/ffmpeg/libavcodec/atrac3.c @@ -863,10 +863,10 @@ static av_cold void atrac3_init_static_data(void) for (i = 0; i < 7; i++) { spectral_coeff_tab[i].table = table; spectral_coeff_tab[i].table_allocated = 256; - ff_init_vlc_from_lengths(&spectral_coeff_tab[i], ATRAC3_VLC_BITS, huff_tab_sizes[i], + ff_vlc_init_from_lengths(&spectral_coeff_tab[i], ATRAC3_VLC_BITS, huff_tab_sizes[i], &hufftabs[0][1], 2, &hufftabs[0][0], 2, 1, - -31, INIT_VLC_USE_NEW_STATIC, NULL); + -31, VLC_INIT_USE_STATIC, NULL); hufftabs += huff_tab_sizes[i]; table += 256; } diff --git a/src/third_party/ffmpeg/libavcodec/atrac3plus.c b/src/third_party/ffmpeg/libavcodec/atrac3plus.c index 5661654c..61753af7 100644 --- a/src/third_party/ffmpeg/libavcodec/atrac3plus.c +++ b/src/third_party/ffmpeg/libavcodec/atrac3plus.c @@ -66,8 +66,8 @@ static av_cold void build_canonical_huff(const uint8_t *cb, const uint8_t **xlat out_vlc->table = &tables_data[*tab_offset]; out_vlc->table_allocated = 1 << max_len; - ff_init_vlc_from_lengths(out_vlc, max_len, index, bits, 1, - *xlat, 1, 1, 0, INIT_VLC_USE_NEW_STATIC, NULL); + ff_vlc_init_from_lengths(out_vlc, max_len, index, bits, 1, + *xlat, 1, 1, 0, VLC_INIT_USE_STATIC, NULL); *tab_offset += 1 << max_len; *xlat += index; diff --git a/src/third_party/ffmpeg/libavcodec/atrac9dec.c b/src/third_party/ffmpeg/libavcodec/atrac9dec.c index 8a694045..d24a8e3f 100644 --- a/src/third_party/ffmpeg/libavcodec/atrac9dec.c +++ b/src/third_party/ffmpeg/libavcodec/atrac9dec.c @@ -849,9 +849,9 @@ static av_cold void atrac9_init_vlc(VLC *vlc, int nb_bits, int nb_codes, vlc->table = &vlc_buf[*buf_offset]; vlc->table_allocated = FF_ARRAY_ELEMS(vlc_buf) - *buf_offset; - ff_init_vlc_from_lengths(vlc, nb_bits, nb_codes, + ff_vlc_init_from_lengths(vlc, nb_bits, nb_codes, &(*tab)[0][1], 2, &(*tab)[0][0], 2, 1, - offset, INIT_VLC_STATIC_OVERLONG, NULL); + offset, VLC_INIT_STATIC_OVERLONG, NULL); *buf_offset += vlc->table_size; *tab += nb_codes; } diff --git a/src/third_party/ffmpeg/libavcodec/audiotoolboxenc.c b/src/third_party/ffmpeg/libavcodec/audiotoolboxenc.c index 46aca4c7..42ab7ae6 100644 --- a/src/third_party/ffmpeg/libavcodec/audiotoolboxenc.c +++ b/src/third_party/ffmpeg/libavcodec/audiotoolboxenc.c @@ -60,17 +60,17 @@ static UInt32 ffat_get_format_id(enum AVCodecID codec, int profile) switch (codec) { case AV_CODEC_ID_AAC: switch (profile) { - case FF_PROFILE_AAC_LOW: + case AV_PROFILE_AAC_LOW: default: return kAudioFormatMPEG4AAC; - case FF_PROFILE_AAC_HE: + case AV_PROFILE_AAC_HE: return kAudioFormatMPEG4AAC_HE; - case FF_PROFILE_AAC_HE_V2: + case AV_PROFILE_AAC_HE_V2: return kAudioFormatMPEG4AAC_HE_V2; - case FF_PROFILE_AAC_LD: + case AV_PROFILE_AAC_LD: return kAudioFormatMPEG4AAC_LD; #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 - case FF_PROFILE_AAC_ELD: + case AV_PROFILE_AAC_ELD: return kAudioFormatMPEG4AAC_ELD; #endif } @@ -483,8 +483,7 @@ static OSStatus ffat_encode_callback(AudioConverterRef converter, UInt32 *nb_pac if (*nb_packets > frame->nb_samples) *nb_packets = frame->nb_samples; - av_frame_unref(at->encoding_frame); - ret = av_frame_ref(at->encoding_frame, frame); + ret = av_frame_replace(at->encoding_frame, frame); if (ret < 0) { *nb_packets = 0; return ret; @@ -586,12 +585,12 @@ static av_cold int ffat_close_encoder(AVCodecContext *avctx) } static const AVProfile aac_profiles[] = { - { FF_PROFILE_AAC_LOW, "LC" }, - { 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 }, + { AV_PROFILE_AAC_LOW, "LC" }, + { AV_PROFILE_AAC_HE, "HE-AAC" }, + { AV_PROFILE_AAC_HE_V2, "HE-AACv2" }, + { AV_PROFILE_AAC_LD, "LD" }, + { AV_PROFILE_AAC_ELD, "ELD" }, + { AV_PROFILE_UNKNOWN }, }; #define AE AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM diff --git a/src/third_party/ffmpeg/libavcodec/av1.h b/src/third_party/ffmpeg/libavcodec/av1.h index 384f7cdd..8704bc41 100644 --- a/src/third_party/ffmpeg/libavcodec/av1.h +++ b/src/third_party/ffmpeg/libavcodec/av1.h @@ -175,6 +175,13 @@ enum { AV1_RESTORE_SWITCHABLE = 3, }; +// TX mode (section 6.8.21) +enum { + AV1_ONLY_4X4 = 0, + AV1_TX_MODE_LARGEST = 1, + AV1_TX_MODE_SELECT = 2, +}; + // Sequence Headers are actually unbounded because one can use // an arbitrary number of leading zeroes when encoding via uvlc. // The following estimate is based around using the lowest number diff --git a/src/third_party/ffmpeg/libavcodec/av1_levels.c b/src/third_party/ffmpeg/libavcodec/av1_levels.c new file mode 100644 index 00000000..19b6ee17 --- /dev/null +++ b/src/third_party/ffmpeg/libavcodec/av1_levels.c @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2023 Intel Corporation + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include "libavutil/macros.h" +#include "av1_levels.h" + +/** ignore entries which named in spec but no details. Like level 2.2 and 7.0. */ +static const AV1LevelDescriptor av1_levels[] = { + // Name MaxVSize MainMbps MaxTiles + // | level_idx | MaxDisplayRate | HighMbps | MaxTileCols + // | | MaxPicSize | | MaxDecodeRate | | MainCR | | + // | | | MaxHSize | | | MaxHeaderRate | | | HighCR| | + // | | | | | | | | | | | | | | + { "2.0", 0, 147456, 2048, 1152, 4423680, 5529600, 150, 1.5, 0, 2, 0, 8, 4 }, + { "2.1", 1, 278784, 2816, 1584, 8363520, 10454400, 150, 3.0, 0, 2, 0, 8, 4 }, + { "3.0", 4, 665856, 4352, 2448, 19975680, 24969600, 150, 6.0, 0, 2, 0, 16, 6 }, + { "3.1", 5, 1065024, 5504, 3096, 31950720, 39938400, 150, 10.0, 0, 2, 0, 16, 6 }, + { "4.0", 8, 2359296, 6144, 3456, 70778880, 77856768, 300, 12.0, 30.0, 4, 4, 32, 8 }, + { "4.1", 9, 2359296, 6144, 3456, 141557760, 155713536, 300, 20.0, 50.0, 4, 4, 32, 8 }, + { "5.0", 12, 8912896, 8192, 4352, 267386880, 273715200, 300, 30.0, 100.0, 6, 4, 64, 8 }, + { "5.1", 13, 8912896, 8192, 4352, 534773760, 547430400, 300, 40.0, 160.0, 8, 4, 64, 8 }, + { "5.2", 14, 8912896, 8192, 4352, 1069547520, 1094860800, 300, 60.0, 240.0, 8, 4, 64, 8 }, + { "5.3", 15, 8912896, 8192, 4352, 1069547520, 1176502272, 300, 60.0, 240.0, 8, 4, 64, 8 }, + { "6.0", 16, 35651584, 16384, 8704, 1069547520, 1176502272, 300, 60.0, 240.0, 8, 4, 128, 16 }, + { "6.1", 17, 35651584, 16384, 8704, 2139095040, 2189721600, 300, 100.0, 480.0, 8, 4, 128, 16 }, + { "6.2", 18, 35651584, 16384, 8704, 4278190080, 4379443200, 300, 160.0, 800.0, 8, 4, 128, 16 }, + { "6.3", 19, 35651584, 16384, 8704, 4278190080, 4706009088, 300, 160.0, 800.0, 8, 4, 128, 16 }, +}; + +const AV1LevelDescriptor *ff_av1_guess_level(int64_t bitrate, + int tier, + int width, + int height, + int tiles, + int tile_cols, + float fps) +{ + int pic_size; + uint64_t display_rate; + float max_br; + + pic_size = width * height; + display_rate = (uint64_t)pic_size * fps; + + for (int i = 0; i < FF_ARRAY_ELEMS(av1_levels); i++) { + const AV1LevelDescriptor *level = &av1_levels[i]; + // Limitation: decode rate, header rate, compress rate, etc. are not considered. + if (pic_size > level->max_pic_size) + continue; + if (width > level->max_h_size) + continue; + if (height > level->max_v_size) + continue; + if (display_rate > level->max_display_rate) + continue; + + if (tier) + max_br = level->high_mbps; + else + max_br = level->main_mbps; + if (!max_br) + continue; + if (bitrate > (int64_t)(1000000.0 * max_br)) + continue; + + if (tiles > level->max_tiles) + continue; + if (tile_cols > level->max_tile_cols) + continue; + return level; + } + + return NULL; +} diff --git a/src/third_party/ffmpeg/libavcodec/av1_levels.h b/src/third_party/ffmpeg/libavcodec/av1_levels.h new file mode 100644 index 00000000..164cb876 --- /dev/null +++ b/src/third_party/ffmpeg/libavcodec/av1_levels.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2023 Intel Corporation + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_AV1_LEVELS_H +#define AVCODEC_AV1_LEVELS_H + +#include + +typedef struct AV1LevelDescriptor { + char name[4]; + uint8_t level_idx; + + uint32_t max_pic_size; + uint32_t max_h_size; + uint32_t max_v_size; + uint64_t max_display_rate; + uint64_t max_decode_rate; + + uint32_t max_header_rate; + float main_mbps; + float high_mbps; + uint32_t main_cr; + uint32_t high_cr; + uint32_t max_tiles; + uint32_t max_tile_cols; +} AV1LevelDescriptor; + +/** + * Guess the level of a stream from some parameters. + * + * Unknown parameters may be zero, in which case they will be ignored. + */ +const AV1LevelDescriptor *ff_av1_guess_level(int64_t bitrate, + int tier, + int width, + int height, + int tile_rows, + int tile_cols, + float fps); + +#endif /* AVCODEC_AV1_LEVELS_H */ diff --git a/src/third_party/ffmpeg/libavcodec/av1dec.c b/src/third_party/ffmpeg/libavcodec/av1dec.c index cc178464..39ccad5b 100644 --- a/src/third_party/ffmpeg/libavcodec/av1dec.c +++ b/src/third_party/ffmpeg/libavcodec/av1dec.c @@ -33,6 +33,7 @@ #include "bytestream.h" #include "codec_internal.h" #include "decode.h" +#include "hwaccel_internal.h" #include "internal.h" #include "hwconfig.h" #include "profiles.h" @@ -439,29 +440,20 @@ static int get_tiles_info(AVCodecContext *avctx, const AV1RawTileGroup *tile_gro } -static int get_pixel_format(AVCodecContext *avctx) +static enum AVPixelFormat get_sw_pixel_format(void *logctx, + const AV1RawSequenceHeader *seq) { - AV1DecContext *s = avctx->priv_data; - const AV1RawSequenceHeader *seq = s->raw_seq; uint8_t bit_depth; - int ret; enum AVPixelFormat pix_fmt = AV_PIX_FMT_NONE; -#define HWACCEL_MAX (CONFIG_AV1_DXVA2_HWACCEL + \ - CONFIG_AV1_D3D11VA_HWACCEL * 2 + \ - CONFIG_AV1_NVDEC_HWACCEL + \ - CONFIG_AV1_VAAPI_HWACCEL + \ - CONFIG_AV1_VDPAU_HWACCEL + \ - CONFIG_AV1_VULKAN_HWACCEL) - enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmtp = pix_fmts; if (seq->seq_profile == 2 && seq->color_config.high_bitdepth) bit_depth = seq->color_config.twelve_bit ? 12 : 10; else if (seq->seq_profile <= 2) bit_depth = seq->color_config.high_bitdepth ? 10 : 8; else { - av_log(avctx, AV_LOG_ERROR, + av_log(logctx, AV_LOG_ERROR, "Unknown AV1 profile %d.\n", seq->seq_profile); - return -1; + return AV_PIX_FMT_NONE; } if (!seq->color_config.mono_chrome) { @@ -475,7 +467,7 @@ static int get_pixel_format(AVCodecContext *avctx) else if (bit_depth == 12) pix_fmt = AV_PIX_FMT_YUV444P12; else - av_log(avctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n"); + av_log(logctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n"); } else if (seq->color_config.subsampling_x == 1 && seq->color_config.subsampling_y == 0) { if (bit_depth == 8) @@ -485,7 +477,7 @@ static int get_pixel_format(AVCodecContext *avctx) else if (bit_depth == 12) pix_fmt = AV_PIX_FMT_YUV422P12; else - av_log(avctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n"); + av_log(logctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n"); } else if (seq->color_config.subsampling_x == 1 && seq->color_config.subsampling_y == 1) { if (bit_depth == 8) @@ -495,7 +487,7 @@ static int get_pixel_format(AVCodecContext *avctx) else if (bit_depth == 12) pix_fmt = AV_PIX_FMT_YUV420P12; else - av_log(avctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n"); + av_log(logctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n"); } } else { if (bit_depth == 8) @@ -505,11 +497,25 @@ static int get_pixel_format(AVCodecContext *avctx) else if (bit_depth == 12) pix_fmt = AV_PIX_FMT_GRAY12; else - av_log(avctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n"); + av_log(logctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n"); } - av_log(avctx, AV_LOG_DEBUG, "AV1 decode get format: %s.\n", - av_get_pix_fmt_name(pix_fmt)); + return pix_fmt; +} + +static int get_pixel_format(AVCodecContext *avctx) +{ + AV1DecContext *s = avctx->priv_data; + const AV1RawSequenceHeader *seq = s->raw_seq; + int ret; + enum AVPixelFormat pix_fmt = get_sw_pixel_format(avctx, seq); +#define HWACCEL_MAX (CONFIG_AV1_DXVA2_HWACCEL + \ + CONFIG_AV1_D3D11VA_HWACCEL * 2 + \ + CONFIG_AV1_NVDEC_HWACCEL + \ + CONFIG_AV1_VAAPI_HWACCEL + \ + CONFIG_AV1_VDPAU_HWACCEL + \ + CONFIG_AV1_VULKAN_HWACCEL) + enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmtp = pix_fmts; if (pix_fmt == AV_PIX_FMT_NONE) return -1; @@ -607,9 +613,7 @@ static int get_pixel_format(AVCodecContext *avctx) *fmtp++ = pix_fmt; *fmtp = AV_PIX_FMT_NONE; - ret = ff_thread_get_format(avctx, pix_fmts); - if (ret < 0) - return ret; + ret = ff_get_format(avctx, pix_fmts); /** * check if the HW accel is inited correctly. If not, return un-implemented. @@ -619,12 +623,16 @@ static int get_pixel_format(AVCodecContext *avctx) if (!avctx->hwaccel) { av_log(avctx, AV_LOG_ERROR, "Your platform doesn't support" " hardware accelerated AV1 decoding.\n"); + avctx->pix_fmt = AV_PIX_FMT_NONE; return AVERROR(ENOSYS); } s->pix_fmt = pix_fmt; avctx->pix_fmt = ret; + av_log(avctx, AV_LOG_DEBUG, "AV1 decode get format: %s.\n", + av_get_pix_fmt_name(avctx->pix_fmt)); + return 0; } @@ -754,7 +762,6 @@ static int set_context_with_sequence(AVCodecContext *avctx, if (ret < 0) return ret; } - avctx->sample_aspect_ratio = (AVRational) { 1, 1 }; if (seq->timing_info_present_flag) avctx->framerate = ff_av1_framerate(1LL + seq->timing_info.num_ticks_per_picture_minus_1, @@ -865,6 +872,8 @@ static av_cold int av1_decode_init(AVCodecContext *avctx) goto end; } + avctx->pix_fmt = get_sw_pixel_format(avctx, seq); + end: ff_cbs_fragment_reset(&s->current_obu); } @@ -907,17 +916,11 @@ static int av1_frame_alloc(AVCodecContext *avctx, AV1Frame *f) break; } - if (avctx->hwaccel) { - const AVHWAccel *hwaccel = avctx->hwaccel; - if (hwaccel->frame_priv_data_size) { - f->hwaccel_priv_buf = ff_hwaccel_frame_priv_alloc(avctx, hwaccel); - if (!f->hwaccel_priv_buf) { - ret = AVERROR(ENOMEM); - goto fail; - } - f->hwaccel_picture_private = f->hwaccel_priv_buf->data; - } - } + ret = ff_hwaccel_frame_priv_alloc(avctx, &f->hwaccel_picture_private, + &f->hwaccel_priv_buf); + if (ret < 0) + goto fail; + return 0; fail: @@ -1239,9 +1242,9 @@ static int av1_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame) } } - if (avctx->hwaccel && avctx->hwaccel->decode_params) { - ret = avctx->hwaccel->decode_params(avctx, unit->type, unit->data, - unit->data_size); + if (FF_HW_HAS_CB(avctx, decode_params)) { + ret = FF_HW_CALL(avctx, decode_params, unit->type, + unit->data, unit->data_size); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "HW accel decode params fail.\n"); s->raw_seq = NULL; @@ -1311,8 +1314,7 @@ static int av1_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame) s->cur_frame.temporal_id = header->temporal_id; if (avctx->hwaccel && s->cur_frame.f->buf[0]) { - ret = avctx->hwaccel->start_frame(avctx, unit->data, - unit->data_size); + ret = FF_HW_CALL(avctx, start_frame, unit->data, unit->data_size); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "HW accel start frame fail.\n"); goto end; @@ -1338,9 +1340,8 @@ static int av1_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame) goto end; if (avctx->hwaccel && s->cur_frame.f->buf[0]) { - ret = avctx->hwaccel->decode_slice(avctx, - raw_tile_group->tile_data.data, - raw_tile_group->tile_data.data_size); + ret = FF_HW_CALL(avctx, decode_slice, raw_tile_group->tile_data.data, + raw_tile_group->tile_data.data_size); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "HW accel decode slice fail.\n"); @@ -1402,7 +1403,7 @@ static int av1_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame) if (raw_tile_group && (s->tile_num == raw_tile_group->tg_end + 1)) { int show_frame = s->raw_frame_header->show_frame; if (avctx->hwaccel && s->cur_frame.f->buf[0]) { - ret = avctx->hwaccel->end_frame(avctx); + ret = FF_HW_SIMPLE_CALL(avctx, end_frame); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "HW accel end frame fail.\n"); goto end; @@ -1498,8 +1499,8 @@ static void av1_decode_flush(AVCodecContext *avctx) ff_cbs_fragment_reset(&s->current_obu); ff_cbs_flush(s->cbc); - if (avctx->hwaccel && avctx->hwaccel->flush) - avctx->hwaccel->flush(avctx); + if (FF_HW_HAS_CB(avctx, flush)) + FF_HW_SIMPLE_CALL(avctx, flush); } #define OFFSET(x) offsetof(AV1DecContext, x) @@ -1526,7 +1527,7 @@ const FFCodec ff_av1_decoder = { .init = av1_decode_init, .close = av1_decode_free, FF_CODEC_RECEIVE_FRAME_CB(av1_receive_frame), - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_AVOID_PROBING, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .flush = av1_decode_flush, .p.profiles = NULL_IF_CONFIG_SMALL(ff_av1_profiles), diff --git a/src/third_party/ffmpeg/libavcodec/avcodec.c b/src/third_party/ffmpeg/libavcodec/avcodec.c index 340abe83..f2dc7b0e 100644 --- a/src/third_party/ffmpeg/libavcodec/avcodec.c +++ b/src/third_party/ffmpeg/libavcodec/avcodec.c @@ -28,6 +28,7 @@ #include "libavutil/avstring.h" #include "libavutil/bprint.h" #include "libavutil/channel_layout.h" +#include "libavutil/emms.h" #include "libavutil/fifo.h" #include "libavutil/imgutils.h" #include "libavutil/mem.h" @@ -36,6 +37,7 @@ #include "avcodec.h" #include "avcodec_internal.h" #include "bsf.h" +#include "codec_desc.h" #include "codec_internal.h" #include "decode.h" #include "encode.h" @@ -44,6 +46,13 @@ #include "internal.h" #include "thread.h" +/** + * Maximum size in bytes of extradata. + * 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) - AV_INPUT_BUFFER_PADDING_SIZE) + int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2), void *arg, int *ret, int count, int size) { size_t i; diff --git a/src/third_party/ffmpeg/libavcodec/avcodec.h b/src/third_party/ffmpeg/libavcodec/avcodec.h index 5d910a69..1b42edbf 100644 --- a/src/third_party/ffmpeg/libavcodec/avcodec.h +++ b/src/third_party/ffmpeg/libavcodec/avcodec.h @@ -31,6 +31,7 @@ #include "libavutil/attributes.h" #include "libavutil/avutil.h" #include "libavutil/buffer.h" +#include "libavutil/channel_layout.h" #include "libavutil/dict.h" #include "libavutil/frame.h" #include "libavutil/log.h" @@ -38,8 +39,6 @@ #include "libavutil/rational.h" #include "codec.h" -#include "codec_desc.h" -#include "codec_par.h" #include "codec_id.h" #include "defs.h" #include "packet.h" @@ -49,8 +48,13 @@ * to avoid unnecessary rebuilds. When included externally, keep including * the full version information. */ #include "version.h" + +#include "codec_desc.h" +#include "codec_par.h" #endif +struct AVCodecParameters; + /** * @defgroup libavc libavcodec * Encoding/Decoding Library @@ -421,8 +425,6 @@ typedef struct RcOverride{ */ #define AV_GET_ENCODE_BUFFER_FLAG_REF (1 << 0) -struct AVCodecInternal; - /** * main external API structure. * New fields can be added to the end with minor version bumps. @@ -1262,7 +1264,7 @@ typedef struct AVCodecContext { /** * decoder bitstream buffer size * - encoding: Set by user. - * - decoding: unused + * - decoding: May be set by libavcodec. */ int rc_buffer_size; @@ -1591,8 +1593,12 @@ typedef struct AVCodecContext { * profile * - encoding: Set by user. * - decoding: Set by libavcodec. + * See the AV_PROFILE_* defines in defs.h. */ int profile; +#if FF_API_FF_PROFILE_LEVEL + /** @deprecated The following defines are deprecated; use AV_PROFILE_* + * in defs.h instead. */ #define FF_PROFILE_UNKNOWN -99 #define FF_PROFILE_RESERVED -100 @@ -1723,14 +1729,20 @@ typedef struct AVCodecContext { #define FF_PROFILE_EVC_BASELINE 0 #define FF_PROFILE_EVC_MAIN 1 +#endif /** * level * - encoding: Set by user. * - decoding: Set by libavcodec. + * See AV_LEVEL_* in defs.h. */ int level; +#if FF_API_FF_PROFILE_LEVEL + /** @deprecated The following define is deprecated; use AV_LEVEL_UNKOWN + * in defs.h instead. */ #define FF_LEVEL_UNKNOWN -99 +#endif /** * Skip loop filtering for selected frames. @@ -1798,9 +1810,9 @@ typedef struct AVCodecContext { enum AVPixelFormat sw_pix_fmt; /** - * Timebase in which pkt_dts/pts and AVPacket.dts/pts are. - * - encoding unused. - * - decoding set by user. + * Timebase in which pkt_dts/pts and AVPacket.dts/pts are expressed. + * - encoding: unused. + * - decoding: set by user. */ AVRational pkt_timebase; @@ -1809,7 +1821,7 @@ typedef struct AVCodecContext { * - encoding: unused. * - decoding: set by libavcodec. */ - const AVCodecDescriptor *codec_descriptor; + const struct AVCodecDescriptor *codec_descriptor; /** * Current statistics for PTS correction. @@ -2148,139 +2160,6 @@ typedef struct AVHWAccel { * see AV_HWACCEL_CODEC_CAP_* */ int capabilities; - - /***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - */ - - /** - * Allocate a custom buffer - */ - int (*alloc_frame)(AVCodecContext *avctx, AVFrame *frame); - - /** - * Called at the beginning of each frame or field picture. - * - * Meaningful frame information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * Note that buf can be NULL along with buf_size set to 0. - * Otherwise, this means the whole frame is available at this point. - * - * @param avctx the codec context - * @param buf the frame data buffer base - * @param buf_size the size of the frame in bytes - * @return zero if successful, a negative value otherwise - */ - int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size); - - /** - * Callback for parameter data (SPS/PPS/VPS etc). - * - * Useful for hardware decoders which keep persistent state about the - * video parameters, and need to receive any changes to update that state. - * - * @param avctx the codec context - * @param type the nal unit type - * @param buf the nal unit data buffer - * @param buf_size the size of the nal unit in bytes - * @return zero if successful, a negative value otherwise - */ - int (*decode_params)(AVCodecContext *avctx, int type, const uint8_t *buf, uint32_t buf_size); - - /** - * Callback for each slice. - * - * Meaningful slice information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * @param avctx the codec context - * @param buf the slice data buffer base - * @param buf_size the size of the slice in bytes - * @return zero if successful, a negative value otherwise - */ - int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size); - - /** - * Called at the end of each frame or field picture. - * - * The whole picture is parsed at this point and can now be sent - * to the hardware accelerator. This function is mandatory. - * - * @param avctx the codec context - * @return zero if successful, a negative value otherwise - */ - int (*end_frame)(AVCodecContext *avctx); - - /** - * Size of per-frame hardware accelerator private data. - * - * Private data is allocated with av_mallocz() before - * AVCodecContext.get_buffer() and deallocated after - * AVCodecContext.release_buffer(). - */ - int frame_priv_data_size; - - /** - * Initialize the hwaccel private data. - * - * This will be called from ff_get_format(), after hwaccel and - * hwaccel_context are set and the hwaccel private data in AVCodecInternal - * is allocated. - */ - int (*init)(AVCodecContext *avctx); - - /** - * Uninitialize the hwaccel private data. - * - * This will be called from get_format() or avcodec_close(), after hwaccel - * and hwaccel_context are already uninitialized. - */ - int (*uninit)(AVCodecContext *avctx); - - /** - * Size of the private data to allocate in - * AVCodecInternal.hwaccel_priv_data. - */ - int priv_data_size; - - /** - * Internal hwaccel capabilities. - */ - int caps_internal; - - /** - * Fill the given hw_frames context with current codec parameters. Called - * from get_format. Refer to avcodec_get_hw_frames_parameters() for - * details. - * - * This CAN be called before AVHWAccel.init is called, and you must assume - * that avctx->hwaccel_priv_data is invalid. - */ - int (*frame_params)(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx); - - /** - * Copy necessary context variables from a previous thread context to the current one. - * For thread-safe hwaccels only. - */ - int (*update_thread_context)(AVCodecContext *dst, const AVCodecContext *src); - - /** - * Callback to free the hwaccel-specific frame data. - * - * @param hwctx a pointer to an AVHWDeviceContext. - * @param data the per-frame hardware accelerator private data to be freed. - */ - void (*free_frame_priv)(void *hwctx, uint8_t *data); - - /** - * Callback to flush the hwaccel state. - */ - void (*flush)(AVCodecContext *avctx); } AVHWAccel; /** @@ -2455,7 +2334,7 @@ const AVClass *avcodec_get_subtitle_rect_class(void); * * @return >= 0 on success, a negative AVERROR code on failure */ -int avcodec_parameters_from_context(AVCodecParameters *par, +int avcodec_parameters_from_context(struct AVCodecParameters *par, const AVCodecContext *codec); /** @@ -2467,7 +2346,7 @@ int avcodec_parameters_from_context(AVCodecParameters *par, * @return >= 0 on success, a negative AVERROR code on failure. */ int avcodec_parameters_to_context(AVCodecContext *codec, - const AVCodecParameters *par); + const struct AVCodecParameters *par); /** * Initialize the AVCodecContext to use the given AVCodec. Prior to using this diff --git a/src/third_party/ffmpeg/libavcodec/avfft.c b/src/third_party/ffmpeg/libavcodec/avfft.c index 2200f377..fb635abf 100644 --- a/src/third_party/ffmpeg/libavcodec/avfft.c +++ b/src/third_party/ffmpeg/libavcodec/avfft.c @@ -16,130 +16,233 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include +#include + #include "libavutil/attributes.h" +#include "libavutil/macros.h" #include "libavutil/mem.h" +#include "libavutil/tx.h" #include "avfft.h" -#include "fft.h" -#include "rdft.h" -#include "dct.h" + +typedef struct AVTXWrapper { + AVTXContext *ctx; + av_tx_fn fn; + + AVTXContext *ctx2; + av_tx_fn fn2; + + ptrdiff_t stride; + int len; + int inv; + + float *tmp; + int out_of_place; +} AVTXWrapper; /* FFT */ FFTContext *av_fft_init(int nbits, int inverse) { - FFTContext *s = av_mallocz(sizeof(*s)); + int ret; + float scale = 1.0f; + AVTXWrapper *s = av_malloc(sizeof(*s)); + if (!s) + return NULL; - if (s && ff_fft_init(s, nbits, inverse)) - av_freep(&s); + ret = av_tx_init(&s->ctx, &s->fn, AV_TX_FLOAT_FFT, inverse, 1 << nbits, + &scale, AV_TX_INPLACE); + if (ret < 0) { + av_free(s); + return NULL; + } - return s; + return (FFTContext *)s; } void av_fft_permute(FFTContext *s, FFTComplex *z) { - s->fft_permute(s, z); + /* Empty */ } void av_fft_calc(FFTContext *s, FFTComplex *z) { - s->fft_calc(s, z); + AVTXWrapper *w = (AVTXWrapper *)s; + w->fn(w->ctx, z, (void *)z, sizeof(AVComplexFloat)); } av_cold void av_fft_end(FFTContext *s) { if (s) { - ff_fft_end(s); - av_free(s); + AVTXWrapper *w = (AVTXWrapper *)s; + av_tx_uninit(&w->ctx); + av_tx_uninit(&w->ctx2); + av_free(w); } } -#if CONFIG_MDCT - FFTContext *av_mdct_init(int nbits, int inverse, double scale) { - FFTContext *s = av_malloc(sizeof(*s)); + int ret; + float scale_f = scale; + AVTXWrapper *s = av_malloc(sizeof(*s)); + if (!s) + return NULL; - if (s && ff_mdct_init(s, nbits, inverse, scale)) - av_freep(&s); + ret = av_tx_init(&s->ctx, &s->fn, AV_TX_FLOAT_MDCT, inverse, 1 << (nbits - 1), &scale_f, 0); + if (ret < 0) { + av_free(s); + return NULL; + } - return s; + if (inverse) { + ret = av_tx_init(&s->ctx2, &s->fn2, AV_TX_FLOAT_MDCT, inverse, 1 << (nbits - 1), + &scale_f, AV_TX_FULL_IMDCT); + if (ret < 0) { + av_tx_uninit(&s->ctx); + av_free(s); + return NULL; + } + } + + return (FFTContext *)s; } void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input) { - s->imdct_calc(s, output, input); + AVTXWrapper *w = (AVTXWrapper *)s; + w->fn2(w->ctx2, output, (void *)input, sizeof(float)); } void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input) { - s->imdct_half(s, output, input); + AVTXWrapper *w = (AVTXWrapper *)s; + w->fn(w->ctx, output, (void *)input, sizeof(float)); } void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input) { - s->mdct_calc(s, output, input); + AVTXWrapper *w = (AVTXWrapper *)s; + w->fn(w->ctx, output, (void *)input, sizeof(float)); } av_cold void av_mdct_end(FFTContext *s) { if (s) { - ff_mdct_end(s); - av_free(s); + AVTXWrapper *w = (AVTXWrapper *)s; + av_tx_uninit(&w->ctx); + av_free(w); } } -#endif /* CONFIG_MDCT */ - -#if CONFIG_RDFT - RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans) { - RDFTContext *s = av_malloc(sizeof(*s)); + int ret; + float scale = trans == IDFT_C2R ? 0.5f : 1.0f; + AVTXWrapper *s; - if (s && ff_rdft_init(s, nbits, trans)) - av_freep(&s); + /* The other 2 modes are unconventional, do not form an orthogonal + * transform, have never been useful, and so they're not implemented. */ + if (trans != IDFT_C2R && trans != DFT_R2C) + return NULL; - return s; + s = av_malloc(sizeof(*s)); + if (!s) + return NULL; + + ret = av_tx_init(&s->ctx, &s->fn, AV_TX_FLOAT_RDFT, trans == IDFT_C2R, + 1 << nbits, &scale, AV_TX_INPLACE); + if (ret < 0) { + av_free(s); + return NULL; + } + + s->stride = (trans == DFT_C2R) ? sizeof(float) : sizeof(AVComplexFloat); + s->len = 1 << nbits; + s->inv = trans == IDFT_C2R; + + return (RDFTContext *)s; } void av_rdft_calc(RDFTContext *s, FFTSample *data) { - s->rdft_calc(s, data); + AVTXWrapper *w = (AVTXWrapper *)s; + if (w->inv) + FFSWAP(float, data[1], data[w->len]); + w->fn(w->ctx, data, (void *)data, w->stride); + if (!w->inv) + FFSWAP(float, data[1], data[w->len]); } av_cold void av_rdft_end(RDFTContext *s) { if (s) { - ff_rdft_end(s); - av_free(s); + AVTXWrapper *w = (AVTXWrapper *)s; + av_tx_uninit(&w->ctx); + av_free(w); } } -#endif /* CONFIG_RDFT */ - -#if CONFIG_DCT - DCTContext *av_dct_init(int nbits, enum DCTTransformType inverse) { - DCTContext *s = av_malloc(sizeof(*s)); + int ret; + const float scale_map[] = { + [DCT_II] = 0.5f, + [DCT_III] = 1.0f / (1 << nbits), + [DCT_I] = 0.5f, + [DST_I] = 2.0f, + }; + static const enum AVTXType type_map[] = { + [DCT_II] = AV_TX_FLOAT_DCT, + [DCT_III] = AV_TX_FLOAT_DCT, + [DCT_I] = AV_TX_FLOAT_DCT_I, + [DST_I] = AV_TX_FLOAT_DST_I, + }; - if (s && ff_dct_init(s, nbits, inverse)) - av_freep(&s); + AVTXWrapper *s = av_malloc(sizeof(*s)); + if (!s) + return NULL; - return s; + s->len = (1 << nbits); + s->out_of_place = (inverse == DCT_I) || (inverse == DST_I); + + ret = av_tx_init(&s->ctx, &s->fn, type_map[inverse], + (inverse == DCT_III), 1 << (nbits - (inverse == DCT_III)), + &scale_map[inverse], s->out_of_place ? 0 : AV_TX_INPLACE); + if (ret < 0) { + av_free(s); + return NULL; + } + + if (s->out_of_place) { + s->tmp = av_malloc((1 << (nbits + 1))*sizeof(float)); + if (!s->tmp) { + av_tx_uninit(&s->ctx); + av_free(s); + return NULL; + } + } + + return (DCTContext *)s; } void av_dct_calc(DCTContext *s, FFTSample *data) { - s->dct_calc(s, data); + AVTXWrapper *w = (AVTXWrapper *)s; + if (w->out_of_place) { + memcpy(w->tmp, data, w->len*sizeof(float)); + w->fn(w->ctx, (void *)data, w->tmp, sizeof(float)); + } else { + w->fn(w->ctx, data, (void *)data, sizeof(float)); + } } av_cold void av_dct_end(DCTContext *s) { if (s) { - ff_dct_end(s); - av_free(s); + AVTXWrapper *w = (AVTXWrapper *)s; + av_tx_uninit(&w->ctx); + av_free(w->tmp); + av_free(w); } } - -#endif /* CONFIG_DCT */ diff --git a/src/third_party/ffmpeg/libavcodec/avfft.h b/src/third_party/ffmpeg/libavcodec/avfft.h index 0c0f9b8d..e3a0da1e 100644 --- a/src/third_party/ffmpeg/libavcodec/avfft.h +++ b/src/third_party/ffmpeg/libavcodec/avfft.h @@ -19,6 +19,10 @@ #ifndef AVCODEC_AVFFT_H #define AVCODEC_AVFFT_H +#include "libavutil/attributes.h" +#include "version_major.h" +#if FF_API_AVFFT + /** * @file * @ingroup lavc_fft @@ -44,26 +48,42 @@ typedef struct FFTContext FFTContext; * Set up a complex FFT. * @param nbits log2 of the length of the input array * @param inverse if 0 perform the forward transform, if 1 perform the inverse + * @deprecated use av_tx_init from libavutil/tx.h with a type of AV_TX_FLOAT_FFT */ +attribute_deprecated FFTContext *av_fft_init(int nbits, int inverse); /** * Do the permutation needed BEFORE calling ff_fft_calc(). + * @deprecated without replacement */ +attribute_deprecated void av_fft_permute(FFTContext *s, FFTComplex *z); /** * Do a complex FFT with the parameters defined in av_fft_init(). The * input data must be permuted before. No 1.0/sqrt(n) normalization is done. + * @deprecated use the av_tx_fn value returned by av_tx_init, which also does permutation */ +attribute_deprecated void av_fft_calc(FFTContext *s, FFTComplex *z); +attribute_deprecated void av_fft_end(FFTContext *s); +/** + * @deprecated use av_tx_init from libavutil/tx.h with a type of AV_TX_FLOAT_MDCT, + * with a flag of AV_TX_FULL_IMDCT for a replacement to av_imdct_calc. + */ +attribute_deprecated FFTContext *av_mdct_init(int nbits, int inverse, double scale); +attribute_deprecated void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input); +attribute_deprecated void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input); +attribute_deprecated void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input); +attribute_deprecated void av_mdct_end(FFTContext *s); /* Real Discrete Fourier Transform */ @@ -81,9 +101,14 @@ typedef struct RDFTContext RDFTContext; * Set up a real FFT. * @param nbits log2 of the length of the input array * @param trans the type of transform + * + * @deprecated use av_tx_init from libavutil/tx.h with a type of AV_TX_FLOAT_RDFT */ +attribute_deprecated RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans); +attribute_deprecated void av_rdft_calc(RDFTContext *s, FFTSample *data); +attribute_deprecated void av_rdft_end(RDFTContext *s); /* Discrete Cosine Transform */ @@ -106,13 +131,19 @@ enum DCTTransformType { * @param type the type of transform * * @note the first element of the input of DST-I is ignored + * + * @deprecated use av_tx_init from libavutil/tx.h with an appropriate type of AV_TX_FLOAT_DCT */ +attribute_deprecated DCTContext *av_dct_init(int nbits, enum DCTTransformType type); +attribute_deprecated void av_dct_calc(DCTContext *s, FFTSample *data); +attribute_deprecated void av_dct_end (DCTContext *s); /** * @} */ +#endif /* FF_API_AVFFT */ #endif /* AVCODEC_AVFFT_H */ diff --git a/src/third_party/ffmpeg/libavcodec/avpacket.c b/src/third_party/ffmpeg/libavcodec/avpacket.c index 5fef65e9..9ec1feb0 100644 --- a/src/third_party/ffmpeg/libavcodec/avpacket.c +++ b/src/third_party/ffmpeg/libavcodec/avpacket.c @@ -22,6 +22,7 @@ #include #include "libavutil/avassert.h" +#include "libavutil/avutil.h" #include "libavutil/intreadwrite.h" #include "libavutil/mathematics.h" #include "libavutil/mem.h" diff --git a/src/third_party/ffmpeg/libavcodec/bgmc.c b/src/third_party/ffmpeg/libavcodec/bgmc.c index 361f7c52..0e41a39e 100644 --- a/src/third_party/ffmpeg/libavcodec/bgmc.c +++ b/src/third_party/ffmpeg/libavcodec/bgmc.c @@ -457,7 +457,7 @@ static uint8_t *bgmc_lut_getp(uint8_t *lut, int *lut_status, int delta) /** Initialize the lookup table arrays */ -av_cold int ff_bgmc_init(AVCodecContext *avctx, +av_cold int ff_bgmc_init(void *logctx, uint8_t **cf_lut, int **cf_lut_status) { *cf_lut = av_malloc(sizeof(**cf_lut) * LUT_BUFF * 16 * LUT_SIZE); @@ -465,7 +465,7 @@ av_cold int ff_bgmc_init(AVCodecContext *avctx, if (!*cf_lut || !*cf_lut_status) { ff_bgmc_end(cf_lut, cf_lut_status); - av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n"); + av_log(logctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n"); return AVERROR(ENOMEM); } else { // initialize lut_status buffer to a value never used to compare against diff --git a/src/third_party/ffmpeg/libavcodec/bgmc.h b/src/third_party/ffmpeg/libavcodec/bgmc.h index 466df31a..81771d4a 100644 --- a/src/third_party/ffmpeg/libavcodec/bgmc.h +++ b/src/third_party/ffmpeg/libavcodec/bgmc.h @@ -30,11 +30,10 @@ #define AVCODEC_BGMC_H -#include "avcodec.h" #include "get_bits.h" -int ff_bgmc_init(AVCodecContext *avctx, uint8_t **cf_lut, int **cf_lut_status); +int ff_bgmc_init(void *logctx, uint8_t **cf_lut, int **cf_lut_status); void ff_bgmc_end(uint8_t **cf_lut, int **cf_lut_status); diff --git a/src/third_party/ffmpeg/libavcodec/bink.c b/src/third_party/ffmpeg/libavcodec/bink.c index e3822d68..804c1419 100644 --- a/src/third_party/ffmpeg/libavcodec/bink.c +++ b/src/third_party/ffmpeg/libavcodec/bink.c @@ -21,6 +21,7 @@ */ #include "libavutil/attributes.h" +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/internal.h" #include "libavutil/mem_internal.h" @@ -1299,8 +1300,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, emms_c(); if (c->version > 'b') { - av_frame_unref(c->last); - if ((ret = av_frame_ref(c->last, frame)) < 0) + if ((ret = av_frame_replace(c->last, frame)) < 0) return ret; } @@ -1318,9 +1318,9 @@ static av_cold void bink_init_vlcs(void) bink_trees[i].table = table + offset; bink_trees[i].table_allocated = 1 << maxbits; offset += bink_trees[i].table_allocated; - init_vlc(&bink_trees[i], maxbits, 16, + vlc_init(&bink_trees[i], maxbits, 16, bink_tree_lens[i], 1, 1, - bink_tree_bits[i], 1, 1, INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE); + bink_tree_bits[i], 1, 1, VLC_INIT_USE_STATIC | VLC_INIT_LE); } } diff --git a/src/third_party/ffmpeg/libavcodec/bitstream.h b/src/third_party/ffmpeg/libavcodec/bitstream.h index b60f0c29..35b7873b 100644 --- a/src/third_party/ffmpeg/libavcodec/bitstream.h +++ b/src/third_party/ffmpeg/libavcodec/bitstream.h @@ -102,6 +102,7 @@ # define bits_decode210 bits_decode210_le # define bits_apply_sign bits_apply_sign_le # define bits_read_vlc bits_read_vlc_le +# define bits_read_vlc_multi bits_read_vlc_multi_le #elif defined(BITS_DEFAULT_BE) @@ -130,6 +131,7 @@ # define bits_decode210 bits_decode210_be # define bits_apply_sign bits_apply_sign_be # define bits_read_vlc bits_read_vlc_be +# define bits_read_vlc_multi bits_read_vlc_multi_be #endif diff --git a/src/third_party/ffmpeg/libavcodec/bitstream_template.h b/src/third_party/ffmpeg/libavcodec/bitstream_template.h index 30bea84a..cf4aeff4 100644 --- a/src/third_party/ffmpeg/libavcodec/bitstream_template.h +++ b/src/third_party/ffmpeg/libavcodec/bitstream_template.h @@ -491,7 +491,7 @@ static inline int BS_FUNC(priv_set_idx)(BSCTX *bc, int code, int *n, /** * Parse a vlc code. * @param bits is the number of bits which will be read at once, must be - * identical to nb_bits in init_vlc() + * identical to nb_bits in vlc_init() * @param max_depth is the number of times bits bits must be read to completely * read the longest vlc code * = (max_vlc_length + bits - 1) / bits @@ -520,6 +520,35 @@ static inline int BS_FUNC(read_vlc)(BSCTX *bc, const VLCElem *table, return code; } +static inline int BS_FUNC(read_vlc_multi)(BSCTX *bc, uint8_t *dst, + const VLC_MULTI_ELEM *const Jtable, + const VLCElem *const table, + const int bits, const int max_depth) +{ + unsigned idx = BS_FUNC(peek)(bc, bits); + int ret, nb_bits, code, n = Jtable[idx].len; + if (Jtable[idx].num) { + AV_COPY64U(dst, Jtable[idx].val); + ret = Jtable[idx].num; + } else { + code = table[idx].sym; + n = table[idx].len; + if (max_depth > 1 && n < 0) { + BS_FUNC(priv_skip_remaining)(bc, bits); + code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); + if (max_depth > 2 && n < 0) { + BS_FUNC(priv_skip_remaining)(bc, nb_bits); + code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); + } + } + AV_WN16(dst, code); + ret = n > 0; + } + BS_FUNC(priv_skip_remaining)(bc, n); + + return ret; +} + #undef BSCTX #undef BS_FUNC #undef BS_JOIN3 diff --git a/src/third_party/ffmpeg/libavcodec/bonk.c b/src/third_party/ffmpeg/libavcodec/bonk.c index fbea91c7..6cd6a0af 100644 --- a/src/third_party/ffmpeg/libavcodec/bonk.c +++ b/src/third_party/ffmpeg/libavcodec/bonk.c @@ -277,7 +277,7 @@ static int predictor_calc_error(int *k, int *state, int order, int error) for (i = order-2; i >= 0; i--, k_ptr--, state_ptr--) { unsigned k_value = *k_ptr, state_value = *state_ptr; - x -= shift_down(k_value * (unsigned)state_value, LATTICE_SHIFT); + x -= (unsigned) shift_down(k_value * (unsigned)state_value, LATTICE_SHIFT); state_ptr[1] = state_value + shift_down(k_value * x, LATTICE_SHIFT); } diff --git a/src/third_party/ffmpeg/libavcodec/cavsdec.c b/src/third_party/ffmpeg/libavcodec/cavsdec.c index 37071dfb..b356da0b 100644 --- a/src/third_party/ffmpeg/libavcodec/cavsdec.c +++ b/src/third_party/ffmpeg/libavcodec/cavsdec.c @@ -26,6 +26,7 @@ */ #include "libavutil/avassert.h" +#include "libavutil/emms.h" #include "avcodec.h" #include "get_bits.h" #include "golomb.h" diff --git a/src/third_party/ffmpeg/libavcodec/cbs.c b/src/third_party/ffmpeg/libavcodec/cbs.c index 13a01bef..daf7f664 100644 --- a/src/third_party/ffmpeg/libavcodec/cbs.c +++ b/src/third_party/ffmpeg/libavcodec/cbs.c @@ -117,8 +117,9 @@ av_cold int ff_cbs_init(CodedBitstreamContext **ctx_ptr, ctx->decompose_unit_types = NULL; - ctx->trace_enable = 0; - ctx->trace_level = AV_LOG_TRACE; + ctx->trace_enable = 0; + ctx->trace_level = AV_LOG_TRACE; + ctx->trace_context = ctx; *ctx_ptr = ctx; return 0; @@ -496,19 +497,27 @@ void ff_cbs_trace_header(CodedBitstreamContext *ctx, av_log(ctx->log_ctx, ctx->trace_level, "%s\n", name); } -void ff_cbs_trace_syntax_element(CodedBitstreamContext *ctx, int position, - const char *str, const int *subscripts, - const char *bits, int64_t value) +void ff_cbs_trace_read_log(void *trace_context, + GetBitContext *gbc, int length, + const char *str, const int *subscripts, + int64_t value) { + CodedBitstreamContext *ctx = trace_context; char name[256]; + char bits[256]; size_t name_len, bits_len; int pad, subs, i, j, k, n; - - if (!ctx->trace_enable) - return; + int position; av_assert0(value >= INT_MIN && value <= UINT32_MAX); + position = get_bits_count(gbc); + + av_assert0(length < 256); + for (i = 0; i < length; i++) + bits[i] = get_bits1(gbc) ? '1' : '0'; + bits[length] = 0; + subs = subscripts ? subscripts[0] : 0; n = 0; for (i = j = 0; str[i];) { @@ -535,7 +544,7 @@ void ff_cbs_trace_syntax_element(CodedBitstreamContext *ctx, int position, av_assert0(n == subs); name_len = strlen(name); - bits_len = strlen(bits); + bits_len = length; if (name_len + bits_len > 60) pad = bits_len + 2; @@ -546,13 +555,47 @@ void ff_cbs_trace_syntax_element(CodedBitstreamContext *ctx, int position, position, name, pad, bits, value); } -int ff_cbs_read_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, - int width, const char *name, - const int *subscripts, uint32_t *write_to, - uint32_t range_min, uint32_t range_max) +void ff_cbs_trace_write_log(void *trace_context, + PutBitContext *pbc, int length, + const char *str, const int *subscripts, + int64_t value) +{ + CodedBitstreamContext *ctx = trace_context; + + // Ensure that the syntax element is written to the output buffer, + // make a GetBitContext pointed at the start position, then call the + // read log function which can read the bits back to log them. + + GetBitContext gbc; + int position; + + if (length > 0) { + PutBitContext flush; + flush = *pbc; + flush_put_bits(&flush); + } + + position = put_bits_count(pbc); + av_assert0(position >= length); + + init_get_bits(&gbc, pbc->buf, position); + + skip_bits_long(&gbc, position - length); + + ff_cbs_trace_read_log(ctx, &gbc, length, str, subscripts, value); +} + +static av_always_inline int cbs_read_unsigned(CodedBitstreamContext *ctx, + GetBitContext *gbc, + int width, const char *name, + const int *subscripts, + uint32_t *write_to, + uint32_t range_min, + uint32_t range_max) { uint32_t value; - int position; + + CBS_TRACE_READ_START(); av_assert0(width > 0 && width <= 32); @@ -562,21 +605,9 @@ int ff_cbs_read_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, return AVERROR_INVALIDDATA; } - if (ctx->trace_enable) - position = get_bits_count(gbc); - value = get_bits_long(gbc, width); - if (ctx->trace_enable) { - char bits[33]; - int i; - for (i = 0; i < width; i++) - bits[i] = value >> (width - i - 1) & 1 ? '1' : '0'; - bits[i] = 0; - - ff_cbs_trace_syntax_element(ctx, position, name, subscripts, - bits, value); - } + CBS_TRACE_READ_END(); if (value < range_min || value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " @@ -589,11 +620,29 @@ int ff_cbs_read_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, return 0; } +int ff_cbs_read_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, + int width, const char *name, + const int *subscripts, uint32_t *write_to, + uint32_t range_min, uint32_t range_max) +{ + return cbs_read_unsigned(ctx, gbc, width, name, subscripts, + write_to, range_min, range_max); +} + +int ff_cbs_read_simple_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, + int width, const char *name, uint32_t *write_to) +{ + return cbs_read_unsigned(ctx, gbc, width, name, NULL, + write_to, 0, UINT32_MAX); +} + int ff_cbs_write_unsigned(CodedBitstreamContext *ctx, PutBitContext *pbc, int width, const char *name, const int *subscripts, uint32_t value, uint32_t range_min, uint32_t range_max) { + CBS_TRACE_WRITE_START(); + av_assert0(width > 0 && width <= 32); if (value < range_min || value > range_max) { @@ -606,32 +655,31 @@ int ff_cbs_write_unsigned(CodedBitstreamContext *ctx, PutBitContext *pbc, if (put_bits_left(pbc) < width) return AVERROR(ENOSPC); - if (ctx->trace_enable) { - char bits[33]; - int i; - for (i = 0; i < width; i++) - bits[i] = value >> (width - i - 1) & 1 ? '1' : '0'; - bits[i] = 0; - - ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), - name, subscripts, bits, value); - } - if (width < 32) put_bits(pbc, width, value); else put_bits32(pbc, value); + CBS_TRACE_WRITE_END(); + return 0; } +int ff_cbs_write_simple_unsigned(CodedBitstreamContext *ctx, PutBitContext *pbc, + int width, const char *name, uint32_t value) +{ + return ff_cbs_write_unsigned(ctx, pbc, width, name, NULL, + value, 0, MAX_UINT_BITS(width)); +} + int ff_cbs_read_signed(CodedBitstreamContext *ctx, GetBitContext *gbc, int width, const char *name, const int *subscripts, int32_t *write_to, int32_t range_min, int32_t range_max) { int32_t value; - int position; + + CBS_TRACE_READ_START(); av_assert0(width > 0 && width <= 32); @@ -641,21 +689,9 @@ int ff_cbs_read_signed(CodedBitstreamContext *ctx, GetBitContext *gbc, return AVERROR_INVALIDDATA; } - if (ctx->trace_enable) - position = get_bits_count(gbc); - value = get_sbits_long(gbc, width); - if (ctx->trace_enable) { - char bits[33]; - int i; - for (i = 0; i < width; i++) - bits[i] = value & (1U << (width - i - 1)) ? '1' : '0'; - bits[i] = 0; - - ff_cbs_trace_syntax_element(ctx, position, name, subscripts, - bits, value); - } + CBS_TRACE_READ_END(); if (value < range_min || value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " @@ -673,6 +709,8 @@ int ff_cbs_write_signed(CodedBitstreamContext *ctx, PutBitContext *pbc, const int *subscripts, int32_t value, int32_t range_min, int32_t range_max) { + CBS_TRACE_WRITE_START(); + av_assert0(width > 0 && width <= 32); if (value < range_min || value > range_max) { @@ -685,22 +723,13 @@ int ff_cbs_write_signed(CodedBitstreamContext *ctx, PutBitContext *pbc, if (put_bits_left(pbc) < width) return AVERROR(ENOSPC); - if (ctx->trace_enable) { - char bits[33]; - int i; - for (i = 0; i < width; i++) - bits[i] = value & (1U << (width - i - 1)) ? '1' : '0'; - bits[i] = 0; - - ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), - name, subscripts, bits, value); - } - if (width < 32) put_sbits(pbc, width, value); else put_bits32(pbc, value); + CBS_TRACE_WRITE_END(); + return 0; } diff --git a/src/third_party/ffmpeg/libavcodec/cbs.h b/src/third_party/ffmpeg/libavcodec/cbs.h index b4131db5..ffb27977 100644 --- a/src/third_party/ffmpeg/libavcodec/cbs.h +++ b/src/third_party/ffmpeg/libavcodec/cbs.h @@ -168,6 +168,51 @@ typedef struct CodedBitstreamFragment { CodedBitstreamUnit *units; } CodedBitstreamFragment; + +struct CodedBitstreamContext; +struct GetBitContext; +struct PutBitContext; + +/** + * Callback type for read tracing. + * + * @param ctx User-set trace context. + * @param gbc A GetBitContext set at the start of the syntax + * element. This is a copy, the callee does not + * need to preserve it. + * @param length Length in bits of the syntax element. + * @param name String name of the syntax elements. + * @param subscripts If the syntax element is an array, a pointer to + * an array of subscripts into the array. + * @param value Parsed value of the syntax element. + */ +typedef void (*CBSTraceReadCallback)(void *trace_context, + struct GetBitContext *gbc, + int start_position, + const char *name, + const int *subscripts, + int64_t value); + +/** + * Callback type for write tracing. + * + * @param ctx User-set trace context. + * @param pbc A PutBitContext set at the end of the syntax + * element. The user must not modify this, but may + * inspect it to determine state. + * @param length Length in bits of the syntax element. + * @param name String name of the syntax elements. + * @param subscripts If the syntax element is an array, a pointer to + * an array of subscripts into the array. + * @param value Written value of the syntax element. + */ +typedef void (*CBSTraceWriteCallback)(void *trace_context, + struct PutBitContext *pbc, + int start_position, + const char *name, + const int *subscripts, + int64_t value); + /** * Context structure for coded bitstream operations. */ @@ -211,11 +256,29 @@ typedef struct CodedBitstreamContext { */ int trace_enable; /** - * Log level to use for trace output. + * Log level to use for default trace output. * * From AV_LOG_*; defaults to AV_LOG_TRACE. */ int trace_level; + /** + * User context pointer to pass to trace callbacks. + */ + void *trace_context; + /** + * Callback for read tracing. + * + * If tracing is enabled then this is called once for each syntax + * element parsed. + */ + CBSTraceReadCallback trace_read_callback; + /** + * Callback for write tracing. + * + * If tracing is enabled then this is called once for each syntax + * element written. + */ + CBSTraceWriteCallback trace_write_callback; /** * Write buffer. Used as intermediate buffer when writing units. @@ -450,4 +513,27 @@ void ff_cbs_discard_units(CodedBitstreamContext *ctx, enum AVDiscard skip, int flags); + +/** + * Helper function for read tracing which formats the syntax element + * and logs the result. + * + * Trace context should be set to the CodedBitstreamContext. + */ +void ff_cbs_trace_read_log(void *trace_context, + struct GetBitContext *gbc, int length, + const char *str, const int *subscripts, + int64_t value); + +/** + * Helper function for write tracing which formats the syntax element + * and logs the result. + * + * Trace context should be set to the CodedBitstreamContext. + */ +void ff_cbs_trace_write_log(void *trace_context, + struct PutBitContext *pbc, int length, + const char *str, const int *subscripts, + int64_t value); + #endif /* AVCODEC_CBS_H */ diff --git a/src/third_party/ffmpeg/libavcodec/cbs_av1.c b/src/third_party/ffmpeg/libavcodec/cbs_av1.c index 8788fee0..ed9a7b80 100644 --- a/src/third_party/ffmpeg/libavcodec/cbs_av1.c +++ b/src/third_party/ffmpeg/libavcodec/cbs_av1.c @@ -20,10 +20,10 @@ #include "libavutil/opt.h" #include "libavutil/pixfmt.h" -#include "avcodec.h" #include "cbs.h" #include "cbs_internal.h" #include "cbs_av1.h" +#include "defs.h" static int cbs_av1_read_uvlc(CodedBitstreamContext *ctx, GetBitContext *gbc, @@ -31,10 +31,8 @@ static int cbs_av1_read_uvlc(CodedBitstreamContext *ctx, GetBitContext *gbc, uint32_t range_min, uint32_t range_max) { uint32_t zeroes, bits_value, value; - int position; - if (ctx->trace_enable) - position = get_bits_count(gbc); + CBS_TRACE_READ_START(); zeroes = 0; while (1) { @@ -50,6 +48,9 @@ static int cbs_av1_read_uvlc(CodedBitstreamContext *ctx, GetBitContext *gbc, } if (zeroes >= 32) { + // Note that the spec allows an arbitrarily large number of + // zero bits followed by a one bit in this case, but the + // libaom implementation does not support it. value = MAX_UINT_BITS(32); } else { if (get_bits_left(gbc) < zeroes) { @@ -62,36 +63,7 @@ static int cbs_av1_read_uvlc(CodedBitstreamContext *ctx, GetBitContext *gbc, value = bits_value + (UINT32_C(1) << zeroes) - 1; } - if (ctx->trace_enable) { - char bits[65]; - int i, j, k; - - if (zeroes >= 32) { - while (zeroes > 32) { - k = FFMIN(zeroes - 32, 32); - for (i = 0; i < k; i++) - bits[i] = '0'; - bits[i] = 0; - ff_cbs_trace_syntax_element(ctx, position, name, - NULL, bits, 0); - zeroes -= k; - position += k; - } - } - - for (i = 0; i < zeroes; i++) - bits[i] = '0'; - bits[i++] = '1'; - - if (zeroes < 32) { - for (j = 0; j < zeroes; j++) - bits[i++] = (bits_value >> (zeroes - j - 1) & 1) ? '1' : '0'; - } - - bits[i] = 0; - ff_cbs_trace_syntax_element(ctx, position, name, - NULL, bits, value); - } + CBS_TRACE_READ_END_NO_SUBSCRIPTS(); if (value < range_min || value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " @@ -109,7 +81,9 @@ static int cbs_av1_write_uvlc(CodedBitstreamContext *ctx, PutBitContext *pbc, uint32_t range_min, uint32_t range_max) { uint32_t v; - int position, zeroes; + int zeroes; + + CBS_TRACE_WRITE_START(); if (value < range_min || value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " @@ -118,28 +92,17 @@ static int cbs_av1_write_uvlc(CodedBitstreamContext *ctx, PutBitContext *pbc, return AVERROR_INVALIDDATA; } - if (ctx->trace_enable) - position = put_bits_count(pbc); - zeroes = av_log2(value + 1); v = value - (1U << zeroes) + 1; + + if (put_bits_left(pbc) < 2 * zeroes + 1) + return AVERROR(ENOSPC); + put_bits(pbc, zeroes, 0); put_bits(pbc, 1, 1); put_bits(pbc, zeroes, v); - if (ctx->trace_enable) { - char bits[65]; - int i, j; - i = 0; - for (j = 0; j < zeroes; j++) - bits[i++] = '0'; - bits[i++] = '1'; - for (j = 0; j < zeroes; j++) - bits[i++] = (v >> (zeroes - j - 1) & 1) ? '1' : '0'; - bits[i++] = 0; - ff_cbs_trace_syntax_element(ctx, position, name, NULL, - bits, value); - } + CBS_TRACE_WRITE_END_NO_SUBSCRIPTS(); return 0; } @@ -148,20 +111,19 @@ static int cbs_av1_read_leb128(CodedBitstreamContext *ctx, GetBitContext *gbc, const char *name, uint64_t *write_to) { uint64_t value; - int position, err, i; + uint32_t byte; + int i; - if (ctx->trace_enable) - position = get_bits_count(gbc); + CBS_TRACE_READ_START(); value = 0; for (i = 0; i < 8; i++) { - int subscript[2] = { 1, i }; - uint32_t byte; - err = ff_cbs_read_unsigned(ctx, gbc, 8, "leb128_byte[i]", subscript, - &byte, 0x00, 0xff); - if (err < 0) - return err; - + if (get_bits_left(gbc) < 8) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid leb128 at " + "%s: bitstream ended.\n", name); + return AVERROR_INVALIDDATA; + } + byte = get_bits(gbc, 8); value |= (uint64_t)(byte & 0x7f) << (i * 7); if (!(byte & 0x80)) break; @@ -170,39 +132,44 @@ static int cbs_av1_read_leb128(CodedBitstreamContext *ctx, GetBitContext *gbc, if (value > UINT32_MAX) return AVERROR_INVALIDDATA; - if (ctx->trace_enable) - ff_cbs_trace_syntax_element(ctx, position, name, NULL, "", value); + CBS_TRACE_READ_END_NO_SUBSCRIPTS(); *write_to = value; return 0; } static int cbs_av1_write_leb128(CodedBitstreamContext *ctx, PutBitContext *pbc, - const char *name, uint64_t value) + const char *name, uint64_t value, int fixed_length) { - int position, err, len, i; + int len, i; uint8_t byte; + CBS_TRACE_WRITE_START(); + len = (av_log2(value) + 7) / 7; - if (ctx->trace_enable) - position = put_bits_count(pbc); + if (fixed_length) { + if (fixed_length < len) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "OBU is too large for " + "fixed length size field (%d > %d).\n", + len, fixed_length); + return AVERROR(EINVAL); + } + len = fixed_length; + } for (i = 0; i < len; i++) { - int subscript[2] = { 1, i }; + if (put_bits_left(pbc) < 8) + return AVERROR(ENOSPC); byte = value >> (7 * i) & 0x7f; if (i < len - 1) byte |= 0x80; - err = ff_cbs_write_unsigned(ctx, pbc, 8, "leb128_byte[i]", subscript, - byte, 0x00, 0xff); - if (err < 0) - return err; + put_bits(pbc, 8, byte); } - if (ctx->trace_enable) - ff_cbs_trace_syntax_element(ctx, position, name, NULL, "", value); + CBS_TRACE_WRITE_END_NO_SUBSCRIPTS(); return 0; } @@ -212,13 +179,12 @@ static int cbs_av1_read_ns(CodedBitstreamContext *ctx, GetBitContext *gbc, const int *subscripts, uint32_t *write_to) { uint32_t m, v, extra_bit, value; - int position, w; + int w; + + CBS_TRACE_READ_START(); av_assert0(n > 0); - if (ctx->trace_enable) - position = get_bits_count(gbc); - w = av_log2(n) + 1; m = (1 << w) - n; @@ -240,18 +206,7 @@ static int cbs_av1_read_ns(CodedBitstreamContext *ctx, GetBitContext *gbc, value = (v << 1) - m + extra_bit; } - if (ctx->trace_enable) { - char bits[33]; - int i; - for (i = 0; i < w - 1; i++) - bits[i] = (v >> i & 1) ? '1' : '0'; - if (v >= m) - bits[i++] = extra_bit ? '1' : '0'; - bits[i] = 0; - - ff_cbs_trace_syntax_element(ctx, position, - name, subscripts, bits, value); - } + CBS_TRACE_READ_END(); *write_to = value; return 0; @@ -262,7 +217,8 @@ static int cbs_av1_write_ns(CodedBitstreamContext *ctx, PutBitContext *pbc, const int *subscripts, uint32_t value) { uint32_t w, m, v, extra_bit; - int position; + + CBS_TRACE_WRITE_START(); if (value > n) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " @@ -271,9 +227,6 @@ static int cbs_av1_write_ns(CodedBitstreamContext *ctx, PutBitContext *pbc, return AVERROR_INVALIDDATA; } - if (ctx->trace_enable) - position = put_bits_count(pbc); - w = av_log2(n) + 1; m = (1 << w) - n; @@ -290,18 +243,7 @@ static int cbs_av1_write_ns(CodedBitstreamContext *ctx, PutBitContext *pbc, put_bits(pbc, 1, extra_bit); } - if (ctx->trace_enable) { - char bits[33]; - int i; - for (i = 0; i < w - 1; i++) - bits[i] = (v >> i & 1) ? '1' : '0'; - if (value >= m) - bits[i++] = extra_bit ? '1' : '0'; - bits[i] = 0; - - ff_cbs_trace_syntax_element(ctx, position, - name, subscripts, bits, value); - } + CBS_TRACE_WRITE_END(); return 0; } @@ -311,33 +253,24 @@ static int cbs_av1_read_increment(CodedBitstreamContext *ctx, GetBitContext *gbc const char *name, uint32_t *write_to) { uint32_t value; - int position, i; - char bits[33]; - av_assert0(range_min <= range_max && range_max - range_min < sizeof(bits) - 1); - if (ctx->trace_enable) - position = get_bits_count(gbc); + CBS_TRACE_READ_START(); - for (i = 0, value = range_min; value < range_max;) { + av_assert0(range_min <= range_max && range_max - range_min < 32); + + for (value = range_min; value < range_max;) { if (get_bits_left(gbc) < 1) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid increment value at " "%s: bitstream ended.\n", name); return AVERROR_INVALIDDATA; } - if (get_bits1(gbc)) { - bits[i++] = '1'; + if (get_bits1(gbc)) ++value; - } else { - bits[i++] = '0'; + else break; - } } - if (ctx->trace_enable) { - bits[i] = 0; - ff_cbs_trace_syntax_element(ctx, position, - name, NULL, bits, value); - } + CBS_TRACE_READ_END_NO_SUBSCRIPTS(); *write_to = value; return 0; @@ -349,6 +282,8 @@ static int cbs_av1_write_increment(CodedBitstreamContext *ctx, PutBitContext *pb { int len; + CBS_TRACE_WRITE_START(); + av_assert0(range_min <= range_max && range_max - range_min < 32); if (value < range_min || value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " @@ -364,23 +299,11 @@ static int cbs_av1_write_increment(CodedBitstreamContext *ctx, PutBitContext *pb if (put_bits_left(pbc) < len) return AVERROR(ENOSPC); - if (ctx->trace_enable) { - char bits[33]; - int i; - for (i = 0; i < len; i++) { - if (range_min + i == value) - bits[i] = '0'; - else - bits[i] = '1'; - } - bits[i] = 0; - ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), - name, NULL, bits, value); - } - if (len > 0) put_bits(pbc, len, (1 << len) - 1 - (value != range_max)); + CBS_TRACE_WRITE_END_NO_SUBSCRIPTS(); + return 0; } @@ -388,12 +311,10 @@ static int cbs_av1_read_subexp(CodedBitstreamContext *ctx, GetBitContext *gbc, uint32_t range_max, const char *name, const int *subscripts, uint32_t *write_to) { - uint32_t value; - int position, err; - uint32_t max_len, len, range_offset, range_bits; + uint32_t value, max_len, len, range_offset, range_bits; + int err; - if (ctx->trace_enable) - position = get_bits_count(gbc); + CBS_TRACE_READ_START(); av_assert0(range_max > 0); max_len = av_log2(range_max - 1) - 3; @@ -412,9 +333,8 @@ static int cbs_av1_read_subexp(CodedBitstreamContext *ctx, GetBitContext *gbc, } if (len < max_len) { - err = ff_cbs_read_unsigned(ctx, gbc, range_bits, - "subexp_bits", NULL, &value, - 0, MAX_UINT_BITS(range_bits)); + err = ff_cbs_read_simple_unsigned(ctx, gbc, range_bits, + "subexp_bits", &value); if (err < 0) return err; @@ -426,9 +346,7 @@ static int cbs_av1_read_subexp(CodedBitstreamContext *ctx, GetBitContext *gbc, } value += range_offset; - if (ctx->trace_enable) - ff_cbs_trace_syntax_element(ctx, position, - name, subscripts, "", value); + CBS_TRACE_READ_END_VALUE_ONLY(); *write_to = value; return err; @@ -438,9 +356,11 @@ static int cbs_av1_write_subexp(CodedBitstreamContext *ctx, PutBitContext *pbc, uint32_t range_max, const char *name, const int *subscripts, uint32_t value) { - int position, err; + int err; uint32_t max_len, len, range_offset, range_bits; + CBS_TRACE_WRITE_START(); + if (value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " "%"PRIu32", but must be in [0,%"PRIu32"].\n", @@ -448,9 +368,6 @@ static int cbs_av1_write_subexp(CodedBitstreamContext *ctx, PutBitContext *pbc, return AVERROR_INVALIDDATA; } - if (ctx->trace_enable) - position = put_bits_count(pbc); - av_assert0(range_max > 0); max_len = av_log2(range_max - 1) - 3; @@ -476,10 +393,9 @@ static int cbs_av1_write_subexp(CodedBitstreamContext *ctx, PutBitContext *pbc, return err; if (len < max_len) { - err = ff_cbs_write_unsigned(ctx, pbc, range_bits, - "subexp_bits", NULL, - value - range_offset, - 0, MAX_UINT_BITS(range_bits)); + err = ff_cbs_write_simple_unsigned(ctx, pbc, range_bits, + "subexp_bits", + value - range_offset); if (err < 0) return err; @@ -491,9 +407,7 @@ static int cbs_av1_write_subexp(CodedBitstreamContext *ctx, PutBitContext *pbc, return err; } - if (ctx->trace_enable) - ff_cbs_trace_syntax_element(ctx, position, - name, subscripts, "", value); + CBS_TRACE_WRITE_END_VALUE_ONLY(); return err; } @@ -546,8 +460,6 @@ static size_t cbs_av1_get_payload_bytes_left(GetBitContext *gbc) #define SUBSCRIPTS(subs, ...) (subs > 0 ? ((int[subs + 1]){ subs, __VA_ARGS__ }) : NULL) -#define fb(width, name) \ - xf(width, name, current->name, 0, MAX_UINT_BITS(width), 0, ) #define fc(width, name, range_min, range_max) \ xf(width, name, current->name, range_min, range_max, 0, ) #define flag(name) fb(1, name) @@ -573,6 +485,13 @@ static size_t cbs_av1_get_payload_bytes_left(GetBitContext *gbc) #define READWRITE read #define RWContext GetBitContext +#define fb(width, name) do { \ + uint32_t value; \ + CHECK(ff_cbs_read_simple_unsigned(ctx, rw, width, \ + #name, &value)); \ + current->name = value; \ + } while (0) + #define xf(width, name, var, range_min, range_max, subs, ...) do { \ uint32_t value; \ CHECK(ff_cbs_read_unsigned(ctx, rw, width, #name, \ @@ -645,6 +564,7 @@ static size_t cbs_av1_get_payload_bytes_left(GetBitContext *gbc) #undef READ #undef READWRITE #undef RWContext +#undef fb #undef xf #undef xsu #undef uvlc @@ -661,6 +581,11 @@ static size_t cbs_av1_get_payload_bytes_left(GetBitContext *gbc) #define READWRITE write #define RWContext PutBitContext +#define fb(width, name) do { \ + CHECK(ff_cbs_write_simple_unsigned(ctx, rw, width, #name, \ + current->name)); \ + } while (0) + #define xf(width, name, var, range_min, range_max, subs, ...) do { \ CHECK(ff_cbs_write_unsigned(ctx, rw, width, #name, \ SUBSCRIPTS(subs, __VA_ARGS__), \ @@ -703,7 +628,7 @@ static size_t cbs_av1_get_payload_bytes_left(GetBitContext *gbc) } while (0) #define leb128(name) do { \ - CHECK(cbs_av1_write_leb128(ctx, rw, #name, current->name)); \ + CHECK(cbs_av1_write_leb128(ctx, rw, #name, current->name, 0)); \ } while (0) #define infer(name, value) do { \ @@ -723,6 +648,7 @@ static size_t cbs_av1_get_payload_bytes_left(GetBitContext *gbc) #undef WRITE #undef READWRITE #undef RWContext +#undef fb #undef xf #undef xsu #undef uvlc @@ -1086,9 +1012,14 @@ static int cbs_av1_write_obu(CodedBitstreamContext *ctx, if (obu->header.obu_has_size_field) { pbc_tmp = *pbc; - // Add space for the size field to fill later. - put_bits32(pbc, 0); - put_bits32(pbc, 0); + if (priv->fixed_obu_size_length) { + for (int i = 0; i < priv->fixed_obu_size_length; i++) + put_bits(pbc, 8, 0); + } else { + // Add space for the size field to fill later. + put_bits32(pbc, 0); + put_bits32(pbc, 0); + } } td = NULL; @@ -1208,7 +1139,8 @@ static int cbs_av1_write_obu(CodedBitstreamContext *ctx, end_pos /= 8; *pbc = pbc_tmp; - err = cbs_av1_write_leb128(ctx, pbc, "obu_size", obu->obu_size); + err = cbs_av1_write_leb128(ctx, pbc, "obu_size", obu->obu_size, + priv->fixed_obu_size_length); if (err < 0) goto error; @@ -1225,8 +1157,13 @@ static int cbs_av1_write_obu(CodedBitstreamContext *ctx, } if (obu->obu_size > 0) { - memmove(pbc->buf + data_pos, - pbc->buf + start_pos, header_size); + if (!priv->fixed_obu_size_length) { + memmove(pbc->buf + data_pos, + pbc->buf + start_pos, header_size); + } else { + // The size was fixed so the following data was + // already written in the correct place. + } skip_put_bytes(pbc, header_size); if (td) { @@ -1345,6 +1282,8 @@ static const CodedBitstreamUnitTypeDescriptor cbs_av1_unit_types[] = { static const AVOption cbs_av1_options[] = { { "operating_point", "Set operating point to select layers to parse from a scalable bitstream", OFFSET(operating_point), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, AV1_MAX_OPERATING_POINTS - 1, 0 }, + { "fixed_obu_size_length", "Set fixed length of the obu_size field", + OFFSET(fixed_obu_size_length), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 8, 0 }, { NULL } }; diff --git a/src/third_party/ffmpeg/libavcodec/cbs_av1.h b/src/third_party/ffmpeg/libavcodec/cbs_av1.h index 64dfdce9..79242571 100644 --- a/src/third_party/ffmpeg/libavcodec/cbs_av1.h +++ b/src/third_party/ffmpeg/libavcodec/cbs_av1.h @@ -467,6 +467,10 @@ typedef struct CodedBitstreamAV1Context { // AVOptions int operating_point; + // When writing, fix the length in bytes of the obu_size field. + // Writing will fail with an error if an OBU larger than can be + // represented by the fixed size is encountered. + int fixed_obu_size_length; } CodedBitstreamAV1Context; diff --git a/src/third_party/ffmpeg/libavcodec/cbs_av1_syntax_template.c b/src/third_party/ffmpeg/libavcodec/cbs_av1_syntax_template.c index a747e177..3be1f2d3 100644 --- a/src/third_party/ffmpeg/libavcodec/cbs_av1_syntax_template.c +++ b/src/third_party/ffmpeg/libavcodec/cbs_av1_syntax_template.c @@ -82,7 +82,7 @@ static int FUNC(color_config)(CodedBitstreamContext *ctx, RWContext *rw, flag(high_bitdepth); - if (seq_profile == FF_PROFILE_AV1_PROFESSIONAL && + if (seq_profile == AV_PROFILE_AV1_PROFESSIONAL && current->high_bitdepth) { flag(twelve_bit); priv->bit_depth = current->twelve_bit ? 12 : 10; @@ -90,7 +90,7 @@ static int FUNC(color_config)(CodedBitstreamContext *ctx, RWContext *rw, priv->bit_depth = current->high_bitdepth ? 10 : 8; } - if (seq_profile == FF_PROFILE_AV1_HIGH) + if (seq_profile == AV_PROFILE_AV1_HIGH) infer(mono_chrome, 0); else flag(mono_chrome); @@ -126,10 +126,10 @@ static int FUNC(color_config)(CodedBitstreamContext *ctx, RWContext *rw, } else { flag(color_range); - if (seq_profile == FF_PROFILE_AV1_MAIN) { + if (seq_profile == AV_PROFILE_AV1_MAIN) { infer(subsampling_x, 1); infer(subsampling_y, 1); - } else if (seq_profile == FF_PROFILE_AV1_HIGH) { + } else if (seq_profile == AV_PROFILE_AV1_HIGH) { infer(subsampling_x, 0); infer(subsampling_y, 0); } else { @@ -190,8 +190,8 @@ static int FUNC(sequence_header_obu)(CodedBitstreamContext *ctx, RWContext *rw, HEADER("Sequence Header"); - fc(3, seq_profile, FF_PROFILE_AV1_MAIN, - FF_PROFILE_AV1_PROFESSIONAL); + fc(3, seq_profile, AV_PROFILE_AV1_MAIN, + AV_PROFILE_AV1_PROFESSIONAL); flag(still_picture); flag(reduced_still_picture_header); @@ -1028,9 +1028,9 @@ static int FUNC(read_tx_mode)(CodedBitstreamContext *ctx, RWContext *rw, int err; if (priv->coded_lossless) - infer(tx_mode, 0); + infer(tx_mode, AV1_ONLY_4X4); else - increment(tx_mode, 1, 2); + increment(tx_mode, AV1_TX_MODE_LARGEST, AV1_TX_MODE_SELECT); return 0; } diff --git a/src/third_party/ffmpeg/libavcodec/cbs_bsf.c b/src/third_party/ffmpeg/libavcodec/cbs_bsf.c index 069f6e99..b2528548 100644 --- a/src/third_party/ffmpeg/libavcodec/cbs_bsf.c +++ b/src/third_party/ffmpeg/libavcodec/cbs_bsf.c @@ -123,6 +123,11 @@ int ff_cbs_bsf_generic_init(AVBSFContext *bsf, const CBSBSFType *type) if (err < 0) return err; + ctx->output->trace_enable = 1; + ctx->output->trace_level = AV_LOG_TRACE; + ctx->output->trace_context = ctx->output; + ctx->output->trace_write_callback = ff_cbs_trace_write_log; + if (bsf->par_in->extradata) { err = ff_cbs_read_extradata(ctx->input, frag, bsf->par_in); if (err < 0) { diff --git a/src/third_party/ffmpeg/libavcodec/cbs_h2645.c b/src/third_party/ffmpeg/libavcodec/cbs_h2645.c index 34c5d1d3..0a1c8ea4 100644 --- a/src/third_party/ffmpeg/libavcodec/cbs_h2645.c +++ b/src/third_party/ffmpeg/libavcodec/cbs_h2645.c @@ -36,41 +36,38 @@ static int cbs_read_ue_golomb(CodedBitstreamContext *ctx, GetBitContext *gbc, uint32_t *write_to, uint32_t range_min, uint32_t range_max) { - uint32_t value; - int position, i, j; - unsigned int k; - char bits[65]; + uint32_t leading_bits, value; + int max_length, leading_zeroes; - position = get_bits_count(gbc); + CBS_TRACE_READ_START(); - for (i = 0; i < 32; i++) { - if (get_bits_left(gbc) < i + 1) { + max_length = FFMIN(get_bits_left(gbc), 32); + + leading_bits = show_bits_long(gbc, max_length); + if (leading_bits == 0) { + if (max_length >= 32) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid ue-golomb code at " + "%s: more than 31 zeroes.\n", name); + return AVERROR_INVALIDDATA; + } else { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid ue-golomb code at " "%s: bitstream ended.\n", name); return AVERROR_INVALIDDATA; } - k = get_bits1(gbc); - bits[i] = k ? '1' : '0'; - if (k) - break; } - if (i >= 32) { + + leading_zeroes = max_length - 1 - av_log2(leading_bits); + skip_bits_long(gbc, leading_zeroes); + + if (get_bits_left(gbc) < leading_zeroes + 1) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid ue-golomb code at " - "%s: more than 31 zeroes.\n", name); + "%s: bitstream ended.\n", name); return AVERROR_INVALIDDATA; } - value = 1; - for (j = 0; j < i; j++) { - k = get_bits1(gbc); - bits[i + j + 1] = k ? '1' : '0'; - value = value << 1 | k; - } - bits[i + j + 1] = 0; - --value; - if (ctx->trace_enable) - ff_cbs_trace_syntax_element(ctx, position, name, subscripts, - bits, value); + value = get_bits_long(gbc, leading_zeroes + 1) - 1; + + CBS_TRACE_READ_END(); if (value < range_min || value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " @@ -88,45 +85,44 @@ static int cbs_read_se_golomb(CodedBitstreamContext *ctx, GetBitContext *gbc, int32_t *write_to, int32_t range_min, int32_t range_max) { + uint32_t leading_bits, unsigned_value; + int max_length, leading_zeroes; int32_t value; - int position, i, j; - unsigned int k; - uint32_t v; - char bits[65]; - position = get_bits_count(gbc); + CBS_TRACE_READ_START(); - for (i = 0; i < 32; i++) { - if (get_bits_left(gbc) < i + 1) { + max_length = FFMIN(get_bits_left(gbc), 32); + + leading_bits = show_bits_long(gbc, max_length); + if (leading_bits == 0) { + if (max_length >= 32) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid se-golomb code at " + "%s: more than 31 zeroes.\n", name); + return AVERROR_INVALIDDATA; + } else { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid se-golomb code at " "%s: bitstream ended.\n", name); return AVERROR_INVALIDDATA; } - k = get_bits1(gbc); - bits[i] = k ? '1' : '0'; - if (k) - break; } - if (i >= 32) { + + leading_zeroes = max_length - 1 - av_log2(leading_bits); + skip_bits_long(gbc, leading_zeroes); + + if (get_bits_left(gbc) < leading_zeroes + 1) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid se-golomb code at " - "%s: more than 31 zeroes.\n", name); + "%s: bitstream ended.\n", name); return AVERROR_INVALIDDATA; } - v = 1; - for (j = 0; j < i; j++) { - k = get_bits1(gbc); - bits[i + j + 1] = k ? '1' : '0'; - v = v << 1 | k; - } - bits[i + j + 1] = 0; - if (v & 1) - value = -(int32_t)(v / 2); - else - value = v / 2; - if (ctx->trace_enable) - ff_cbs_trace_syntax_element(ctx, position, name, subscripts, - bits, value); + unsigned_value = get_bits_long(gbc, leading_zeroes + 1); + + if (unsigned_value & 1) + value = -(int32_t)(unsigned_value / 2); + else + value = unsigned_value / 2; + + CBS_TRACE_READ_END(); if (value < range_min || value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " @@ -146,6 +142,8 @@ static int cbs_write_ue_golomb(CodedBitstreamContext *ctx, PutBitContext *pbc, { int len; + CBS_TRACE_WRITE_START(); + if (value < range_min || value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " "%"PRIu32", but must be in [%"PRIu32",%"PRIu32"].\n", @@ -158,27 +156,14 @@ static int cbs_write_ue_golomb(CodedBitstreamContext *ctx, PutBitContext *pbc, if (put_bits_left(pbc) < 2 * len + 1) return AVERROR(ENOSPC); - if (ctx->trace_enable) { - char bits[65]; - int i; - - for (i = 0; i < len; i++) - bits[i] = '0'; - bits[len] = '1'; - for (i = 0; i < len; i++) - bits[len + i + 1] = (value + 1) >> (len - i - 1) & 1 ? '1' : '0'; - bits[len + len + 1] = 0; - - ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), - name, subscripts, bits, value); - } - put_bits(pbc, len, 0); if (len + 1 < 32) put_bits(pbc, len + 1, value + 1); else put_bits32(pbc, value + 1); + CBS_TRACE_WRITE_END(); + return 0; } @@ -190,6 +175,8 @@ static int cbs_write_se_golomb(CodedBitstreamContext *ctx, PutBitContext *pbc, int len; uint32_t uvalue; + CBS_TRACE_WRITE_START(); + if (value < range_min || value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " "%"PRId32", but must be in [%"PRId32",%"PRId32"].\n", @@ -209,27 +196,14 @@ static int cbs_write_se_golomb(CodedBitstreamContext *ctx, PutBitContext *pbc, if (put_bits_left(pbc) < 2 * len + 1) return AVERROR(ENOSPC); - if (ctx->trace_enable) { - char bits[65]; - int i; - - for (i = 0; i < len; i++) - bits[i] = '0'; - bits[len] = '1'; - for (i = 0; i < len; i++) - bits[len + i + 1] = (uvalue + 1) >> (len - i - 1) & 1 ? '1' : '0'; - bits[len + len + 1] = 0; - - ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), - name, subscripts, bits, value); - } - put_bits(pbc, len, 0); if (len + 1 < 32) put_bits(pbc, len + 1, uvalue + 1); else put_bits32(pbc, uvalue + 1); + CBS_TRACE_WRITE_END(); + return 0; } @@ -264,8 +238,6 @@ static int cbs_h265_payload_extension_present(GetBitContext *gbc, uint32_t paylo #define u(width, name, range_min, range_max) \ xu(width, name, current->name, range_min, range_max, 0, ) -#define ub(width, name) \ - xu(width, name, current->name, 0, MAX_UINT_BITS(width), 0, ) #define flag(name) ub(1, name) #define ue(name, range_min, range_max) \ xue(name, current->name, range_min, range_max, 0, ) @@ -301,6 +273,12 @@ static int cbs_h265_payload_extension_present(GetBitContext *gbc, uint32_t paylo #define READWRITE read #define RWContext GetBitContext +#define ub(width, name) do { \ + uint32_t value; \ + CHECK(ff_cbs_read_simple_unsigned(ctx, rw, width, #name, \ + &value)); \ + current->name = value; \ + } while (0) #define xu(width, name, var, range_min, range_max, subs, ...) do { \ uint32_t value; \ CHECK(ff_cbs_read_unsigned(ctx, rw, width, #name, \ @@ -379,6 +357,7 @@ static int cbs_h2645_read_more_rbsp_data(GetBitContext *gbc) #undef READ #undef READWRITE #undef RWContext +#undef ub #undef xu #undef xi #undef xue @@ -394,6 +373,11 @@ static int cbs_h2645_read_more_rbsp_data(GetBitContext *gbc) #define READWRITE write #define RWContext PutBitContext +#define ub(width, name) do { \ + uint32_t value = current->name; \ + CHECK(ff_cbs_write_simple_unsigned(ctx, rw, width, #name, \ + value)); \ + } while (0) #define xu(width, name, var, range_min, range_max, subs, ...) do { \ uint32_t value = var; \ CHECK(ff_cbs_write_unsigned(ctx, rw, width, #name, \ @@ -461,6 +445,7 @@ static int cbs_h2645_read_more_rbsp_data(GetBitContext *gbc) #undef WRITE #undef READWRITE #undef RWContext +#undef ub #undef xu #undef xi #undef xue @@ -695,7 +680,7 @@ static int cbs_h2645_split_fragment(CodedBitstreamContext *ctx, int nal_unit_type = bytestream2_get_byte(&gbc) & 0x1f; unsigned int num_nalus = 1; if(nal_unit_type != VVC_DCI_NUT && nal_unit_type != VVC_OPI_NUT) - num_nalus = bytestream2_get_be16u(&gbc); + num_nalus = bytestream2_get_be16(&gbc); start = bytestream2_tell(&gbc); for(i = 0; i < num_nalus; i++) { diff --git a/src/third_party/ffmpeg/libavcodec/cbs_h266.h b/src/third_party/ffmpeg/libavcodec/cbs_h266.h index 0196f46b..3a6f6d96 100644 --- a/src/third_party/ffmpeg/libavcodec/cbs_h266.h +++ b/src/third_party/ffmpeg/libavcodec/cbs_h266.h @@ -666,6 +666,9 @@ typedef struct H266RawPredWeightTable { int8_t luma_offset_l1[15]; int8_t delta_chroma_weight_l1[15][2]; int16_t delta_chroma_offset_l1[15][2]; + + uint8_t num_weights_l0; ///< NumWeightsL0 + uint8_t num_weights_l1; ///< NumWeightsL1 } H266RawPredWeightTable; typedef struct H266RawPictureHeader { @@ -828,6 +831,10 @@ typedef struct H266RawSliceHeader { uint8_t sh_entry_offset_len_minus1; uint32_t sh_entry_point_offset_minus1[VVC_MAX_ENTRY_POINTS]; + // derived values + uint32_t num_entry_points; ///< NumEntryPoints + uint8_t num_ref_idx_active[2]; ///< NumRefIdxActive[] + } H266RawSliceHeader; typedef struct H266RawSlice { diff --git a/src/third_party/ffmpeg/libavcodec/cbs_h266_syntax_template.c b/src/third_party/ffmpeg/libavcodec/cbs_h266_syntax_template.c index dce0216f..aecc4d79 100644 --- a/src/third_party/ffmpeg/libavcodec/cbs_h266_syntax_template.c +++ b/src/third_party/ffmpeg/libavcodec/cbs_h266_syntax_template.c @@ -891,6 +891,8 @@ static int FUNC(vps) (CodedBitstreamContext *ctx, RWContext *rw, } } } + if (!num_output_layers_in_ols[i]) + return AVERROR_INVALIDDATA; } for (i = 1; i < total_num_olss; i++) { int num_layers_in_ols = 0; @@ -1140,6 +1142,8 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw, if (current->sps_num_subpics_minus1 > 0) { int wlen = av_ceil_log2(tmp_width_val); int hlen = av_ceil_log2(tmp_height_val); + infer(sps_subpic_ctu_top_left_x[0], 0); + infer(sps_subpic_ctu_top_left_y[0], 0); if (current->sps_pic_width_max_in_luma_samples > ctb_size_y) ubs(wlen, sps_subpic_width_minus1[0], 1, 0); else @@ -1147,7 +1151,7 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw, if (current->sps_pic_height_max_in_luma_samples > ctb_size_y) ubs(hlen, sps_subpic_height_minus1[0], 1, 0); else - infer(sps_subpic_height_minus1[0], tmp_height_val); + infer(sps_subpic_height_minus1[0], tmp_height_val - 1); if (!current->sps_independent_subpics_flag) { flags(sps_subpic_treated_as_pic_flag[0], 1, 0); flags(sps_loop_filter_across_subpic_enabled_flag[0], 1, 0); @@ -1187,6 +1191,12 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw, } else { int num_subpic_cols = tmp_width_val / (current->sps_subpic_width_minus1[0] + 1); + if (tmp_width_val % (current->sps_subpic_width_minus1[0] + 1) || + tmp_height_val % (current->sps_subpic_width_minus1[0] + 1) || + current->sps_num_subpics_minus1 != + (num_subpic_cols * tmp_height_val / + (current->sps_subpic_height_minus1[0] + 1) - 1)) + return AVERROR_INVALIDDATA; infer(sps_subpic_ctu_top_left_x[i], (i % num_subpic_cols) * (current->sps_subpic_width_minus1[0] + 1)); @@ -1976,6 +1986,7 @@ static int FUNC(pps) (CodedBitstreamContext *ctx, RWContext *rw, 0, current->row_height_val[tile_y] - 1, 1, i); if (current->pps_num_exp_slices_in_tile[i] == 0) { num_slices_in_tile = 1; + current->slice_height_in_ctus[i] = current->row_height_val[tile_y]; slice_top_left_ctu_x[i] = ctu_x; slice_top_left_ctu_y[i] = ctu_y; } else { @@ -2498,7 +2509,6 @@ static int FUNC(pred_weight_table) (CodedBitstreamContext *ctx, RWContext *rw, H266RawPredWeightTable *current) { int err, i, j; - uint8_t num_weights_l0, num_weights_l1; ue(luma_log2_weight_denom, 0, 7); if (sps->sps_chroma_format_idc != 0) { se(delta_chroma_log2_weight_denom, @@ -2507,21 +2517,21 @@ static int FUNC(pred_weight_table) (CodedBitstreamContext *ctx, RWContext *rw, } else { infer(delta_chroma_log2_weight_denom, 0); } - if (pps->pps_wp_info_in_ph_flag) + if (pps->pps_wp_info_in_ph_flag) { ue(num_l0_weights, 0, FFMIN(15, ref_lists->rpl_ref_list[0].num_ref_entries)); - else - infer(num_l0_weights, 0); - num_weights_l0 = pps->pps_wp_info_in_ph_flag ? - current->num_l0_weights : num_ref_idx_active[0]; - for (i = 0; i < num_weights_l0; i++) { + infer(num_weights_l0, current->num_l0_weights); + } else { + infer(num_weights_l0, num_ref_idx_active[0]); + } + for (i = 0; i < current->num_weights_l0; i++) { flags(luma_weight_l0_flag[i], 1, i); } if (sps->sps_chroma_format_idc != 0) { - for (i = 0; i < num_weights_l0; i++) + for (i = 0; i < current->num_weights_l0; i++) flags(chroma_weight_l0_flag[i], 1, i); } - for (i = 0; i < num_weights_l0; i++) { + for (i = 0; i < current->num_weights_l0; i++) { if (current->luma_weight_l0_flag[i]) { ses(delta_luma_weight_l0[i], -128, 127, 1, i); ses(luma_offset_l0[i], -128, 127, 1, i); @@ -2537,28 +2547,26 @@ static int FUNC(pred_weight_table) (CodedBitstreamContext *ctx, RWContext *rw, } } - if (pps->pps_weighted_bipred_flag && pps->pps_wp_info_in_ph_flag && + if (pps->pps_weighted_bipred_flag && ref_lists->rpl_ref_list[1].num_ref_entries > 0) { - ue(num_l1_weights, 0, - FFMIN(15, ref_lists->rpl_ref_list[1].num_ref_entries)); - } - if (!pps->pps_weighted_bipred_flag || - (pps->pps_wp_info_in_ph_flag && - ref_lists->rpl_ref_list[1].num_ref_entries == 0)) { - num_weights_l1 = 0; - } else if (pps->pps_wp_info_in_ph_flag) { - num_weights_l1 = current->num_l1_weights; + if (pps->pps_wp_info_in_ph_flag) { + ue(num_l1_weights, 0, + FFMIN(15, ref_lists->rpl_ref_list[1].num_ref_entries)); + infer(num_weights_l1, current->num_l1_weights); + } else { + infer(num_weights_l1, num_ref_idx_active[1]); + } } else { - num_weights_l1 = num_ref_idx_active[1]; + infer(num_weights_l1, 0); } - for (i = 0; i < num_weights_l1; i++) + for (i = 0; i < current->num_weights_l1; i++) flags(luma_weight_l1_flag[i], 1, i); if (sps->sps_chroma_format_idc != 0) { - for (i = 0; i < num_weights_l1; i++) + for (i = 0; i < current->num_weights_l1; i++) flags(chroma_weight_l1_flag[i], 1, i); } - for (i = 0; i < num_weights_l1; i++) { + for (i = 0; i < current->num_weights_l1; i++) { if (current->luma_weight_l1_flag[i]) { ses(delta_luma_weight_l1[i], -128, 127, 1, i); ses(luma_offset_l1[i], -128, 127, 1, i); @@ -2930,20 +2938,14 @@ static int FUNC(picture_header) (CodedBitstreamContext *ctx, RWContext *rw, infer(ph_sao_chroma_enabled_flag, 0); } - if (pps->pps_dbf_info_in_ph_flag) { + if (pps->pps_dbf_info_in_ph_flag) flag(ph_deblocking_params_present_flag); - if (current->ph_deblocking_params_present_flag) { - if (!pps->pps_deblocking_filter_disabled_flag) { - flag(ph_deblocking_filter_disabled_flag); - } else { - if (pps->pps_deblocking_filter_disabled_flag && - current->ph_deblocking_params_present_flag) { - infer(ph_deblocking_filter_disabled_flag, 0); - } else { - infer(ph_deblocking_filter_disabled_flag, - pps->pps_deblocking_filter_disabled_flag); - } - } + else + infer(ph_deblocking_params_present_flag, 0); + + if (current->ph_deblocking_params_present_flag) { + if (!pps->pps_deblocking_filter_disabled_flag) { + flag(ph_deblocking_filter_disabled_flag); if (!current->ph_deblocking_filter_disabled_flag) { se(ph_luma_beta_offset_div2, -12, 12); se(ph_luma_tc_offset_div2, -12, 12); @@ -2962,25 +2964,19 @@ static int FUNC(picture_header) (CodedBitstreamContext *ctx, RWContext *rw, infer(ph_cr_tc_offset_div2, current->ph_luma_tc_offset_div2); } - } else { - infer(ph_luma_beta_offset_div2, pps->pps_luma_beta_offset_div2); - infer(ph_luma_tc_offset_div2, pps->pps_luma_tc_offset_div2); - if (pps->pps_chroma_tool_offsets_present_flag) { - infer(ph_cb_beta_offset_div2, pps->pps_cb_beta_offset_div2); - infer(ph_cb_tc_offset_div2, pps->pps_cb_tc_offset_div2); - infer(ph_cr_beta_offset_div2, pps->pps_cr_beta_offset_div2); - infer(ph_cr_tc_offset_div2, pps->pps_cr_tc_offset_div2); - } else { - infer(ph_cb_beta_offset_div2, - current->ph_luma_beta_offset_div2); - infer(ph_cb_tc_offset_div2, - current->ph_luma_tc_offset_div2); - infer(ph_cr_beta_offset_div2, - current->ph_luma_beta_offset_div2); - infer(ph_cr_tc_offset_div2, - current->ph_luma_tc_offset_div2); - } } + } else { + infer(ph_deblocking_filter_disabled_flag, 0); + } + } else { + infer(ph_deblocking_filter_disabled_flag, pps->pps_deblocking_filter_disabled_flag); + if (!current->ph_deblocking_filter_disabled_flag) { + infer(ph_luma_beta_offset_div2, pps->pps_luma_beta_offset_div2); + infer(ph_luma_tc_offset_div2, pps->pps_luma_tc_offset_div2); + infer(ph_cb_beta_offset_div2, pps->pps_cb_beta_offset_div2); + infer(ph_cb_tc_offset_div2, pps->pps_cb_tc_offset_div2); + infer(ph_cr_beta_offset_div2, pps->pps_cr_beta_offset_div2); + infer(ph_cr_tc_offset_div2, pps->pps_cr_tc_offset_div2); } } @@ -3103,57 +3099,74 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, if (nal_unit_type == VVC_IDR_W_RADL || nal_unit_type == VVC_IDR_N_LP || nal_unit_type == VVC_CRA_NUT || nal_unit_type == VVC_GDR_NUT) flag(sh_no_output_of_prior_pics_flag); - if (sps->sps_alf_enabled_flag && !pps->pps_alf_info_in_ph_flag) { - flag(sh_alf_enabled_flag); - if (current->sh_alf_enabled_flag) { - ub(3, sh_num_alf_aps_ids_luma); - for (i = 0; i < current->sh_num_alf_aps_ids_luma; i++) - ubs(3, sh_alf_aps_id_luma[i], 1, i); - if (sps->sps_chroma_format_idc != 0) { - flag(sh_alf_cb_enabled_flag); - flag(sh_alf_cr_enabled_flag); - } else { + + if (sps->sps_alf_enabled_flag) { + if (!pps->pps_alf_info_in_ph_flag) { + flag(sh_alf_enabled_flag); + if (current->sh_alf_enabled_flag) { + ub(3, sh_num_alf_aps_ids_luma); + for (i = 0; i < current->sh_num_alf_aps_ids_luma; i++) + ubs(3, sh_alf_aps_id_luma[i], 1, i); + + if (sps->sps_chroma_format_idc != 0) { + flag(sh_alf_cb_enabled_flag); + flag(sh_alf_cr_enabled_flag); + } + if (current->sh_alf_cb_enabled_flag || + current->sh_alf_cr_enabled_flag) { + ub(3, sh_alf_aps_id_chroma); + } + + if (sps->sps_ccalf_enabled_flag) { + flag(sh_alf_cc_cb_enabled_flag); + if (current->sh_alf_cc_cb_enabled_flag) + ub(3, sh_alf_cc_cb_aps_id); + + flag(sh_alf_cc_cr_enabled_flag); + if (current->sh_alf_cc_cr_enabled_flag) + ub(3, sh_alf_cc_cr_aps_id); + } + } + } else { + infer(sh_alf_enabled_flag, ph->ph_alf_enabled_flag); + if (current->sh_alf_enabled_flag) { + infer(sh_num_alf_aps_ids_luma, ph->ph_num_alf_aps_ids_luma); + for (i = 0; i < current->sh_num_alf_aps_ids_luma; i++) + infer(sh_alf_aps_id_luma[i], ph->ph_alf_aps_id_luma[i]); + infer(sh_alf_cb_enabled_flag, ph->ph_alf_cb_enabled_flag); infer(sh_alf_cr_enabled_flag, ph->ph_alf_cr_enabled_flag); - } - if (current->sh_alf_cb_enabled_flag || - current->sh_alf_cr_enabled_flag) - ub(3, sh_alf_aps_id_chroma); - else - infer(sh_alf_aps_id_chroma, ph->ph_alf_aps_id_chroma); - if (sps->sps_ccalf_enabled_flag) { - flag(sh_alf_cc_cb_enabled_flag); - if (current->sh_alf_cc_cb_enabled_flag) - ub(3, sh_alf_cc_cb_aps_id); - else - infer(sh_alf_cc_cb_aps_id, ph->ph_alf_cc_cb_aps_id); - flag(sh_alf_cc_cr_enabled_flag); - if (current->sh_alf_cc_cr_enabled_flag) - ub(3, sh_alf_cc_cr_aps_id); - else - infer(sh_alf_cc_cr_aps_id, ph->ph_alf_cc_cr_aps_id); - } else { - infer(sh_alf_cc_cb_enabled_flag, ph->ph_alf_cc_cb_enabled_flag); - infer(sh_alf_cc_cr_enabled_flag, ph->ph_alf_cc_cr_enabled_flag); - infer(sh_alf_cc_cb_aps_id, ph->ph_alf_cc_cb_aps_id); - infer(sh_alf_cc_cr_aps_id, ph->ph_alf_cc_cr_aps_id); + if (current->sh_alf_cb_enabled_flag ||current->sh_alf_cr_enabled_flag) + infer(sh_alf_aps_id_chroma, ph->ph_alf_aps_id_chroma); + + if (sps->sps_ccalf_enabled_flag) { + infer(sh_alf_cc_cb_enabled_flag, ph->ph_alf_cc_cb_enabled_flag); + if (current->sh_alf_cc_cb_enabled_flag) + infer(sh_alf_cc_cb_aps_id, ph->ph_alf_cc_cb_aps_id); + + infer(sh_alf_cc_cr_enabled_flag, ph->ph_alf_cc_cr_enabled_flag); + if (current->sh_alf_cc_cr_enabled_flag) + infer(sh_alf_cc_cr_aps_id, ph->ph_alf_cc_cr_aps_id); + } } } - } else { - infer(sh_alf_enabled_flag, 0); } - if (ph->ph_lmcs_enabled_flag && - !current->sh_picture_header_in_slice_header_flag) - flag(sh_lmcs_used_flag); - else - infer(sh_lmcs_used_flag, 0); + if (current->sh_picture_header_in_slice_header_flag) { + infer(sh_lmcs_used_flag, ph->ph_lmcs_enabled_flag); + infer(sh_explicit_scaling_list_used_flag, + ph->ph_explicit_scaling_list_enabled_flag); + } else { + if (ph->ph_lmcs_enabled_flag) + flag(sh_lmcs_used_flag); + else + infer(sh_lmcs_used_flag, 0); - if (ph->ph_explicit_scaling_list_enabled_flag && - !current->sh_picture_header_in_slice_header_flag) - flag(sh_explicit_scaling_list_used_flag); - else - infer(sh_explicit_scaling_list_used_flag, 0); + if (ph->ph_explicit_scaling_list_enabled_flag) + flag(sh_explicit_scaling_list_used_flag); + else + infer(sh_explicit_scaling_list_used_flag, 0); + } if (!pps->pps_rpl_info_in_ph_flag && ((nal_unit_type != VVC_IDR_W_RADL && @@ -3180,53 +3193,51 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, } else { infer(sh_num_ref_idx_active_override_flag, 1); } + + for (i = 0; i < 2; i++) { + if (current->sh_slice_type == VVC_SLICE_TYPE_B || + (current->sh_slice_type == VVC_SLICE_TYPE_P && i == 0)) { + if (current->sh_num_ref_idx_active_override_flag) { + current->num_ref_idx_active[i] = current->sh_num_ref_idx_active_minus1[i] + 1; + } else { + current->num_ref_idx_active[i] = + FFMIN(ref_pic_lists->rpl_ref_list[i].num_ref_entries, + pps->pps_num_ref_idx_default_active_minus1[i] + 1); + } + } else { + current->num_ref_idx_active[i] = 0; + } + } + if (current->sh_slice_type != VVC_SLICE_TYPE_I) { if (pps->pps_cabac_init_present_flag) flag(sh_cabac_init_flag); else infer(sh_cabac_init_flag, 0); if (ph->ph_temporal_mvp_enabled_flag && !pps->pps_rpl_info_in_ph_flag) { - uint8_t num_ref_idx_active[2]; - for (i = 0; i < 2; i++) { - if (current->sh_slice_type == VVC_SLICE_TYPE_B || - (current->sh_slice_type == VVC_SLICE_TYPE_P && i == 0)) { - if (current->sh_num_ref_idx_active_override_flag) { - num_ref_idx_active[i] = - current->sh_num_ref_idx_active_minus1[i] + 1; - } else { - num_ref_idx_active[i] = - FFMIN(ref_pic_lists->rpl_ref_list[i].num_ref_entries, - pps->pps_num_ref_idx_default_active_minus1[i] + 1); - } - } else { - num_ref_idx_active[i] = 0; - } - } - if (current->sh_slice_type == VVC_SLICE_TYPE_B) flag(sh_collocated_from_l0_flag); else infer(sh_collocated_from_l0_flag, 1); if ((current->sh_collocated_from_l0_flag && - num_ref_idx_active[0] > 1) || + current->num_ref_idx_active[0] > 1) || (!current->sh_collocated_from_l0_flag && - num_ref_idx_active[1] > 1)) { + current->num_ref_idx_active[1] > 1)) { unsigned int idx = current->sh_collocated_from_l0_flag ? 0 : 1; - ue(sh_collocated_ref_idx, 0, num_ref_idx_active[idx] - 1); + ue(sh_collocated_ref_idx, 0, current->num_ref_idx_active[idx] - 1); } else { infer(sh_collocated_ref_idx, 0); } - if (!pps->pps_wp_info_in_ph_flag && - ((pps->pps_weighted_pred_flag && - current->sh_slice_type == VVC_SLICE_TYPE_P) || - (pps->pps_weighted_bipred_flag && - current->sh_slice_type == VVC_SLICE_TYPE_B))) { - CHECK(FUNC(pred_weight_table) (ctx, rw, sps, pps, ref_pic_lists, - num_ref_idx_active, - ¤t->sh_pred_weight_table)); - } } - + if (!pps->pps_wp_info_in_ph_flag && + ((pps->pps_weighted_pred_flag && + current->sh_slice_type == VVC_SLICE_TYPE_P) || + (pps->pps_weighted_bipred_flag && + current->sh_slice_type == VVC_SLICE_TYPE_B))) { + CHECK(FUNC(pred_weight_table) (ctx, rw, sps, pps, ref_pic_lists, + current->num_ref_idx_active, + ¤t->sh_pred_weight_table)); + } } qp_bd_offset = 6 * sps->sps_bitdepth_minus8; if (!pps->pps_qp_delta_info_in_ph_flag) @@ -3296,9 +3307,7 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, if (!pps->pps_deblocking_filter_disabled_flag) flag(sh_deblocking_filter_disabled_flag); else - infer(sh_deblocking_filter_disabled_flag, - !(pps->pps_deblocking_filter_disabled_flag && - current->sh_deblocking_params_present_flag)); + infer(sh_deblocking_filter_disabled_flag, 0); if (!current->sh_deblocking_filter_disabled_flag) { se(sh_luma_beta_offset_div2, -12, 12); se(sh_luma_tc_offset_div2, -12, 12); @@ -3315,22 +3324,16 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, current->sh_luma_beta_offset_div2); infer(sh_cr_tc_offset_div2, current->sh_luma_tc_offset_div2); } - } else { + } + } else { + infer(sh_deblocking_filter_disabled_flag, ph->ph_deblocking_filter_disabled_flag); + if (!current->sh_deblocking_filter_disabled_flag) { infer(sh_luma_beta_offset_div2, ph->ph_luma_beta_offset_div2); infer(sh_luma_tc_offset_div2, ph->ph_luma_tc_offset_div2); - if (pps->pps_chroma_tool_offsets_present_flag) { - infer(sh_cb_beta_offset_div2, ph->ph_cb_beta_offset_div2); - infer(sh_cb_tc_offset_div2, ph->ph_cb_tc_offset_div2); - infer(sh_cr_beta_offset_div2, ph->ph_cr_beta_offset_div2); - infer(sh_cr_tc_offset_div2, ph->ph_cr_beta_offset_div2); - } else { - infer(sh_cb_beta_offset_div2, - current->sh_luma_beta_offset_div2); - infer(sh_cb_tc_offset_div2, current->sh_luma_tc_offset_div2); - infer(sh_cr_beta_offset_div2, - current->sh_luma_beta_offset_div2); - infer(sh_cr_tc_offset_div2, current->sh_luma_tc_offset_div2); - } + infer(sh_cb_beta_offset_div2, ph->ph_cb_beta_offset_div2); + infer(sh_cb_tc_offset_div2, ph->ph_cb_tc_offset_div2); + infer(sh_cr_beta_offset_div2, ph->ph_cr_beta_offset_div2); + infer(sh_cr_tc_offset_div2, ph->ph_cr_tc_offset_div2); } } @@ -3368,8 +3371,9 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, for (i = 0; i < current->sh_slice_header_extension_length; i++) us(8, sh_slice_header_extension_data_byte[i], 0x00, 0xff, 1, i); } + + current->num_entry_points = 0; if (sps->sps_entry_point_offsets_present_flag) { - int num_entry_points = 0; uint8_t entropy_sync = sps->sps_entropy_coding_sync_enabled_flag; int height; if (pps->pps_rect_slice_flag) { @@ -3386,7 +3390,7 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, else height = pps->pps_slice_height_in_tiles_minus1[slice_idx] + 1; - num_entry_points = width_in_tiles * height; + current->num_entry_points = width_in_tiles * height; } else { int tile_idx; int tile_y; @@ -3396,18 +3400,18 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, current->sh_num_tiles_in_slice_minus1; tile_idx++) { tile_y = tile_idx / pps->num_tile_rows; height = pps->row_height_val[tile_y]; - num_entry_points += (entropy_sync ? height : 1); + current->num_entry_points += (entropy_sync ? height : 1); } } - num_entry_points--; - if (num_entry_points > VVC_MAX_ENTRY_POINTS) { + current->num_entry_points--; + if (current->num_entry_points > VVC_MAX_ENTRY_POINTS) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Too many entry points: " - "%" PRIu16 ".\n", num_entry_points); + "%" PRIu16 ".\n", current->num_entry_points); return AVERROR_PATCHWELCOME; } - if (num_entry_points > 0) { + if (current->num_entry_points > 0) { ue(sh_entry_offset_len_minus1, 0, 31); - for (i = 0; i < num_entry_points; i++) { + for (i = 0; i < current->num_entry_points; i++) { ubs(current->sh_entry_offset_len_minus1 + 1, sh_entry_point_offset_minus1[i], 1, i); } diff --git a/src/third_party/ffmpeg/libavcodec/cbs_internal.h b/src/third_party/ffmpeg/libavcodec/cbs_internal.h index b752d646..285deb40 100644 --- a/src/third_party/ffmpeg/libavcodec/cbs_internal.h +++ b/src/third_party/ffmpeg/libavcodec/cbs_internal.h @@ -157,24 +157,29 @@ typedef struct CodedBitstreamType { void ff_cbs_trace_header(CodedBitstreamContext *ctx, const char *name); -void ff_cbs_trace_syntax_element(CodedBitstreamContext *ctx, int position, - const char *name, const int *subscripts, - const char *bitstring, int64_t value); - // Helper functions for read/write of common bitstream elements, including -// generation of trace output. +// generation of trace output. The simple functions are equivalent to +// their non-simple counterparts except that their range is unrestricted +// (i.e. only limited by the amount of bits used) and they lack +// the ability to use subscripts. int ff_cbs_read_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, int width, const char *name, const int *subscripts, uint32_t *write_to, uint32_t range_min, uint32_t range_max); +int ff_cbs_read_simple_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, + int width, const char *name, uint32_t *write_to); + int ff_cbs_write_unsigned(CodedBitstreamContext *ctx, PutBitContext *pbc, int width, const char *name, const int *subscripts, uint32_t value, uint32_t range_min, uint32_t range_max); +int ff_cbs_write_simple_unsigned(CodedBitstreamContext *ctx, PutBitContext *pbc, + int width, const char *name, uint32_t value); + int ff_cbs_read_signed(CodedBitstreamContext *ctx, GetBitContext *gbc, int width, const char *name, const int *subscripts, int32_t *write_to, @@ -197,6 +202,87 @@ int ff_cbs_write_signed(CodedBitstreamContext *ctx, PutBitContext *pbc, // range_min in the above functions. #define MIN_INT_BITS(length) (-(INT64_C(1) << ((length) - 1))) + +// Start of a syntax element during read tracing. +#define CBS_TRACE_READ_START() \ + GetBitContext trace_start; \ + do { \ + if (ctx->trace_enable) \ + trace_start = *gbc; \ + } while (0) + +// End of a syntax element for tracing, make callback. +#define CBS_TRACE_READ_END() \ + do { \ + if (ctx->trace_enable) { \ + int start_position = get_bits_count(&trace_start); \ + int end_position = get_bits_count(gbc); \ + av_assert0(start_position <= end_position); \ + ctx->trace_read_callback(ctx->trace_context, &trace_start, \ + end_position - start_position, \ + name, subscripts, value); \ + } \ + } while (0) + +// End of a syntax element with no subscript entries. +#define CBS_TRACE_READ_END_NO_SUBSCRIPTS() \ + do { \ + const int *subscripts = NULL; \ + CBS_TRACE_READ_END(); \ + } while (0) + +// End of a syntax element which is made up of subelements which +// are aleady traced, so we are only showing the value. +#define CBS_TRACE_READ_END_VALUE_ONLY() \ + do { \ + if (ctx->trace_enable) { \ + ctx->trace_read_callback(ctx->trace_context, &trace_start, 0, \ + name, subscripts, value); \ + } \ + } while (0) + +// Start of a syntax element during write tracing. +#define CBS_TRACE_WRITE_START() \ + int start_position; \ + do { \ + if (ctx->trace_enable) \ + start_position = put_bits_count(pbc);; \ + } while (0) + +// End of a syntax element for tracing, make callback. +#define CBS_TRACE_WRITE_END() \ + do { \ + if (ctx->trace_enable) { \ + int end_position = put_bits_count(pbc); \ + av_assert0(start_position <= end_position); \ + ctx->trace_write_callback(ctx->trace_context, pbc, \ + end_position - start_position, \ + name, subscripts, value); \ + } \ + } while (0) + +// End of a syntax element with no subscript entries. +#define CBS_TRACE_WRITE_END_NO_SUBSCRIPTS() \ + do { \ + const int *subscripts = NULL; \ + CBS_TRACE_WRITE_END(); \ + } while (0) + +// End of a syntax element which is made up of subelements which are +// aleady traced, so we are only showing the value. This forges a +// PutBitContext to point to the position of the start of the syntax +// element, but the other state doesn't matter because length is zero. +#define CBS_TRACE_WRITE_END_VALUE_ONLY() \ + do { \ + if (ctx->trace_enable) { \ + PutBitContext tmp; \ + init_put_bits(&tmp, pbc->buf, start_position); \ + skip_put_bits(&tmp, start_position); \ + ctx->trace_write_callback(ctx->trace_context, &tmp, 0, \ + name, subscripts, value); \ + } \ + } while (0) + #define TYPE_LIST(...) { __VA_ARGS__ } #define CBS_UNIT_TYPE_POD(type_, structure) { \ .nb_unit_types = 1, \ diff --git a/src/third_party/ffmpeg/libavcodec/cbs_mpeg2.c b/src/third_party/ffmpeg/libavcodec/cbs_mpeg2.c index 04b0c7f8..37fc28a4 100644 --- a/src/third_party/ffmpeg/libavcodec/cbs_mpeg2.c +++ b/src/third_party/ffmpeg/libavcodec/cbs_mpeg2.c @@ -40,8 +40,6 @@ #define SUBSCRIPTS(subs, ...) (subs > 0 ? ((int[subs + 1]){ subs, __VA_ARGS__ }) : NULL) -#define ui(width, name) \ - xui(width, name, current->name, 0, MAX_UINT_BITS(width), 0, ) #define uir(width, name) \ xui(width, name, current->name, 1, MAX_UINT_BITS(width), 0, ) #define uis(width, name, subs, ...) \ @@ -65,6 +63,12 @@ #define READWRITE read #define RWContext GetBitContext +#define ui(width, name) do { \ + uint32_t value; \ + CHECK(ff_cbs_read_simple_unsigned(ctx, rw, width, #name, \ + &value)); \ + current->name = value; \ + } while (0) #define xuia(width, string, var, range_min, range_max, subs, ...) do { \ uint32_t value; \ CHECK(ff_cbs_read_unsigned(ctx, rw, width, string, \ @@ -95,6 +99,7 @@ #undef READ #undef READWRITE #undef RWContext +#undef ui #undef xuia #undef xsi #undef nextbits @@ -105,6 +110,11 @@ #define READWRITE write #define RWContext PutBitContext +#define ui(width, name) do { \ + CHECK(ff_cbs_write_simple_unsigned(ctx, rw, width, #name, \ + current->name)); \ + } while (0) + #define xuia(width, string, var, range_min, range_max, subs, ...) do { \ CHECK(ff_cbs_write_unsigned(ctx, rw, width, string, \ SUBSCRIPTS(subs, __VA_ARGS__), \ @@ -134,6 +144,7 @@ #undef WRITE #undef READWRITE #undef RWContext +#undef ui #undef xuia #undef xsi #undef nextbits diff --git a/src/third_party/ffmpeg/libavcodec/cbs_vp9.c b/src/third_party/ffmpeg/libavcodec/cbs_vp9.c index 184fdcad..816d06da 100644 --- a/src/third_party/ffmpeg/libavcodec/cbs_vp9.c +++ b/src/third_party/ffmpeg/libavcodec/cbs_vp9.c @@ -28,11 +28,10 @@ static int cbs_vp9_read_s(CodedBitstreamContext *ctx, GetBitContext *gbc, const int *subscripts, int32_t *write_to) { uint32_t magnitude; - int position, sign; + int sign; int32_t value; - if (ctx->trace_enable) - position = get_bits_count(gbc); + CBS_TRACE_READ_START(); if (get_bits_left(gbc) < width + 1) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid signed value at " @@ -44,17 +43,7 @@ static int cbs_vp9_read_s(CodedBitstreamContext *ctx, GetBitContext *gbc, sign = get_bits1(gbc); value = sign ? -(int32_t)magnitude : magnitude; - if (ctx->trace_enable) { - char bits[33]; - int i; - for (i = 0; i < width; i++) - bits[i] = magnitude >> (width - i - 1) & 1 ? '1' : '0'; - bits[i] = sign ? '1' : '0'; - bits[i + 1] = 0; - - ff_cbs_trace_syntax_element(ctx, position, name, subscripts, - bits, value); - } + CBS_TRACE_READ_END(); *write_to = value; return 0; @@ -67,27 +56,19 @@ static int cbs_vp9_write_s(CodedBitstreamContext *ctx, PutBitContext *pbc, uint32_t magnitude; int sign; + CBS_TRACE_WRITE_START(); + if (put_bits_left(pbc) < width + 1) return AVERROR(ENOSPC); sign = value < 0; magnitude = sign ? -value : value; - if (ctx->trace_enable) { - char bits[33]; - int i; - for (i = 0; i < width; i++) - bits[i] = magnitude >> (width - i - 1) & 1 ? '1' : '0'; - bits[i] = sign ? '1' : '0'; - bits[i + 1] = 0; - - ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), - name, subscripts, bits, value); - } - put_bits(pbc, width, magnitude); put_bits(pbc, 1, sign); + CBS_TRACE_WRITE_END(); + return 0; } @@ -96,32 +77,24 @@ static int cbs_vp9_read_increment(CodedBitstreamContext *ctx, GetBitContext *gbc const char *name, uint32_t *write_to) { uint32_t value; - int position, i; - char bits[8]; - av_assert0(range_min <= range_max && range_max - range_min < sizeof(bits) - 1); - if (ctx->trace_enable) - position = get_bits_count(gbc); + CBS_TRACE_READ_START(); - for (i = 0, value = range_min; value < range_max;) { + av_assert0(range_min <= range_max && range_max - range_min < 32); + + for (value = range_min; value < range_max;) { if (get_bits_left(gbc) < 1) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid increment value at " "%s: bitstream ended.\n", name); return AVERROR_INVALIDDATA; } - if (get_bits1(gbc)) { - bits[i++] = '1'; + if (get_bits1(gbc)) ++value; - } else { - bits[i++] = '0'; + else break; - } } - if (ctx->trace_enable) { - bits[i] = 0; - ff_cbs_trace_syntax_element(ctx, position, name, NULL, bits, value); - } + CBS_TRACE_READ_END_NO_SUBSCRIPTS(); *write_to = value; return 0; @@ -133,6 +106,8 @@ static int cbs_vp9_write_increment(CodedBitstreamContext *ctx, PutBitContext *pb { int len; + CBS_TRACE_WRITE_START(); + av_assert0(range_min <= range_max && range_max - range_min < 8); if (value < range_min || value > range_max) { av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " @@ -148,23 +123,11 @@ static int cbs_vp9_write_increment(CodedBitstreamContext *ctx, PutBitContext *pb if (put_bits_left(pbc) < len) return AVERROR(ENOSPC); - if (ctx->trace_enable) { - char bits[8]; - int i; - for (i = 0; i < len; i++) { - if (range_min + i == value) - bits[i] = '0'; - else - bits[i] = '1'; - } - bits[i] = 0; - ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), - name, NULL, bits, value); - } - if (len > 0) put_bits(pbc, len, (1 << len) - 1 - (value != range_max)); + CBS_TRACE_WRITE_END_NO_SUBSCRIPTS(); + return 0; } @@ -173,13 +136,12 @@ static int cbs_vp9_read_le(CodedBitstreamContext *ctx, GetBitContext *gbc, const int *subscripts, uint32_t *write_to) { uint32_t value; - int position, b; + int b; + + CBS_TRACE_READ_START(); av_assert0(width % 8 == 0); - if (ctx->trace_enable) - position = get_bits_count(gbc); - if (get_bits_left(gbc) < width) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid le value at " "%s: bitstream ended.\n", name); @@ -190,17 +152,7 @@ static int cbs_vp9_read_le(CodedBitstreamContext *ctx, GetBitContext *gbc, for (b = 0; b < width; b += 8) value |= get_bits(gbc, 8) << b; - if (ctx->trace_enable) { - char bits[33]; - int i; - for (b = 0; b < width; b += 8) - for (i = 0; i < 8; i++) - bits[b + i] = value >> (b + i) & 1 ? '1' : '0'; - bits[b] = 0; - - ff_cbs_trace_syntax_element(ctx, position, name, subscripts, - bits, value); - } + CBS_TRACE_READ_END(); *write_to = value; return 0; @@ -212,26 +164,18 @@ static int cbs_vp9_write_le(CodedBitstreamContext *ctx, PutBitContext *pbc, { int b; + CBS_TRACE_WRITE_START(); + av_assert0(width % 8 == 0); if (put_bits_left(pbc) < width) return AVERROR(ENOSPC); - if (ctx->trace_enable) { - char bits[33]; - int i; - for (b = 0; b < width; b += 8) - for (i = 0; i < 8; i++) - bits[b + i] = value >> (b + i) & 1 ? '1' : '0'; - bits[b] = 0; - - ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), - name, subscripts, bits, value); - } - for (b = 0; b < width; b += 8) put_bits(pbc, 8, value >> b & 0xff); + CBS_TRACE_WRITE_END(); + return 0; } @@ -251,8 +195,6 @@ static int cbs_vp9_write_le(CodedBitstreamContext *ctx, PutBitContext *pbc, #define SUBSCRIPTS(subs, ...) (subs > 0 ? ((int[subs + 1]){ subs, __VA_ARGS__ }) : NULL) -#define f(width, name) \ - xf(width, name, current->name, 0, ) #define s(width, name) \ xs(width, name, current->name, 0, ) #define fs(width, name, subs, ...) \ @@ -264,6 +206,12 @@ static int cbs_vp9_write_le(CodedBitstreamContext *ctx, PutBitContext *pbc, #define READWRITE read #define RWContext GetBitContext +#define f(width, name) do { \ + uint32_t value; \ + CHECK(ff_cbs_read_simple_unsigned(ctx, rw, width, #name, \ + &value)); \ + current->name = value; \ + } while (0) #define xf(width, name, var, subs, ...) do { \ uint32_t value; \ CHECK(ff_cbs_read_unsigned(ctx, rw, width, #name, \ @@ -329,6 +277,7 @@ static int cbs_vp9_write_le(CodedBitstreamContext *ctx, PutBitContext *pbc, #undef READ #undef READWRITE #undef RWContext +#undef f #undef xf #undef xs #undef increment @@ -344,6 +293,10 @@ static int cbs_vp9_write_le(CodedBitstreamContext *ctx, PutBitContext *pbc, #define READWRITE write #define RWContext PutBitContext +#define f(width, name) do { \ + CHECK(ff_cbs_write_simple_unsigned(ctx, rw, width, #name, \ + current->name)); \ + } while (0) #define xf(width, name, var, subs, ...) do { \ CHECK(ff_cbs_write_unsigned(ctx, rw, width, #name, \ SUBSCRIPTS(subs, __VA_ARGS__), \ @@ -396,6 +349,7 @@ static int cbs_vp9_write_le(CodedBitstreamContext *ctx, PutBitContext *pbc, #undef WRITE #undef READWRITE #undef RWContext +#undef f #undef xf #undef xs #undef increment diff --git a/src/third_party/ffmpeg/libavcodec/cdgraphics.c b/src/third_party/ffmpeg/libavcodec/cdgraphics.c index 0c5022a5..f33f7fbf 100644 --- a/src/third_party/ffmpeg/libavcodec/cdgraphics.c +++ b/src/third_party/ffmpeg/libavcodec/cdgraphics.c @@ -90,19 +90,19 @@ static av_cold int cdg_decode_init(AVCodecContext *avctx) static void cdg_border_preset(CDGraphicsContext *cc, uint8_t *data) { - int y; - int lsize = cc->frame->linesize[0]; + ptrdiff_t lsize = cc->frame->linesize[0]; uint8_t *buf = cc->frame->data[0]; int color = data[0] & 0x0F; if (!(data[1] & 0x0F)) { /// fill the top and bottom borders - memset(buf, color, CDG_BORDER_HEIGHT * lsize); - memset(buf + (CDG_FULL_HEIGHT - CDG_BORDER_HEIGHT) * lsize, - color, CDG_BORDER_HEIGHT * lsize); + for (int y = 0; y < CDG_BORDER_HEIGHT; y++) + memset(buf + y * lsize, color, cc->frame->width); + for (int y = CDG_FULL_HEIGHT-CDG_BORDER_HEIGHT; y < CDG_FULL_HEIGHT; y++) + memset(buf + y * lsize, color, cc->frame->width); /// fill the side borders - for (y = CDG_BORDER_HEIGHT; y < CDG_FULL_HEIGHT - CDG_BORDER_HEIGHT; y++) { + for (int y = CDG_BORDER_HEIGHT; y < CDG_FULL_HEIGHT - CDG_BORDER_HEIGHT; y++) { memset(buf + y * lsize, color, CDG_BORDER_WIDTH); memset(buf + CDG_FULL_WIDTH - CDG_BORDER_WIDTH + y * lsize, color, CDG_BORDER_WIDTH); @@ -138,7 +138,7 @@ static int cdg_tile_block(CDGraphicsContext *cc, uint8_t *data, int b) int color; int x, y; int ai; - int stride = cc->frame->linesize[0]; + ptrdiff_t stride = cc->frame->linesize[0]; uint8_t *buf = cc->frame->data[0]; ri = (data[2] & 0x1F) * CDG_TILE_HEIGHT + cc->vscroll; @@ -210,7 +210,7 @@ static void cdg_scroll(CDGraphicsContext *cc, uint8_t *data, int color; int hscmd, h_off, hinc, vscmd, v_off, vinc; int y; - int stride = cc->frame->linesize[0]; + ptrdiff_t stride = cc->frame->linesize[0]; uint8_t *in = cc->frame->data[0]; uint8_t *out = new_frame->data[0]; @@ -249,11 +249,11 @@ static void cdg_scroll(CDGraphicsContext *cc, uint8_t *data, if (vinc > 0) cdg_fill_wrapper(0, 0, out, 0, CDG_FULL_HEIGHT - vinc, in, color, - stride, vinc, stride, roll_over); + FFABS(stride), vinc, stride, roll_over); else if (vinc < 0) cdg_fill_wrapper(0, CDG_FULL_HEIGHT + vinc, out, 0, 0, in, color, - stride, -1 * vinc, stride, roll_over); + FFABS(stride), -1 * vinc, stride, roll_over); if (hinc > 0) cdg_fill_wrapper(0, 0, out, @@ -290,7 +290,8 @@ static int cdg_decode_frame(AVCodecContext *avctx, AVFrame *frame, if ((ret = ff_reget_buffer(avctx, cc->frame, 0)) < 0) return ret; if (!cc->cleared) { - memset(cc->frame->data[0], 0, cc->frame->linesize[0] * avctx->height); + for (int y = 0; y < avctx->height; y++) + memset(cc->frame->data[0] + y * cc->frame->linesize[0], 0, avctx->width); memset(cc->frame->data[1], 0, AVPALETTE_SIZE); cc->cleared = 1; } @@ -304,9 +305,11 @@ static int cdg_decode_frame(AVCodecContext *avctx, AVFrame *frame, if ((command & CDG_MASK) == CDG_COMMAND) { switch (inst) { case CDG_INST_MEMORY_PRESET: - if (!(cdg_data[1] & 0x0F)) - memset(cc->frame->data[0], cdg_data[0] & 0x0F, - cc->frame->linesize[0] * CDG_FULL_HEIGHT); + if (!(cdg_data[1] & 0x0F)) { + for (int y = 0; y < avctx->height; y++) + memset(cc->frame->data[0] + y * cc->frame->linesize[0], + cdg_data[0] & 0x0F, avctx->width); + } break; case CDG_INST_LOAD_PAL_LO: case CDG_INST_LOAD_PAL_HIGH: @@ -344,8 +347,7 @@ static int cdg_decode_frame(AVCodecContext *avctx, AVFrame *frame, return ret; cdg_scroll(cc, cdg_data, frame, inst == CDG_INST_SCROLL_COPY); - av_frame_unref(cc->frame); - ret = av_frame_ref(cc->frame, frame); + ret = av_frame_replace(cc->frame, frame); if (ret < 0) return ret; break; @@ -377,7 +379,8 @@ static void cdg_decode_flush(AVCodecContext *avctx) if (!cc->frame->data[0]) return; - memset(cc->frame->data[0], 0, cc->frame->linesize[0] * avctx->height); + for (int y = 0; y < avctx->height; y++) + memset(cc->frame->data[0] + y * cc->frame->linesize[0], 0, avctx->width); if (!avctx->frame_num) memset(cc->frame->data[1], 0, AVPALETTE_SIZE); } diff --git a/src/third_party/ffmpeg/libavcodec/cdxl.c b/src/third_party/ffmpeg/libavcodec/cdxl.c index 085ae97c..3c892ada 100644 --- a/src/third_party/ffmpeg/libavcodec/cdxl.c +++ b/src/third_party/ffmpeg/libavcodec/cdxl.c @@ -125,9 +125,10 @@ static void chunky2chunky(CDXLVideoContext *c, int linesize, uint8_t *out) } } -static void import_format(CDXLVideoContext *c, int linesize, uint8_t *out) +static void import_format(CDXLVideoContext *c, ptrdiff_t linesize, uint8_t *out) { - memset(out, 0, linesize * c->avctx->height); + for (int y = 0; y < c->avctx->height; y++) + memset(out + y * linesize, 0, c->avctx->width); switch (c->format) { case BIT_PLANAR: diff --git a/src/third_party/ffmpeg/libavcodec/celp_math.h b/src/third_party/ffmpeg/libavcodec/celp_math.h index 18888a42..99a04707 100644 --- a/src/third_party/ffmpeg/libavcodec/celp_math.h +++ b/src/third_party/ffmpeg/libavcodec/celp_math.h @@ -78,7 +78,7 @@ int64_t ff_dot_product(const int16_t *a, const int16_t *b, int length); * * @return value << offset, if offset>=0; value >> -offset - otherwise */ -static inline int bidir_sal(int value, int offset) +static inline unsigned bidir_sal(unsigned value, int offset) { if(offset < 0) return value >> -offset; else return value << offset; diff --git a/src/third_party/ffmpeg/libavcodec/cfhddata.c b/src/third_party/ffmpeg/libavcodec/cfhddata.c index fd5cc817..a3948a14 100644 --- a/src/third_party/ffmpeg/libavcodec/cfhddata.c +++ b/src/third_party/ffmpeg/libavcodec/cfhddata.c @@ -150,7 +150,7 @@ static av_cold int cfhd_init_vlc(CFHD_RL_VLC_ELEM out[], unsigned out_size, } } - ret = ff_init_vlc_from_lengths(&vlc, VLC_BITS, j, + ret = ff_vlc_init_from_lengths(&vlc, VLC_BITS, j, &tmp[0].len, sizeof(tmp[0]), NULL, 0, 0, 0, 0, logctx); if (ret < 0) @@ -173,7 +173,7 @@ static av_cold int cfhd_init_vlc(CFHD_RL_VLC_ELEM out[], unsigned out_size, out[i].level = level; out[i].run = run; } - ff_free_vlc(&vlc); + ff_vlc_free(&vlc); return 0; } diff --git a/src/third_party/ffmpeg/libavcodec/clearvideo.c b/src/third_party/ffmpeg/libavcodec/clearvideo.c index f84e3e6e..7f2c1c5f 100644 --- a/src/third_party/ffmpeg/libavcodec/clearvideo.c +++ b/src/third_party/ffmpeg/libavcodec/clearvideo.c @@ -637,8 +637,8 @@ static av_cold void build_vlc(VLC *vlc, const uint8_t counts[16], } vlc->table = &vlc_buf[*offset]; vlc->table_allocated = FF_ARRAY_ELEMS(vlc_buf) - *offset; - ff_init_vlc_from_lengths(vlc, CLV_VLC_BITS, num, lens, 1, - *syms, 2, 2, 0, INIT_VLC_STATIC_OVERLONG, NULL); + ff_vlc_init_from_lengths(vlc, CLV_VLC_BITS, num, lens, 1, + *syms, 2, 2, 0, VLC_INIT_STATIC_OVERLONG, NULL); *syms += num; *offset += vlc->table_size; } @@ -647,10 +647,10 @@ static av_cold void clv_init_static(void) { const uint16_t *mv_syms = clv_mv_syms, *bias_syms = clv_bias_syms; - INIT_VLC_STATIC_FROM_LENGTHS(&dc_vlc, CLV_VLC_BITS, NUM_DC_CODES, + VLC_INIT_STATIC_FROM_LENGTHS(&dc_vlc, CLV_VLC_BITS, NUM_DC_CODES, clv_dc_lens, 1, clv_dc_syms, 1, 1, -63, 0, 1104); - INIT_VLC_STATIC_FROM_LENGTHS(&ac_vlc, CLV_VLC_BITS, NUM_AC_CODES, + VLC_INIT_STATIC_FROM_LENGTHS(&ac_vlc, CLV_VLC_BITS, NUM_AC_CODES, clv_ac_bits, 1, clv_ac_syms, 2, 2, 0, 0, 554); for (unsigned i = 0, j = 0, k = 0, offset = 0;; i++) { @@ -663,10 +663,10 @@ static av_cold void clv_init_static(void) if (0x1B7 & (1 << i)) { lev[i].flags_cb.table = &vlc_buf[offset]; lev[i].flags_cb.table_allocated = FF_ARRAY_ELEMS(vlc_buf) - offset; - ff_init_vlc_from_lengths(&lev[i].flags_cb, CLV_VLC_BITS, 16, + ff_vlc_init_from_lengths(&lev[i].flags_cb, CLV_VLC_BITS, 16, clv_flags_bits[j], 1, clv_flags_syms[j], 1, 1, - 0, INIT_VLC_STATIC_OVERLONG, NULL); + 0, VLC_INIT_STATIC_OVERLONG, NULL); offset += lev[i].flags_cb.table_size; build_vlc(&lev[i + 1].bias_cb, clv_bias_len_counts[j], diff --git a/src/third_party/ffmpeg/libavcodec/cllc.c b/src/third_party/ffmpeg/libavcodec/cllc.c index 52cb86e5..0c6ae13d 100644 --- a/src/third_party/ffmpeg/libavcodec/cllc.c +++ b/src/third_party/ffmpeg/libavcodec/cllc.c @@ -77,7 +77,7 @@ static int read_code_table(CLLCContext *ctx, GetBitContext *gb, VLC *vlc) } } - return ff_init_vlc_from_lengths(vlc, VLC_BITS, count, bits, 1, + return ff_vlc_init_from_lengths(vlc, VLC_BITS, count, bits, 1, symbols, 1, 1, 0, 0, ctx->avctx); } @@ -235,7 +235,7 @@ static int decode_argb_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic) ret = read_code_table(ctx, gb, &vlc[i]); if (ret < 0) { for (j = 0; j < i; j++) - ff_free_vlc(&vlc[j]); + ff_vlc_free(&vlc[j]); av_log(ctx->avctx, AV_LOG_ERROR, "Could not read code table %d.\n", i); @@ -251,7 +251,7 @@ static int decode_argb_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic) } for (i = 0; i < 4; i++) - ff_free_vlc(&vlc[i]); + ff_vlc_free(&vlc[i]); return 0; } @@ -278,7 +278,7 @@ static int decode_rgb24_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic) ret = read_code_table(ctx, gb, &vlc[i]); if (ret < 0) { for (j = 0; j < i; j++) - ff_free_vlc(&vlc[j]); + ff_vlc_free(&vlc[j]); av_log(ctx->avctx, AV_LOG_ERROR, "Could not read code table %d.\n", i); @@ -295,7 +295,7 @@ static int decode_rgb24_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic) } for (i = 0; i < 3; i++) - ff_free_vlc(&vlc[i]); + ff_vlc_free(&vlc[i]); return 0; } @@ -331,7 +331,7 @@ static int decode_yuv_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic) ret = read_code_table(ctx, gb, &vlc[i]); if (ret < 0) { for (j = 0; j < i; j++) - ff_free_vlc(&vlc[j]); + ff_vlc_free(&vlc[j]); av_log(ctx->avctx, AV_LOG_ERROR, "Could not read code table %d.\n", i); @@ -350,7 +350,7 @@ static int decode_yuv_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic) } for (i = 0; i < 2; i++) - ff_free_vlc(&vlc[i]); + ff_vlc_free(&vlc[i]); return 0; } diff --git a/src/third_party/ffmpeg/libavcodec/codec.h b/src/third_party/ffmpeg/libavcodec/codec.h index 7a932d75..8034f1a5 100644 --- a/src/third_party/ffmpeg/libavcodec/codec.h +++ b/src/third_party/ffmpeg/libavcodec/codec.h @@ -217,7 +217,7 @@ typedef struct AVCodec { const uint64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 #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} + const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {AV_PROFILE_UNKNOWN} /** * Group name of the codec implementation. diff --git a/src/third_party/ffmpeg/libavcodec/codec_desc.c b/src/third_party/ffmpeg/libavcodec/codec_desc.c index 4406dd83..f556bb94 100644 --- a/src/third_party/ffmpeg/libavcodec/codec_desc.c +++ b/src/third_party/ffmpeg/libavcodec/codec_desc.c @@ -3413,6 +3413,13 @@ static const AVCodecDescriptor codec_descriptors[] = { .long_name = NULL_IF_CONFIG_SMALL("AC-4"), .props = AV_CODEC_PROP_LOSSY, }, + { + .id = AV_CODEC_ID_OSQ, + .type = AVMEDIA_TYPE_AUDIO, + .name = "osq", + .long_name = NULL_IF_CONFIG_SMALL("OSQ (Original Sound Quality)"), + .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS, + }, /* subtitle codecs */ { diff --git a/src/third_party/ffmpeg/libavcodec/codec_desc.h b/src/third_party/ffmpeg/libavcodec/codec_desc.h index dd449111..96afd202 100644 --- a/src/third_party/ffmpeg/libavcodec/codec_desc.h +++ b/src/third_party/ffmpeg/libavcodec/codec_desc.h @@ -60,7 +60,7 @@ typedef struct AVCodecDescriptor { const char *const *mime_types; /** * If non-NULL, an array of profiles recognized for this codec. - * Terminated with FF_PROFILE_UNKNOWN. + * Terminated with AV_PROFILE_UNKNOWN. */ const struct AVProfile *profiles; } AVCodecDescriptor; diff --git a/src/third_party/ffmpeg/libavcodec/codec_id.h b/src/third_party/ffmpeg/libavcodec/codec_id.h index a5a0cb85..29b410b8 100644 --- a/src/third_party/ffmpeg/libavcodec/codec_id.h +++ b/src/third_party/ffmpeg/libavcodec/codec_id.h @@ -543,6 +543,7 @@ enum AVCodecID { AV_CODEC_ID_WAVARC, AV_CODEC_ID_RKA, AV_CODEC_ID_AC4, + AV_CODEC_ID_OSQ, /* subtitle codecs */ AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. diff --git a/src/third_party/ffmpeg/libavcodec/codec_par.c b/src/third_party/ffmpeg/libavcodec/codec_par.c index 775c1870..e4e4cd48 100644 --- a/src/third_party/ffmpeg/libavcodec/codec_par.c +++ b/src/third_party/ffmpeg/libavcodec/codec_par.c @@ -47,8 +47,8 @@ static void codec_parameters_reset(AVCodecParameters *par) par->chroma_location = AVCHROMA_LOC_UNSPECIFIED; par->sample_aspect_ratio = (AVRational){ 0, 1 }; par->framerate = (AVRational){ 0, 1 }; - par->profile = FF_PROFILE_UNKNOWN; - par->level = FF_LEVEL_UNKNOWN; + par->profile = AV_PROFILE_UNKNOWN; + par->level = AV_LEVEL_UNKNOWN; } AVCodecParameters *avcodec_parameters_alloc(void) @@ -253,8 +253,8 @@ FF_ENABLE_DEPRECATION_WARNINGS break; } + av_freep(&codec->extradata); if (par->extradata) { - av_freep(&codec->extradata); codec->extradata = av_mallocz(par->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE); if (!codec->extradata) return AVERROR(ENOMEM); diff --git a/src/third_party/ffmpeg/libavcodec/codec_par.h b/src/third_party/ffmpeg/libavcodec/codec_par.h index add90fdb..c1679ea0 100644 --- a/src/third_party/ffmpeg/libavcodec/codec_par.h +++ b/src/third_party/ffmpeg/libavcodec/codec_par.h @@ -29,21 +29,13 @@ #include "libavutil/pixfmt.h" #include "codec_id.h" +#include "defs.h" /** * @addtogroup lavc_core * @{ */ -enum AVFieldOrder { - AV_FIELD_UNKNOWN, - AV_FIELD_PROGRESSIVE, - AV_FIELD_TT, ///< Top coded_first, top displayed first - AV_FIELD_BB, ///< Bottom coded first, bottom displayed first - AV_FIELD_TB, ///< Top coded first, bottom displayed first - AV_FIELD_BT, ///< Bottom coded first, top displayed first -}; - /** * This struct describes the properties of an encoded stream. * diff --git a/src/third_party/ffmpeg/libavcodec/cook.c b/src/third_party/ffmpeg/libavcodec/cook.c index 7d05afcc..705213de 100644 --- a/src/third_party/ffmpeg/libavcodec/cook.c +++ b/src/third_party/ffmpeg/libavcodec/cook.c @@ -208,7 +208,7 @@ static av_cold int build_vlc(VLC *vlc, int nb_bits, const uint8_t counts[16], for (unsigned count = num + counts[i]; num < count; num++) lens[num] = i + 1; - return ff_init_vlc_from_lengths(vlc, nb_bits, num, lens, 1, + return ff_vlc_init_from_lengths(vlc, nb_bits, num, lens, 1, syms, symbol_size, symbol_size, offset, 0, logctx); } @@ -341,11 +341,11 @@ static av_cold int cook_decode_close(AVCodecContext *avctx) /* Free the VLC tables. */ for (i = 0; i < 13; i++) - ff_free_vlc(&q->envelope_quant_index[i]); + ff_vlc_free(&q->envelope_quant_index[i]); for (i = 0; i < 7; i++) - ff_free_vlc(&q->sqvh[i]); + ff_vlc_free(&q->sqvh[i]); for (i = 0; i < q->num_subpackets; i++) - ff_free_vlc(&q->subpacket[i].channel_coupling); + ff_vlc_free(&q->subpacket[i].channel_coupling); av_log(avctx, AV_LOG_DEBUG, "Memory deallocated.\n"); diff --git a/src/third_party/ffmpeg/libavcodec/cscd.c b/src/third_party/ffmpeg/libavcodec/cscd.c index 23dd2df9..685cf18c 100644 --- a/src/third_party/ffmpeg/libavcodec/cscd.c +++ b/src/third_party/ffmpeg/libavcodec/cscd.c @@ -70,6 +70,9 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, int buf_size = avpkt->size; CamStudioContext *c = avctx->priv_data; int ret; + int bpp = avctx->bits_per_coded_sample / 8; + int bugdelta = FFALIGN(avctx->width * bpp, 4) * avctx->height + - (avctx->width & ~3) * bpp * avctx->height; if (buf_size < 2) { av_log(avctx, AV_LOG_ERROR, "coded frame too small\n"); @@ -83,7 +86,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, switch ((buf[0] >> 1) & 7) { case 0: { // lzo compression int outlen = c->decomp_size, inlen = buf_size - 2; - if (av_lzo1x_decode(c->decomp_buf, &outlen, &buf[2], &inlen) || outlen) { + if (av_lzo1x_decode(c->decomp_buf, &outlen, &buf[2], &inlen) || (outlen && outlen != bugdelta)) { av_log(avctx, AV_LOG_ERROR, "error during lzo decompression\n"); return AVERROR_INVALIDDATA; } @@ -92,7 +95,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, case 1: { // zlib compression #if CONFIG_ZLIB unsigned long dlen = c->decomp_size; - if (uncompress(c->decomp_buf, &dlen, &buf[2], buf_size - 2) != Z_OK || dlen != c->decomp_size) { + if (uncompress(c->decomp_buf, &dlen, &buf[2], buf_size - 2) != Z_OK || (dlen != c->decomp_size && dlen != c->decomp_size - bugdelta)) { av_log(avctx, AV_LOG_ERROR, "error during zlib decompression\n"); return AVERROR_INVALIDDATA; } diff --git a/src/third_party/ffmpeg/libavcodec/cuviddec.c b/src/third_party/ffmpeg/libavcodec/cuviddec.c index 814bc53f..da37207c 100644 --- a/src/third_party/ffmpeg/libavcodec/cuviddec.c +++ b/src/third_party/ffmpeg/libavcodec/cuviddec.c @@ -360,6 +360,11 @@ static int CUDAAPI cuvid_handle_video_sequence(void *opaque, CUVIDEOFORMAT* form } } + if(ctx->cuparseinfo.ulMaxNumDecodeSurfaces != cuinfo.ulNumDecodeSurfaces) { + ctx->cuparseinfo.ulMaxNumDecodeSurfaces = cuinfo.ulNumDecodeSurfaces; + return cuinfo.ulNumDecodeSurfaces; + } + return 1; } @@ -1022,7 +1027,7 @@ static av_cold int cuvid_decode_init(AVCodecContext *avctx) goto error; } - ctx->cuparseinfo.ulMaxNumDecodeSurfaces = ctx->nb_surfaces; + ctx->cuparseinfo.ulMaxNumDecodeSurfaces = 1; ctx->cuparseinfo.ulMaxDisplayDelay = (avctx->flags & AV_CODEC_FLAG_LOW_DELAY) ? 0 : CUVID_MAX_DISPLAY_DELAY; ctx->cuparseinfo.pUserData = avctx; ctx->cuparseinfo.pfnSequenceCallback = cuvid_handle_video_sequence; diff --git a/src/third_party/ffmpeg/libavcodec/dca_core.c b/src/third_party/ffmpeg/libavcodec/dca_core.c index c50d005a..60508fab 100644 --- a/src/third_party/ffmpeg/libavcodec/dca_core.c +++ b/src/third_party/ffmpeg/libavcodec/dca_core.c @@ -19,6 +19,7 @@ */ #include "libavutil/channel_layout.h" +#include "libavutil/emms.h" #include "dcaadpcm.h" #include "dcadec.h" #include "dcadata.h" @@ -2386,13 +2387,13 @@ int ff_dca_core_filter_frame(DCACoreDecoder *s, AVFrame *frame) // Set profile, bit rate, etc if (s->ext_audio_mask & DCA_EXSS_MASK) - avctx->profile = FF_PROFILE_DTS_HD_HRA; + avctx->profile = AV_PROFILE_DTS_HD_HRA; else if (s->ext_audio_mask & (DCA_CSS_XXCH | DCA_CSS_XCH)) - avctx->profile = FF_PROFILE_DTS_ES; + avctx->profile = AV_PROFILE_DTS_ES; else if (s->ext_audio_mask & DCA_CSS_X96) - avctx->profile = FF_PROFILE_DTS_96_24; + avctx->profile = AV_PROFILE_DTS_96_24; else - avctx->profile = FF_PROFILE_DTS; + avctx->profile = AV_PROFILE_DTS; if (s->bit_rate > 3 && !(s->ext_audio_mask & DCA_EXSS_MASK)) avctx->bit_rate = s->bit_rate; diff --git a/src/third_party/ffmpeg/libavcodec/dca_lbr.c b/src/third_party/ffmpeg/libavcodec/dca_lbr.c index bef0054d..c9c5c0f8 100644 --- a/src/third_party/ffmpeg/libavcodec/dca_lbr.c +++ b/src/third_party/ffmpeg/libavcodec/dca_lbr.c @@ -1744,7 +1744,7 @@ int ff_dca_lbr_filter_frame(DCALbrDecoder *s, AVFrame *frame) avctx->sample_rate = s->sample_rate; avctx->sample_fmt = AV_SAMPLE_FMT_FLTP; avctx->bits_per_raw_sample = 0; - avctx->profile = FF_PROFILE_DTS_EXPRESS; + avctx->profile = AV_PROFILE_DTS_EXPRESS; avctx->bit_rate = s->bit_rate_scaled; if (s->flags & LBR_FLAG_LFE_PRESENT) { diff --git a/src/third_party/ffmpeg/libavcodec/dca_parser.c b/src/third_party/ffmpeg/libavcodec/dca_parser.c index 3148397b..eb0ef55d 100644 --- a/src/third_party/ffmpeg/libavcodec/dca_parser.c +++ b/src/third_party/ffmpeg/libavcodec/dca_parser.c @@ -228,7 +228,7 @@ static int dca_parse_params(DCAParseContext *pc1, const uint8_t *buf, *sample_rate = ff_dca_sampling_freqs[pc1->sr_code]; *duration = 1024 << ff_dca_freq_ranges[pc1->sr_code]; - *profile = FF_PROFILE_DTS_EXPRESS; + *profile = AV_PROFILE_DTS_EXPRESS; return 0; } @@ -253,7 +253,7 @@ static int dca_parse_params(DCAParseContext *pc1, const uint8_t *buf, *sample_rate = asset->max_sample_rate; *duration = (1 + (*sample_rate > 96000)) << nsamples_log2; - *profile = FF_PROFILE_DTS_HD_MA; + *profile = AV_PROFILE_DTS_HD_MA; return 0; } @@ -268,18 +268,18 @@ static int dca_parse_params(DCAParseContext *pc1, const uint8_t *buf, *duration = h.npcmblocks * DCA_PCMBLOCK_SAMPLES; *sample_rate = ff_dca_sample_rates[h.sr_code]; - if (*profile != FF_PROFILE_UNKNOWN) + if (*profile != AV_PROFILE_UNKNOWN) return 0; - *profile = FF_PROFILE_DTS; + *profile = AV_PROFILE_DTS; if (h.ext_audio_present) { switch (h.ext_audio_type) { case DCA_EXT_AUDIO_XCH: case DCA_EXT_AUDIO_XXCH: - *profile = FF_PROFILE_DTS_ES; + *profile = AV_PROFILE_DTS_ES; break; case DCA_EXT_AUDIO_X96: - *profile = FF_PROFILE_DTS_96_24; + *profile = AV_PROFILE_DTS_96_24; break; } } @@ -296,9 +296,9 @@ static int dca_parse_params(DCAParseContext *pc1, const uint8_t *buf, return 0; if (asset->extension_mask & DCA_EXSS_XLL) - *profile = FF_PROFILE_DTS_HD_MA; + *profile = AV_PROFILE_DTS_HD_MA; else if (asset->extension_mask & (DCA_EXSS_XBR | DCA_EXSS_XXCH | DCA_EXSS_X96)) - *profile = FF_PROFILE_DTS_HD_HRA; + *profile = AV_PROFILE_DTS_HD_HRA; return 0; } diff --git a/src/third_party/ffmpeg/libavcodec/dca_xll.c b/src/third_party/ffmpeg/libavcodec/dca_xll.c index b8cf37a3..15f9bd91 100644 --- a/src/third_party/ffmpeg/libavcodec/dca_xll.c +++ b/src/third_party/ffmpeg/libavcodec/dca_xll.c @@ -1446,11 +1446,11 @@ int ff_dca_xll_filter_frame(DCAXllDecoder *s, AVFrame *frame) } if (s->x_imax_syncword_present) { - avctx->profile = FF_PROFILE_DTS_HD_MA_X_IMAX; + avctx->profile = AV_PROFILE_DTS_HD_MA_X_IMAX; } else if (s->x_syncword_present) { - avctx->profile = FF_PROFILE_DTS_HD_MA_X; + avctx->profile = AV_PROFILE_DTS_HD_MA_X; } else { - avctx->profile = FF_PROFILE_DTS_HD_MA; + avctx->profile = AV_PROFILE_DTS_HD_MA; } avctx->bits_per_raw_sample = p->storage_bit_res; diff --git a/src/third_party/ffmpeg/libavcodec/dcadec.c b/src/third_party/ffmpeg/libavcodec/dcadec.c index 3e3e3053..1fee49cf 100644 --- a/src/third_party/ffmpeg/libavcodec/dcadec.c +++ b/src/third_party/ffmpeg/libavcodec/dcadec.c @@ -217,11 +217,10 @@ static int dcadec_decode_frame(AVCodecContext *avctx, AVFrame *frame, if (asset && (asset->extension_mask & DCA_EXSS_XLL)) { if ((ret = ff_dca_xll_parse(&s->xll, input, asset)) < 0) { // Conceal XLL synchronization error - if (ret == AVERROR(EAGAIN) - && (prev_packet & DCA_PACKET_XLL) - && (s->packet & DCA_PACKET_CORE)) - s->packet |= DCA_PACKET_XLL | DCA_PACKET_RECOVERY; - else if (ret == AVERROR(ENOMEM) || (avctx->err_recognition & AV_EF_EXPLODE)) + if (ret == AVERROR(EAGAIN)) { + if ((prev_packet & DCA_PACKET_XLL) && (s->packet & DCA_PACKET_CORE)) + s->packet |= DCA_PACKET_XLL | DCA_PACKET_RECOVERY; + } else if (ret == AVERROR(ENOMEM) || (avctx->err_recognition & AV_EF_EXPLODE)) return ret; } else { s->packet |= DCA_PACKET_XLL; diff --git a/src/third_party/ffmpeg/libavcodec/dcahuff.c b/src/third_party/ffmpeg/libavcodec/dcahuff.c index af3a6e53..7c4b1d82 100644 --- a/src/third_party/ffmpeg/libavcodec/dcahuff.c +++ b/src/third_party/ffmpeg/libavcodec/dcahuff.c @@ -796,9 +796,9 @@ av_cold void ff_dca_init_vlcs(void) do { \ vlc.table = &dca_table[offset]; \ vlc.table_allocated = FF_ARRAY_ELEMS(dca_table) - offset; \ - ff_init_vlc_from_lengths(&vlc, nb_bits, nb_codes, &src_table[0][1], 2, \ + ff_vlc_init_from_lengths(&vlc, nb_bits, nb_codes, &src_table[0][1], 2, \ &src_table[0][0], 2, 1, entry_offset, \ - INIT_VLC_STATIC_OVERLONG, NULL); \ + VLC_INIT_STATIC_OVERLONG, NULL); \ offset += vlc.table_size; \ src_table += nb_codes; \ } while (0) @@ -822,9 +822,9 @@ av_cold void ff_dca_init_vlcs(void) do { \ vlc.table = &dca_table[offset]; \ vlc.table_allocated = FF_ARRAY_ELEMS(dca_table) - offset; \ - ff_init_vlc_from_lengths(&vlc, nb_bits, nb_codes, &src_table[0][1], 2, \ + ff_vlc_init_from_lengths(&vlc, nb_bits, nb_codes, &src_table[0][1], 2, \ &src_table[0][0], 2, 1, entry_offset, \ - INIT_VLC_STATIC_OVERLONG | INIT_VLC_LE,\ + VLC_INIT_STATIC_OVERLONG | VLC_INIT_LE,\ NULL); \ offset += vlc.table_size; \ src_table += nb_codes; \ diff --git a/src/third_party/ffmpeg/libavcodec/dct.h b/src/third_party/ffmpeg/libavcodec/dct.h index 0a03e256..17c881a6 100644 --- a/src/third_party/ffmpeg/libavcodec/dct.h +++ b/src/third_party/ffmpeg/libavcodec/dct.h @@ -21,44 +21,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(AVCODEC_DCT_H) && (!defined(FFT_FLOAT) || FFT_FLOAT) +#ifndef AVCODEC_DCT_H #define AVCODEC_DCT_H #include #include -#include "rdft.h" - -struct DCTContext { - int nbits; - int inverse; - RDFTContext rdft; - const float *costab; - FFTSample *csc2; - void (*dct_calc)(struct DCTContext *s, FFTSample *data); - void (*dct32)(FFTSample *out, const FFTSample *in); -}; - -/** - * Set up DCT. - * @param nbits size of the input array: - * (1 << nbits) for DCT-II, DCT-III and DST-I - * (1 << nbits) + 1 for DCT-I - * - * @note the first element of the input of DST-I is ignored - */ -int ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType type); -void ff_dct_end (DCTContext *s); - -void ff_dct_init_x86(DCTContext *s); - -void ff_fdct_ifast(int16_t *data); -void ff_fdct_ifast248(int16_t *data); -void ff_jpeg_fdct_islow_8(int16_t *data); -void ff_jpeg_fdct_islow_10(int16_t *data); -void ff_fdct248_islow_8(int16_t *data); -void ff_fdct248_islow_10(int16_t *data); - void ff_j_rev_dct(int16_t *data); void ff_j_rev_dct4(int16_t *data); void ff_j_rev_dct2(int16_t *data); diff --git a/src/third_party/ffmpeg/libavcodec/decode.c b/src/third_party/ffmpeg/libavcodec/decode.c index f0e6acc0..8f94678e 100644 --- a/src/third_party/ffmpeg/libavcodec/decode.c +++ b/src/third_party/ffmpeg/libavcodec/decode.c @@ -32,6 +32,7 @@ #include "libavutil/bprint.h" #include "libavutil/channel_layout.h" #include "libavutil/common.h" +#include "libavutil/emms.h" #include "libavutil/fifo.h" #include "libavutil/frame.h" #include "libavutil/hwcontext.h" @@ -44,8 +45,10 @@ #include "avcodec_internal.h" #include "bytestream.h" #include "bsf.h" +#include "codec_desc.h" #include "codec_internal.h" #include "decode.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "internal.h" #include "packet_internal.h" @@ -104,15 +107,26 @@ FF_DISABLE_DEPRECATION_WARNINGS ret = AVERROR_INVALIDDATA; goto fail2; } - avctx->channels = val; + av_channel_layout_uninit(&avctx->ch_layout); + avctx->ch_layout.nb_channels = val; + avctx->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; size -= 4; } if (flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) { if (size < 8) goto fail; - avctx->channel_layout = bytestream_get_le64(&data); + av_channel_layout_uninit(&avctx->ch_layout); + ret = av_channel_layout_from_mask(&avctx->ch_layout, bytestream_get_le64(&data)); + if (ret < 0) + goto fail2; size -= 8; } + if (flags & (AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT | + AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT)) { + avctx->channels = avctx->ch_layout.nb_channels; + avctx->channel_layout = (avctx->ch_layout.order == AV_CHANNEL_ORDER_NATIVE) ? + avctx->ch_layout.u.mask : 0; + } FF_ENABLE_DEPRECATION_WARNINGS #endif if (flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) { @@ -444,6 +458,9 @@ FF_ENABLE_DEPRECATION_WARNINGS if (ret == AVERROR(EAGAIN)) av_frame_unref(frame); + // FF_CODEC_CB_TYPE_DECODE decoders must not return AVERROR EAGAIN + // code later will add AVERROR(EAGAIN) to a pointer + av_assert0(consumed != AVERROR(EAGAIN)); if (consumed < 0) ret = consumed; if (consumed >= 0 && avctx->codec->type == AVMEDIA_TYPE_VIDEO) @@ -520,7 +537,9 @@ static int detect_colorspace(AVCodecContext *avctx, AVFrame *frame) if (!profile) return AVERROR_INVALIDDATA; - ret = ff_icc_profile_read_primaries(&avci->icc, profile, &coeffs); + ret = ff_icc_profile_sanitize(&avci->icc, profile); + if (!ret) + ret = ff_icc_profile_read_primaries(&avci->icc, profile, &coeffs); if (!ret) ret = ff_icc_profile_detect_transfer(&avci->icc, profile, &trc); cmsCloseProfile(profile); @@ -1148,7 +1167,7 @@ int avcodec_get_hw_frames_parameters(AVCodecContext *avctx, { AVBufferRef *frames_ref = NULL; const AVCodecHWConfigInternal *hw_config; - const AVHWAccel *hwa; + const FFHWAccel *hwa; int i, ret; for (i = 0;; i++) { @@ -1200,14 +1219,14 @@ int avcodec_get_hw_frames_parameters(AVCodecContext *avctx, } static int hwaccel_init(AVCodecContext *avctx, - const AVHWAccel *hwaccel) + const FFHWAccel *hwaccel) { int err; - if (hwaccel->capabilities & AV_HWACCEL_CODEC_CAP_EXPERIMENTAL && + if (hwaccel->p.capabilities & AV_HWACCEL_CODEC_CAP_EXPERIMENTAL && avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) { av_log(avctx, AV_LOG_WARNING, "Ignoring experimental hwaccel: %s\n", - hwaccel->name); + hwaccel->p.name); return AVERROR_PATCHWELCOME; } @@ -1218,13 +1237,13 @@ static int hwaccel_init(AVCodecContext *avctx, return AVERROR(ENOMEM); } - avctx->hwaccel = hwaccel; + avctx->hwaccel = &hwaccel->p; if (hwaccel->init) { err = hwaccel->init(avctx); if (err < 0) { av_log(avctx, AV_LOG_ERROR, "Failed setup for format %s: " "hwaccel initialisation returned error.\n", - av_get_pix_fmt_name(hwaccel->pix_fmt)); + av_get_pix_fmt_name(hwaccel->p.pix_fmt)); av_freep(&avctx->internal->hwaccel_priv_data); avctx->hwaccel = NULL; return err; @@ -1236,8 +1255,8 @@ static int hwaccel_init(AVCodecContext *avctx, void ff_hwaccel_uninit(AVCodecContext *avctx) { - if (avctx->hwaccel && avctx->hwaccel->uninit) - avctx->hwaccel->uninit(avctx); + if (FF_HW_HAS_CB(avctx, uninit)) + FF_HW_SIMPLE_CALL(avctx, uninit); av_freep(&avctx->internal->hwaccel_priv_data); @@ -1460,10 +1479,11 @@ FF_ENABLE_DEPRECATION_WARNINGS int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame) { - const AVPacket *pkt = avctx->internal->last_pkt_props; int ret; if (!(ffcodec(avctx->codec)->caps_internal & FF_CODEC_CAP_SETS_FRAME_PROPS)) { + const AVPacket *pkt = avctx->internal->last_pkt_props; + ret = ff_decode_frame_props_from_pkt(avctx, frame, pkt); if (ret < 0) return ret; @@ -1558,7 +1578,7 @@ int ff_attach_decode_data(AVFrame *frame) int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags) { - const AVHWAccel *hwaccel = avctx->hwaccel; + const FFHWAccel *hwaccel = ffhwaccel(avctx->hwaccel); int override_dimensions = 1; int ret; @@ -1777,24 +1797,36 @@ int ff_copy_palette(void *dst, const AVPacket *src, void *logctx) return 0; } -AVBufferRef *ff_hwaccel_frame_priv_alloc(AVCodecContext *avctx, - const AVHWAccel *hwaccel) +int ff_hwaccel_frame_priv_alloc(AVCodecContext *avctx, void **hwaccel_picture_private, + AVBufferRef **hwaccel_priv_buf) { + const FFHWAccel *hwaccel = ffhwaccel(avctx->hwaccel); AVBufferRef *ref; - AVHWFramesContext *frames_ctx = (AVHWFramesContext *)avctx->hw_frames_ctx->data; - uint8_t *data = av_mallocz(hwaccel->frame_priv_data_size); + AVHWFramesContext *frames_ctx; + uint8_t *data; + + if (!hwaccel || !hwaccel->frame_priv_data_size) + return 0; + + av_assert0(!*hwaccel_picture_private); + data = av_mallocz(hwaccel->frame_priv_data_size); if (!data) - return NULL; + return AVERROR(ENOMEM); + + frames_ctx = (AVHWFramesContext *)avctx->hw_frames_ctx->data; ref = av_buffer_create(data, hwaccel->frame_priv_data_size, hwaccel->free_frame_priv, frames_ctx->device_ctx, 0); if (!ref) { av_free(data); - return NULL; + return AVERROR(ENOMEM); } - return ref; + *hwaccel_priv_buf = ref; + *hwaccel_picture_private = ref->data; + + return 0; } void ff_decode_flush_buffers(AVCodecContext *avctx) diff --git a/src/third_party/ffmpeg/libavcodec/decode.h b/src/third_party/ffmpeg/libavcodec/decode.h index 2b9fe599..a52152e4 100644 --- a/src/third_party/ffmpeg/libavcodec/decode.h +++ b/src/third_party/ffmpeg/libavcodec/decode.h @@ -140,14 +140,17 @@ int ff_side_data_update_matrix_encoding(AVFrame *frame, enum AVMatrixEncoding matrix_encoding); /** - * Allocate a hwaccel frame private data and create an AVBufferRef - * from it. + * Allocate a hwaccel frame private data if the provided avctx + * uses a hwaccel method that needs it. The private data will + * be refcounted via the AVBuffer API (if allocated). * - * @param avctx The codec context which to attach as an opaque value - * @param hwaccel The hwaccel for which to allocate - * @return The allocated buffer + * @param avctx The codec context + * @param hwaccel_picture_private Pointer to return hwaccel_picture_private + * @param hwaccel_priv_buf Pointer to return the AVBufferRef owning + * hwaccel_picture_private + * @return 0 on success, < 0 on error */ -AVBufferRef *ff_hwaccel_frame_priv_alloc(AVCodecContext *avctx, - const AVHWAccel *hwaccel); +int ff_hwaccel_frame_priv_alloc(AVCodecContext *avctx, void **hwaccel_picture_private, + AVBufferRef **hwaccel_priv_buf); #endif /* AVCODEC_DECODE_H */ diff --git a/src/third_party/ffmpeg/libavcodec/defs.h b/src/third_party/ffmpeg/libavcodec/defs.h index fbe3254d..00d840ec 100644 --- a/src/third_party/ffmpeg/libavcodec/defs.h +++ b/src/third_party/ffmpeg/libavcodec/defs.h @@ -61,6 +61,149 @@ #define FF_COMPLIANCE_UNOFFICIAL -1 ///< Allow unofficial extensions #define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things. + +#define AV_PROFILE_UNKNOWN -99 +#define AV_PROFILE_RESERVED -100 + +#define AV_PROFILE_AAC_MAIN 0 +#define AV_PROFILE_AAC_LOW 1 +#define AV_PROFILE_AAC_SSR 2 +#define AV_PROFILE_AAC_LTP 3 +#define AV_PROFILE_AAC_HE 4 +#define AV_PROFILE_AAC_HE_V2 28 +#define AV_PROFILE_AAC_LD 22 +#define AV_PROFILE_AAC_ELD 38 +#define AV_PROFILE_MPEG2_AAC_LOW 128 +#define AV_PROFILE_MPEG2_AAC_HE 131 + +#define AV_PROFILE_DNXHD 0 +#define AV_PROFILE_DNXHR_LB 1 +#define AV_PROFILE_DNXHR_SQ 2 +#define AV_PROFILE_DNXHR_HQ 3 +#define AV_PROFILE_DNXHR_HQX 4 +#define AV_PROFILE_DNXHR_444 5 + +#define AV_PROFILE_DTS 20 +#define AV_PROFILE_DTS_ES 30 +#define AV_PROFILE_DTS_96_24 40 +#define AV_PROFILE_DTS_HD_HRA 50 +#define AV_PROFILE_DTS_HD_MA 60 +#define AV_PROFILE_DTS_EXPRESS 70 +#define AV_PROFILE_DTS_HD_MA_X 61 +#define AV_PROFILE_DTS_HD_MA_X_IMAX 62 + +#define AV_PROFILE_EAC3_DDP_ATMOS 30 + +#define AV_PROFILE_TRUEHD_ATMOS 30 + +#define AV_PROFILE_MPEG2_422 0 +#define AV_PROFILE_MPEG2_HIGH 1 +#define AV_PROFILE_MPEG2_SS 2 +#define AV_PROFILE_MPEG2_SNR_SCALABLE 3 +#define AV_PROFILE_MPEG2_MAIN 4 +#define AV_PROFILE_MPEG2_SIMPLE 5 + +#define AV_PROFILE_H264_CONSTRAINED (1<<9) // 8+1; constraint_set1_flag +#define AV_PROFILE_H264_INTRA (1<<11) // 8+3; constraint_set3_flag + +#define AV_PROFILE_H264_BASELINE 66 +#define AV_PROFILE_H264_CONSTRAINED_BASELINE (66|AV_PROFILE_H264_CONSTRAINED) +#define AV_PROFILE_H264_MAIN 77 +#define AV_PROFILE_H264_EXTENDED 88 +#define AV_PROFILE_H264_HIGH 100 +#define AV_PROFILE_H264_HIGH_10 110 +#define AV_PROFILE_H264_HIGH_10_INTRA (110|AV_PROFILE_H264_INTRA) +#define AV_PROFILE_H264_MULTIVIEW_HIGH 118 +#define AV_PROFILE_H264_HIGH_422 122 +#define AV_PROFILE_H264_HIGH_422_INTRA (122|AV_PROFILE_H264_INTRA) +#define AV_PROFILE_H264_STEREO_HIGH 128 +#define AV_PROFILE_H264_HIGH_444 144 +#define AV_PROFILE_H264_HIGH_444_PREDICTIVE 244 +#define AV_PROFILE_H264_HIGH_444_INTRA (244|AV_PROFILE_H264_INTRA) +#define AV_PROFILE_H264_CAVLC_444 44 + +#define AV_PROFILE_VC1_SIMPLE 0 +#define AV_PROFILE_VC1_MAIN 1 +#define AV_PROFILE_VC1_COMPLEX 2 +#define AV_PROFILE_VC1_ADVANCED 3 + +#define AV_PROFILE_MPEG4_SIMPLE 0 +#define AV_PROFILE_MPEG4_SIMPLE_SCALABLE 1 +#define AV_PROFILE_MPEG4_CORE 2 +#define AV_PROFILE_MPEG4_MAIN 3 +#define AV_PROFILE_MPEG4_N_BIT 4 +#define AV_PROFILE_MPEG4_SCALABLE_TEXTURE 5 +#define AV_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION 6 +#define AV_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE 7 +#define AV_PROFILE_MPEG4_HYBRID 8 +#define AV_PROFILE_MPEG4_ADVANCED_REAL_TIME 9 +#define AV_PROFILE_MPEG4_CORE_SCALABLE 10 +#define AV_PROFILE_MPEG4_ADVANCED_CODING 11 +#define AV_PROFILE_MPEG4_ADVANCED_CORE 12 +#define AV_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13 +#define AV_PROFILE_MPEG4_SIMPLE_STUDIO 14 +#define AV_PROFILE_MPEG4_ADVANCED_SIMPLE 15 + +#define AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 1 +#define AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 2 +#define AV_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION 32768 +#define AV_PROFILE_JPEG2000_DCINEMA_2K 3 +#define AV_PROFILE_JPEG2000_DCINEMA_4K 4 + +#define AV_PROFILE_VP9_0 0 +#define AV_PROFILE_VP9_1 1 +#define AV_PROFILE_VP9_2 2 +#define AV_PROFILE_VP9_3 3 + +#define AV_PROFILE_HEVC_MAIN 1 +#define AV_PROFILE_HEVC_MAIN_10 2 +#define AV_PROFILE_HEVC_MAIN_STILL_PICTURE 3 +#define AV_PROFILE_HEVC_REXT 4 +#define AV_PROFILE_HEVC_SCC 9 + +#define AV_PROFILE_VVC_MAIN_10 1 +#define AV_PROFILE_VVC_MAIN_10_444 33 + +#define AV_PROFILE_AV1_MAIN 0 +#define AV_PROFILE_AV1_HIGH 1 +#define AV_PROFILE_AV1_PROFESSIONAL 2 + +#define AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT 0xc0 +#define AV_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT 0xc1 +#define AV_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT 0xc2 +#define AV_PROFILE_MJPEG_HUFFMAN_LOSSLESS 0xc3 +#define AV_PROFILE_MJPEG_JPEG_LS 0xf7 + +#define AV_PROFILE_SBC_MSBC 1 + +#define AV_PROFILE_PRORES_PROXY 0 +#define AV_PROFILE_PRORES_LT 1 +#define AV_PROFILE_PRORES_STANDARD 2 +#define AV_PROFILE_PRORES_HQ 3 +#define AV_PROFILE_PRORES_4444 4 +#define AV_PROFILE_PRORES_XQ 5 + +#define AV_PROFILE_ARIB_PROFILE_A 0 +#define AV_PROFILE_ARIB_PROFILE_C 1 + +#define AV_PROFILE_KLVA_SYNC 0 +#define AV_PROFILE_KLVA_ASYNC 1 + +#define AV_PROFILE_EVC_BASELINE 0 +#define AV_PROFILE_EVC_MAIN 1 + + +#define AV_LEVEL_UNKNOWN -99 + +enum AVFieldOrder { + AV_FIELD_UNKNOWN, + AV_FIELD_PROGRESSIVE, + AV_FIELD_TT, ///< Top coded_first, top displayed first + AV_FIELD_BB, ///< Bottom coded first, bottom displayed first + AV_FIELD_TB, ///< Top coded first, bottom displayed first + AV_FIELD_BT, ///< Bottom coded first, top displayed first +}; + /** * @ingroup lavc_decoding */ diff --git a/src/third_party/ffmpeg/libavcodec/dirac.c b/src/third_party/ffmpeg/libavcodec/dirac.c index bc51a2fb..47363049 100644 --- a/src/third_party/ffmpeg/libavcodec/dirac.c +++ b/src/third_party/ffmpeg/libavcodec/dirac.c @@ -26,9 +26,12 @@ * @author Marco Gerards , David Conrad, Jordi Ortiz */ +#include "config.h" + #include "libavutil/pixdesc.h" #include "dirac.h" +#include "get_bits.h" #include "golomb.h" #include "mpeg12data.h" diff --git a/src/third_party/ffmpeg/libavcodec/dirac.h b/src/third_party/ffmpeg/libavcodec/dirac.h index e6d9d346..8c348cdc 100644 --- a/src/third_party/ffmpeg/libavcodec/dirac.h +++ b/src/third_party/ffmpeg/libavcodec/dirac.h @@ -31,7 +31,11 @@ * @author Jordi Ortiz */ -#include "avcodec.h" +#include +#include + +#include "libavutil/pixfmt.h" +#include "libavutil/rational.h" /** * The spec limits the number of wavelet decompositions to 4 for both diff --git a/src/third_party/ffmpeg/libavcodec/dirac_dwt.c b/src/third_party/ffmpeg/libavcodec/dirac_dwt.c index 4039899c..d473f64d 100644 --- a/src/third_party/ffmpeg/libavcodec/dirac_dwt.c +++ b/src/third_party/ffmpeg/libavcodec/dirac_dwt.c @@ -21,6 +21,7 @@ #include "libavutil/attributes.h" #include "libavutil/common.h" +#include "libavutil/log.h" #include "dirac_dwt.h" #define TEMPLATE_8bit diff --git a/src/third_party/ffmpeg/libavcodec/dnxhddata.c b/src/third_party/ffmpeg/libavcodec/dnxhddata.c index d52abe87..ce06d77f 100644 --- a/src/third_party/ffmpeg/libavcodec/dnxhddata.c +++ b/src/third_party/ffmpeg/libavcodec/dnxhddata.c @@ -22,7 +22,7 @@ #include #include "libavutil/log.h" #include "libavutil/macros.h" -#include "avcodec.h" +#include "defs.h" #include "dnxhddata.h" /* The quantization tables below are in zigzag order! */ @@ -1110,15 +1110,15 @@ int ff_dnxhd_get_hr_frame_size(int cid, int w, int h) static int dnxhd_find_hr_cid(AVCodecContext *avctx) { switch (avctx->profile) { - case FF_PROFILE_DNXHR_444: + case AV_PROFILE_DNXHR_444: return 1270; - case FF_PROFILE_DNXHR_HQX: + case AV_PROFILE_DNXHR_HQX: return 1271; - case FF_PROFILE_DNXHR_HQ: + case AV_PROFILE_DNXHR_HQ: return 1272; - case FF_PROFILE_DNXHR_SQ: + case AV_PROFILE_DNXHR_SQ: return 1273; - case FF_PROFILE_DNXHR_LB: + case AV_PROFILE_DNXHR_LB: return 1274; } return 0; @@ -1129,7 +1129,7 @@ int ff_dnxhd_find_cid(AVCodecContext *avctx, int bit_depth) int i, j; int mbs = avctx->bit_rate / 1000000; - if (avctx->profile != FF_PROFILE_DNXHD) + if (avctx->profile != AV_PROFILE_DNXHD) return dnxhd_find_hr_cid(avctx); if (!mbs) diff --git a/src/third_party/ffmpeg/libavcodec/dnxhddec.c b/src/third_party/ffmpeg/libavcodec/dnxhddec.c index 84bd0e61..d96b82c0 100644 --- a/src/third_party/ffmpeg/libavcodec/dnxhddec.c +++ b/src/third_party/ffmpeg/libavcodec/dnxhddec.c @@ -130,21 +130,22 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, uint32_t cid, int bitdepth) ctx->cid_table = cid_table; av_log(ctx->avctx, AV_LOG_VERBOSE, "Profile cid %"PRIu32".\n", cid); - ff_free_vlc(&ctx->ac_vlc); - ff_free_vlc(&ctx->dc_vlc); - ff_free_vlc(&ctx->run_vlc); + ff_vlc_free(&ctx->ac_vlc); + ff_vlc_free(&ctx->dc_vlc); + ff_vlc_free(&ctx->run_vlc); - if ((ret = init_vlc(&ctx->ac_vlc, DNXHD_VLC_BITS, 257, + if ((ret = vlc_init(&ctx->ac_vlc, DNXHD_VLC_BITS, 257, ctx->cid_table->ac_bits, 1, 1, ctx->cid_table->ac_codes, 2, 2, 0)) < 0) goto out; - if ((ret = init_vlc(&ctx->dc_vlc, DNXHD_DC_VLC_BITS, bitdepth > 8 ? 14 : 12, + if ((ret = vlc_init(&ctx->dc_vlc, DNXHD_DC_VLC_BITS, bitdepth > 8 ? 14 : 12, ctx->cid_table->dc_bits, 1, 1, ctx->cid_table->dc_codes, 1, 1, 0)) < 0) goto out; - if ((ret = init_vlc(&ctx->run_vlc, DNXHD_VLC_BITS, 62, + if ((ret = ff_vlc_init_sparse(&ctx->run_vlc, DNXHD_VLC_BITS, 62, ctx->cid_table->run_bits, 1, 1, - ctx->cid_table->run_codes, 2, 2, 0)) < 0) + ctx->cid_table->run_codes, 2, 2, + ctx->cid_table->run, 1, 1, 0)) < 0) goto out; ctx->cid = cid; @@ -152,7 +153,7 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, uint32_t cid, int bitdepth) ret = 0; out: if (ret < 0) - av_log(ctx->avctx, AV_LOG_ERROR, "init_vlc failed\n"); + av_log(ctx->avctx, AV_LOG_ERROR, "vlc_init failed\n"); return ret; } @@ -160,17 +161,17 @@ static int dnxhd_get_profile(int cid) { switch(cid) { case 1270: - return FF_PROFILE_DNXHR_444; + return AV_PROFILE_DNXHR_444; case 1271: - return FF_PROFILE_DNXHR_HQX; + return AV_PROFILE_DNXHR_HQX; case 1272: - return FF_PROFILE_DNXHR_HQ; + return AV_PROFILE_DNXHR_HQ; case 1273: - return FF_PROFILE_DNXHR_SQ; + return AV_PROFILE_DNXHR_SQ; case 1274: - return FF_PROFILE_DNXHR_LB; + return AV_PROFILE_DNXHR_LB; } - return FF_PROFILE_DNXHD; + return AV_PROFILE_DNXHD; } static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, @@ -262,7 +263,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, ctx->decode_dct_block = dnxhd_decode_dct_block_12; ctx->pix_fmt = AV_PIX_FMT_YUV422P12; } else if (bitdepth == 10) { - if (ctx->avctx->profile == FF_PROFILE_DNXHR_HQX) + if (ctx->avctx->profile == AV_PROFILE_DNXHR_HQX) ctx->decode_dct_block = dnxhd_decode_dct_block_10_444; else ctx->decode_dct_block = dnxhd_decode_dct_block_10; @@ -358,7 +359,7 @@ static av_always_inline int dnxhd_decode_dct_block(const DNXHDContext *ctx, int level_shift, int dc_shift) { - int i, j, index1, index2, len, flags; + int i, j, index1, len, flags; int level, component, sign; const int *scale; const uint8_t *weight_matrix; @@ -425,10 +426,11 @@ static av_always_inline int dnxhd_decode_dct_block(const DNXHDContext *ctx, } if (flags & 2) { + int run; UPDATE_CACHE(bs, &row->gb); - GET_VLC(index2, bs, &row->gb, ctx->run_vlc.table, + GET_VLC(run, bs, &row->gb, ctx->run_vlc.table, DNXHD_VLC_BITS, 2); - i += ctx->cid_table->run[index2]; + i += run; } if (++i > 63) { @@ -716,9 +718,9 @@ static av_cold int dnxhd_decode_close(AVCodecContext *avctx) { DNXHDContext *ctx = avctx->priv_data; - ff_free_vlc(&ctx->ac_vlc); - ff_free_vlc(&ctx->dc_vlc); - ff_free_vlc(&ctx->run_vlc); + ff_vlc_free(&ctx->ac_vlc); + ff_vlc_free(&ctx->dc_vlc); + ff_vlc_free(&ctx->run_vlc); av_freep(&ctx->rows); diff --git a/src/third_party/ffmpeg/libavcodec/dnxhdenc.c b/src/third_party/ffmpeg/libavcodec/dnxhdenc.c index a1852fa6..f52a2e99 100644 --- a/src/third_party/ffmpeg/libavcodec/dnxhdenc.c +++ b/src/third_party/ffmpeg/libavcodec/dnxhdenc.c @@ -54,19 +54,19 @@ static const AVOption options[] = { offsetof(DNXHDEncContext, intra_quant_bias), AV_OPT_TYPE_INT, { .i64 = 0 }, INT_MIN, INT_MAX, VE }, { "profile", NULL, offsetof(DNXHDEncContext, profile), AV_OPT_TYPE_INT, - { .i64 = FF_PROFILE_DNXHD }, - FF_PROFILE_DNXHD, FF_PROFILE_DNXHR_444, VE, "profile" }, - { "dnxhd", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_DNXHD }, + { .i64 = AV_PROFILE_DNXHD }, + AV_PROFILE_DNXHD, AV_PROFILE_DNXHR_444, VE, "profile" }, + { "dnxhd", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_DNXHD }, 0, 0, VE, "profile" }, - { "dnxhr_444", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_DNXHR_444 }, + { "dnxhr_444", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_DNXHR_444 }, 0, 0, VE, "profile" }, - { "dnxhr_hqx", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_DNXHR_HQX }, + { "dnxhr_hqx", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_DNXHR_HQX }, 0, 0, VE, "profile" }, - { "dnxhr_hq", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_DNXHR_HQ }, + { "dnxhr_hq", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_DNXHR_HQ }, 0, 0, VE, "profile" }, - { "dnxhr_sq", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_DNXHR_SQ }, + { "dnxhr_sq", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_DNXHR_SQ }, 0, 0, VE, "profile" }, - { "dnxhr_lb", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_DNXHR_LB }, + { "dnxhr_lb", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_DNXHR_LB }, 0, 0, VE, "profile" }, { NULL } }; @@ -367,30 +367,30 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx) break; } - if ((ctx->profile == FF_PROFILE_DNXHR_444 && (avctx->pix_fmt != AV_PIX_FMT_YUV444P10 && + if ((ctx->profile == AV_PROFILE_DNXHR_444 && (avctx->pix_fmt != AV_PIX_FMT_YUV444P10 && avctx->pix_fmt != AV_PIX_FMT_GBRP10)) || - (ctx->profile != FF_PROFILE_DNXHR_444 && (avctx->pix_fmt == AV_PIX_FMT_YUV444P10 || + (ctx->profile != AV_PROFILE_DNXHR_444 && (avctx->pix_fmt == AV_PIX_FMT_YUV444P10 || avctx->pix_fmt == AV_PIX_FMT_GBRP10))) { av_log(avctx, AV_LOG_ERROR, "pixel format is incompatible with DNxHD profile\n"); return AVERROR(EINVAL); } - if (ctx->profile == FF_PROFILE_DNXHR_HQX && avctx->pix_fmt != AV_PIX_FMT_YUV422P10) { + if (ctx->profile == AV_PROFILE_DNXHR_HQX && avctx->pix_fmt != AV_PIX_FMT_YUV422P10) { av_log(avctx, AV_LOG_ERROR, "pixel format is incompatible with DNxHR HQX profile\n"); return AVERROR(EINVAL); } - if ((ctx->profile == FF_PROFILE_DNXHR_LB || - ctx->profile == FF_PROFILE_DNXHR_SQ || - ctx->profile == FF_PROFILE_DNXHR_HQ) && avctx->pix_fmt != AV_PIX_FMT_YUV422P) { + if ((ctx->profile == AV_PROFILE_DNXHR_LB || + ctx->profile == AV_PROFILE_DNXHR_SQ || + ctx->profile == AV_PROFILE_DNXHR_HQ) && avctx->pix_fmt != AV_PIX_FMT_YUV422P) { av_log(avctx, AV_LOG_ERROR, "pixel format is incompatible with DNxHR LB/SQ/HQ profile\n"); return AVERROR(EINVAL); } - ctx->is_444 = ctx->profile == FF_PROFILE_DNXHR_444; + ctx->is_444 = ctx->profile == AV_PROFILE_DNXHR_444; avctx->profile = ctx->profile; ctx->cid = ff_dnxhd_find_cid(avctx, ctx->bit_depth); if (!ctx->cid) { @@ -426,13 +426,13 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx) ff_pixblockdsp_init(&ctx->m.pdsp, avctx); ff_dct_encode_init(&ctx->m); - if (ctx->profile != FF_PROFILE_DNXHD) + if (ctx->profile != AV_PROFILE_DNXHD) ff_videodsp_init(&ctx->m.vdsp, ctx->bit_depth); if (!ctx->m.dct_quantize) ctx->m.dct_quantize = ff_dct_quantize_c; - if (ctx->is_444 || ctx->profile == FF_PROFILE_DNXHR_HQX) { + if (ctx->is_444 || ctx->profile == AV_PROFILE_DNXHR_HQX) { ctx->m.dct_quantize = dnxhd_10bit_dct_quantize_444; ctx->get_pixels_8x4_sym = dnxhd_10bit_get_pixels_8x4_sym; ctx->block_width_l2 = 4; @@ -457,7 +457,7 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx) ctx->m.mb_height /= 2; } - if (ctx->interlaced && ctx->profile != FF_PROFILE_DNXHD) { + if (ctx->interlaced && ctx->profile != AV_PROFILE_DNXHD) { av_log(avctx, AV_LOG_ERROR, "Interlaced encoding is not supported for DNxHR profiles.\n"); return AVERROR(EINVAL); diff --git a/src/third_party/ffmpeg/libavcodec/dolby_e.c b/src/third_party/ffmpeg/libavcodec/dolby_e.c index 921c33f3..b8dac0fa 100644 --- a/src/third_party/ffmpeg/libavcodec/dolby_e.c +++ b/src/third_party/ffmpeg/libavcodec/dolby_e.c @@ -1200,7 +1200,7 @@ static av_cold void init_tables(void) gain_tab[i] = exp2f((i - 960) / 64.0f); // short 1 - ff_kbd_window_init(window, 3.0f, 128); + avpriv_kbd_window_init(window, 3.0f, 128); for (i = 0; i < 128; i++) window[128 + i] = window[127 - i]; @@ -1227,7 +1227,7 @@ static av_cold void init_tables(void) window[1088 + i] = 1.0f; // long - ff_kbd_window_init(window + 1408, 3.0f, 256); + avpriv_kbd_window_init(window + 1408, 3.0f, 256); for (i = 0; i < 640; i++) window[1664 + i] = 1.0f; for (i = 0; i < 256; i++) diff --git a/src/third_party/ffmpeg/libavcodec/dvdec.c b/src/third_party/ffmpeg/libavcodec/dvdec.c index c57578a2..f66a5f1a 100644 --- a/src/third_party/ffmpeg/libavcodec/dvdec.c +++ b/src/third_party/ffmpeg/libavcodec/dvdec.c @@ -36,6 +36,7 @@ */ #include "libavutil/avassert.h" +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "libavutil/mem_internal.h" #include "libavutil/thread.h" @@ -174,9 +175,9 @@ static av_cold void dv_init_static(void) /* NOTE: as a trick, we use the fact the no codes are unused * to accelerate the parsing of partial codes */ - ff_init_vlc_from_lengths(&dv_vlc, TEX_VLC_BITS, j, + ff_vlc_init_from_lengths(&dv_vlc, TEX_VLC_BITS, j, &tmp[0].len, sizeof(tmp[0]), - NULL, 0, 0, 0, INIT_VLC_USE_NEW_STATIC, NULL); + NULL, 0, 0, 0, VLC_INIT_USE_STATIC, NULL); av_assert1(dv_vlc.table_size == 1664); for (int i = 0; i < dv_vlc.table_size; i++) { diff --git a/src/third_party/ffmpeg/libavcodec/dvenc.c b/src/third_party/ffmpeg/libavcodec/dvenc.c index 7bd50174..ce212470 100644 --- a/src/third_party/ffmpeg/libavcodec/dvenc.c +++ b/src/third_party/ffmpeg/libavcodec/dvenc.c @@ -29,6 +29,7 @@ #include "config.h" #include "libavutil/attributes.h" +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "libavutil/mem_internal.h" #include "libavutil/opt.h" diff --git a/src/third_party/ffmpeg/libavcodec/dxa.c b/src/third_party/ffmpeg/libavcodec/dxa.c index d903b7ec..d33ac3c8 100644 --- a/src/third_party/ffmpeg/libavcodec/dxa.c +++ b/src/third_party/ffmpeg/libavcodec/dxa.c @@ -45,8 +45,8 @@ typedef struct DxaDecContext { uint32_t pal[256]; } DxaDecContext; -static const int shift1[6] = { 0, 8, 8, 8, 4, 4 }; -static const int shift2[6] = { 0, 0, 8, 4, 0, 4 }; +static const uint8_t shift1[6] = { 0, 8, 8, 8, 4, 4 }; +static const uint8_t shift2[6] = { 0, 0, 8, 4, 0, 4 }; static int decode_13(AVCodecContext *avctx, DxaDecContext *c, uint8_t* dst, int stride, uint8_t *src, int srcsize, uint8_t *ref) @@ -317,8 +317,7 @@ FF_ENABLE_DEPRECATION_WARNINGS return AVERROR_INVALIDDATA; } - av_frame_unref(c->prev); - if ((ret = av_frame_ref(c->prev, frame)) < 0) + if ((ret = av_frame_replace(c->prev, frame)) < 0) return ret; *got_frame = 1; diff --git a/src/third_party/ffmpeg/libavcodec/dxva2.c b/src/third_party/ffmpeg/libavcodec/dxva2.c index 568d686f..d7bc5875 100644 --- a/src/third_party/ffmpeg/libavcodec/dxva2.c +++ b/src/third_party/ffmpeg/libavcodec/dxva2.c @@ -53,28 +53,28 @@ DEFINE_GUID(ff_IID_IDirectXVideoDecoderService, 0xfc51a551,0xd5e7,0x11d9,0xaf,0x typedef struct dxva_mode { const GUID *guid; enum AVCodecID codec; - // List of supported profiles, terminated by a FF_PROFILE_UNKNOWN entry. + // List of supported profiles, terminated by a AV_PROFILE_UNKNOWN entry. // If NULL, don't check profile. const int *profiles; } dxva_mode; -static const int prof_mpeg2_main[] = {FF_PROFILE_MPEG2_SIMPLE, - FF_PROFILE_MPEG2_MAIN, - FF_PROFILE_UNKNOWN}; -static const int prof_h264_high[] = {FF_PROFILE_H264_CONSTRAINED_BASELINE, - FF_PROFILE_H264_MAIN, - FF_PROFILE_H264_HIGH, - FF_PROFILE_UNKNOWN}; -static const int prof_hevc_main[] = {FF_PROFILE_HEVC_MAIN, - FF_PROFILE_UNKNOWN}; -static const int prof_hevc_main10[] = {FF_PROFILE_HEVC_MAIN_10, - FF_PROFILE_UNKNOWN}; -static const int prof_vp9_profile0[] = {FF_PROFILE_VP9_0, - FF_PROFILE_UNKNOWN}; -static const int prof_vp9_profile2[] = {FF_PROFILE_VP9_2, - FF_PROFILE_UNKNOWN}; -static const int prof_av1_profile0[] = {FF_PROFILE_AV1_MAIN, - FF_PROFILE_UNKNOWN}; +static const int prof_mpeg2_main[] = {AV_PROFILE_MPEG2_SIMPLE, + AV_PROFILE_MPEG2_MAIN, + AV_PROFILE_UNKNOWN}; +static const int prof_h264_high[] = {AV_PROFILE_H264_CONSTRAINED_BASELINE, + AV_PROFILE_H264_MAIN, + AV_PROFILE_H264_HIGH, + AV_PROFILE_UNKNOWN}; +static const int prof_hevc_main[] = {AV_PROFILE_HEVC_MAIN, + AV_PROFILE_UNKNOWN}; +static const int prof_hevc_main10[] = {AV_PROFILE_HEVC_MAIN_10, + AV_PROFILE_UNKNOWN}; +static const int prof_vp9_profile0[] = {AV_PROFILE_VP9_0, + AV_PROFILE_UNKNOWN}; +static const int prof_vp9_profile2[] = {AV_PROFILE_VP9_2, + AV_PROFILE_UNKNOWN}; +static const int prof_av1_profile0[] = {AV_PROFILE_AV1_MAIN, + AV_PROFILE_UNKNOWN}; static const dxva_mode dxva_modes[] = { /* MPEG-2 */ @@ -199,7 +199,7 @@ static int dxva_check_codec_compatibility(AVCodecContext *avctx, const dxva_mode if (mode->profiles && !(avctx->hwaccel_flags & AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH)) { int i, found = 0; - for (i = 0; mode->profiles[i] != FF_PROFILE_UNKNOWN; i++) { + for (i = 0; mode->profiles[i] != AV_PROFILE_UNKNOWN; i++) { if (avctx->profile == mode->profiles[i]) { found = 1; break; diff --git a/src/third_party/ffmpeg/libavcodec/dxva2_av1.c b/src/third_party/ffmpeg/libavcodec/dxva2_av1.c index 228f72ba..ab118a43 100644 --- a/src/third_party/ffmpeg/libavcodec/dxva2_av1.c +++ b/src/third_party/ffmpeg/libavcodec/dxva2_av1.c @@ -27,6 +27,7 @@ #include "dxva2_internal.h" #include "av1dec.h" +#include "hwaccel_internal.h" #define MAX_TILES 256 @@ -457,11 +458,11 @@ static int dxva2_av1_uninit(AVCodecContext *avctx) } #if CONFIG_AV1_DXVA2_HWACCEL -const AVHWAccel ff_av1_dxva2_hwaccel = { - .name = "av1_dxva2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AV1, - .pix_fmt = AV_PIX_FMT_DXVA2_VLD, +const FFHWAccel ff_av1_dxva2_hwaccel = { + .p.name = "av1_dxva2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, + .p.pix_fmt = AV_PIX_FMT_DXVA2_VLD, .init = ff_dxva2_decode_init, .uninit = dxva2_av1_uninit, .start_frame = dxva2_av1_start_frame, @@ -474,11 +475,11 @@ const AVHWAccel ff_av1_dxva2_hwaccel = { #endif #if CONFIG_AV1_D3D11VA_HWACCEL -const AVHWAccel ff_av1_d3d11va_hwaccel = { - .name = "av1_d3d11va", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AV1, - .pix_fmt = AV_PIX_FMT_D3D11VA_VLD, +const FFHWAccel ff_av1_d3d11va_hwaccel = { + .p.name = "av1_d3d11va", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, + .p.pix_fmt = AV_PIX_FMT_D3D11VA_VLD, .init = ff_dxva2_decode_init, .uninit = dxva2_av1_uninit, .start_frame = dxva2_av1_start_frame, @@ -491,11 +492,11 @@ const AVHWAccel ff_av1_d3d11va_hwaccel = { #endif #if CONFIG_AV1_D3D11VA2_HWACCEL -const AVHWAccel ff_av1_d3d11va2_hwaccel = { - .name = "av1_d3d11va2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AV1, - .pix_fmt = AV_PIX_FMT_D3D11, +const FFHWAccel ff_av1_d3d11va2_hwaccel = { + .p.name = "av1_d3d11va2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, + .p.pix_fmt = AV_PIX_FMT_D3D11, .init = ff_dxva2_decode_init, .uninit = dxva2_av1_uninit, .start_frame = dxva2_av1_start_frame, diff --git a/src/third_party/ffmpeg/libavcodec/dxva2_h264.c b/src/third_party/ffmpeg/libavcodec/dxva2_h264.c index 6300b141..20e64f84 100644 --- a/src/third_party/ffmpeg/libavcodec/dxva2_h264.c +++ b/src/third_party/ffmpeg/libavcodec/dxva2_h264.c @@ -28,6 +28,7 @@ #include "h264dec.h" #include "h264data.h" #include "h264_ps.h" +#include "hwaccel_internal.h" #include "mpegutils.h" struct dxva2_picture_context { @@ -516,11 +517,11 @@ static int dxva2_h264_end_frame(AVCodecContext *avctx) } #if CONFIG_H264_DXVA2_HWACCEL -const AVHWAccel ff_h264_dxva2_hwaccel = { - .name = "h264_dxva2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, - .pix_fmt = AV_PIX_FMT_DXVA2_VLD, +const FFHWAccel ff_h264_dxva2_hwaccel = { + .p.name = "h264_dxva2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, + .p.pix_fmt = AV_PIX_FMT_DXVA2_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_h264_start_frame, @@ -533,11 +534,11 @@ const AVHWAccel ff_h264_dxva2_hwaccel = { #endif #if CONFIG_H264_D3D11VA_HWACCEL -const AVHWAccel ff_h264_d3d11va_hwaccel = { - .name = "h264_d3d11va", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, - .pix_fmt = AV_PIX_FMT_D3D11VA_VLD, +const FFHWAccel ff_h264_d3d11va_hwaccel = { + .p.name = "h264_d3d11va", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, + .p.pix_fmt = AV_PIX_FMT_D3D11VA_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_h264_start_frame, @@ -550,11 +551,11 @@ const AVHWAccel ff_h264_d3d11va_hwaccel = { #endif #if CONFIG_H264_D3D11VA2_HWACCEL -const AVHWAccel ff_h264_d3d11va2_hwaccel = { - .name = "h264_d3d11va2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, - .pix_fmt = AV_PIX_FMT_D3D11, +const FFHWAccel ff_h264_d3d11va2_hwaccel = { + .p.name = "h264_d3d11va2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, + .p.pix_fmt = AV_PIX_FMT_D3D11, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_h264_start_frame, diff --git a/src/third_party/ffmpeg/libavcodec/dxva2_hevc.c b/src/third_party/ffmpeg/libavcodec/dxva2_hevc.c index 6b239d99..b6c08943 100644 --- a/src/third_party/ffmpeg/libavcodec/dxva2_hevc.c +++ b/src/third_party/ffmpeg/libavcodec/dxva2_hevc.c @@ -27,6 +27,7 @@ #include "dxva2_internal.h" #include "hevc_data.h" #include "hevcdec.h" +#include "hwaccel_internal.h" #define MAX_SLICES 256 @@ -420,11 +421,11 @@ static int dxva2_hevc_end_frame(AVCodecContext *avctx) } #if CONFIG_HEVC_DXVA2_HWACCEL -const AVHWAccel ff_hevc_dxva2_hwaccel = { - .name = "hevc_dxva2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, - .pix_fmt = AV_PIX_FMT_DXVA2_VLD, +const FFHWAccel ff_hevc_dxva2_hwaccel = { + .p.name = "hevc_dxva2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, + .p.pix_fmt = AV_PIX_FMT_DXVA2_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_hevc_start_frame, @@ -437,11 +438,11 @@ const AVHWAccel ff_hevc_dxva2_hwaccel = { #endif #if CONFIG_HEVC_D3D11VA_HWACCEL -const AVHWAccel ff_hevc_d3d11va_hwaccel = { - .name = "hevc_d3d11va", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, - .pix_fmt = AV_PIX_FMT_D3D11VA_VLD, +const FFHWAccel ff_hevc_d3d11va_hwaccel = { + .p.name = "hevc_d3d11va", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, + .p.pix_fmt = AV_PIX_FMT_D3D11VA_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_hevc_start_frame, @@ -454,11 +455,11 @@ const AVHWAccel ff_hevc_d3d11va_hwaccel = { #endif #if CONFIG_HEVC_D3D11VA2_HWACCEL -const AVHWAccel ff_hevc_d3d11va2_hwaccel = { - .name = "hevc_d3d11va2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, - .pix_fmt = AV_PIX_FMT_D3D11, +const FFHWAccel ff_hevc_d3d11va2_hwaccel = { + .p.name = "hevc_d3d11va2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, + .p.pix_fmt = AV_PIX_FMT_D3D11, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_hevc_start_frame, diff --git a/src/third_party/ffmpeg/libavcodec/dxva2_mpeg2.c b/src/third_party/ffmpeg/libavcodec/dxva2_mpeg2.c index 1989c588..75c41665 100644 --- a/src/third_party/ffmpeg/libavcodec/dxva2_mpeg2.c +++ b/src/third_party/ffmpeg/libavcodec/dxva2_mpeg2.c @@ -25,6 +25,7 @@ #include "libavutil/log.h" #include "dxva2_internal.h" +#include "hwaccel_internal.h" #include "mpegutils.h" #include "mpegvideodec.h" @@ -316,11 +317,11 @@ static int dxva2_mpeg2_end_frame(AVCodecContext *avctx) } #if CONFIG_MPEG2_DXVA2_HWACCEL -const AVHWAccel ff_mpeg2_dxva2_hwaccel = { - .name = "mpeg2_dxva2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG2VIDEO, - .pix_fmt = AV_PIX_FMT_DXVA2_VLD, +const FFHWAccel ff_mpeg2_dxva2_hwaccel = { + .p.name = "mpeg2_dxva2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG2VIDEO, + .p.pix_fmt = AV_PIX_FMT_DXVA2_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_mpeg2_start_frame, @@ -333,11 +334,11 @@ const AVHWAccel ff_mpeg2_dxva2_hwaccel = { #endif #if CONFIG_MPEG2_D3D11VA_HWACCEL -const AVHWAccel ff_mpeg2_d3d11va_hwaccel = { - .name = "mpeg2_d3d11va", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG2VIDEO, - .pix_fmt = AV_PIX_FMT_D3D11VA_VLD, +const FFHWAccel ff_mpeg2_d3d11va_hwaccel = { + .p.name = "mpeg2_d3d11va", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG2VIDEO, + .p.pix_fmt = AV_PIX_FMT_D3D11VA_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_mpeg2_start_frame, @@ -350,11 +351,11 @@ const AVHWAccel ff_mpeg2_d3d11va_hwaccel = { #endif #if CONFIG_MPEG2_D3D11VA2_HWACCEL -const AVHWAccel ff_mpeg2_d3d11va2_hwaccel = { - .name = "mpeg2_d3d11va2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG2VIDEO, - .pix_fmt = AV_PIX_FMT_D3D11, +const FFHWAccel ff_mpeg2_d3d11va2_hwaccel = { + .p.name = "mpeg2_d3d11va2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG2VIDEO, + .p.pix_fmt = AV_PIX_FMT_D3D11, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_mpeg2_start_frame, diff --git a/src/third_party/ffmpeg/libavcodec/dxva2_vc1.c b/src/third_party/ffmpeg/libavcodec/dxva2_vc1.c index 12e3de59..b35fb115 100644 --- a/src/third_party/ffmpeg/libavcodec/dxva2_vc1.c +++ b/src/third_party/ffmpeg/libavcodec/dxva2_vc1.c @@ -23,6 +23,7 @@ #include "config_components.h" #include "dxva2_internal.h" +#include "hwaccel_internal.h" #include "mpegutils.h" #include "mpegvideodec.h" #include "vc1.h" @@ -376,11 +377,11 @@ static int dxva2_vc1_end_frame(AVCodecContext *avctx) } #if CONFIG_WMV3_DXVA2_HWACCEL -const AVHWAccel ff_wmv3_dxva2_hwaccel = { - .name = "wmv3_dxva2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WMV3, - .pix_fmt = AV_PIX_FMT_DXVA2_VLD, +const FFHWAccel ff_wmv3_dxva2_hwaccel = { + .p.name = "wmv3_dxva2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WMV3, + .p.pix_fmt = AV_PIX_FMT_DXVA2_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_vc1_start_frame, @@ -393,11 +394,11 @@ const AVHWAccel ff_wmv3_dxva2_hwaccel = { #endif #if CONFIG_VC1_DXVA2_HWACCEL -const AVHWAccel ff_vc1_dxva2_hwaccel = { - .name = "vc1_dxva2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VC1, - .pix_fmt = AV_PIX_FMT_DXVA2_VLD, +const FFHWAccel ff_vc1_dxva2_hwaccel = { + .p.name = "vc1_dxva2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VC1, + .p.pix_fmt = AV_PIX_FMT_DXVA2_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_vc1_start_frame, @@ -410,11 +411,11 @@ const AVHWAccel ff_vc1_dxva2_hwaccel = { #endif #if CONFIG_WMV3_D3D11VA_HWACCEL -const AVHWAccel ff_wmv3_d3d11va_hwaccel = { - .name = "wmv3_d3d11va", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WMV3, - .pix_fmt = AV_PIX_FMT_D3D11VA_VLD, +const FFHWAccel ff_wmv3_d3d11va_hwaccel = { + .p.name = "wmv3_d3d11va", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WMV3, + .p.pix_fmt = AV_PIX_FMT_D3D11VA_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_vc1_start_frame, @@ -427,11 +428,11 @@ const AVHWAccel ff_wmv3_d3d11va_hwaccel = { #endif #if CONFIG_WMV3_D3D11VA2_HWACCEL -const AVHWAccel ff_wmv3_d3d11va2_hwaccel = { - .name = "wmv3_d3d11va2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WMV3, - .pix_fmt = AV_PIX_FMT_D3D11, +const FFHWAccel ff_wmv3_d3d11va2_hwaccel = { + .p.name = "wmv3_d3d11va2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WMV3, + .p.pix_fmt = AV_PIX_FMT_D3D11, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_vc1_start_frame, @@ -444,11 +445,11 @@ const AVHWAccel ff_wmv3_d3d11va2_hwaccel = { #endif #if CONFIG_VC1_D3D11VA_HWACCEL -const AVHWAccel ff_vc1_d3d11va_hwaccel = { - .name = "vc1_d3d11va", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VC1, - .pix_fmt = AV_PIX_FMT_D3D11VA_VLD, +const FFHWAccel ff_vc1_d3d11va_hwaccel = { + .p.name = "vc1_d3d11va", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VC1, + .p.pix_fmt = AV_PIX_FMT_D3D11VA_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_vc1_start_frame, @@ -461,11 +462,11 @@ const AVHWAccel ff_vc1_d3d11va_hwaccel = { #endif #if CONFIG_VC1_D3D11VA2_HWACCEL -const AVHWAccel ff_vc1_d3d11va2_hwaccel = { - .name = "vc1_d3d11va2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VC1, - .pix_fmt = AV_PIX_FMT_D3D11, +const FFHWAccel ff_vc1_d3d11va2_hwaccel = { + .p.name = "vc1_d3d11va2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VC1, + .p.pix_fmt = AV_PIX_FMT_D3D11, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_vc1_start_frame, diff --git a/src/third_party/ffmpeg/libavcodec/dxva2_vp9.c b/src/third_party/ffmpeg/libavcodec/dxva2_vp9.c index dbe6c08a..eba4df90 100644 --- a/src/third_party/ffmpeg/libavcodec/dxva2_vp9.c +++ b/src/third_party/ffmpeg/libavcodec/dxva2_vp9.c @@ -26,6 +26,7 @@ #include "libavutil/pixdesc.h" #include "dxva2_internal.h" +#include "hwaccel_internal.h" #include "vp9shared.h" struct vp9_dxva2_picture_context { @@ -307,11 +308,11 @@ static int dxva2_vp9_end_frame(AVCodecContext *avctx) } #if CONFIG_VP9_DXVA2_HWACCEL -const AVHWAccel ff_vp9_dxva2_hwaccel = { - .name = "vp9_dxva2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP9, - .pix_fmt = AV_PIX_FMT_DXVA2_VLD, +const FFHWAccel ff_vp9_dxva2_hwaccel = { + .p.name = "vp9_dxva2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP9, + .p.pix_fmt = AV_PIX_FMT_DXVA2_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_vp9_start_frame, @@ -324,11 +325,11 @@ const AVHWAccel ff_vp9_dxva2_hwaccel = { #endif #if CONFIG_VP9_D3D11VA_HWACCEL -const AVHWAccel ff_vp9_d3d11va_hwaccel = { - .name = "vp9_d3d11va", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP9, - .pix_fmt = AV_PIX_FMT_D3D11VA_VLD, +const FFHWAccel ff_vp9_d3d11va_hwaccel = { + .p.name = "vp9_d3d11va", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP9, + .p.pix_fmt = AV_PIX_FMT_D3D11VA_VLD, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_vp9_start_frame, @@ -341,11 +342,11 @@ const AVHWAccel ff_vp9_d3d11va_hwaccel = { #endif #if CONFIG_VP9_D3D11VA2_HWACCEL -const AVHWAccel ff_vp9_d3d11va2_hwaccel = { - .name = "vp9_d3d11va2", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP9, - .pix_fmt = AV_PIX_FMT_D3D11, +const FFHWAccel ff_vp9_d3d11va2_hwaccel = { + .p.name = "vp9_d3d11va2", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP9, + .p.pix_fmt = AV_PIX_FMT_D3D11, .init = ff_dxva2_decode_init, .uninit = ff_dxva2_decode_uninit, .start_frame = dxva2_vp9_start_frame, diff --git a/src/third_party/ffmpeg/libavcodec/eacmv.c b/src/third_party/ffmpeg/libavcodec/eacmv.c index e73e310c..43dba20f 100644 --- a/src/third_party/ffmpeg/libavcodec/eacmv.c +++ b/src/third_party/ffmpeg/libavcodec/eacmv.c @@ -210,9 +210,8 @@ static int cmv_decode_frame(AVCodecContext *avctx, AVFrame *frame, cmv_decode_intra(s, frame, buf+2, buf_end); } - av_frame_unref(s->last2_frame); - av_frame_move_ref(s->last2_frame, s->last_frame); - if ((ret = av_frame_ref(s->last_frame, frame)) < 0) + FFSWAP(AVFrame*, s->last2_frame, s->last_frame); + if ((ret = av_frame_replace(s->last_frame, frame)) < 0) return ret; *got_frame = 1; diff --git a/src/third_party/ffmpeg/libavcodec/eamad.c b/src/third_party/ffmpeg/libavcodec/eamad.c index 45012c62..287575e0 100644 --- a/src/third_party/ffmpeg/libavcodec/eamad.c +++ b/src/third_party/ffmpeg/libavcodec/eamad.c @@ -317,8 +317,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, *got_frame = 1; if (chunk_type != MADe_TAG) { - av_frame_unref(s->last_frame); - if ((ret = av_frame_ref(s->last_frame, frame)) < 0) + if ((ret = av_frame_replace(s->last_frame, frame)) < 0) return ret; } diff --git a/src/third_party/ffmpeg/libavcodec/eatgv.c b/src/third_party/ffmpeg/libavcodec/eatgv.c index a2aead46..35bd88b7 100644 --- a/src/third_party/ffmpeg/libavcodec/eatgv.c +++ b/src/third_party/ffmpeg/libavcodec/eatgv.c @@ -338,8 +338,7 @@ static int tgv_decode_frame(AVCodecContext *avctx, AVFrame *frame, } } - av_frame_unref(s->last_frame); - if ((ret = av_frame_ref(s->last_frame, frame)) < 0) + if ((ret = av_frame_replace(s->last_frame, frame)) < 0) return ret; *got_frame = 1; diff --git a/src/third_party/ffmpeg/libavcodec/encode.c b/src/third_party/ffmpeg/libavcodec/encode.c index 32cc903b..a436be26 100644 --- a/src/third_party/ffmpeg/libavcodec/encode.c +++ b/src/third_party/ffmpeg/libavcodec/encode.c @@ -21,6 +21,7 @@ #include "libavutil/attributes.h" #include "libavutil/avassert.h" #include "libavutil/channel_layout.h" +#include "libavutil/emms.h" #include "libavutil/frame.h" #include "libavutil/imgutils.h" #include "libavutil/internal.h" @@ -29,6 +30,7 @@ #include "avcodec.h" #include "avcodec_internal.h" +#include "codec_desc.h" #include "codec_internal.h" #include "encode.h" #include "frame_thread_encoder.h" @@ -864,3 +866,34 @@ AVCodecInternal *ff_encode_internal_alloc(void) { return av_mallocz(sizeof(EncodeContext)); } + +AVCPBProperties *ff_encode_add_cpb_side_data(AVCodecContext *avctx) +{ + AVPacketSideData *tmp; + AVCPBProperties *props; + size_t size; + int i; + + for (i = 0; i < avctx->nb_coded_side_data; i++) + if (avctx->coded_side_data[i].type == AV_PKT_DATA_CPB_PROPERTIES) + return (AVCPBProperties *)avctx->coded_side_data[i].data; + + props = av_cpb_properties_alloc(&size); + if (!props) + return NULL; + + tmp = av_realloc_array(avctx->coded_side_data, avctx->nb_coded_side_data + 1, sizeof(*tmp)); + if (!tmp) { + av_freep(&props); + return NULL; + } + + avctx->coded_side_data = tmp; + avctx->nb_coded_side_data++; + + avctx->coded_side_data[avctx->nb_coded_side_data - 1].type = AV_PKT_DATA_CPB_PROPERTIES; + avctx->coded_side_data[avctx->nb_coded_side_data - 1].data = (uint8_t*)props; + avctx->coded_side_data[avctx->nb_coded_side_data - 1].size = size; + + return props; +} diff --git a/src/third_party/ffmpeg/libavcodec/encode.h b/src/third_party/ffmpeg/libavcodec/encode.h index dfaab7c9..e019cd77 100644 --- a/src/third_party/ffmpeg/libavcodec/encode.h +++ b/src/third_party/ffmpeg/libavcodec/encode.h @@ -73,6 +73,11 @@ int ff_encode_reordered_opaque(AVCodecContext *avctx, int ff_encode_encode_cb(AVCodecContext *avctx, AVPacket *avpkt, AVFrame *frame, int *got_packet); +/** + * Add a CPB properties side data to an encoding context. + */ +AVCPBProperties *ff_encode_add_cpb_side_data(AVCodecContext *avctx); + /** * Rescale from sample rate to AVCodecContext.time_base. */ diff --git a/src/third_party/ffmpeg/libavcodec/error_resilience.c b/src/third_party/ffmpeg/libavcodec/error_resilience.c index 2aa6f1d8..9d03e532 100644 --- a/src/third_party/ffmpeg/libavcodec/error_resilience.c +++ b/src/third_party/ffmpeg/libavcodec/error_resilience.c @@ -393,7 +393,7 @@ static void guess_mv(ERContext *s) const ptrdiff_t mb_stride = s->mb_stride; const int mb_width = s->mb_width; int mb_height = s->mb_height; - int i, depth, num_avail; + int i, num_avail; int mb_x, mb_y; ptrdiff_t mot_step, mot_stride; int blocklist_length, next_blocklist_length; @@ -469,7 +469,7 @@ static void guess_mv(ERContext *s) } } - for (depth = 0; ; depth++) { + for (;;) { int changed, pass, none_left; int blocklist_index; @@ -804,7 +804,7 @@ void ff_er_frame_start(ERContext *s) static int er_supported(ERContext *s) { - if(s->avctx->hwaccel && s->avctx->hwaccel->decode_slice || + if (s->avctx->hwaccel || !s->cur_pic.f || s->cur_pic.field_picture ) @@ -828,7 +828,7 @@ void ff_er_add_slice(ERContext *s, int startx, int starty, const int end_xy = s->mb_index2xy[end_i]; int mask = -1; - if (s->avctx->hwaccel && s->avctx->hwaccel->decode_slice) + if (s->avctx->hwaccel) return; if (start_i > end_i || start_xy > end_xy) { @@ -889,7 +889,7 @@ void ff_er_add_slice(ERContext *s, int startx, int starty, } } -void ff_er_frame_end(ERContext *s) +void ff_er_frame_end(ERContext *s, int *decode_error_flags) { int *linesize = NULL; int i, mb_x, mb_y, error, error_type, dc_error, mv_error, ac_error; @@ -1114,7 +1114,10 @@ void ff_er_frame_end(ERContext *s) av_log(s->avctx, AV_LOG_INFO, "concealing %d DC, %d AC, %d MV errors in %c frame\n", dc_error, ac_error, mv_error, av_get_picture_type_char(s->cur_pic.f->pict_type)); - s->cur_pic.f->decode_error_flags |= FF_DECODE_ERROR_CONCEALMENT_ACTIVE; + if (decode_error_flags) + *decode_error_flags |= FF_DECODE_ERROR_CONCEALMENT_ACTIVE; + else + s->cur_pic.f->decode_error_flags |= FF_DECODE_ERROR_CONCEALMENT_ACTIVE; is_intra_likely = is_intra_more_likely(s); diff --git a/src/third_party/ffmpeg/libavcodec/error_resilience.h b/src/third_party/ffmpeg/libavcodec/error_resilience.h index 47cc8a4f..b03f8ec8 100644 --- a/src/third_party/ffmpeg/libavcodec/error_resilience.h +++ b/src/third_party/ffmpeg/libavcodec/error_resilience.h @@ -90,7 +90,17 @@ typedef struct ERContext { } ERContext; void ff_er_frame_start(ERContext *s); -void ff_er_frame_end(ERContext *s); + +/** + * Indicate that a frame has finished decoding and perform error concealment + * in case it has been enabled and is necessary and supported. + * + * @param s ERContext in use + * @param decode_error_flags pointer where updated decode_error_flags are written + * if supplied; if not, the new flags are directly + * applied to the AVFrame whose errors are concealed + */ +void ff_er_frame_end(ERContext *s, int *decode_error_flags); void ff_er_add_slice(ERContext *s, int startx, int starty, int endx, int endy, int status); diff --git a/src/third_party/ffmpeg/libavcodec/escape124.c b/src/third_party/ffmpeg/libavcodec/escape124.c index 592de09a..357320ef 100644 --- a/src/third_party/ffmpeg/libavcodec/escape124.c +++ b/src/third_party/ffmpeg/libavcodec/escape124.c @@ -234,7 +234,7 @@ static int escape124_decode_frame(AVCodecContext *avctx, AVFrame *frame, if ((ret = av_frame_ref(frame, s->frame)) < 0) return ret; - return frame_size; + return 0; } for (i = 0; i < 3; i++) { @@ -362,13 +362,12 @@ static int escape124_decode_frame(AVCodecContext *avctx, AVFrame *frame, "Escape sizes: %i, %i, %i\n", frame_size, buf_size, get_bits_count(&gb) / 8); - av_frame_unref(s->frame); - if ((ret = av_frame_ref(s->frame, frame)) < 0) + if ((ret = av_frame_replace(s->frame, frame)) < 0) return ret; *got_frame = 1; - return frame_size; + return 0; } diff --git a/src/third_party/ffmpeg/libavcodec/evc.h b/src/third_party/ffmpeg/libavcodec/evc.h index d1fdb4fa..9711c760 100644 --- a/src/third_party/ffmpeg/libavcodec/evc.h +++ b/src/third_party/ffmpeg/libavcodec/evc.h @@ -126,7 +126,7 @@ enum { EVC_MAX_NUM_REF_PICS = 21, - EVC_MAX_NUM_RPLS = 32, + EVC_MAX_NUM_RPLS = 64, // A.4.1: pic_width_in_luma_samples and pic_height_in_luma_samples are // constrained to be not greater than sqrt(MaxLumaPs * 8). Hence height/ diff --git a/src/third_party/ffmpeg/libavcodec/evc_frame_merge_bsf.c b/src/third_party/ffmpeg/libavcodec/evc_frame_merge_bsf.c index cfdf24c6..7b8e6b1c 100644 --- a/src/third_party/ffmpeg/libavcodec/evc_frame_merge_bsf.c +++ b/src/third_party/ffmpeg/libavcodec/evc_frame_merge_bsf.c @@ -18,13 +18,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "get_bits.h" -#include "golomb.h" #include "bsf.h" #include "bsf_internal.h" -#include "avcodec.h" #include "evc.h" #include "evc_parse.h" +#include "evc_ps.h" // Access unit data typedef struct AccessUnitBuffer { diff --git a/src/third_party/ffmpeg/libavcodec/evc_parse.c b/src/third_party/ffmpeg/libavcodec/evc_parse.c index 447f6195..bd3a4416 100644 --- a/src/third_party/ffmpeg/libavcodec/evc_parse.c +++ b/src/third_party/ffmpeg/libavcodec/evc_parse.c @@ -17,7 +17,6 @@ */ #include "golomb.h" -#include "parser.h" #include "evc.h" #include "evc_parse.h" diff --git a/src/third_party/ffmpeg/libavcodec/evc_parse.h b/src/third_party/ffmpeg/libavcodec/evc_parse.h index 55cdd553..47123108 100644 --- a/src/third_party/ffmpeg/libavcodec/evc_parse.h +++ b/src/third_party/ffmpeg/libavcodec/evc_parse.h @@ -28,7 +28,6 @@ #include "libavutil/intreadwrite.h" #include "libavutil/log.h" -#include "libavutil/rational.h" #include "evc.h" #include "evc_ps.h" diff --git a/src/third_party/ffmpeg/libavcodec/evc_parser.c b/src/third_party/ffmpeg/libavcodec/evc_parser.c index 76790d81..8590ebcd 100644 --- a/src/third_party/ffmpeg/libavcodec/evc_parser.c +++ b/src/third_party/ffmpeg/libavcodec/evc_parser.c @@ -20,7 +20,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "parser.h" +#include "avcodec.h" #include "bytestream.h" #include "evc.h" #include "evc_parse.h" diff --git a/src/third_party/ffmpeg/libavcodec/evc_ps.c b/src/third_party/ffmpeg/libavcodec/evc_ps.c index fc2105b3..c11b92d1 100644 --- a/src/third_party/ffmpeg/libavcodec/evc_ps.c +++ b/src/third_party/ffmpeg/libavcodec/evc_ps.c @@ -16,18 +16,22 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "get_bits.h" #include "golomb.h" -#include "parser.h" #include "evc.h" #include "evc_ps.h" #define EXTENDED_SAR 255 // @see ISO_IEC_23094-1 (7.3.7 Reference picture list structure syntax) -static int ref_pic_list_struct(GetBitContext *gb, RefPicListStruct *rpl) +static int ref_pic_list_struct(const EVCParserSPS *sps, GetBitContext *gb, RefPicListStruct *rpl) { uint32_t delta_poc_st, strp_entry_sign_flag = 0; rpl->ref_pic_num = get_ue_golomb_long(gb); + + if ((unsigned)rpl->ref_pic_num > sps->sps_max_dec_pic_buffering_minus1) + return AVERROR_INVALIDDATA; + if (rpl->ref_pic_num > 0) { delta_poc_st = get_ue_golomb_long(gb); @@ -53,6 +57,9 @@ static int ref_pic_list_struct(GetBitContext *gb, RefPicListStruct *rpl) static int hrd_parameters(GetBitContext *gb, HRDParameters *hrd) { hrd->cpb_cnt_minus1 = get_ue_golomb_31(gb); + if (hrd->cpb_cnt_minus1 >= FF_ARRAY_ELEMS(hrd->cpb_size_value_minus1)) + return AVERROR_INVALIDDATA; + hrd->bit_rate_scale = get_bits(gb, 4); hrd->cpb_size_scale = get_bits(gb, 4); for (int SchedSelIdx = 0; SchedSelIdx <= hrd->cpb_cnt_minus1; SchedSelIdx++) { @@ -71,6 +78,8 @@ static int hrd_parameters(GetBitContext *gb, HRDParameters *hrd) // @see ISO_IEC_23094-1 (E.2.1 VUI parameters syntax) static int vui_parameters(GetBitContext *gb, VUIParameters *vui) { + int ret; + vui->aspect_ratio_info_present_flag = get_bits(gb, 1); if (vui->aspect_ratio_info_present_flag) { vui->aspect_ratio_idc = get_bits(gb, 8); @@ -109,11 +118,18 @@ static int vui_parameters(GetBitContext *gb, VUIParameters *vui) vui->fixed_pic_rate_flag = get_bits(gb, 1); } vui->nal_hrd_parameters_present_flag = get_bits(gb, 1); - if (vui->nal_hrd_parameters_present_flag) - hrd_parameters(gb, &vui->hrd_parameters); + if (vui->nal_hrd_parameters_present_flag) { + ret = hrd_parameters(gb, &vui->hrd_parameters); + if (ret < 0) + return ret; + } + vui->vcl_hrd_parameters_present_flag = get_bits(gb, 1); - if (vui->vcl_hrd_parameters_present_flag) - hrd_parameters(gb, &vui->hrd_parameters); + if (vui->vcl_hrd_parameters_present_flag) { + ret = hrd_parameters(gb, &vui->hrd_parameters); + if (ret < 0) + return ret; + } if (vui->nal_hrd_parameters_present_flag || vui->vcl_hrd_parameters_present_flag) vui->low_delay_hrd_flag = get_bits(gb, 1); vui->pic_struct_present_flag = get_bits(gb, 1); @@ -239,17 +255,36 @@ int ff_evc_parse_sps(GetBitContext *gb, EVCParamSets *ps) sps->max_num_tid0_ref_pics = get_ue_golomb_31(gb); else { sps->sps_max_dec_pic_buffering_minus1 = get_ue_golomb_long(gb); + if ((unsigned)sps->sps_max_dec_pic_buffering_minus1 > 16 - 1) { + ret = AVERROR_INVALIDDATA; + goto fail; + } sps->long_term_ref_pic_flag = get_bits1(gb); sps->rpl1_same_as_rpl0_flag = get_bits1(gb); sps->num_ref_pic_list_in_sps[0] = get_ue_golomb(gb); - for (int i = 0; i < sps->num_ref_pic_list_in_sps[0]; ++i) - ref_pic_list_struct(gb, &sps->rpls[0][i]); + if ((unsigned)sps->num_ref_pic_list_in_sps[0] >= EVC_MAX_NUM_RPLS) { + ret = AVERROR_INVALIDDATA; + goto fail; + } + + for (int i = 0; i < sps->num_ref_pic_list_in_sps[0]; ++i) { + ret = ref_pic_list_struct(sps, gb, &sps->rpls[0][i]); + if (ret < 0) + goto fail; + } if (!sps->rpl1_same_as_rpl0_flag) { sps->num_ref_pic_list_in_sps[1] = get_ue_golomb(gb); - for (int i = 0; i < sps->num_ref_pic_list_in_sps[1]; ++i) - ref_pic_list_struct(gb, &sps->rpls[1][i]); + if ((unsigned)sps->num_ref_pic_list_in_sps[1] >= EVC_MAX_NUM_RPLS) { + ret = AVERROR_INVALIDDATA; + goto fail; + } + for (int i = 0; i < sps->num_ref_pic_list_in_sps[1]; ++i) { + ret = ref_pic_list_struct(sps, gb, &sps->rpls[1][i]); + if (ret < 0) + goto fail; + } } } @@ -283,8 +318,11 @@ int ff_evc_parse_sps(GetBitContext *gb, EVCParamSets *ps) } sps->vui_parameters_present_flag = get_bits1(gb); - if (sps->vui_parameters_present_flag) - vui_parameters(gb, &(sps->vui_parameters)); + if (sps->vui_parameters_present_flag) { + ret = vui_parameters(gb, &(sps->vui_parameters)); + if (ret < 0) + goto fail; + } // @note // If necessary, add the missing fields to the EVCParserSPS structure diff --git a/src/third_party/ffmpeg/libavcodec/exr.c b/src/third_party/ffmpeg/libavcodec/exr.c index fae1d08a..b30d3b74 100644 --- a/src/third_party/ffmpeg/libavcodec/exr.c +++ b/src/third_party/ffmpeg/libavcodec/exr.c @@ -404,8 +404,8 @@ static int huf_build_dec_table(const EXRContext *s, td->he[j].code = td->freq[iM] >> 6; j++; - ff_free_vlc(&td->vlc); - return ff_init_vlc_sparse(&td->vlc, 12, j, + ff_vlc_free(&td->vlc); + return ff_vlc_init_sparse(&td->vlc, 12, j, &td->he[0].len, sizeof(td->he[0]), sizeof(td->he[0].len), &td->he[0].code, sizeof(td->he[0]), sizeof(td->he[0].code), &td->he[0].sym, sizeof(td->he[0]), sizeof(td->he[0].sym), 0); @@ -760,8 +760,8 @@ static int pxr24_uncompress(const EXRContext *s, const uint8_t *src, static void unpack_14(const uint8_t b[14], uint16_t s[16]) { - unsigned short shift = (b[ 2] >> 2) & 15; - unsigned short bias = (0x20 << shift); + uint16_t shift = (b[ 2] >> 2) & 15; + uint16_t bias = (0x20 << shift); int i; s[ 0] = (b[0] << 8) | b[1]; @@ -1870,7 +1870,7 @@ static int decode_header(EXRContext *s, AVFrame *frame) continue; } else if ((var_size = check_header_variable(s, "tiles", "tiledesc", 22)) >= 0) { - char tileLevel; + uint8_t tileLevel; if (!s->is_tile) av_log(s->avctx, AV_LOG_WARNING, @@ -2088,6 +2088,8 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture, if (s->apply_trc_type != AVCOL_TRC_UNSPECIFIED) avctx->color_trc = s->apply_trc_type; + else if (s->gamma > 0.9999f && s->gamma < 1.0001f) + avctx->color_trc = AVCOL_TRC_LINEAR; switch (s->compression) { case EXR_RAW: @@ -2282,7 +2284,7 @@ static av_cold int decode_end(AVCodecContext *avctx) av_freep(&td->dc_data); av_freep(&td->rle_data); av_freep(&td->rle_raw_data); - ff_free_vlc(&td->vlc); + ff_vlc_free(&td->vlc); } av_freep(&s->thread_data); diff --git a/src/third_party/ffmpeg/libavcodec/extract_extradata_bsf.c b/src/third_party/ffmpeg/libavcodec/extract_extradata_bsf.c index d5c81a27..baa62929 100644 --- a/src/third_party/ffmpeg/libavcodec/extract_extradata_bsf.c +++ b/src/third_party/ffmpeg/libavcodec/extract_extradata_bsf.c @@ -49,25 +49,53 @@ typedef struct ExtractExtradataContext { int remove; } ExtractExtradataContext; -static int val_in_array(const int *arr, int len, int val) +static int val_in_array(const int *arr, size_t len, int val) { - int i; - for (i = 0; i < len; i++) + for (size_t i = 0; i < len; i++) if (arr[i] == val) return 1; return 0; } -static int extract_extradata_av1(AVBSFContext *ctx, AVPacket *pkt, - uint8_t **data, int *size) +static int metadata_is_global(const AV1OBU *obu) +{ + static const int metadata_obu_types[] = { + AV1_METADATA_TYPE_HDR_CLL, AV1_METADATA_TYPE_HDR_MDCV, + }; + GetBitContext gb; + int metadata_type; + + if (init_get_bits(&gb, obu->data, obu->size_bits) < 0) + return 0; + + metadata_type = leb128(&gb); + + return val_in_array(metadata_obu_types, FF_ARRAY_ELEMS(metadata_obu_types), + metadata_type); +} + +static int obu_is_global(const AV1OBU *obu) { static const int extradata_obu_types[] = { AV1_OBU_SEQUENCE_HEADER, AV1_OBU_METADATA, }; + + if (!val_in_array(extradata_obu_types, FF_ARRAY_ELEMS(extradata_obu_types), + obu->type)) + return 0; + if (obu->type != AV1_OBU_METADATA) + return 1; + + return metadata_is_global(obu); +} + +static int extract_extradata_av1(AVBSFContext *ctx, AVPacket *pkt, + uint8_t **data, int *size) +{ + ExtractExtradataContext *s = ctx->priv_data; int extradata_size = 0, filtered_size = 0; - int nb_extradata_obu_types = FF_ARRAY_ELEMS(extradata_obu_types); int i, has_seq = 0, ret = 0; ret = ff_av1_packet_split(&s->av1_pkt, pkt->data, pkt->size, ctx); @@ -76,7 +104,7 @@ static int extract_extradata_av1(AVBSFContext *ctx, AVPacket *pkt, for (i = 0; i < s->av1_pkt.nb_obus; i++) { AV1OBU *obu = &s->av1_pkt.obus[i]; - if (val_in_array(extradata_obu_types, nb_extradata_obu_types, obu->type)) { + if (obu_is_global(obu)) { extradata_size += obu->raw_size; if (obu->type == AV1_OBU_SEQUENCE_HEADER) has_seq = 1; @@ -113,8 +141,7 @@ static int extract_extradata_av1(AVBSFContext *ctx, AVPacket *pkt, for (i = 0; i < s->av1_pkt.nb_obus; i++) { AV1OBU *obu = &s->av1_pkt.obus[i]; - if (val_in_array(extradata_obu_types, nb_extradata_obu_types, - obu->type)) { + if (obu_is_global(obu)) { bytestream2_put_bufferu(&pb_extradata, obu->raw_data, obu->raw_size); } else if (s->remove) { bytestream2_put_bufferu(&pb_filtered_data, obu->raw_data, obu->raw_size); @@ -149,7 +176,7 @@ static int extract_extradata_h2645(AVBSFContext *ctx, AVPacket *pkt, int extradata_size = 0, filtered_size = 0; const int *extradata_nal_types; - int nb_extradata_nal_types; + size_t nb_extradata_nal_types; int i, has_sps = 0, has_vps = 0, ret = 0; if (ctx->par_in->codec_id == AV_CODEC_ID_VVC) { diff --git a/src/third_party/ffmpeg/libavcodec/faandct.c b/src/third_party/ffmpeg/libavcodec/faandct.c index 38c392bb..b0b11859 100644 --- a/src/third_party/ffmpeg/libavcodec/faandct.c +++ b/src/third_party/ffmpeg/libavcodec/faandct.c @@ -26,6 +26,7 @@ */ #include "faandct.h" +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "libavutil/libm.h" diff --git a/src/third_party/ffmpeg/libavcodec/faanidct.c b/src/third_party/ffmpeg/libavcodec/faanidct.c index 3921f82d..f2667fb7 100644 --- a/src/third_party/ffmpeg/libavcodec/faanidct.c +++ b/src/third_party/ffmpeg/libavcodec/faanidct.c @@ -20,6 +20,7 @@ */ #include "faanidct.h" #include "libavutil/common.h" +#include "libavutil/emms.h" /* To allow switching to double. */ typedef float FLOAT; diff --git a/src/third_party/ffmpeg/libavcodec/faxcompr.c b/src/third_party/ffmpeg/libavcodec/faxcompr.c index d9dec3fc..62729fe9 100644 --- a/src/third_party/ffmpeg/libavcodec/faxcompr.c +++ b/src/third_party/ffmpeg/libavcodec/faxcompr.c @@ -108,13 +108,13 @@ static av_cold void ccitt_unpack_init(void) ccitt_vlc[1].table = code_table2; ccitt_vlc[1].table_allocated = 648; for (i = 0; i < 2; i++) { - ff_init_vlc_sparse(&ccitt_vlc[i], 9, CCITT_SYMS, + ff_vlc_init_sparse(&ccitt_vlc[i], 9, CCITT_SYMS, ccitt_codes_lens[i], 1, 1, ccitt_codes_bits[i], 1, 1, ccitt_syms, 2, 2, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); } - INIT_VLC_STATIC(&ccitt_group3_2d_vlc, 9, 11, + VLC_INIT_STATIC(&ccitt_group3_2d_vlc, 9, 11, ccitt_group3_2d_lens, 1, 1, ccitt_group3_2d_bits, 1, 1, 512); } diff --git a/src/third_party/ffmpeg/libavcodec/fdctdsp.c b/src/third_party/ffmpeg/libavcodec/fdctdsp.c index 5306c9d0..f8ba1742 100644 --- a/src/third_party/ffmpeg/libavcodec/fdctdsp.c +++ b/src/third_party/ffmpeg/libavcodec/fdctdsp.c @@ -18,7 +18,6 @@ #include "libavutil/attributes.h" #include "avcodec.h" -#include "dct.h" #include "faandct.h" #include "fdctdsp.h" #include "config.h" diff --git a/src/third_party/ffmpeg/libavcodec/fdctdsp.h b/src/third_party/ffmpeg/libavcodec/fdctdsp.h index 3e1f683b..7378eab8 100644 --- a/src/third_party/ffmpeg/libavcodec/fdctdsp.h +++ b/src/third_party/ffmpeg/libavcodec/fdctdsp.h @@ -21,17 +21,28 @@ #include -#include "avcodec.h" +#include "libavutil/attributes_internal.h" + +struct AVCodecContext; typedef struct FDCTDSPContext { void (*fdct)(int16_t *block /* align 16 */); void (*fdct248)(int16_t *block /* align 16 */); } FDCTDSPContext; -void ff_fdctdsp_init(FDCTDSPContext *c, AVCodecContext *avctx); -void ff_fdctdsp_init_ppc(FDCTDSPContext *c, AVCodecContext *avctx, +FF_VISIBILITY_PUSH_HIDDEN +void ff_fdctdsp_init(FDCTDSPContext *c, struct AVCodecContext *avctx); +void ff_fdctdsp_init_ppc(FDCTDSPContext *c, struct AVCodecContext *avctx, unsigned high_bit_depth); -void ff_fdctdsp_init_x86(FDCTDSPContext *c, AVCodecContext *avctx, +void ff_fdctdsp_init_x86(FDCTDSPContext *c, struct AVCodecContext *avctx, unsigned high_bit_depth); +void ff_fdct_ifast(int16_t *data); +void ff_fdct_ifast248(int16_t *data); +void ff_jpeg_fdct_islow_8(int16_t *data); +void ff_jpeg_fdct_islow_10(int16_t *data); +void ff_fdct248_islow_8(int16_t *data); +void ff_fdct248_islow_10(int16_t *data); +FF_VISIBILITY_POP_HIDDEN + #endif /* AVCODEC_FDCTDSP_H */ diff --git a/src/third_party/ffmpeg/libavcodec/ffjni.c b/src/third_party/ffmpeg/libavcodec/ffjni.c index 154be9ae..e3cf24d3 100644 --- a/src/third_party/ffmpeg/libavcodec/ffjni.c +++ b/src/third_party/ffmpeg/libavcodec/ffjni.c @@ -25,6 +25,7 @@ #include #include "libavutil/bprint.h" +#include "libavutil/error.h" #include "libavutil/log.h" #include "libavutil/mem.h" diff --git a/src/third_party/ffmpeg/libavcodec/fflcms2.c b/src/third_party/ffmpeg/libavcodec/fflcms2.c index 5443f178..3b67e62d 100644 --- a/src/third_party/ffmpeg/libavcodec/fflcms2.c +++ b/src/third_party/ffmpeg/libavcodec/fflcms2.c @@ -201,6 +201,57 @@ static av_always_inline void XYZ_xy(cmsCIEXYZ XYZ, AVCIExy *xy) xy->y = av_d2q(k * XYZ.Y, 100000); } +static av_always_inline AVRational abs_sub_q(AVRational r1, AVRational r2) +{ + AVRational diff = av_sub_q(r1, r2); + /* denominator assumed to be positive */ + return av_make_q(abs(diff.num), diff.den); +} + +static const AVCIExy wp_d50 = { {3457, 10000}, {3585, 10000} }; /* CIE D50 */ + +int ff_icc_profile_sanitize(FFIccContext *s, cmsHPROFILE profile) +{ + cmsCIEXYZ *white, fixed; + AVCIExy wpxy; + AVRational diff, z; + if (!profile) + return 0; + + if (cmsGetEncodedICCversion(profile) >= 0x4000000) { // ICC v4 + switch (cmsGetHeaderRenderingIntent(profile)) { + case INTENT_RELATIVE_COLORIMETRIC: + case INTENT_ABSOLUTE_COLORIMETRIC: ; + /* ICC v4 colorimetric profiles are specified to always use D50 + * media white point, anything else is a violation of the spec. + * Sadly, such profiles are incredibly common (Apple...), so make + * an effort to fix them. */ + if (!(white = cmsReadTag(profile, cmsSigMediaWhitePointTag))) + return AVERROR_INVALIDDATA; + XYZ_xy(*white, &wpxy); + diff = av_add_q(abs_sub_q(wpxy.x, wp_d50.x), abs_sub_q(wpxy.y, wp_d50.y)); + if (av_cmp_q(diff, av_make_q(1, 1000)) > 0) { + av_log(s->avctx, AV_LOG_WARNING, "Invalid colorimetric ICCv4 " + "profile media white point tag (expected %.4f %.4f, " + "got %.4f %.4f)\n", + av_q2d(wp_d50.x), av_q2d(wp_d50.y), + av_q2d(wpxy.x), av_q2d(wpxy.y)); + /* x+y+z = 1 */ + z = av_sub_q(av_sub_q(av_make_q(1, 1), wp_d50.x), wp_d50.y); + fixed.X = av_q2d(av_div_q(wp_d50.x, wp_d50.y)) * white->Y; + fixed.Y = white->Y; + fixed.Z = av_q2d(av_div_q(z, wp_d50.y)) * white->Y; + if (!cmsWriteTag(profile, cmsSigMediaWhitePointTag, &fixed)) + return AVERROR_EXTERNAL; + } + break; + default: break; + } + } + + return 0; +} + int ff_icc_profile_read_primaries(FFIccContext *s, cmsHPROFILE profile, AVColorPrimariesDesc *out_primaries) { diff --git a/src/third_party/ffmpeg/libavcodec/fflcms2.h b/src/third_party/ffmpeg/libavcodec/fflcms2.h index af63c9a1..b54173e5 100644 --- a/src/third_party/ffmpeg/libavcodec/fflcms2.h +++ b/src/third_party/ffmpeg/libavcodec/fflcms2.h @@ -65,6 +65,13 @@ int ff_icc_profile_generate(FFIccContext *s, */ int ff_icc_profile_attach(FFIccContext *s, cmsHPROFILE profile, AVFrame *frame); +/** + * Sanitize an ICC profile to try and fix badly broken values. + * + * Returns 0 on success, or a negative error code. + */ +int ff_icc_profile_sanitize(FFIccContext *s, cmsHPROFILE profile); + /** * Read the color primaries and white point coefficients encoded by an ICC * profile, and return the raw values in `out_primaries`. diff --git a/src/third_party/ffmpeg/libavcodec/ffv1dec.c b/src/third_party/ffmpeg/libavcodec/ffv1dec.c index 54cf075b..a376a4c8 100644 --- a/src/third_party/ffmpeg/libavcodec/ffv1dec.c +++ b/src/third_party/ffmpeg/libavcodec/ffv1dec.c @@ -626,6 +626,9 @@ static int read_header(FFV1Context *f) } else if (f->avctx->bits_per_raw_sample == 12) { f->packed_at_lsb = 1; f->avctx->pix_fmt = AV_PIX_FMT_GRAY12; + } else if (f->avctx->bits_per_raw_sample == 14) { + f->packed_at_lsb = 1; + f->avctx->pix_fmt = AV_PIX_FMT_GRAY14; } else if (f->avctx->bits_per_raw_sample == 16) { f->packed_at_lsb = 1; f->avctx->pix_fmt = AV_PIX_FMT_GRAY16; @@ -690,6 +693,12 @@ static int read_header(FFV1Context *f) case 0x10: f->avctx->pix_fmt = AV_PIX_FMT_YUV422P12; break; case 0x11: f->avctx->pix_fmt = AV_PIX_FMT_YUV420P12; break; } + } else if (f->avctx->bits_per_raw_sample == 12 && f->transparency) { + f->packed_at_lsb = 1; + switch(16 * f->chroma_h_shift + f->chroma_v_shift) { + case 0x00: f->avctx->pix_fmt = AV_PIX_FMT_YUVA444P12; break; + case 0x10: f->avctx->pix_fmt = AV_PIX_FMT_YUVA422P12; break; + } } else if (f->avctx->bits_per_raw_sample == 14 && !f->transparency) { f->packed_at_lsb = 1; switch(16 * f->chroma_h_shift + f->chroma_v_shift) { @@ -734,6 +743,8 @@ static int read_header(FFV1Context *f) f->avctx->pix_fmt = AV_PIX_FMT_GBRAP12; else if (f->avctx->bits_per_raw_sample == 14 && !f->transparency) f->avctx->pix_fmt = AV_PIX_FMT_GBRP14; + else if (f->avctx->bits_per_raw_sample == 14 && f->transparency) + f->avctx->pix_fmt = AV_PIX_FMT_GBRAP14; else if (f->avctx->bits_per_raw_sample == 16 && !f->transparency) { f->avctx->pix_fmt = AV_PIX_FMT_GBRP16; f->use32bit = 1; @@ -1061,26 +1072,19 @@ static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src) if (dst == src) return 0; - { - ThreadFrame picture = fdst->picture, last_picture = fdst->last_picture; - uint8_t (*initial_states[MAX_QUANT_TABLES])[32]; - struct FFV1Context *slice_context[MAX_SLICES]; - memcpy(initial_states, fdst->initial_states, sizeof(fdst->initial_states)); - memcpy(slice_context, fdst->slice_context , sizeof(fdst->slice_context)); + copy_fields(fdst, fsrc, fsrc); + fdst->use32bit = fsrc->use32bit; + memcpy(fdst->state_transition, fsrc->state_transition, + sizeof(fdst->state_transition)); + memcpy(fdst->quant_table, fsrc->quant_table, sizeof(fsrc->quant_table)); - memcpy(fdst, fsrc, sizeof(*fdst)); - memcpy(fdst->initial_states, initial_states, sizeof(fdst->initial_states)); - memcpy(fdst->slice_context, slice_context , sizeof(fdst->slice_context)); - fdst->picture = picture; - fdst->last_picture = last_picture; - for (i = 0; inum_h_slices * fdst->num_v_slices; i++) { - FFV1Context *fssrc = fsrc->slice_context[i]; - FFV1Context *fsdst = fdst->slice_context[i]; - copy_fields(fsdst, fssrc, fsrc); - } - av_assert0(!fdst->plane[0].state); - av_assert0(!fdst->sample_buffer); + for (i = 0; i < fdst->num_h_slices * fdst->num_v_slices; i++) { + FFV1Context *fssrc = fsrc->slice_context[i]; + FFV1Context *fsdst = fdst->slice_context[i]; + copy_fields(fsdst, fssrc, fsrc); } + av_assert0(!fdst->plane[0].state); + av_assert0(!fdst->sample_buffer); av_assert1(fdst->max_slice_count == fsrc->max_slice_count); diff --git a/src/third_party/ffmpeg/libavcodec/ffv1enc.c b/src/third_party/ffmpeg/libavcodec/ffv1enc.c index 746f7175..2778c630 100644 --- a/src/third_party/ffmpeg/libavcodec/ffv1enc.c +++ b/src/third_party/ffmpeg/libavcodec/ffv1enc.c @@ -585,8 +585,11 @@ static av_cold int encode_init(AVCodecContext *avctx) case AV_PIX_FMT_YUV440P12: case AV_PIX_FMT_YUV420P12: case AV_PIX_FMT_YUV422P12: + case AV_PIX_FMT_YUVA444P12: + case AV_PIX_FMT_YUVA422P12: if (!avctx->bits_per_raw_sample && !s->bits_per_raw_sample) s->bits_per_raw_sample = 12; + case AV_PIX_FMT_GRAY14: case AV_PIX_FMT_YUV444P14: case AV_PIX_FMT_YUV420P14: case AV_PIX_FMT_YUV422P14: @@ -667,6 +670,7 @@ static av_cold int encode_init(AVCodecContext *avctx) if (!avctx->bits_per_raw_sample && !s->bits_per_raw_sample) s->bits_per_raw_sample = 12; case AV_PIX_FMT_GBRP14: + case AV_PIX_FMT_GBRAP14: if (!avctx->bits_per_raw_sample && !s->bits_per_raw_sample) s->bits_per_raw_sample = 14; case AV_PIX_FMT_GBRP16: @@ -1284,13 +1288,14 @@ const FFCodec ff_ffv1_encoder = { AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUVA444P16, AV_PIX_FMT_YUVA422P16, AV_PIX_FMT_YUVA420P16, + AV_PIX_FMT_YUVA444P12, AV_PIX_FMT_YUVA422P12, AV_PIX_FMT_YUVA444P10, AV_PIX_FMT_YUVA422P10, AV_PIX_FMT_YUVA420P10, AV_PIX_FMT_YUVA444P9, AV_PIX_FMT_YUVA422P9, AV_PIX_FMT_YUVA420P9, AV_PIX_FMT_GRAY16, AV_PIX_FMT_GRAY8, AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10, - AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14, + AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14, AV_PIX_FMT_GBRAP14, AV_PIX_FMT_GBRAP10, AV_PIX_FMT_GBRAP12, AV_PIX_FMT_YA8, - AV_PIX_FMT_GRAY10, AV_PIX_FMT_GRAY12, + AV_PIX_FMT_GRAY10, AV_PIX_FMT_GRAY12, AV_PIX_FMT_GRAY14, AV_PIX_FMT_GBRP16, AV_PIX_FMT_RGB48, AV_PIX_FMT_GBRAP16, AV_PIX_FMT_RGBA64, AV_PIX_FMT_GRAY9, diff --git a/src/third_party/ffmpeg/libavcodec/flac.c b/src/third_party/ffmpeg/libavcodec/flac.c index 174b4801..fac4cff9 100644 --- a/src/third_party/ffmpeg/libavcodec/flac.c +++ b/src/third_party/ffmpeg/libavcodec/flac.c @@ -48,14 +48,14 @@ static int64_t get_utf8(GetBitContext *gb) return val; } -int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, +int ff_flac_decode_frame_header(void *logctx, GetBitContext *gb, FLACFrameInfo *fi, int log_level_offset) { int bs_code, sr_code, bps_code; /* frame sync code */ if ((get_bits(gb, 15) & 0x7FFF) != 0x7FFC) { - av_log(avctx, AV_LOG_ERROR + log_level_offset, "invalid sync code\n"); + av_log(logctx, AV_LOG_ERROR + log_level_offset, "invalid sync code\n"); return AVERROR_INVALIDDATA; } @@ -75,7 +75,7 @@ int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, fi->channels = 2; fi->ch_mode -= FLAC_MAX_CHANNELS - 1; } else { - av_log(avctx, AV_LOG_ERROR + log_level_offset, + av_log(logctx, AV_LOG_ERROR + log_level_offset, "invalid channel mode: %d\n", fi->ch_mode); return AVERROR_INVALIDDATA; } @@ -83,7 +83,7 @@ int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, /* bits per sample */ bps_code = get_bits(gb, 3); if (bps_code == 3) { - av_log(avctx, AV_LOG_ERROR + log_level_offset, + av_log(logctx, AV_LOG_ERROR + log_level_offset, "invalid sample size code (%d)\n", bps_code); return AVERROR_INVALIDDATA; @@ -92,7 +92,7 @@ int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, /* reserved bit */ if (get_bits1(gb)) { - av_log(avctx, AV_LOG_ERROR + log_level_offset, + av_log(logctx, AV_LOG_ERROR + log_level_offset, "broken stream, invalid padding\n"); return AVERROR_INVALIDDATA; } @@ -100,14 +100,14 @@ int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, /* sample or frame count */ fi->frame_or_sample_num = get_utf8(gb); if (fi->frame_or_sample_num < 0) { - av_log(avctx, AV_LOG_ERROR + log_level_offset, + av_log(logctx, AV_LOG_ERROR + log_level_offset, "sample/frame number invalid; utf8 fscked\n"); return AVERROR_INVALIDDATA; } /* blocksize */ if (bs_code == 0) { - av_log(avctx, AV_LOG_ERROR + log_level_offset, + av_log(logctx, AV_LOG_ERROR + log_level_offset, "reserved blocksize code: 0\n"); return AVERROR_INVALIDDATA; } else if (bs_code == 6) { @@ -128,7 +128,7 @@ int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, } else if (sr_code == 14) { fi->samplerate = get_bits(gb, 16) * 10; } else { - av_log(avctx, AV_LOG_ERROR + log_level_offset, + av_log(logctx, AV_LOG_ERROR + log_level_offset, "illegal sample rate code %d\n", sr_code); return AVERROR_INVALIDDATA; @@ -138,7 +138,7 @@ int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, skip_bits(gb, 8); if (av_crc(av_crc_get_table(AV_CRC_8_ATM), 0, gb->buffer, get_bits_count(gb)/8)) { - av_log(avctx, AV_LOG_ERROR + log_level_offset, + av_log(logctx, AV_LOG_ERROR + log_level_offset, "header crc mismatch\n"); return AVERROR_INVALIDDATA; } diff --git a/src/third_party/ffmpeg/libavcodec/flac_parse.h b/src/third_party/ffmpeg/libavcodec/flac_parse.h index 67a7320b..b0cbad82 100644 --- a/src/third_party/ffmpeg/libavcodec/flac_parse.h +++ b/src/third_party/ffmpeg/libavcodec/flac_parse.h @@ -75,13 +75,13 @@ int ff_flac_is_extradata_valid(AVCodecContext *avctx, /** * Validate and decode a frame header. - * @param avctx AVCodecContext to use as av_log() context + * @param logctx context for logging * @param gb GetBitContext from which to read frame header * @param[out] fi frame information * @param log_level_offset log level offset. can be used to silence error messages. * @return non-zero on error, 0 if ok */ -int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, +int ff_flac_decode_frame_header(void *logctx, GetBitContext *gb, FLACFrameInfo *fi, int log_level_offset); void ff_flac_set_channel_layout(AVCodecContext *avctx, int channels); diff --git a/src/third_party/ffmpeg/libavcodec/flacdec.c b/src/third_party/ffmpeg/libavcodec/flacdec.c index 524a0469..ed2de14d 100644 --- a/src/third_party/ffmpeg/libavcodec/flacdec.c +++ b/src/third_party/ffmpeg/libavcodec/flacdec.c @@ -366,19 +366,19 @@ static int decode_subframe_fixed(FLACContext *s, int32_t *decoded, break; \ case 1: \ for (int i = pred_order; i < blocksize; i++) \ - decoded[i] = (int64_t)residual[i] + (int64_t)decoded[i-1];\ + decoded[i] = (uint64_t)residual[i] + (uint64_t)decoded[i-1];\ break; \ case 2: \ for (int i = pred_order; i < blocksize; i++) \ - decoded[i] = (int64_t)residual[i] + 2*(int64_t)decoded[i-1] - (int64_t)decoded[i-2]; \ + decoded[i] = (uint64_t)residual[i] + 2*(uint64_t)decoded[i-1] - (uint64_t)decoded[i-2]; \ break; \ case 3: \ for (int i = pred_order; i < blocksize; i++) \ - decoded[i] = (int64_t)residual[i] + 3*(int64_t)decoded[i-1] - 3*(int64_t)decoded[i-2] + (int64_t)decoded[i-3]; \ + decoded[i] = (uint64_t)residual[i] + 3*(uint64_t)decoded[i-1] - 3*(uint64_t)decoded[i-2] + (uint64_t)decoded[i-3]; \ break; \ case 4: \ for (int i = pred_order; i < blocksize; i++) \ - decoded[i] = (int64_t)residual[i] + 4*(int64_t)decoded[i-1] - 6*(int64_t)decoded[i-2] + 4*(int64_t)decoded[i-3] - (int64_t)decoded[i-4]; \ + decoded[i] = (uint64_t)residual[i] + 4*(uint64_t)decoded[i-1] - 6*(uint64_t)decoded[i-2] + 4*(uint64_t)decoded[i-3] - (uint64_t)decoded[i-4]; \ break; \ default: \ av_log(s->avctx, AV_LOG_ERROR, "illegal pred order %d\n", pred_order); \ @@ -706,10 +706,10 @@ static void decorrelate_33bps(int ch_mode, int32_t **decoded, int64_t *decoded_3 int i; if (ch_mode == FLAC_CHMODE_LEFT_SIDE ) { for (i = 0; i < len; i++) - decoded[1][i] = decoded[0][i] - decoded_33bps[i]; + decoded[1][i] = decoded[0][i] - (uint64_t)decoded_33bps[i]; } else if (ch_mode == FLAC_CHMODE_RIGHT_SIDE ) { for (i = 0; i < len; i++) - decoded[0][i] = decoded[1][i] + decoded_33bps[i]; + decoded[0][i] = decoded[1][i] + (uint64_t)decoded_33bps[i]; } else if (ch_mode == FLAC_CHMODE_MID_SIDE ) { for (i = 0; i < len; i++) { uint64_t a = decoded[0][i]; diff --git a/src/third_party/ffmpeg/libavcodec/flicvideo.c b/src/third_party/ffmpeg/libavcodec/flicvideo.c index e4b334e1..6ce033ba 100644 --- a/src/third_party/ffmpeg/libavcodec/flicvideo.c +++ b/src/third_party/ffmpeg/libavcodec/flicvideo.c @@ -60,12 +60,28 @@ #define FLC_DTA_TYPE_CODE (0xAF44) /* Marks an "Extended FLC" comes from Dave's Targa Animator (DTA) */ #define FLC_MAGIC_CARPET_SYNTHETIC_TYPE_CODE (0xAF13) +static inline int check_pixel_ptr(ptrdiff_t ptr, int n, + ptrdiff_t limit, int direction) +{ + if (( direction && ptr + n > limit) || + (!direction && ptr + n < limit)) + return AVERROR_INVALIDDATA; + return 0; +} + #define CHECK_PIXEL_PTR(n) \ - if (pixel_ptr + n > pixel_limit) { \ - av_log (s->avctx, AV_LOG_ERROR, "Invalid pixel_ptr = %d > pixel_limit = %d\n", \ - pixel_ptr + n, pixel_limit); \ - return AVERROR_INVALIDDATA; \ - } \ +{ \ + ret = check_pixel_ptr(pixel_ptr, (n), pixel_limit, direction); \ + if (ret < 0) \ + return ret; \ +} + +#define CHECK_Y_PTR() \ +{ \ + ret = check_pixel_ptr(y_ptr, 0, pixel_limit, direction); \ + if (ret < 0) \ + return ret; \ +} typedef struct FlicDecodeContext { AVCodecContext *avctx; @@ -79,7 +95,7 @@ typedef struct FlicDecodeContext { static av_cold int flic_decode_init(AVCodecContext *avctx) { FlicDecodeContext *s = avctx->priv_data; - unsigned char *fli_header = (unsigned char *)avctx->extradata; + uint8_t *fli_header = avctx->extradata; int depth; if (avctx->extradata_size != 0 && @@ -128,6 +144,7 @@ static av_cold int flic_decode_init(AVCodecContext *avctx) } switch (depth) { + case 1 : avctx->pix_fmt = AV_PIX_FMT_MONOBLACK; break; case 8 : avctx->pix_fmt = AV_PIX_FMT_PAL8; break; case 15 : avctx->pix_fmt = AV_PIX_FMT_RGB555; break; case 16 : avctx->pix_fmt = AV_PIX_FMT_RGB565; break; @@ -146,6 +163,198 @@ static av_cold int flic_decode_init(AVCodecContext *avctx) return 0; } +static int flic_decode_frame_1BPP(AVCodecContext *avctx, + AVFrame *rframe, int *got_frame, + const uint8_t *buf, int buf_size) +{ + FlicDecodeContext *s = avctx->priv_data; + + GetByteContext g2; + ptrdiff_t pixel_ptr; + + unsigned int frame_size; + int num_chunks; + + unsigned int chunk_size; + int chunk_type; + + int i, j, ret, direction; + + int lines; + int compressed_lines; + int starting_line; + int line_packets; + ptrdiff_t y_ptr; + int byte_run; + int pixel_skip; + int pixel_countdown; + unsigned char *pixels; + ptrdiff_t pixel_limit; + + bytestream2_init(&g2, buf, buf_size); + + if ((ret = ff_reget_buffer(avctx, s->frame, 0)) < 0) + return ret; + + direction = s->frame->linesize[0] > 0; + pixels = s->frame->data[0]; + pixel_limit = s->avctx->height * s->frame->linesize[0]; + if (buf_size < 16 || buf_size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE) + return AVERROR_INVALIDDATA; + frame_size = bytestream2_get_le32(&g2); + if (frame_size > buf_size) + frame_size = buf_size; + bytestream2_skip(&g2, 2); /* skip the magic number */ + num_chunks = bytestream2_get_le16(&g2); + bytestream2_skip(&g2, 8); /* skip padding */ + + if (frame_size < 16) + return AVERROR_INVALIDDATA; + + frame_size -= 16; + + /* iterate through the chunks */ + while ((frame_size >= 6) && (num_chunks > 0) && + bytestream2_get_bytes_left(&g2) >= 4) { + int stream_ptr_after_chunk; + chunk_size = bytestream2_get_le32(&g2); + if (chunk_size > frame_size) { + av_log(avctx, AV_LOG_WARNING, + "Invalid chunk_size = %u > frame_size = %u\n", chunk_size, frame_size); + chunk_size = frame_size; + } + stream_ptr_after_chunk = bytestream2_tell(&g2) - 4 + chunk_size; + + chunk_type = bytestream2_get_le16(&g2); + + switch (chunk_type) { + case FLI_BRUN: + /* Byte run compression: This chunk type only occurs in the first + * FLI frame and it will update the entire frame. */ + y_ptr = 0; + for (lines = 0; lines < s->avctx->height; lines++) { + pixel_ptr = y_ptr; + /* disregard the line packets; instead, iterate through all + * pixels on a row */ + bytestream2_skip(&g2, 1); + pixel_countdown = (s->avctx->width + 7) >> 3; + while (pixel_countdown > 0) { + if (bytestream2_tell(&g2) + 1 > stream_ptr_after_chunk) + break; + byte_run = sign_extend(bytestream2_get_byte(&g2), 8); + if (!byte_run) { + av_log(avctx, AV_LOG_ERROR, "Invalid byte run value.\n"); + return AVERROR_INVALIDDATA; + } + + if (byte_run > 0) { + int value = bytestream2_get_byte(&g2); + CHECK_PIXEL_PTR(byte_run); + for (j = 0; j < byte_run; j++) { + pixels[pixel_ptr++] = value; + pixel_countdown--; + if (pixel_countdown < 0) + av_log(avctx, AV_LOG_ERROR, "pixel_countdown < 0 (%d) at line %d\n", + pixel_countdown, lines); + } + } else { /* copy bytes if byte_run < 0 */ + byte_run = -byte_run; + CHECK_PIXEL_PTR(byte_run); + if (bytestream2_tell(&g2) + byte_run > stream_ptr_after_chunk) + break; + for (j = 0; j < byte_run; j++) { + pixels[pixel_ptr++] = bytestream2_get_byte(&g2); + pixel_countdown--; + if (pixel_countdown < 0) + av_log(avctx, AV_LOG_ERROR, "pixel_countdown < 0 (%d) at line %d\n", + pixel_countdown, lines); + } + } + } + + y_ptr += s->frame->linesize[0]; + } + break; + + case FLI_LC: + /* line compressed */ + starting_line = bytestream2_get_le16(&g2); + if (starting_line >= s->avctx->height) + return AVERROR_INVALIDDATA; + y_ptr = 0; + y_ptr += starting_line * s->frame->linesize[0]; + + compressed_lines = bytestream2_get_le16(&g2); + while (compressed_lines > 0) { + pixel_ptr = y_ptr; + CHECK_PIXEL_PTR(0); + pixel_countdown = (s->avctx->width + 7) >> 3; + if (bytestream2_tell(&g2) + 1 > stream_ptr_after_chunk) + break; + line_packets = bytestream2_get_byte(&g2); + if (line_packets > 0) { + for (i = 0; i < line_packets; i++) { + /* account for the skip bytes */ + if (bytestream2_tell(&g2) + 1 > stream_ptr_after_chunk) + break; + pixel_skip = bytestream2_get_byte(&g2); + pixel_ptr += pixel_skip; + pixel_countdown -= pixel_skip; + byte_run = sign_extend(bytestream2_get_byte(&g2),8); + if (byte_run > 0) { + CHECK_PIXEL_PTR(byte_run); + if (bytestream2_tell(&g2) + byte_run > stream_ptr_after_chunk) + break; + for (j = 0; j < byte_run; j++, pixel_countdown--) { + pixels[pixel_ptr++] = bytestream2_get_byte(&g2); + } + } else if (byte_run < 0) { + int value = bytestream2_get_byte(&g2); + byte_run = -byte_run; + CHECK_PIXEL_PTR(byte_run); + for (j = 0; j < byte_run; j++, pixel_countdown--) { + pixels[pixel_ptr++] = value; + } + } + } + } + + y_ptr += s->frame->linesize[0]; + compressed_lines--; + } + break; + + default: + av_log(avctx, AV_LOG_ERROR, "Unrecognized chunk type: %d\n", chunk_type); + break; + } + + if (stream_ptr_after_chunk - bytestream2_tell(&g2) >= 0) { + bytestream2_skip(&g2, stream_ptr_after_chunk - bytestream2_tell(&g2)); + } else { + av_log(avctx, AV_LOG_ERROR, "Chunk overread\n"); + break; + } + + frame_size -= chunk_size; + num_chunks--; + } + + /* by the end of the chunk, the stream ptr should equal the frame + * size (minus 1 or 2, possibly); if it doesn't, issue a warning */ + if (bytestream2_get_bytes_left(&g2) > 2) + av_log(avctx, AV_LOG_ERROR, "Processed FLI chunk where chunk size = %d " \ + "and final chunk ptr = %d\n", buf_size, + buf_size - bytestream2_get_bytes_left(&g2)); + + if ((ret = av_frame_ref(rframe, s->frame)) < 0) + return ret; + + *got_frame = 1; + + return buf_size; +} + static int flic_decode_frame_8BPP(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, const uint8_t *buf, int buf_size) @@ -153,7 +362,7 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx, FlicDecodeContext *s = avctx->priv_data; GetByteContext g2; - int pixel_ptr; + ptrdiff_t pixel_ptr; int palette_ptr; unsigned char palette_idx1; unsigned char palette_idx2; @@ -164,7 +373,7 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx, unsigned int chunk_size; int chunk_type; - int i, j, ret; + int i, j, ret, direction; int color_packets; int color_changes; @@ -175,18 +384,19 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx, int compressed_lines; int starting_line; int line_packets; - int y_ptr; + ptrdiff_t y_ptr; int byte_run; int pixel_skip; int pixel_countdown; unsigned char *pixels; - unsigned int pixel_limit; + ptrdiff_t pixel_limit; bytestream2_init(&g2, buf, buf_size); if ((ret = ff_reget_buffer(avctx, s->frame, 0)) < 0) return ret; + direction = s->frame->linesize[0] > 0; pixels = s->frame->data[0]; pixel_limit = s->avctx->height * s->frame->linesize[0]; if (buf_size < 16 || buf_size > INT_MAX - (3 * 256 + AV_INPUT_BUFFER_PADDING_SIZE)) @@ -271,8 +481,7 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx, while (compressed_lines > 0) { if (bytestream2_tell(&g2) + 2 > stream_ptr_after_chunk) break; - if (y_ptr > pixel_limit) - return AVERROR_INVALIDDATA; + CHECK_Y_PTR() line_packets = sign_extend(bytestream2_get_le16(&g2), 16); if ((line_packets & 0xC000) == 0xC000) { // line skip opcode @@ -374,8 +583,8 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx, case FLI_BLACK: /* set the whole frame to color 0 (which is usually black) */ - memset(pixels, 0, - s->frame->linesize[0] * s->avctx->height); + for (int y = 0; y < s->avctx->height; y++) + memset(pixels + y * s->frame->linesize[0], 0, s->avctx->width); break; case FLI_BRUN: @@ -433,7 +642,7 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx, "has incorrect size, skipping chunk\n", chunk_size - 6); bytestream2_skip(&g2, chunk_size - 6); } else { - for (y_ptr = 0; y_ptr < s->frame->linesize[0] * s->avctx->height; + for (y_ptr = 0; check_pixel_ptr(y_ptr, 0, pixel_limit, direction) == 0; y_ptr += s->frame->linesize[0]) { bytestream2_get_buffer(&g2, &pixels[y_ptr], s->avctx->width); @@ -498,7 +707,7 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx, FlicDecodeContext *s = avctx->priv_data; GetByteContext g2; - int pixel_ptr; + ptrdiff_t pixel_ptr; unsigned char palette_idx1; unsigned int frame_size; @@ -507,24 +716,25 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx, unsigned int chunk_size; int chunk_type; - int i, j, ret; + int i, j, ret, direction; int lines; int compressed_lines; int line_packets; - int y_ptr; + ptrdiff_t y_ptr; int byte_run; int pixel_skip; int pixel_countdown; unsigned char *pixels; int pixel; - unsigned int pixel_limit; + ptrdiff_t pixel_limit; bytestream2_init(&g2, buf, buf_size); if ((ret = ff_reget_buffer(avctx, s->frame, 0)) < 0) return ret; + direction = s->frame->linesize[0] > 0; pixels = s->frame->data[0]; pixel_limit = s->avctx->height * s->frame->linesize[0]; @@ -573,8 +783,7 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx, while (compressed_lines > 0) { if (bytestream2_tell(&g2) + 2 > stream_ptr_after_chunk) break; - if (y_ptr > pixel_limit) - return AVERROR_INVALIDDATA; + CHECK_Y_PTR() line_packets = sign_extend(bytestream2_get_le16(&g2), 16); if (line_packets < 0) { line_packets = -line_packets; @@ -625,8 +834,8 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx, case FLI_BLACK: /* set the whole frame to 0x0000 which is black in both 15Bpp and 16Bpp modes. */ - memset(pixels, 0x0000, - s->frame->linesize[0] * s->avctx->height); + for (int y = 0; y < s->avctx->height; y++) + memset(pixels + y * s->frame->linesize[0], 0, s->avctx->width * 2); break; case FLI_BRUN: @@ -740,7 +949,7 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx, if (bytestream2_get_bytes_left(&g2) < 2 * s->avctx->width * s->avctx->height ) return AVERROR_INVALIDDATA; - for (y_ptr = 0; y_ptr < s->frame->linesize[0] * s->avctx->height; + for (y_ptr = 0; check_pixel_ptr(y_ptr, 0, pixel_limit, direction) == 0; y_ptr += s->frame->linesize[0]) { pixel_countdown = s->avctx->width; @@ -798,7 +1007,7 @@ static int flic_decode_frame_24BPP(AVCodecContext *avctx, FlicDecodeContext *s = avctx->priv_data; GetByteContext g2; - int pixel_ptr; + ptrdiff_t pixel_ptr; unsigned char palette_idx1; unsigned int frame_size; @@ -807,24 +1016,25 @@ static int flic_decode_frame_24BPP(AVCodecContext *avctx, unsigned int chunk_size; int chunk_type; - int i, j, ret; + int i, j, ret, direction; int lines; int compressed_lines; int line_packets; - int y_ptr; + ptrdiff_t y_ptr; int byte_run; int pixel_skip; int pixel_countdown; unsigned char *pixels; int pixel; - unsigned int pixel_limit; + ptrdiff_t pixel_limit; bytestream2_init(&g2, buf, buf_size); if ((ret = ff_reget_buffer(avctx, s->frame, 0)) < 0) return ret; + direction = s->frame->linesize[0] > 0; pixels = s->frame->data[0]; pixel_limit = s->avctx->height * s->frame->linesize[0]; @@ -873,8 +1083,7 @@ static int flic_decode_frame_24BPP(AVCodecContext *avctx, while (compressed_lines > 0) { if (bytestream2_tell(&g2) + 2 > stream_ptr_after_chunk) break; - if (y_ptr > pixel_limit) - return AVERROR_INVALIDDATA; + CHECK_Y_PTR() line_packets = sign_extend(bytestream2_get_le16(&g2), 16); if (line_packets < 0) { line_packets = -line_packets; @@ -926,8 +1135,8 @@ static int flic_decode_frame_24BPP(AVCodecContext *avctx, case FLI_BLACK: /* set the whole frame to 0x00 which is black for 24 bit mode. */ - memset(pixels, 0x00, - s->frame->linesize[0] * s->avctx->height); + for (int y = 0; y < s->avctx->height; y++) + memset(pixels + y * s->frame->linesize[0], 0, s->avctx->width * 3); break; case FLI_BRUN: @@ -1026,7 +1235,7 @@ static int flic_decode_frame_24BPP(AVCodecContext *avctx, "bigger than image, skipping chunk\n", chunk_size - 6); bytestream2_skip(&g2, chunk_size - 6); } else { - for (y_ptr = 0; y_ptr < s->frame->linesize[0] * s->avctx->height; + for (y_ptr = 0; check_pixel_ptr(y_ptr, 0, pixel_limit, direction) == 0; y_ptr += s->frame->linesize[0]) { bytestream2_get_buffer(&g2, pixels + y_ptr, 3*s->avctx->width); @@ -1076,7 +1285,10 @@ static int flic_decode_frame(AVCodecContext *avctx, AVFrame *frame, { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; - if (avctx->pix_fmt == AV_PIX_FMT_PAL8) { + if (avctx->pix_fmt == AV_PIX_FMT_MONOBLACK) { + return flic_decode_frame_1BPP(avctx, frame, got_frame, + buf, buf_size); + } else if (avctx->pix_fmt == AV_PIX_FMT_PAL8) { return flic_decode_frame_8BPP(avctx, frame, got_frame, buf, buf_size); } else if ((avctx->pix_fmt == AV_PIX_FMT_RGB555) || diff --git a/src/third_party/ffmpeg/libavcodec/fraps.c b/src/third_party/ffmpeg/libavcodec/fraps.c index 834e6576..7790e689 100644 --- a/src/third_party/ffmpeg/libavcodec/fraps.c +++ b/src/third_party/ffmpeg/libavcodec/fraps.c @@ -56,7 +56,6 @@ typedef struct FrapsContext { int tmpbuf_size; } FrapsContext; - /** * initializes decoder * @param avctx codec context @@ -123,13 +122,13 @@ static int fraps2_decode_plane(FrapsContext *s, uint8_t *dst, int stride, int w, else if (Uoff) dst[i] += 0x80; if (get_bits_left(&gb) < 0) { - ff_free_vlc(&vlc); + ff_vlc_free(&vlc); return AVERROR_INVALIDDATA; } } dst += stride; } - ff_free_vlc(&vlc); + ff_vlc_free(&vlc); return 0; } @@ -323,7 +322,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *f, return buf_size; } - /** * closes decoder * @param avctx codec context @@ -331,13 +329,12 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *f, */ static av_cold int decode_end(AVCodecContext *avctx) { - FrapsContext *s = (FrapsContext*)avctx->priv_data; + FrapsContext *s = avctx->priv_data; av_freep(&s->tmpbuf); return 0; } - const FFCodec ff_fraps_decoder = { .p.name = "fraps", CODEC_LONG_NAME("Fraps"), diff --git a/src/third_party/ffmpeg/libavcodec/g2meet.c b/src/third_party/ffmpeg/libavcodec/g2meet.c index 2dfa73df..34ff60a3 100644 --- a/src/third_party/ffmpeg/libavcodec/g2meet.c +++ b/src/third_party/ffmpeg/libavcodec/g2meet.c @@ -195,8 +195,8 @@ static av_cold void jpg_free_context(JPGContext *ctx) int i; for (i = 0; i < 2; i++) { - ff_free_vlc(&ctx->dc_vlc[i]); - ff_free_vlc(&ctx->ac_vlc[i]); + ff_vlc_free(&ctx->dc_vlc[i]); + ff_vlc_free(&ctx->ac_vlc[i]); } av_freep(&ctx->buf); diff --git a/src/third_party/ffmpeg/libavcodec/g722dsp.c b/src/third_party/ffmpeg/libavcodec/g722dsp.c index c770bfbd..30228368 100644 --- a/src/third_party/ffmpeg/libavcodec/g722dsp.c +++ b/src/third_party/ffmpeg/libavcodec/g722dsp.c @@ -71,6 +71,8 @@ av_cold void ff_g722dsp_init(G722DSPContext *c) #if ARCH_ARM ff_g722dsp_init_arm(c); +#elif ARCH_RISCV + ff_g722dsp_init_riscv(c); #elif ARCH_X86 ff_g722dsp_init_x86(c); #endif diff --git a/src/third_party/ffmpeg/libavcodec/g722dsp.h b/src/third_party/ffmpeg/libavcodec/g722dsp.h index c956a1e1..1aa7078a 100644 --- a/src/third_party/ffmpeg/libavcodec/g722dsp.h +++ b/src/third_party/ffmpeg/libavcodec/g722dsp.h @@ -29,6 +29,7 @@ typedef struct G722DSPContext { void ff_g722dsp_init(G722DSPContext *c); void ff_g722dsp_init_arm(G722DSPContext *c); +void ff_g722dsp_init_riscv(G722DSPContext *c); void ff_g722dsp_init_x86(G722DSPContext *c); #endif /* AVCODEC_G722DSP_H */ diff --git a/src/third_party/ffmpeg/libavcodec/g729postfilter.c b/src/third_party/ffmpeg/libavcodec/g729postfilter.c index 26e937f0..382db924 100644 --- a/src/third_party/ffmpeg/libavcodec/g729postfilter.c +++ b/src/third_party/ffmpeg/libavcodec/g729postfilter.c @@ -581,7 +581,7 @@ void ff_g729_postfilter(AudioDSPContext *adsp, int16_t* ht_prev_data, int* voici int16_t ff_g729_adaptive_gain_control(int gain_before, int gain_after, int16_t *speech, int subframe_size, int16_t gain_prev) { - int gain; // (3.12) + unsigned gain; // (3.12) int n; int exp_before, exp_after; @@ -603,7 +603,7 @@ int16_t ff_g729_adaptive_gain_control(int gain_before, int gain_after, int16_t * gain = ((gain_before - gain_after) << 14) / gain_after + 0x4000; gain = bidir_sal(gain, exp_after - exp_before); } - gain = av_clip_int16(gain); + gain = FFMIN(gain, 32767); gain = (gain * G729_AGC_FAC1 + 0x4000) >> 15; // gain * (1-0.9875) } else gain = 0; diff --git a/src/third_party/ffmpeg/libavcodec/get_bits.h b/src/third_party/ffmpeg/libavcodec/get_bits.h index 65dc080d..cfcf97c0 100644 --- a/src/third_party/ffmpeg/libavcodec/get_bits.h +++ b/src/third_party/ffmpeg/libavcodec/get_bits.h @@ -93,6 +93,7 @@ typedef BitstreamContext GetBitContext; #define init_get_bits8 bits_init8 #define align_get_bits bits_align #define get_vlc2 bits_read_vlc +#define get_vlc_multi bits_read_vlc_multi #define init_get_bits8_le(s, buffer, byte_size) bits_init8_le((BitstreamContextLE*)s, buffer, byte_size) #define get_bits_le(s, n) bits_read_le((BitstreamContextLE*)s, n) @@ -186,21 +187,28 @@ static inline unsigned int show_bits(GetBitContext *s, int n); #define CLOSE_READER(name, gb) (gb)->index = name ## _index +#define UPDATE_CACHE_BE_EXT(name, gb, bits, dst_bits) name ## _cache = \ + AV_RB ## bits((gb)->buffer + (name ## _index >> 3)) << (name ## _index & 7) >> (bits - dst_bits) + +#define UPDATE_CACHE_LE_EXT(name, gb, bits, dst_bits) name ## _cache = \ + (uint ## dst_bits ## _t)(AV_RL ## bits((gb)->buffer + (name ## _index >> 3)) >> (name ## _index & 7)) + +/* Using these two macros ensures that 32 bits are available. */ +# define UPDATE_CACHE_LE_32(name, gb) UPDATE_CACHE_LE_EXT(name, (gb), 64, 32) + +# define UPDATE_CACHE_BE_32(name, gb) UPDATE_CACHE_BE_EXT(name, (gb), 64, 32) + # ifdef LONG_BITSTREAM_READER -# define UPDATE_CACHE_LE(name, gb) name ## _cache = \ - AV_RL64((gb)->buffer + (name ## _index >> 3)) >> (name ## _index & 7) +# define UPDATE_CACHE_LE(name, gb) UPDATE_CACHE_LE_32(name, (gb)) -# define UPDATE_CACHE_BE(name, gb) name ## _cache = \ - AV_RB64((gb)->buffer + (name ## _index >> 3)) >> (32 - (name ## _index & 7)) +# define UPDATE_CACHE_BE(name, gb) UPDATE_CACHE_BE_32(name, (gb)) #else -# define UPDATE_CACHE_LE(name, gb) name ## _cache = \ - AV_RL32((gb)->buffer + (name ## _index >> 3)) >> (name ## _index & 7) +# define UPDATE_CACHE_LE(name, gb) UPDATE_CACHE_LE_EXT(name, (gb), 32, 32) -# define UPDATE_CACHE_BE(name, gb) name ## _cache = \ - AV_RB32((gb)->buffer + (name ## _index >> 3)) << (name ## _index & 7) +# define UPDATE_CACHE_BE(name, gb) UPDATE_CACHE_BE_EXT(name, (gb), 32, 32) #endif @@ -208,12 +216,14 @@ static inline unsigned int show_bits(GetBitContext *s, int n); #ifdef BITSTREAM_READER_LE # define UPDATE_CACHE(name, gb) UPDATE_CACHE_LE(name, gb) +# define UPDATE_CACHE_32(name, gb) UPDATE_CACHE_LE_32(name, (gb)) # define SKIP_CACHE(name, gb, num) name ## _cache >>= (num) #else # define UPDATE_CACHE(name, gb) UPDATE_CACHE_BE(name, gb) +# define UPDATE_CACHE_32(name, gb) UPDATE_CACHE_BE_32(name, (gb)) # define SKIP_CACHE(name, gb, num) name ## _cache <<= (num) @@ -413,15 +423,26 @@ static inline unsigned int get_bits_long(GetBitContext *s, int n) av_assert2(n>=0 && n<=32); if (!n) { return 0; - } else if (n <= MIN_CACHE_BITS) { + } else if ((!HAVE_FAST_64BIT || av_builtin_constant_p(n <= MIN_CACHE_BITS)) + && n <= MIN_CACHE_BITS) { return get_bits(s, n); } else { +#if HAVE_FAST_64BIT + unsigned tmp; + OPEN_READER(re, s); + UPDATE_CACHE_32(re, s); + tmp = SHOW_UBITS(re, s, n); + LAST_SKIP_BITS(re, s, n); + CLOSE_READER(re, s); + return tmp; +#else #ifdef BITSTREAM_READER_LE unsigned ret = get_bits(s, 16); return ret | (get_bits(s, n - 16) << 16); #else unsigned ret = get_bits(s, 16) << (n - 16); return ret | get_bits(s, n - 16); +#endif #endif } } @@ -622,7 +643,7 @@ static inline const uint8_t *align_get_bits(GetBitContext *s) /** * Parse a vlc code. * @param bits is the number of bits which will be read at once, must be - * identical to nb_bits in init_vlc() + * identical to nb_bits in vlc_init() * @param max_depth is the number of times bits bits must be read to completely * read the longest vlc code * = (max_vlc_length + bits - 1) / bits @@ -643,6 +664,15 @@ static av_always_inline int get_vlc2(GetBitContext *s, const VLCElem *table, return code; } +static inline int get_vlc_multi(GetBitContext *s, uint8_t *dst, + const VLC_MULTI_ELEM *const Jtable, + const VLCElem *const table, + const int bits, const int max_depth) +{ + dst[0] = get_vlc2(s, table, bits, max_depth); + return 1; +} + static inline int decode012(GetBitContext *gb) { int n; diff --git a/src/third_party/ffmpeg/libavcodec/gif.c b/src/third_party/ffmpeg/libavcodec/gif.c index 131af619..11add644 100644 --- a/src/third_party/ffmpeg/libavcodec/gif.c +++ b/src/third_party/ffmpeg/libavcodec/gif.c @@ -503,8 +503,7 @@ static int gif_encode_frame(AVCodecContext *avctx, AVPacket *pkt, } if (!s->image) { - av_frame_unref(s->last_frame); - ret = av_frame_ref(s->last_frame, pict); + ret = av_frame_replace(s->last_frame, pict); if (ret < 0) return ret; } diff --git a/src/third_party/ffmpeg/libavcodec/gifdec.c b/src/third_party/ffmpeg/libavcodec/gifdec.c index 86aaa888..a97a6d15 100644 --- a/src/third_party/ffmpeg/libavcodec/gifdec.c +++ b/src/third_party/ffmpeg/libavcodec/gifdec.c @@ -59,7 +59,7 @@ typedef struct GifState { /* depending on disposal method we store either part of the image * drawn on the canvas or background color that * should be used upon disposal */ - uint32_t * stored_img; + uint8_t *stored_img; int stored_img_size; int stored_bg_color; @@ -86,52 +86,55 @@ static void gif_read_palette(GifState *s, uint32_t *pal, int nb) static void gif_fill(AVFrame *picture, uint32_t color) { - uint32_t *p = (uint32_t *)picture->data[0]; - uint32_t *p_end = p + (picture->linesize[0] / sizeof(uint32_t)) * picture->height; + const ptrdiff_t linesize = picture->linesize[0]; + uint8_t *py = picture->data[0]; + const int w = picture->width; + const int h = picture->height; - for (; p < p_end; p++) - *p = color; + for (int y = 0; y < h; y++) { + uint32_t *px = (uint32_t *)py; + for (int x = 0; x < w; x++) + px[x] = color; + py += linesize; + } } static void gif_fill_rect(AVFrame *picture, uint32_t color, int l, int t, int w, int h) { - const int linesize = picture->linesize[0] / sizeof(uint32_t); - const uint32_t *py = (uint32_t *)picture->data[0] + t * linesize; - const uint32_t *pr, *pb = py + h * linesize; - uint32_t *px; + const ptrdiff_t linesize = picture->linesize[0]; + uint8_t *py = picture->data[0] + t * linesize; - for (; py < pb; py += linesize) { - px = (uint32_t *)py + l; - pr = px + w; - - for (; px < pr; px++) - *px = color; + for (int y = 0; y < h; y++) { + uint32_t *px = ((uint32_t *)py) + l; + for (int x = 0; x < w; x++) + px[x] = color; + py += linesize; } } -static void gif_copy_img_rect(const uint32_t *src, uint32_t *dst, - int linesize, int l, int t, int w, int h) +static void gif_copy_img_rect(const uint8_t *src, uint8_t *dst, + ptrdiff_t src_linesize, + ptrdiff_t dst_linesize, + int l, int t, int w, int h) { - const int y_start = t * linesize; - const uint32_t *src_px, - *src_py = src + y_start, - *dst_py = dst + y_start; - const uint32_t *src_pb = src_py + h * linesize; - uint32_t *dst_px; + const uint8_t *src_py = src; + uint8_t *dst_py = dst; - for (; src_py < src_pb; src_py += linesize, dst_py += linesize) { - src_px = src_py + l; - dst_px = (uint32_t *)dst_py + l; - - memcpy(dst_px, src_px, w * sizeof(uint32_t)); + src_py += t * src_linesize; + dst_py += t * dst_linesize; + for (int y = 0; y < h; y++) { + memcpy(dst_py + l * 4, src_py + l * 4, w * 4); + src_py += src_linesize; + dst_py += dst_linesize; } } static int gif_read_image(GifState *s, AVFrame *frame) { int left, top, width, height, bits_per_pixel, code_size, flags, pw; - int is_interleaved, has_local_palette, y, pass, y1, linesize, pal_size, lzwed_len; + int is_interleaved, has_local_palette, y, pass, y1, pal_size, lzwed_len; uint32_t *ptr, *pal, *px, *pr, *ptr1; + ptrdiff_t linesize; int ret; uint8_t *idx; @@ -214,8 +217,8 @@ static int gif_read_image(GifState *s, AVFrame *frame) if (s->gce_prev_disposal == GCE_DISPOSAL_BACKGROUND) { gif_fill_rect(frame, s->stored_bg_color, s->gce_l, s->gce_t, s->gce_w, s->gce_h); } else if (s->gce_prev_disposal == GCE_DISPOSAL_RESTORE) { - gif_copy_img_rect(s->stored_img, (uint32_t *)frame->data[0], - frame->linesize[0] / sizeof(uint32_t), s->gce_l, s->gce_t, s->gce_w, s->gce_h); + gif_copy_img_rect(s->stored_img, frame->data[0], + FFABS(frame->linesize[0]), frame->linesize[0], s->gce_l, s->gce_t, s->gce_w, s->gce_h); } s->gce_prev_disposal = s->gce_disposal; @@ -230,12 +233,12 @@ static int gif_read_image(GifState *s, AVFrame *frame) else s->stored_bg_color = s->bg_color; } else if (s->gce_disposal == GCE_DISPOSAL_RESTORE) { - av_fast_malloc(&s->stored_img, &s->stored_img_size, frame->linesize[0] * frame->height); + av_fast_malloc(&s->stored_img, &s->stored_img_size, FFABS(frame->linesize[0]) * frame->height); if (!s->stored_img) return AVERROR(ENOMEM); - gif_copy_img_rect((uint32_t *)frame->data[0], s->stored_img, - frame->linesize[0] / sizeof(uint32_t), left, top, pw, height); + gif_copy_img_rect(frame->data[0], s->stored_img, + frame->linesize[0], FFABS(frame->linesize[0]), left, top, pw, height); } } @@ -252,8 +255,8 @@ static int gif_read_image(GifState *s, AVFrame *frame) } /* read all the image */ - linesize = frame->linesize[0] / sizeof(uint32_t); - ptr1 = (uint32_t *)frame->data[0] + top * linesize + left; + linesize = frame->linesize[0]; + ptr1 = (uint32_t *)(frame->data[0] + top * linesize) + left; ptr = ptr1; pass = 0; y1 = 0; @@ -278,24 +281,24 @@ static int gif_read_image(GifState *s, AVFrame *frame) case 0: case 1: y1 += 8; - ptr += linesize * 8; + ptr += linesize * 2; break; case 2: y1 += 4; - ptr += linesize * 4; + ptr += linesize * 1; break; case 3: y1 += 2; - ptr += linesize * 2; + ptr += linesize / 2; break; } while (y1 >= height) { y1 = 4 >> pass; - ptr = ptr1 + linesize * y1; + ptr = ptr1 + linesize / 4 * y1; pass++; } } else { - ptr += linesize; + ptr += linesize / 4; } } diff --git a/src/third_party/ffmpeg/libavcodec/h261dec.c b/src/third_party/ffmpeg/libavcodec/h261dec.c index 620b7eef..c41b96c3 100644 --- a/src/third_party/ffmpeg/libavcodec/h261dec.c +++ b/src/third_party/ffmpeg/libavcodec/h261dec.c @@ -64,16 +64,16 @@ typedef struct H261DecContext { static av_cold void h261_decode_init_static(void) { - INIT_VLC_STATIC(&h261_mba_vlc, H261_MBA_VLC_BITS, 35, + VLC_INIT_STATIC(&h261_mba_vlc, H261_MBA_VLC_BITS, 35, ff_h261_mba_bits, 1, 1, ff_h261_mba_code, 1, 1, 540); - INIT_VLC_STATIC(&h261_mtype_vlc, H261_MTYPE_VLC_BITS, 10, + VLC_INIT_STATIC(&h261_mtype_vlc, H261_MTYPE_VLC_BITS, 10, ff_h261_mtype_bits, 1, 1, ff_h261_mtype_code, 1, 1, 80); - INIT_VLC_STATIC(&h261_mv_vlc, H261_MV_VLC_BITS, 17, + VLC_INIT_STATIC(&h261_mv_vlc, H261_MV_VLC_BITS, 17, &ff_h261_mv_tab[0][1], 2, 1, &ff_h261_mv_tab[0][0], 2, 1, 144); - INIT_VLC_STATIC(&h261_cbp_vlc, H261_CBP_VLC_BITS, 63, + VLC_INIT_STATIC(&h261_cbp_vlc, H261_CBP_VLC_BITS, 63, &ff_h261_cbp_tab[0][1], 2, 1, &ff_h261_cbp_tab[0][0], 2, 1, 512); INIT_FIRST_VLC_RL(ff_h261_rl_tcoeff, 552); diff --git a/src/third_party/ffmpeg/libavcodec/h263dec.c b/src/third_party/ffmpeg/libavcodec/h263dec.c index b5c0f4a5..3dc9f7f5 100644 --- a/src/third_party/ffmpeg/libavcodec/h263dec.c +++ b/src/third_party/ffmpeg/libavcodec/h263dec.c @@ -36,6 +36,7 @@ #include "flvdec.h" #include "h263.h" #include "h263dec.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "mpeg_er.h" #include "mpeg4video.h" @@ -190,7 +191,7 @@ static int decode_slice(MpegEncContext *s) if (s->avctx->hwaccel) { const uint8_t *start = s->gb.buffer + get_bits_count(&s->gb) / 8; - ret = s->avctx->hwaccel->decode_slice(s->avctx, start, s->gb.buffer_end - start); + ret = FF_HW_CALL(s->avctx, decode_slice, start, s->gb.buffer_end - start); // ensure we exit decode loop s->mb_y = s->mb_height; return ret; @@ -568,8 +569,8 @@ retry: ff_thread_finish_setup(avctx); if (avctx->hwaccel) { - ret = avctx->hwaccel->start_frame(avctx, s->gb.buffer, - s->gb.buffer_end - s->gb.buffer); + ret = FF_HW_CALL(avctx, start_frame, + s->gb.buffer, s->gb.buffer_end - s->gb.buffer); if (ret < 0 ) return ret; } @@ -621,10 +622,10 @@ retry: av_assert1(s->bitstream_buffer_size == 0); frame_end: if (!s->studio_profile) - ff_er_frame_end(&s->er); + ff_er_frame_end(&s->er, NULL); if (avctx->hwaccel) { - ret = avctx->hwaccel->end_frame(avctx); + ret = FF_HW_SIMPLE_CALL(avctx, end_frame); if (ret < 0) return ret; } diff --git a/src/third_party/ffmpeg/libavcodec/h2645_sei.c b/src/third_party/ffmpeg/libavcodec/h2645_sei.c index 63ab711b..cb6be059 100644 --- a/src/third_party/ffmpeg/libavcodec/h2645_sei.c +++ b/src/third_party/ffmpeg/libavcodec/h2645_sei.c @@ -29,6 +29,7 @@ #include "libavutil/display.h" #include "libavutil/hdr_dynamic_metadata.h" #include "libavutil/film_grain_params.h" +#include "libavutil/mastering_display_metadata.h" #include "libavutil/pixdesc.h" #include "libavutil/stereo3d.h" @@ -392,6 +393,52 @@ static int decode_film_grain_characteristics(H2645SEIFilmGrainCharacteristics *h return 0; } +static int decode_nal_sei_mastering_display_info(H2645SEIMasteringDisplay *s, + GetByteContext *gb) +{ + int i; + + if (bytestream2_get_bytes_left(gb) < 24) + return AVERROR_INVALIDDATA; + + // Mastering primaries + for (i = 0; i < 3; i++) { + s->display_primaries[i][0] = bytestream2_get_be16u(gb); + s->display_primaries[i][1] = bytestream2_get_be16u(gb); + } + // White point (x, y) + s->white_point[0] = bytestream2_get_be16u(gb); + s->white_point[1] = bytestream2_get_be16u(gb); + + // Max and min luminance of mastering display + s->max_luminance = bytestream2_get_be32u(gb); + s->min_luminance = bytestream2_get_be32u(gb); + + // As this SEI message comes before the first frame that references it, + // initialize the flag to 2 and decrement on IRAP access unit so it + // persists for the coded video sequence (e.g., between two IRAPs) + s->present = 2; + + return 0; +} + +static int decode_nal_sei_content_light_info(H2645SEIContentLight *s, + GetByteContext *gb) +{ + if (bytestream2_get_bytes_left(gb) < 4) + return AVERROR_INVALIDDATA; + + // Max and average light levels + s->max_content_light_level = bytestream2_get_be16u(gb); + s->max_pic_average_light_level = bytestream2_get_be16u(gb); + // As this SEI message comes before the first frame that references it, + // initialize the flag to 2 and decrement on IRAP access unit so it + // persists for the coded video sequence (e.g., between two IRAPs) + s->present = 2; + + return 0; +} + int ff_h2645_sei_message_decode(H2645SEI *h, enum SEIType type, enum AVCodecID codec_id, GetBitContext *gb, GetByteContext *gbyte, void *logctx) @@ -412,6 +459,11 @@ int ff_h2645_sei_message_decode(H2645SEI *h, enum SEIType type, case SEI_TYPE_AMBIENT_VIEWING_ENVIRONMENT: return decode_ambient_viewing_environment(&h->ambient_viewing_environment, gbyte); + case SEI_TYPE_MASTERING_DISPLAY_COLOUR_VOLUME: + return decode_nal_sei_mastering_display_info(&h->mastering_display, + gbyte); + case SEI_TYPE_CONTENT_LIGHT_LEVEL_INFO: + return decode_nal_sei_content_light_info(&h->content_light, gbyte); default: return FF_H2645_SEI_MESSAGE_UNHANDLED; } @@ -652,6 +704,64 @@ int ff_h2645_sei_to_frame(AVFrame *frame, H2645SEI *sei, dst_env->ambient_light_y = av_make_q(env->ambient_light_y, 50000); } + if (sei->mastering_display.present) { + // HEVC uses a g,b,r ordering, which we convert to a more natural r,g,b + const int mapping[3] = {2, 0, 1}; + const int chroma_den = 50000; + const int luma_den = 10000; + int i; + AVMasteringDisplayMetadata *metadata = + av_mastering_display_metadata_create_side_data(frame); + if (!metadata) + return AVERROR(ENOMEM); + + for (i = 0; i < 3; i++) { + const int j = mapping[i]; + metadata->display_primaries[i][0].num = sei->mastering_display.display_primaries[j][0]; + metadata->display_primaries[i][0].den = chroma_den; + metadata->display_primaries[i][1].num = sei->mastering_display.display_primaries[j][1]; + metadata->display_primaries[i][1].den = chroma_den; + } + metadata->white_point[0].num = sei->mastering_display.white_point[0]; + metadata->white_point[0].den = chroma_den; + metadata->white_point[1].num = sei->mastering_display.white_point[1]; + metadata->white_point[1].den = chroma_den; + + metadata->max_luminance.num = sei->mastering_display.max_luminance; + metadata->max_luminance.den = luma_den; + metadata->min_luminance.num = sei->mastering_display.min_luminance; + metadata->min_luminance.den = luma_den; + metadata->has_luminance = 1; + metadata->has_primaries = 1; + + av_log(avctx, AV_LOG_DEBUG, "Mastering Display Metadata:\n"); + av_log(avctx, AV_LOG_DEBUG, + "r(%5.4f,%5.4f) g(%5.4f,%5.4f) b(%5.4f %5.4f) wp(%5.4f, %5.4f)\n", + av_q2d(metadata->display_primaries[0][0]), + av_q2d(metadata->display_primaries[0][1]), + av_q2d(metadata->display_primaries[1][0]), + av_q2d(metadata->display_primaries[1][1]), + av_q2d(metadata->display_primaries[2][0]), + av_q2d(metadata->display_primaries[2][1]), + av_q2d(metadata->white_point[0]), av_q2d(metadata->white_point[1])); + av_log(avctx, AV_LOG_DEBUG, + "min_luminance=%f, max_luminance=%f\n", + av_q2d(metadata->min_luminance), av_q2d(metadata->max_luminance)); + } + + if (sei->content_light.present) { + AVContentLightMetadata *metadata = + av_content_light_metadata_create_side_data(frame); + if (!metadata) + return AVERROR(ENOMEM); + metadata->MaxCLL = sei->content_light.max_content_light_level; + metadata->MaxFALL = sei->content_light.max_pic_average_light_level; + + av_log(avctx, AV_LOG_DEBUG, "Content Light Level Metadata:\n"); + av_log(avctx, AV_LOG_DEBUG, "MaxCLL=%d, MaxFALL=%d\n", + metadata->MaxCLL, metadata->MaxFALL); + } + return 0; } @@ -667,4 +777,6 @@ void ff_h2645_sei_reset(H2645SEI *s) av_buffer_unref(&s->dynamic_hdr_vivid.info); s->ambient_viewing_environment.present = 0; + s->mastering_display.present = 0; + s->content_light.present = 0; } diff --git a/src/third_party/ffmpeg/libavcodec/h2645_sei.h b/src/third_party/ffmpeg/libavcodec/h2645_sei.h index e07ae103..0ebf4801 100644 --- a/src/third_party/ffmpeg/libavcodec/h2645_sei.h +++ b/src/third_party/ffmpeg/libavcodec/h2645_sei.h @@ -105,6 +105,20 @@ typedef struct H2645SEIFilmGrainCharacteristics { int persistence_flag; //< HEVC only } H2645SEIFilmGrainCharacteristics; +typedef struct H2645SEIMasteringDisplay { + int present; + uint16_t display_primaries[3][2]; + uint16_t white_point[2]; + uint32_t max_luminance; + uint32_t min_luminance; +} H2645SEIMasteringDisplay; + +typedef struct H2645SEIContentLight { + int present; + uint16_t max_content_light_level; + uint16_t max_pic_average_light_level; +} H2645SEIContentLight; + typedef struct H2645SEI { H2645SEIA53Caption a53_caption; H2645SEIAFD afd; @@ -116,6 +130,8 @@ typedef struct H2645SEI { H2645SEIAlternativeTransfer alternative_transfer; H2645SEIFilmGrainCharacteristics film_grain_characteristics; H2645SEIAmbientViewingEnvironment ambient_viewing_environment; + H2645SEIMasteringDisplay mastering_display; + H2645SEIContentLight content_light; } H2645SEI; enum { diff --git a/src/third_party/ffmpeg/libavcodec/h264_cavlc.c b/src/third_party/ffmpeg/libavcodec/h264_cavlc.c index 2ace4ca9..13c87bf9 100644 --- a/src/third_party/ffmpeg/libavcodec/h264_cavlc.c +++ b/src/third_party/ffmpeg/libavcodec/h264_cavlc.c @@ -328,26 +328,26 @@ av_cold void ff_h264_decode_init_vlc(void) chroma_dc_coeff_token_vlc.table = chroma_dc_coeff_token_vlc_table; chroma_dc_coeff_token_vlc.table_allocated = chroma_dc_coeff_token_vlc_table_size; - init_vlc(&chroma_dc_coeff_token_vlc, CHROMA_DC_COEFF_TOKEN_VLC_BITS, 4*5, + vlc_init(&chroma_dc_coeff_token_vlc, CHROMA_DC_COEFF_TOKEN_VLC_BITS, 4*5, &chroma_dc_coeff_token_len [0], 1, 1, &chroma_dc_coeff_token_bits[0], 1, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); chroma422_dc_coeff_token_vlc.table = chroma422_dc_coeff_token_vlc_table; chroma422_dc_coeff_token_vlc.table_allocated = chroma422_dc_coeff_token_vlc_table_size; - init_vlc(&chroma422_dc_coeff_token_vlc, CHROMA422_DC_COEFF_TOKEN_VLC_BITS, 4*9, + vlc_init(&chroma422_dc_coeff_token_vlc, CHROMA422_DC_COEFF_TOKEN_VLC_BITS, 4*9, &chroma422_dc_coeff_token_len [0], 1, 1, &chroma422_dc_coeff_token_bits[0], 1, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); offset = 0; for (int i = 0; i < 4; i++) { coeff_token_vlc[i].table = coeff_token_vlc_tables + offset; coeff_token_vlc[i].table_allocated = coeff_token_vlc_tables_size[i]; - init_vlc(&coeff_token_vlc[i], COEFF_TOKEN_VLC_BITS, 4*17, + vlc_init(&coeff_token_vlc[i], COEFF_TOKEN_VLC_BITS, 4*17, &coeff_token_len [i][0], 1, 1, &coeff_token_bits[i][0], 1, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); offset += coeff_token_vlc_tables_size[i]; } /* @@ -360,48 +360,48 @@ av_cold void ff_h264_decode_init_vlc(void) for (int i = 0; i < 3; i++) { chroma_dc_total_zeros_vlc[i + 1].table = chroma_dc_total_zeros_vlc_tables[i]; chroma_dc_total_zeros_vlc[i + 1].table_allocated = chroma_dc_total_zeros_vlc_tables_size; - init_vlc(&chroma_dc_total_zeros_vlc[i + 1], + vlc_init(&chroma_dc_total_zeros_vlc[i + 1], CHROMA_DC_TOTAL_ZEROS_VLC_BITS, 4, &chroma_dc_total_zeros_len [i][0], 1, 1, &chroma_dc_total_zeros_bits[i][0], 1, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); } for (int i = 0; i < 7; i++) { chroma422_dc_total_zeros_vlc[i + 1].table = chroma422_dc_total_zeros_vlc_tables[i]; chroma422_dc_total_zeros_vlc[i + 1].table_allocated = chroma422_dc_total_zeros_vlc_tables_size; - init_vlc(&chroma422_dc_total_zeros_vlc[i + 1], + vlc_init(&chroma422_dc_total_zeros_vlc[i + 1], CHROMA422_DC_TOTAL_ZEROS_VLC_BITS, 8, &chroma422_dc_total_zeros_len [i][0], 1, 1, &chroma422_dc_total_zeros_bits[i][0], 1, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); } for (int i = 0; i < 15; i++) { total_zeros_vlc[i + 1].table = total_zeros_vlc_tables[i]; total_zeros_vlc[i + 1].table_allocated = total_zeros_vlc_tables_size; - init_vlc(&total_zeros_vlc[i + 1], + vlc_init(&total_zeros_vlc[i + 1], TOTAL_ZEROS_VLC_BITS, 16, &total_zeros_len [i][0], 1, 1, &total_zeros_bits[i][0], 1, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); } for (int i = 0; i < 6; i++) { run_vlc[i + 1].table = run_vlc_tables[i]; run_vlc[i + 1].table_allocated = run_vlc_tables_size; - init_vlc(&run_vlc[i + 1], + vlc_init(&run_vlc[i + 1], RUN_VLC_BITS, 7, &run_len [i][0], 1, 1, &run_bits[i][0], 1, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); } run7_vlc.table = run7_vlc_table; run7_vlc.table_allocated = run7_vlc_table_size; - init_vlc(&run7_vlc, RUN7_VLC_BITS, 16, + vlc_init(&run7_vlc, RUN7_VLC_BITS, 16, &run_len [6][0], 1, 1, &run_bits[6][0], 1, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); init_cavlc_level_tab(); } diff --git a/src/third_party/ffmpeg/libavcodec/h264_mb.c b/src/third_party/ffmpeg/libavcodec/h264_mb.c index 0b317745..32d29cfb 100644 --- a/src/third_party/ffmpeg/libavcodec/h264_mb.c +++ b/src/third_party/ffmpeg/libavcodec/h264_mb.c @@ -34,6 +34,7 @@ #include "h264dec.h" #include "h264_ps.h" #include "qpeldsp.h" +#include "rectangle.h" #include "threadframe.h" static inline int get_lowest_part_list_y(H264SliceContext *sl, diff --git a/src/third_party/ffmpeg/libavcodec/h264_metadata_bsf.c b/src/third_party/ffmpeg/libavcodec/h264_metadata_bsf.c index b9cfeaba..39b9e8ee 100644 --- a/src/third_party/ffmpeg/libavcodec/h264_metadata_bsf.c +++ b/src/third_party/ffmpeg/libavcodec/h264_metadata_bsf.c @@ -26,10 +26,11 @@ #include "cbs.h" #include "cbs_bsf.h" #include "cbs_h264.h" +#include "cbs_sei.h" #include "h264.h" #include "h264_levels.h" -#include "h264_sei.h" #include "h2645data.h" +#include "sei.h" enum { FLIP_HORIZONTAL = 1, diff --git a/src/third_party/ffmpeg/libavcodec/h264_mvpred.h b/src/third_party/ffmpeg/libavcodec/h264_mvpred.h index 46ae2738..bc9fef50 100644 --- a/src/third_party/ffmpeg/libavcodec/h264_mvpred.h +++ b/src/third_party/ffmpeg/libavcodec/h264_mvpred.h @@ -30,10 +30,142 @@ #include "h264dec.h" #include "mpegutils.h" +#include "rectangle.h" + #include "libavutil/avassert.h" #include "libavutil/mem_internal.h" +/** + * Get the predicted intra4x4 prediction mode. + */ +static av_always_inline int pred_intra_mode(const H264Context *h, + H264SliceContext *sl, int n) +{ + const int index8 = scan8[n]; + const int left = sl->intra4x4_pred_mode_cache[index8 - 1]; + const int top = sl->intra4x4_pred_mode_cache[index8 - 8]; + const int min = FFMIN(left, top); + + ff_tlog(h->avctx, "mode:%d %d min:%d\n", left, top, min); + + if (min < 0) + return DC_PRED; + else + return min; +} + +static av_always_inline void write_back_intra_pred_mode(const H264Context *h, + H264SliceContext *sl) +{ + int8_t *i4x4 = sl->intra4x4_pred_mode + h->mb2br_xy[sl->mb_xy]; + int8_t *i4x4_cache = sl->intra4x4_pred_mode_cache; + + AV_COPY32(i4x4, i4x4_cache + 4 + 8 * 4); + i4x4[4] = i4x4_cache[7 + 8 * 3]; + i4x4[5] = i4x4_cache[7 + 8 * 2]; + i4x4[6] = i4x4_cache[7 + 8 * 1]; +} + +static av_always_inline void write_back_non_zero_count(const H264Context *h, + H264SliceContext *sl) +{ + const int mb_xy = sl->mb_xy; + uint8_t *nnz = h->non_zero_count[mb_xy]; + uint8_t *nnz_cache = sl->non_zero_count_cache; + + AV_COPY32(&nnz[ 0], &nnz_cache[4 + 8 * 1]); + AV_COPY32(&nnz[ 4], &nnz_cache[4 + 8 * 2]); + AV_COPY32(&nnz[ 8], &nnz_cache[4 + 8 * 3]); + AV_COPY32(&nnz[12], &nnz_cache[4 + 8 * 4]); + AV_COPY32(&nnz[16], &nnz_cache[4 + 8 * 6]); + AV_COPY32(&nnz[20], &nnz_cache[4 + 8 * 7]); + AV_COPY32(&nnz[32], &nnz_cache[4 + 8 * 11]); + AV_COPY32(&nnz[36], &nnz_cache[4 + 8 * 12]); + + if (!h->chroma_y_shift) { + AV_COPY32(&nnz[24], &nnz_cache[4 + 8 * 8]); + AV_COPY32(&nnz[28], &nnz_cache[4 + 8 * 9]); + AV_COPY32(&nnz[40], &nnz_cache[4 + 8 * 13]); + AV_COPY32(&nnz[44], &nnz_cache[4 + 8 * 14]); + } +} + +static av_always_inline void write_back_motion_list(const H264Context *h, + H264SliceContext *sl, + int b_stride, + int b_xy, int b8_xy, + int mb_type, int list) +{ + int16_t(*mv_dst)[2] = &h->cur_pic.motion_val[list][b_xy]; + int16_t(*mv_src)[2] = &sl->mv_cache[list][scan8[0]]; + AV_COPY128(mv_dst + 0 * b_stride, mv_src + 8 * 0); + AV_COPY128(mv_dst + 1 * b_stride, mv_src + 8 * 1); + AV_COPY128(mv_dst + 2 * b_stride, mv_src + 8 * 2); + AV_COPY128(mv_dst + 3 * b_stride, mv_src + 8 * 3); + if (CABAC(h)) { + uint8_t (*mvd_dst)[2] = &sl->mvd_table[list][FMO ? 8 * sl->mb_xy + : h->mb2br_xy[sl->mb_xy]]; + uint8_t(*mvd_src)[2] = &sl->mvd_cache[list][scan8[0]]; + if (IS_SKIP(mb_type)) { + AV_ZERO128(mvd_dst); + } else { + AV_COPY64(mvd_dst, mvd_src + 8 * 3); + AV_COPY16(mvd_dst + 3 + 3, mvd_src + 3 + 8 * 0); + AV_COPY16(mvd_dst + 3 + 2, mvd_src + 3 + 8 * 1); + AV_COPY16(mvd_dst + 3 + 1, mvd_src + 3 + 8 * 2); + } + } + + { + int8_t *ref_index = &h->cur_pic.ref_index[list][b8_xy]; + int8_t *ref_cache = sl->ref_cache[list]; + ref_index[0 + 0 * 2] = ref_cache[scan8[0]]; + ref_index[1 + 0 * 2] = ref_cache[scan8[4]]; + ref_index[0 + 1 * 2] = ref_cache[scan8[8]]; + ref_index[1 + 1 * 2] = ref_cache[scan8[12]]; + } +} + +static av_always_inline void write_back_motion(const H264Context *h, + H264SliceContext *sl, + int mb_type) +{ + const int b_stride = h->b_stride; + const int b_xy = 4 * sl->mb_x + 4 * sl->mb_y * h->b_stride; // try mb2b(8)_xy + const int b8_xy = 4 * sl->mb_xy; + + if (USES_LIST(mb_type, 0)) { + write_back_motion_list(h, sl, b_stride, b_xy, b8_xy, mb_type, 0); + } else { + fill_rectangle(&h->cur_pic.ref_index[0][b8_xy], + 2, 2, 2, (uint8_t)LIST_NOT_USED, 1); + } + if (USES_LIST(mb_type, 1)) + write_back_motion_list(h, sl, b_stride, b_xy, b8_xy, mb_type, 1); + + if (sl->slice_type_nos == AV_PICTURE_TYPE_B && CABAC(h)) { + if (IS_8X8(mb_type)) { + uint8_t *direct_table = &h->direct_table[4 * sl->mb_xy]; + direct_table[1] = sl->sub_mb_type[1] >> 1; + direct_table[2] = sl->sub_mb_type[2] >> 1; + direct_table[3] = sl->sub_mb_type[3] >> 1; + } + } +} + +static av_always_inline int get_dct8x8_allowed(const H264Context *h, H264SliceContext *sl) +{ + if (h->ps.sps->direct_8x8_inference_flag) + return !(AV_RN64A(sl->sub_mb_type) & + ((MB_TYPE_16x8 | MB_TYPE_8x16 | MB_TYPE_8x8) * + 0x0001000100010001ULL)); + else + return !(AV_RN64A(sl->sub_mb_type) & + ((MB_TYPE_16x8 | MB_TYPE_8x16 | MB_TYPE_8x8 | MB_TYPE_DIRECT2) * + 0x0001000100010001ULL)); +} + static av_always_inline int fetch_diagonal_mv(const H264Context *h, H264SliceContext *sl, const int16_t **C, int i, int list, int part_width) diff --git a/src/third_party/ffmpeg/libavcodec/h264_parse.c b/src/third_party/ffmpeg/libavcodec/h264_parse.c index 97ddf0e4..3378650f 100644 --- a/src/third_party/ffmpeg/libavcodec/h264_parse.c +++ b/src/third_party/ffmpeg/libavcodec/h264_parse.c @@ -526,22 +526,22 @@ int ff_h264_decode_extradata(const uint8_t *data, int size, H264ParamSets *ps, * * @param sps SPS * - * @return profile as defined by FF_PROFILE_H264_* + * @return profile as defined by AV_PROFILE_H264_* */ int ff_h264_get_profile(const SPS *sps) { int profile = sps->profile_idc; switch (sps->profile_idc) { - case FF_PROFILE_H264_BASELINE: + case AV_PROFILE_H264_BASELINE: // constraint_set1_flag set to 1 - profile |= (sps->constraint_set_flags & 1 << 1) ? FF_PROFILE_H264_CONSTRAINED : 0; + profile |= (sps->constraint_set_flags & 1 << 1) ? AV_PROFILE_H264_CONSTRAINED : 0; break; - case FF_PROFILE_H264_HIGH_10: - case FF_PROFILE_H264_HIGH_422: - case FF_PROFILE_H264_HIGH_444_PREDICTIVE: + case AV_PROFILE_H264_HIGH_10: + case AV_PROFILE_H264_HIGH_422: + case AV_PROFILE_H264_HIGH_444_PREDICTIVE: // constraint_set3_flag set to 1 - profile |= (sps->constraint_set_flags & 1 << 3) ? FF_PROFILE_H264_INTRA : 0; + profile |= (sps->constraint_set_flags & 1 << 3) ? AV_PROFILE_H264_INTRA : 0; break; } diff --git a/src/third_party/ffmpeg/libavcodec/h264_picture.c b/src/third_party/ffmpeg/libavcodec/h264_picture.c index dcaf0fdb..31b5e231 100644 --- a/src/third_party/ffmpeg/libavcodec/h264_picture.c +++ b/src/third_party/ffmpeg/libavcodec/h264_picture.c @@ -26,9 +26,11 @@ */ #include "libavutil/avassert.h" +#include "libavutil/emms.h" #include "error_resilience.h" #include "avcodec.h" #include "h264dec.h" +#include "hwaccel_internal.h" #include "mpegutils.h" #include "thread.h" #include "threadframe.h" @@ -52,6 +54,7 @@ void ff_h264_unref_picture(H264Context *h, H264Picture *pic) av_buffer_unref(&pic->motion_val_buf[i]); av_buffer_unref(&pic->ref_index_buf[i]); } + av_buffer_unref(&pic->decode_error_flags); memset((uint8_t*)pic + off, 0, sizeof(*pic) - off); } @@ -134,6 +137,10 @@ int ff_h264_ref_picture(H264Context *h, H264Picture *dst, H264Picture *src) dst->hwaccel_picture_private = dst->hwaccel_priv_buf->data; } + ret = av_buffer_replace(&dst->decode_error_flags, src->decode_error_flags); + if (ret < 0) + goto fail; + h264_copy_picture_params(dst, src); return 0; @@ -184,6 +191,10 @@ int ff_h264_replace_picture(H264Context *h, H264Picture *dst, const H264Picture dst->hwaccel_picture_private = src->hwaccel_picture_private; + ret = av_buffer_replace(&dst->decode_error_flags, src->decode_error_flags); + if (ret < 0) + goto fail; + h264_copy_picture_params(dst, src); return 0; @@ -233,7 +244,7 @@ int ff_h264_field_end(H264Context *h, H264SliceContext *sl, int in_setup) } if (avctx->hwaccel) { - err = avctx->hwaccel->end_frame(avctx); + err = FF_HW_SIMPLE_CALL(avctx, end_frame); if (err < 0) av_log(avctx, AV_LOG_ERROR, "hardware accelerator failed to decode picture\n"); diff --git a/src/third_party/ffmpeg/libavcodec/h264_slice.c b/src/third_party/ffmpeg/libavcodec/h264_slice.c index 41bf30ee..24f4690e 100644 --- a/src/third_party/ffmpeg/libavcodec/h264_slice.c +++ b/src/third_party/ffmpeg/libavcodec/h264_slice.c @@ -28,15 +28,11 @@ #include "config_components.h" #include "libavutil/avassert.h" -#include "libavutil/display.h" -#include "libavutil/film_grain_params.h" #include "libavutil/pixdesc.h" #include "libavutil/timecode.h" -#include "internal.h" #include "decode.h" #include "cabac.h" #include "cabac_functions.h" -#include "decode.h" #include "error_resilience.h" #include "avcodec.h" #include "h264.h" @@ -209,16 +205,18 @@ static int alloc_picture(H264Context *h, H264Picture *pic) goto fail; } - if (h->avctx->hwaccel) { - const AVHWAccel *hwaccel = h->avctx->hwaccel; - av_assert0(!pic->hwaccel_picture_private); - if (hwaccel->frame_priv_data_size) { - pic->hwaccel_priv_buf = ff_hwaccel_frame_priv_alloc(h->avctx, hwaccel); - if (!pic->hwaccel_priv_buf) - return AVERROR(ENOMEM); - pic->hwaccel_picture_private = pic->hwaccel_priv_buf->data; - } + ret = ff_hwaccel_frame_priv_alloc(h->avctx, &pic->hwaccel_picture_private, + &pic->hwaccel_priv_buf); + if (ret < 0) + goto fail; + + if (h->decode_error_flags_pool) { + pic->decode_error_flags = av_buffer_pool_get(h->decode_error_flags_pool); + if (!pic->decode_error_flags) + goto fail; + atomic_init((atomic_int*)pic->decode_error_flags->data, 0); } + 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, @@ -304,6 +302,34 @@ static void copy_picture_range(H264Picture **to, H264Picture **from, int count, } } +static void color_frame(AVFrame *frame, const int c[4]) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format); + + av_assert0(desc->flags & AV_PIX_FMT_FLAG_PLANAR); + + for (int p = 0; p < desc->nb_components; p++) { + uint8_t *dst = frame->data[p]; + int is_chroma = p == 1 || p == 2; + int bytes = is_chroma ? AV_CEIL_RSHIFT(frame->width, desc->log2_chroma_w) : frame->width; + int height = is_chroma ? AV_CEIL_RSHIFT(frame->height, desc->log2_chroma_h) : frame->height; + if (desc->comp[0].depth >= 9) { + ((uint16_t*)dst)[0] = c[p]; + av_memcpy_backptr(dst + 2, 2, bytes - 2); + dst += frame->linesize[p]; + for (int y = 1; y < height; y++) { + memcpy(dst, frame->data[p], 2*bytes); + dst += frame->linesize[p]; + } + } else { + for (int y = 0; y < height; y++) { + memset(dst, c[p], bytes); + dst += frame->linesize[p]; + } + } + } +} + static int h264_slice_header_init(H264Context *h); int ff_h264_update_thread_context(AVCodecContext *dst, @@ -378,10 +404,6 @@ int ff_h264_update_thread_context(AVCodecContext *dst, memcpy(h->block_offset, h1->block_offset, sizeof(h->block_offset)); } - h->avctx->coded_height = h1->avctx->coded_height; - h->avctx->coded_width = h1->avctx->coded_width; - h->avctx->width = h1->avctx->width; - h->avctx->height = h1->avctx->height; h->width_from_caller = h1->width_from_caller; h->height_from_caller = h1->height_from_caller; h->coded_picture_number = h1->coded_picture_number; @@ -439,6 +461,8 @@ int ff_h264_update_thread_context(AVCodecContext *dst, return ret; h->sei.common.unregistered.x264_build = h1->sei.common.unregistered.x264_build; + h->sei.common.mastering_display = h1->sei.common.mastering_display; + h->sei.common.content_light = h1->sei.common.content_light; if (!h->cur_pic_ptr) return 0; @@ -784,8 +808,6 @@ static enum AVPixelFormat get_pixel_format(H264Context *h, int force_callback) CONFIG_H264_VDPAU_HWACCEL + \ CONFIG_H264_VULKAN_HWACCEL) enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmt = pix_fmts; - const enum AVPixelFormat *choices = pix_fmts; - int i; switch (h->ps.sps->bit_depth_luma) { case 9: @@ -886,9 +908,7 @@ static enum AVPixelFormat get_pixel_format(H264Context *h, int force_callback) #if CONFIG_H264_VAAPI_HWACCEL *fmt++ = AV_PIX_FMT_VAAPI; #endif - if (h->avctx->codec->pix_fmts) - choices = h->avctx->codec->pix_fmts; - else if (h->avctx->color_range == AVCOL_RANGE_JPEG) + if (h->avctx->color_range == AVCOL_RANGE_JPEG) *fmt++ = AV_PIX_FMT_YUVJ420P; else *fmt++ = AV_PIX_FMT_YUV420P; @@ -902,10 +922,10 @@ static enum AVPixelFormat get_pixel_format(H264Context *h, int force_callback) *fmt = AV_PIX_FMT_NONE; - for (i=0; choices[i] != AV_PIX_FMT_NONE; i++) - if (choices[i] == h->avctx->pix_fmt && !force_callback) - return choices[i]; - return ff_thread_get_format(h->avctx, choices); + for (int i = 0; pix_fmts[i] != AV_PIX_FMT_NONE; i++) + if (pix_fmts[i] == h->avctx->pix_fmt && !force_callback) + return pix_fmts[i]; + return ff_get_format(h->avctx, pix_fmts); } /* export coded and cropped frame dimensions to AVCodecContext */ @@ -1554,7 +1574,7 @@ static int h264_field_start(H264Context *h, const H264SliceContext *sl, if (h->short_ref[0]->field_picture) ff_thread_report_progress(&h->short_ref[0]->tf, INT_MAX, 1); } else if (!h->frame_recovered && !h->avctx->hwaccel) - ff_color_frame(h->short_ref[0]->f, c); + color_frame(h->short_ref[0]->f, c); h->short_ref[0]->frame_num = h->poc.prev_frame_num; } } diff --git a/src/third_party/ffmpeg/libavcodec/h264dec.c b/src/third_party/ffmpeg/libavcodec/h264dec.c index 17763939..70733d65 100644 --- a/src/third_party/ffmpeg/libavcodec/h264dec.c +++ b/src/third_party/ffmpeg/libavcodec/h264dec.c @@ -30,6 +30,7 @@ #include "config_components.h" #include "libavutil/avassert.h" +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/opt.h" #include "libavutil/thread.h" @@ -45,6 +46,7 @@ #include "h264data.h" #include "h264_ps.h" #include "golomb.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "mpegutils.h" #include "profiles.h" @@ -305,6 +307,12 @@ static int h264_init_context(AVCodecContext *avctx, H264Context *h) ff_h264_sei_uninit(&h->sei); + if (avctx->active_thread_type & FF_THREAD_FRAME) { + h->decode_error_flags_pool = av_buffer_pool_init(sizeof(atomic_int), NULL); + if (!h->decode_error_flags_pool) + return AVERROR(ENOMEM); + } + h->nb_slice_ctx = (avctx->active_thread_type & FF_THREAD_SLICE) ? avctx->thread_count : 1; h->slice_ctx = av_calloc(h->nb_slice_ctx, sizeof(*h->slice_ctx)); if (!h->slice_ctx) { @@ -351,6 +359,8 @@ static av_cold int h264_decode_end(AVCodecContext *avctx) h->cur_pic_ptr = NULL; + av_buffer_pool_uninit(&h->decode_error_flags_pool); + av_freep(&h->slice_ctx); h->nb_slice_ctx = 0; @@ -485,8 +495,8 @@ static void h264_decode_flush(AVCodecContext *avctx) ff_h264_free_tables(h); h->context_initialized = 0; - if (avctx->hwaccel && avctx->hwaccel->flush) - avctx->hwaccel->flush(avctx); + if (FF_HW_HAS_CB(avctx, flush)) + FF_HW_SIMPLE_CALL(avctx, flush); } static int get_last_needed_nal(H264Context *h) @@ -652,14 +662,14 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size) } if (h->avctx->hwaccel && - (ret = h->avctx->hwaccel->start_frame(h->avctx, buf, buf_size)) < 0) + (ret = FF_HW_CALL(h->avctx, start_frame, buf, buf_size)) < 0) goto end; } max_slice_ctx = avctx->hwaccel ? 1 : h->nb_slice_ctx; if (h->nb_slice_ctx_queued == max_slice_ctx) { if (h->avctx->hwaccel) { - ret = avctx->hwaccel->decode_slice(avctx, nal->raw_data, nal->raw_size); + ret = FF_HW_CALL(avctx, decode_slice, nal->raw_data, nal->raw_size); h->nb_slice_ctx_queued = 0; } else ret = ff_h264_execute_decode_slices(h); @@ -686,11 +696,9 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size) break; case H264_NAL_SPS: { GetBitContext tmp_gb = nal->gb; - if (avctx->hwaccel && avctx->hwaccel->decode_params) { - ret = avctx->hwaccel->decode_params(avctx, - nal->type, - nal->raw_data, - nal->raw_size); + if (FF_HW_HAS_CB(avctx, decode_params)) { + ret = FF_HW_CALL(avctx, decode_params, + nal->type, nal->raw_data, nal->raw_size); if (ret < 0) goto end; } @@ -705,11 +713,9 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size) break; } case H264_NAL_PPS: - if (avctx->hwaccel && avctx->hwaccel->decode_params) { - ret = avctx->hwaccel->decode_params(avctx, - nal->type, - nal->raw_data, - nal->raw_size); + if (FF_HW_HAS_CB(avctx, decode_params)) { + ret = FF_HW_CALL(avctx, decode_params, + nal->type, nal->raw_data, nal->raw_size); if (ret < 0) goto end; } @@ -741,7 +747,16 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size) // set decode_error_flags to allow users to detect concealed decoding errors if ((ret < 0 || h->er.error_occurred) && h->cur_pic_ptr) { - h->cur_pic_ptr->f->decode_error_flags |= FF_DECODE_ERROR_DECODE_SLICES; + if (h->cur_pic_ptr->decode_error_flags) { + /* Frame-threading in use */ + atomic_int *decode_error = (atomic_int*)h->cur_pic_ptr->decode_error_flags->data; + /* Using atomics here is not supposed to provide syncronisation; + * they are merely used to allow to set decode_error from both + * decoding threads in case of coded slices. */ + atomic_fetch_or_explicit(decode_error, FF_DECODE_ERROR_DECODE_SLICES, + memory_order_relaxed); + } else + h->cur_pic_ptr->f->decode_error_flags |= FF_DECODE_ERROR_DECODE_SLICES; } ret = 0; @@ -764,6 +779,7 @@ end: H264SliceContext *sl = h->slice_ctx; int use_last_pic = h->last_pic_for_ec.f->buf[0] && !sl->ref_count[0]; + int decode_error_flags = 0; ff_h264_set_erpic(&h->er.cur_pic, h->cur_pic_ptr); @@ -781,7 +797,15 @@ end: if (sl->ref_count[1]) ff_h264_set_erpic(&h->er.next_pic, sl->ref_list[1][0].parent); - ff_er_frame_end(&h->er); + ff_er_frame_end(&h->er, &decode_error_flags); + if (decode_error_flags) { + if (h->cur_pic_ptr->decode_error_flags) { + atomic_int *decode_error = (atomic_int*)h->cur_pic_ptr->decode_error_flags->data; + atomic_fetch_or_explicit(decode_error, decode_error_flags, + memory_order_relaxed); + } else + h->cur_pic_ptr->f->decode_error_flags |= decode_error_flags; + } if (use_last_pic) memset(&sl->ref_list[0][0], 0, sizeof(sl->ref_list[0][0])); } @@ -853,6 +877,14 @@ static int output_frame(H264Context *h, AVFrame *dst, H264Picture *srcp) if (srcp->needs_fg && (ret = av_frame_copy_props(dst, srcp->f)) < 0) return ret; + if (srcp->decode_error_flags) { + atomic_int *decode_error = (atomic_int*)srcp->decode_error_flags->data; + /* The following is not supposed to provide synchronisation at all: + * given that srcp has already finished decoding, decode_error + * has already been set to its final value. */ + dst->decode_error_flags |= atomic_load_explicit(decode_error, memory_order_relaxed); + } + av_dict_set(&dst->metadata, "stereo_mode", ff_h264_sei_stereo_mode(&h->sei.common.frame_packing), 0); if (srcp->sei_recovery_frame_cnt == 0) diff --git a/src/third_party/ffmpeg/libavcodec/h264dec.h b/src/third_party/ffmpeg/libavcodec/h264dec.h index 9a1ec1ba..322c06a1 100644 --- a/src/third_party/ffmpeg/libavcodec/h264dec.h +++ b/src/third_party/ffmpeg/libavcodec/h264dec.h @@ -29,7 +29,6 @@ #define AVCODEC_H264DEC_H #include "libavutil/buffer.h" -#include "libavutil/intreadwrite.h" #include "libavutil/mem_internal.h" #include "cabac.h" @@ -44,7 +43,6 @@ #include "h264qpel.h" #include "h274.h" #include "mpegutils.h" -#include "rectangle.h" #include "videodsp.h" #define H264_MAX_PICTURE_COUNT 36 @@ -154,6 +152,9 @@ typedef struct H264Picture { int mb_width, mb_height; int mb_stride; + + /* data points to an atomic_int */ + AVBufferRef *decode_error_flags; } H264Picture; typedef struct H264Ref { @@ -551,6 +552,7 @@ typedef struct H264Context { AVBufferPool *mb_type_pool; AVBufferPool *motion_val_pool; AVBufferPool *ref_index_pool; + AVBufferPool *decode_error_flags_pool; int ref2frm[MAX_SLICES][2][64]; ///< reference to frame number lists, used in the loop filter, the first 2 are for -2,-1 } H264Context; @@ -649,136 +651,6 @@ static av_always_inline int get_chroma_qp(const PPS *pps, int t, int qscale) return pps->chroma_qp_table[t][qscale]; } -/** - * Get the predicted intra4x4 prediction mode. - */ -static av_always_inline int pred_intra_mode(const H264Context *h, - H264SliceContext *sl, int n) -{ - const int index8 = scan8[n]; - const int left = sl->intra4x4_pred_mode_cache[index8 - 1]; - const int top = sl->intra4x4_pred_mode_cache[index8 - 8]; - const int min = FFMIN(left, top); - - ff_tlog(h->avctx, "mode:%d %d min:%d\n", left, top, min); - - if (min < 0) - return DC_PRED; - else - return min; -} - -static av_always_inline void write_back_intra_pred_mode(const H264Context *h, - H264SliceContext *sl) -{ - int8_t *i4x4 = sl->intra4x4_pred_mode + h->mb2br_xy[sl->mb_xy]; - int8_t *i4x4_cache = sl->intra4x4_pred_mode_cache; - - AV_COPY32(i4x4, i4x4_cache + 4 + 8 * 4); - i4x4[4] = i4x4_cache[7 + 8 * 3]; - i4x4[5] = i4x4_cache[7 + 8 * 2]; - i4x4[6] = i4x4_cache[7 + 8 * 1]; -} - -static av_always_inline void write_back_non_zero_count(const H264Context *h, - H264SliceContext *sl) -{ - const int mb_xy = sl->mb_xy; - uint8_t *nnz = h->non_zero_count[mb_xy]; - uint8_t *nnz_cache = sl->non_zero_count_cache; - - AV_COPY32(&nnz[ 0], &nnz_cache[4 + 8 * 1]); - AV_COPY32(&nnz[ 4], &nnz_cache[4 + 8 * 2]); - AV_COPY32(&nnz[ 8], &nnz_cache[4 + 8 * 3]); - AV_COPY32(&nnz[12], &nnz_cache[4 + 8 * 4]); - AV_COPY32(&nnz[16], &nnz_cache[4 + 8 * 6]); - AV_COPY32(&nnz[20], &nnz_cache[4 + 8 * 7]); - AV_COPY32(&nnz[32], &nnz_cache[4 + 8 * 11]); - AV_COPY32(&nnz[36], &nnz_cache[4 + 8 * 12]); - - if (!h->chroma_y_shift) { - AV_COPY32(&nnz[24], &nnz_cache[4 + 8 * 8]); - AV_COPY32(&nnz[28], &nnz_cache[4 + 8 * 9]); - AV_COPY32(&nnz[40], &nnz_cache[4 + 8 * 13]); - AV_COPY32(&nnz[44], &nnz_cache[4 + 8 * 14]); - } -} - -static av_always_inline void write_back_motion_list(const H264Context *h, - H264SliceContext *sl, - int b_stride, - int b_xy, int b8_xy, - int mb_type, int list) -{ - int16_t(*mv_dst)[2] = &h->cur_pic.motion_val[list][b_xy]; - int16_t(*mv_src)[2] = &sl->mv_cache[list][scan8[0]]; - AV_COPY128(mv_dst + 0 * b_stride, mv_src + 8 * 0); - AV_COPY128(mv_dst + 1 * b_stride, mv_src + 8 * 1); - AV_COPY128(mv_dst + 2 * b_stride, mv_src + 8 * 2); - AV_COPY128(mv_dst + 3 * b_stride, mv_src + 8 * 3); - if (CABAC(h)) { - uint8_t (*mvd_dst)[2] = &sl->mvd_table[list][FMO ? 8 * sl->mb_xy - : h->mb2br_xy[sl->mb_xy]]; - uint8_t(*mvd_src)[2] = &sl->mvd_cache[list][scan8[0]]; - if (IS_SKIP(mb_type)) { - AV_ZERO128(mvd_dst); - } else { - AV_COPY64(mvd_dst, mvd_src + 8 * 3); - AV_COPY16(mvd_dst + 3 + 3, mvd_src + 3 + 8 * 0); - AV_COPY16(mvd_dst + 3 + 2, mvd_src + 3 + 8 * 1); - AV_COPY16(mvd_dst + 3 + 1, mvd_src + 3 + 8 * 2); - } - } - - { - int8_t *ref_index = &h->cur_pic.ref_index[list][b8_xy]; - int8_t *ref_cache = sl->ref_cache[list]; - ref_index[0 + 0 * 2] = ref_cache[scan8[0]]; - ref_index[1 + 0 * 2] = ref_cache[scan8[4]]; - ref_index[0 + 1 * 2] = ref_cache[scan8[8]]; - ref_index[1 + 1 * 2] = ref_cache[scan8[12]]; - } -} - -static av_always_inline void write_back_motion(const H264Context *h, - H264SliceContext *sl, - int mb_type) -{ - const int b_stride = h->b_stride; - const int b_xy = 4 * sl->mb_x + 4 * sl->mb_y * h->b_stride; // try mb2b(8)_xy - const int b8_xy = 4 * sl->mb_xy; - - if (USES_LIST(mb_type, 0)) { - write_back_motion_list(h, sl, b_stride, b_xy, b8_xy, mb_type, 0); - } else { - fill_rectangle(&h->cur_pic.ref_index[0][b8_xy], - 2, 2, 2, (uint8_t)LIST_NOT_USED, 1); - } - if (USES_LIST(mb_type, 1)) - write_back_motion_list(h, sl, b_stride, b_xy, b8_xy, mb_type, 1); - - if (sl->slice_type_nos == AV_PICTURE_TYPE_B && CABAC(h)) { - if (IS_8X8(mb_type)) { - uint8_t *direct_table = &h->direct_table[4 * sl->mb_xy]; - direct_table[1] = sl->sub_mb_type[1] >> 1; - direct_table[2] = sl->sub_mb_type[2] >> 1; - direct_table[3] = sl->sub_mb_type[3] >> 1; - } - } -} - -static av_always_inline int get_dct8x8_allowed(const H264Context *h, H264SliceContext *sl) -{ - if (h->ps.sps->direct_8x8_inference_flag) - return !(AV_RN64A(sl->sub_mb_type) & - ((MB_TYPE_16x8 | MB_TYPE_8x16 | MB_TYPE_8x8) * - 0x0001000100010001ULL)); - else - return !(AV_RN64A(sl->sub_mb_type) & - ((MB_TYPE_16x8 | MB_TYPE_8x16 | MB_TYPE_8x8 | MB_TYPE_DIRECT2) * - 0x0001000100010001ULL)); -} - int ff_h264_field_end(H264Context *h, H264SliceContext *sl, int in_setup); int ff_h264_ref_picture(H264Context *h, H264Picture *dst, H264Picture *src); diff --git a/src/third_party/ffmpeg/libavcodec/h266_metadata_bsf.c b/src/third_party/ffmpeg/libavcodec/h266_metadata_bsf.c index c0dbf8ef..1f0f875c 100644 --- a/src/third_party/ffmpeg/libavcodec/h266_metadata_bsf.c +++ b/src/third_party/ffmpeg/libavcodec/h266_metadata_bsf.c @@ -43,7 +43,7 @@ static int h266_metadata_update_fragment(AVBSFContext *bsf, AVPacket *pkt, int err, i; // If an AUD is present, it must be the first NAL unit. - if (pu->units[0].type == VVC_AUD_NUT) { + if (pu->nb_units && pu->units[0].type == VVC_AUD_NUT) { if (ctx->aud == BSF_ELEMENT_REMOVE) ff_cbs_delete_unit(pu, 0); } else if ( pkt && ctx->aud == BSF_ELEMENT_INSERT) { diff --git a/src/third_party/ffmpeg/libavcodec/h274.c b/src/third_party/ffmpeg/libavcodec/h274.c index a69f9411..57092003 100644 --- a/src/third_party/ffmpeg/libavcodec/h274.c +++ b/src/third_party/ffmpeg/libavcodec/h274.c @@ -38,7 +38,7 @@ static void prng_shift(uint32_t *state) { // Primitive polynomial x^31 + x^3 + 1 (modulo 2) uint32_t x = *state; - uint8_t feedback = (x >> 2) ^ (x >> 30); + uint8_t feedback = 1u ^ (x >> 2) ^ (x >> 30); *state = (x << 1) | (feedback & 1u); } @@ -59,13 +59,13 @@ static void init_slice_c(int8_t out[64][64], uint8_t h, uint8_t v, // // Note: To make the subsequent matrix multiplication cache friendlier, we // store each *column* of the starting image in a *row* of `out` - for (int y = 0; y <= freq_v; y++) { - for (int x = 0; x <= freq_h; x += 4) { + for (int l = 0; l <= freq_v; l++) { + for (int k = 0; k <= freq_h; k += 4) { uint16_t offset = seed % 2048; - out[x + 0][y] = Gaussian_LUT[offset + 0]; - out[x + 1][y] = Gaussian_LUT[offset + 1]; - out[x + 2][y] = Gaussian_LUT[offset + 2]; - out[x + 3][y] = Gaussian_LUT[offset + 3]; + out[l][k + 0] = Gaussian_LUT[offset + 0]; + out[l][k + 1] = Gaussian_LUT[offset + 1]; + out[l][k + 2] = Gaussian_LUT[offset + 2]; + out[l][k + 3] = Gaussian_LUT[offset + 3]; prng_shift(&seed); } } @@ -74,9 +74,9 @@ static void init_slice_c(int8_t out[64][64], uint8_t h, uint8_t v, // 64x64 inverse integer transform for (int y = 0; y < 64; y++) { - for (int x = 0; x <= freq_h; x++) { + for (int x = 0; x <= freq_v; x++) { int32_t sum = 0; - for (int p = 0; p <= freq_v; p++) + for (int p = 0; p <= freq_h; p++) sum += R64T[y][p] * out[x][p]; tmp[y][x] = (sum + 128) >> 8; } @@ -85,8 +85,8 @@ static void init_slice_c(int8_t out[64][64], uint8_t h, uint8_t v, for (int y = 0; y < 64; y++) { for (int x = 0; x < 64; x++) { int32_t sum = 0; - for (int p = 0; p <= freq_h; p++) - sum += tmp[y][p] * R64T[x][p]; // R64T^T = R64 + for (int p = 0; p <= freq_v; p++) + sum += tmp[x][p] * R64T[y][p]; // R64T^T = R64 // Renormalize and clip to [-127, 127] out[y][x] = av_clip((sum + 128) >> 8, -127, 127); } @@ -110,7 +110,7 @@ static void init_slice(H274FilmGrainDatabase *database, uint8_t h, uint8_t v) init_slice_c(database->db[h][v], h, v, database->slice_tmp); } -// Computes the average of an 8x8 block, right-shifted by 6 +// Computes the average of an 8x8 block static uint16_t avg_8x8_c(const uint8_t *in, int in_stride) { uint16_t avg[8] = {0}; // summing over an array vectorizes better @@ -259,11 +259,11 @@ int ff_h274_apply_film_grain(AVFrame *out_frame, const AVFrame *in_frame, // only advanced in 16x16 blocks, so use a nested loop for (int y = 0; y < height; y += 16) { for (int x = 0; x < width; x += 16) { - uint16_t y_offset = (seed >> 16) % 52; - uint16_t x_offset = (seed & 0xFFFF) % 56; + uint16_t x_offset = (seed >> 16) % 52; + uint16_t y_offset = (seed & 0xFFFF) % 56; const int invert = (seed & 0x1); - y_offset &= 0xFFFC; - x_offset &= 0xFFF8; + x_offset &= 0xFFFC; + y_offset &= 0xFFF8; prng_shift(&seed); for (int yy = 0; yy < 16 && y+yy < height; yy += 8) { diff --git a/src/third_party/ffmpeg/libavcodec/h274.h b/src/third_party/ffmpeg/libavcodec/h274.h index 920f6991..cebc8bec 100644 --- a/src/third_party/ffmpeg/libavcodec/h274.h +++ b/src/third_party/ffmpeg/libavcodec/h274.h @@ -40,11 +40,26 @@ typedef struct H274FilmGrainDatabase { int16_t slice_tmp[64][64]; } H274FilmGrainDatabase; +/** + * Check whether ff_h274_apply_film_grain() supports the given parameter combination. + * + * @param model_id model_id from AVFilmGrainParams to be supplied + * @param pix_fmt pixel format of the frames to be supplied + */ +static inline int ff_h274_film_grain_params_supported(int model_id, enum AVPixelFormat pix_fmt) +{ + return model_id == 0 && pix_fmt == AV_PIX_FMT_YUV420P; +} + // Synthesizes film grain on top of `in` and stores the result to `out`. `out` // must already have been allocated and set to the same size and format as // `in`. // // Returns a negative error code on error, such as invalid params. +// If ff_h274_film_grain_params_supported() indicated that the parameters +// are supported, no error will be returned if the arguments given to +// ff_h274_film_grain_params_supported() coincide with actual values +// from the frames and params. int ff_h274_apply_film_grain(AVFrame *out, const AVFrame *in, H274FilmGrainDatabase *db, const AVFilmGrainParams *params); diff --git a/src/third_party/ffmpeg/libavcodec/hcadec.c b/src/third_party/ffmpeg/libavcodec/hcadec.c index 2f019a82..6f277afb 100644 --- a/src/third_party/ffmpeg/libavcodec/hcadec.c +++ b/src/third_party/ffmpeg/libavcodec/hcadec.c @@ -28,8 +28,12 @@ #include "get_bits.h" #include "hca_data.h" +#define HCA_MASK 0x7f7f7f7f +#define MAX_CHANNELS 16 + typedef struct ChannelContext { - float base[128]; + DECLARE_ALIGNED(32, float, base)[128]; + DECLARE_ALIGNED(32, float, factors)[128]; DECLARE_ALIGNED(32, float, imdct_in)[128]; DECLARE_ALIGNED(32, float, imdct_out)[128]; DECLARE_ALIGNED(32, float, imdct_prev)[128]; @@ -44,11 +48,15 @@ typedef struct ChannelContext { typedef struct HCAContext { const AVCRC *crc_table; - ChannelContext ch[16]; + ChannelContext ch[MAX_CHANNELS]; uint8_t ath[128]; + uint8_t cipher[256]; + uint64_t key; + uint16_t subkey; int ath_type; + int ciph_type; unsigned hfr_group_count; uint8_t track_count; uint8_t channel_config; @@ -62,6 +70,93 @@ typedef struct HCAContext { AVFloatDSPContext *fdsp; } HCAContext; +static void cipher_init56_create_table(uint8_t *r, uint8_t key) +{ + const int mul = ((key & 1) << 3) | 5; + const int add = (key & 0xE) | 1; + + key >>= 4; + for (int i = 0; i < 16; i++) { + key = (key * mul + add) & 0xF; + r[i] = key; + } +} + +static void cipher_init56(uint8_t *cipher, uint64_t keycode) +{ + uint8_t base[256], base_r[16], base_c[16], kc[8], seed[16]; + + /* 56bit keycode encryption (given as a uint64_t number, but upper 8b aren't used) */ + /* keycode = keycode - 1 */ + if (keycode != 0) + keycode--; + + /* init keycode table */ + for (int r = 0; r < (8-1); r++) { + kc[r] = keycode & 0xFF; + keycode = keycode >> 8; + } + + /* init seed table */ + seed[ 0] = kc[1]; + seed[ 1] = kc[1] ^ kc[6]; + seed[ 2] = kc[2] ^ kc[3]; + seed[ 3] = kc[2]; + seed[ 4] = kc[2] ^ kc[1]; + seed[ 5] = kc[3] ^ kc[4]; + seed[ 6] = kc[3]; + seed[ 7] = kc[3] ^ kc[2]; + seed[ 8] = kc[4] ^ kc[5]; + seed[ 9] = kc[4]; + seed[10] = kc[4] ^ kc[3]; + seed[11] = kc[5] ^ kc[6]; + seed[12] = kc[5]; + seed[13] = kc[5] ^ kc[4]; + seed[14] = kc[6] ^ kc[1]; + seed[15] = kc[6]; + + /* init base table */ + cipher_init56_create_table(base_r, kc[0]); + for (int r = 0; r < 16; r++) { + uint8_t nb; + cipher_init56_create_table(base_c, seed[r]); + nb = base_r[r] << 4; + for (int c = 0; c < 16; c++) + base[r*16 + c] = nb | base_c[c]; /* combine nibbles */ + } + + /* final shuffle table */ + { + unsigned x = 0; + unsigned pos = 1; + + for (int i = 0; i < 256; i++) { + x = (x + 17) & 0xFF; + if (base[x] != 0 && base[x] != 0xFF) + cipher[pos++] = base[x]; + } + cipher[0] = 0; + cipher[0xFF] = 0xFF; + } +} + +static void cipher_init(uint8_t *cipher, int type, uint64_t keycode, uint16_t subkey) +{ + switch (type) { + case 56: + if (keycode) { + if (subkey) + keycode = keycode * (((uint64_t)subkey<<16u)|((uint16_t)~subkey+2u)); + cipher_init56(cipher, keycode); + } + break; + case 0: + for (int i = 0; i < 256; i++) + cipher[i] = i; + break; + } +} + static void ath_init1(uint8_t *ath, int sample_rate) { unsigned int index; @@ -101,24 +196,19 @@ static inline unsigned ceil2(unsigned a, unsigned b) return (b > 0) ? (a / b + ((a % b) ? 1 : 0)) : 0; } -static av_cold int decode_init(AVCodecContext *avctx) +static int init_hca(AVCodecContext *avctx, const uint8_t *extradata, + const int extradata_size) { HCAContext *c = avctx->priv_data; GetByteContext gb0, *const gb = &gb0; int8_t r[16] = { 0 }; - float scale = 1.f / 8.f; unsigned b, chunk; int version, ret; - avctx->sample_fmt = AV_SAMPLE_FMT_FLTP; - c->crc_table = av_crc_get_table(AV_CRC_16_ANSI); - - if (avctx->ch_layout.nb_channels <= 0 || avctx->ch_layout.nb_channels > 16) - return AVERROR(EINVAL); - - if (avctx->extradata_size < 36) + if (extradata_size < 36) return AVERROR_INVALIDDATA; - bytestream2_init(gb, avctx->extradata, avctx->extradata_size); + + bytestream2_init(gb, extradata, extradata_size); bytestream2_skipu(gb, 4); version = bytestream2_get_be16(gb); @@ -126,13 +216,13 @@ static av_cold int decode_init(AVCodecContext *avctx) c->ath_type = version >= 0x200 ? 0 : 1; - if (bytestream2_get_be32u(gb) != MKBETAG('f', 'm', 't', 0)) + if ((bytestream2_get_be32u(gb) & HCA_MASK) != MKBETAG('f', 'm', 't', 0)) return AVERROR_INVALIDDATA; bytestream2_skipu(gb, 4); bytestream2_skipu(gb, 4); bytestream2_skipu(gb, 4); - chunk = bytestream2_get_be32u(gb); + chunk = bytestream2_get_be32u(gb) & HCA_MASK; if (chunk == MKBETAG('c', 'o', 'm', 'p')) { bytestream2_skipu(gb, 2); bytestream2_skipu(gb, 1); @@ -161,9 +251,8 @@ static av_cold int decode_init(AVCodecContext *avctx) if (c->total_band_count > FF_ARRAY_ELEMS(c->ch->imdct_in)) return AVERROR_INVALIDDATA; - while (bytestream2_get_bytes_left(gb) >= 4) { - chunk = bytestream2_get_be32u(gb); + chunk = bytestream2_get_be32u(gb) & HCA_MASK; if (chunk == MKBETAG('v', 'b', 'r', 0)) { bytestream2_skip(gb, 2 + 2); } else if (chunk == MKBETAG('a', 't', 'h', 0)) { @@ -173,7 +262,7 @@ static av_cold int decode_init(AVCodecContext *avctx) } else if (chunk == MKBETAG('c', 'o', 'm', 'm')) { bytestream2_skip(gb, bytestream2_get_byte(gb) * 8); } else if (chunk == MKBETAG('c', 'i', 'p', 'h')) { - bytestream2_skip(gb, 2); + c->ciph_type = bytestream2_get_be16(gb); } else if (chunk == MKBETAG('l', 'o', 'o', 'p')) { bytestream2_skip(gb, 4 + 4 + 2 + 2); } else if (chunk == MKBETAG('p', 'a', 'd', 0)) { @@ -183,6 +272,14 @@ static av_cold int decode_init(AVCodecContext *avctx) } } + if (bytestream2_get_bytes_left(gb) >= 10) { + bytestream2_skip(gb, bytestream2_get_bytes_left(gb) - 10); + c->key = bytestream2_get_be64u(gb); + c->subkey = bytestream2_get_be16u(gb); + } + + cipher_init(c->cipher, c->ciph_type, c->key, c->subkey); + ret = ath_init(c->ath, c->ath_type, avctx->sample_rate); if (ret < 0) return ret; @@ -243,11 +340,36 @@ static av_cold int decode_init(AVCodecContext *avctx) return AVERROR_INVALIDDATA; } + return 0; +} + +static av_cold int decode_init(AVCodecContext *avctx) +{ + HCAContext *c = avctx->priv_data; + float scale = 1.f / 8.f; + int ret; + + avctx->sample_fmt = AV_SAMPLE_FMT_FLTP; + c->crc_table = av_crc_get_table(AV_CRC_16_ANSI); + + if (avctx->ch_layout.nb_channels <= 0 || avctx->ch_layout.nb_channels > FF_ARRAY_ELEMS(c->ch)) + return AVERROR(EINVAL); + c->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT); if (!c->fdsp) return AVERROR(ENOMEM); - return av_tx_init(&c->tx_ctx, &c->tx_fn, AV_TX_FLOAT_MDCT, 1, 128, &scale, 0); + ret = av_tx_init(&c->tx_ctx, &c->tx_fn, AV_TX_FLOAT_MDCT, 1, 128, &scale, 0); + if (ret < 0) + return ret; + + if (avctx->extradata_size != 0 && avctx->extradata_size < 36) + return AVERROR_INVALIDDATA; + + if (!avctx->extradata_size) + return 0; + + return init_hca(avctx, avctx->extradata, avctx->extradata_size); } static void run_imdct(HCAContext *c, ChannelContext *ch, int index, float *out) @@ -273,8 +395,8 @@ static void apply_intensity_stereo(HCAContext *s, ChannelContext *ch1, ChannelCo return; for (int i = 0; i < band_count; i++) { - *(c2++) = *c1 * ratio_r; - *(c1++) *= ratio_l; + c2[i] = c1[i] * ratio_r; + c1[i] *= ratio_l; } } @@ -299,6 +421,10 @@ static void reconstruct_hfr(HCAContext *s, ChannelContext *ch, static void dequantize_coefficients(HCAContext *c, ChannelContext *ch, GetBitContext *gb) { + const float *base = ch->base; + float *factors = ch->factors; + float *out = ch->imdct_in; + for (int i = 0; i < ch->count; i++) { unsigned scale = ch->scale[i]; int nb_bits = max_bits_table[scale]; @@ -315,10 +441,11 @@ static void dequantize_coefficients(HCAContext *c, ChannelContext *ch, skip_bits_long(gb, quant_spectrum_bits[value] - nb_bits); factor = quant_spectrum_value[value]; } - ch->imdct_in[i] = factor * ch->base[i]; + factors[i] = factor; } - memset(ch->imdct_in + ch->count, 0, sizeof(ch->imdct_in) - ch->count * sizeof(ch->imdct_in[0])); + memset(factors + ch->count, 0, 512 - ch->count * sizeof(*factors)); + c->fdsp->vector_fmul(out, factors, base, 128); } static void unpack(HCAContext *c, ChannelContext *ch, @@ -385,16 +512,44 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { HCAContext *c = avctx->priv_data; - int ch, ret, packed_noise_level; + int ch, offset = 0, ret, packed_noise_level; GetBitContext gb0, *const gb = &gb0; float **samples; + if (avpkt->size <= 8) + return AVERROR_INVALIDDATA; + + if (AV_RN16(avpkt->data) != 0xFFFF) { + if ((AV_RL32(avpkt->data)) != MKTAG('H','C','A',0)) { + return AVERROR_INVALIDDATA; + } else if (AV_RB16(avpkt->data + 6) <= avpkt->size) { + ret = init_hca(avctx, avpkt->data, AV_RB16(avpkt->data + 6)); + if (ret < 0) + return ret; + offset = AV_RB16(avpkt->data + 6); + if (offset == avpkt->size) + return avpkt->size; + } else { + return AVERROR_INVALIDDATA; + } + } + + if (c->key || c->subkey) { + uint8_t *data, *cipher = c->cipher; + + if ((ret = av_packet_make_writable(avpkt)) < 0) + return ret; + data = avpkt->data; + for (int n = 0; n < avpkt->size; n++) + data[n] = cipher[data[n]]; + } + if (avctx->err_recognition & AV_EF_CRCCHECK) { - if (av_crc(c->crc_table, 0, avpkt->data, avpkt->size)) + if (av_crc(c->crc_table, 0, avpkt->data + offset, avpkt->size - offset)) return AVERROR_INVALIDDATA; } - if ((ret = init_get_bits8(gb, avpkt->data, avpkt->size)) < 0) + if ((ret = init_get_bits8(gb, avpkt->data + offset, avpkt->size - offset)) < 0) return ret; if (get_bits(gb, 16) != 0xFFFF) diff --git a/src/third_party/ffmpeg/libavcodec/hevc_ps.c b/src/third_party/ffmpeg/libavcodec/hevc_ps.c index 1db2d3a2..7507d2bf 100644 --- a/src/third_party/ffmpeg/libavcodec/hevc_ps.c +++ b/src/third_party/ffmpeg/libavcodec/hevc_ps.c @@ -250,15 +250,15 @@ static int decode_profile_tier_level(GetBitContext *gb, AVCodecContext *avctx, ptl->profile_space = get_bits(gb, 2); ptl->tier_flag = get_bits1(gb); ptl->profile_idc = get_bits(gb, 5); - if (ptl->profile_idc == FF_PROFILE_HEVC_MAIN) + if (ptl->profile_idc == AV_PROFILE_HEVC_MAIN) av_log(avctx, AV_LOG_DEBUG, "Main profile bitstream\n"); - else if (ptl->profile_idc == FF_PROFILE_HEVC_MAIN_10) + else if (ptl->profile_idc == AV_PROFILE_HEVC_MAIN_10) av_log(avctx, AV_LOG_DEBUG, "Main 10 profile bitstream\n"); - else if (ptl->profile_idc == FF_PROFILE_HEVC_MAIN_STILL_PICTURE) + else if (ptl->profile_idc == AV_PROFILE_HEVC_MAIN_STILL_PICTURE) av_log(avctx, AV_LOG_DEBUG, "Main Still Picture profile bitstream\n"); - else if (ptl->profile_idc == FF_PROFILE_HEVC_REXT) + else if (ptl->profile_idc == AV_PROFILE_HEVC_REXT) av_log(avctx, AV_LOG_DEBUG, "Range Extension profile bitstream\n"); - else if (ptl->profile_idc == FF_PROFILE_HEVC_SCC) + else if (ptl->profile_idc == AV_PROFILE_HEVC_SCC) av_log(avctx, AV_LOG_DEBUG, "Screen Content Coding Extension profile bitstream\n"); else av_log(avctx, AV_LOG_WARNING, "Unknown HEVC profile: %d\n", ptl->profile_idc); @@ -406,12 +406,11 @@ static int decode_hrd(GetBitContext *gb, int common_inf_present, for (int i = 0; i < max_sublayers; i++) { hdr->flags.fixed_pic_rate_general_flag = get_bits1(gb); - hdr->cpb_cnt_minus1[i] = 1; - if (!hdr->flags.fixed_pic_rate_general_flag) hdr->flags.fixed_pic_rate_within_cvs_flag = get_bits1(gb); - if (hdr->flags.fixed_pic_rate_within_cvs_flag) + if (hdr->flags.fixed_pic_rate_within_cvs_flag || + hdr->flags.fixed_pic_rate_general_flag) hdr->elemental_duration_in_tc_minus1[i] = get_ue_golomb_long(gb); else hdr->flags.low_delay_hrd_flag = get_bits1(gb); @@ -426,11 +425,11 @@ static int decode_hrd(GetBitContext *gb, int common_inf_present, } if (hdr->flags.nal_hrd_parameters_present_flag) - decode_sublayer_hrd(gb, hdr->cpb_cnt_minus1[i], &hdr->nal_params[i], + decode_sublayer_hrd(gb, hdr->cpb_cnt_minus1[i]+1, &hdr->nal_params[i], hdr->flags.sub_pic_hrd_params_present_flag); if (hdr->flags.vcl_hrd_parameters_present_flag) - decode_sublayer_hrd(gb, hdr->cpb_cnt_minus1[i], &hdr->vcl_params[i], + decode_sublayer_hrd(gb, hdr->cpb_cnt_minus1[i]+1, &hdr->vcl_params[i], hdr->flags.sub_pic_hrd_params_present_flag); } @@ -1968,7 +1967,7 @@ int ff_hevc_decode_nal_pps(GetBitContext *gb, AVCodecContext *avctx, pps->pps_scc_extension_flag = get_bits1(gb); skip_bits(gb, 4); // pps_extension_4bits - if (sps->ptl.general_ptl.profile_idc >= FF_PROFILE_HEVC_REXT && pps->pps_range_extensions_flag) { + if (sps->ptl.general_ptl.profile_idc >= AV_PROFILE_HEVC_REXT && pps->pps_range_extensions_flag) { if ((ret = pps_range_extensions(gb, avctx, pps, sps)) < 0) goto err; } diff --git a/src/third_party/ffmpeg/libavcodec/hevc_refs.c b/src/third_party/ffmpeg/libavcodec/hevc_refs.c index 3aa8e199..c5c1203e 100644 --- a/src/third_party/ffmpeg/libavcodec/hevc_refs.c +++ b/src/third_party/ffmpeg/libavcodec/hevc_refs.c @@ -118,16 +118,10 @@ static HEVCFrame *alloc_frame(HEVCContext *s) (s->sei.picture_timing.picture_struct == AV_PICTURE_STRUCTURE_BOTTOM_FIELD)) frame->frame->flags |= AV_FRAME_FLAG_INTERLACED; - if (s->avctx->hwaccel) { - const AVHWAccel *hwaccel = s->avctx->hwaccel; - av_assert0(!frame->hwaccel_picture_private); - if (hwaccel->frame_priv_data_size) { - frame->hwaccel_priv_buf = ff_hwaccel_frame_priv_alloc(s->avctx, hwaccel); - if (!frame->hwaccel_priv_buf) - goto fail; - frame->hwaccel_picture_private = frame->hwaccel_priv_buf->data; - } - } + ret = ff_hwaccel_frame_priv_alloc(s->avctx, &frame->hwaccel_picture_private, + &frame->hwaccel_priv_buf); + if (ret < 0) + goto fail; return frame; fail: diff --git a/src/third_party/ffmpeg/libavcodec/hevc_sei.c b/src/third_party/ffmpeg/libavcodec/hevc_sei.c index 3c6bde1b..351e6997 100644 --- a/src/third_party/ffmpeg/libavcodec/hevc_sei.c +++ b/src/third_party/ffmpeg/libavcodec/hevc_sei.c @@ -49,52 +49,6 @@ static int decode_nal_sei_decoded_picture_hash(HEVCSEIPictureHash *s, return 0; } -static int decode_nal_sei_mastering_display_info(HEVCSEIMasteringDisplay *s, - GetByteContext *gb) -{ - int i; - - if (bytestream2_get_bytes_left(gb) < 24) - return AVERROR_INVALIDDATA; - - // Mastering primaries - for (i = 0; i < 3; i++) { - s->display_primaries[i][0] = bytestream2_get_be16u(gb); - s->display_primaries[i][1] = bytestream2_get_be16u(gb); - } - // White point (x, y) - s->white_point[0] = bytestream2_get_be16u(gb); - s->white_point[1] = bytestream2_get_be16u(gb); - - // Max and min luminance of mastering display - s->max_luminance = bytestream2_get_be32u(gb); - s->min_luminance = bytestream2_get_be32u(gb); - - // As this SEI message comes before the first frame that references it, - // initialize the flag to 2 and decrement on IRAP access unit so it - // persists for the coded video sequence (e.g., between two IRAPs) - s->present = 2; - - return 0; -} - -static int decode_nal_sei_content_light_info(HEVCSEIContentLight *s, - GetByteContext *gb) -{ - if (bytestream2_get_bytes_left(gb) < 4) - return AVERROR_INVALIDDATA; - - // Max and average light levels - s->max_content_light_level = bytestream2_get_be16u(gb); - s->max_pic_average_light_level = bytestream2_get_be16u(gb); - // As this SEI message comes before the first frame that references it, - // initialize the flag to 2 and decrement on IRAP access unit so it - // persists for the coded video sequence (e.g., between two IRAPs) - s->present = 2; - - return 0; -} - static int decode_nal_sei_pic_timing(HEVCSEI *s, GetBitContext *gb, const HEVCParamSets *ps, void *logctx) { @@ -206,10 +160,6 @@ static int decode_nal_sei_prefix(GetBitContext *gb, GetByteContext *gbyte, return decode_nal_sei_decoded_picture_hash(&s->picture_hash, gbyte); case SEI_TYPE_PIC_TIMING: return decode_nal_sei_pic_timing(s, gb, ps, logctx); - case SEI_TYPE_MASTERING_DISPLAY_COLOUR_VOLUME: - return decode_nal_sei_mastering_display_info(&s->mastering_display, gbyte); - case SEI_TYPE_CONTENT_LIGHT_LEVEL_INFO: - return decode_nal_sei_content_light_info(&s->content_light, gbyte); case SEI_TYPE_ACTIVE_PARAMETER_SETS: return decode_nal_sei_active_parameter_sets(s, gb, logctx); case SEI_TYPE_TIME_CODE: diff --git a/src/third_party/ffmpeg/libavcodec/hevc_sei.h b/src/third_party/ffmpeg/libavcodec/hevc_sei.h index 4189f5e6..a23a64ec 100644 --- a/src/third_party/ffmpeg/libavcodec/hevc_sei.h +++ b/src/third_party/ffmpeg/libavcodec/hevc_sei.h @@ -53,20 +53,6 @@ typedef struct HEVCSEIPictureTiming { int picture_struct; } HEVCSEIPictureTiming; -typedef struct HEVCSEIMasteringDisplay { - int present; - uint16_t display_primaries[3][2]; - uint16_t white_point[2]; - uint32_t max_luminance; - uint32_t min_luminance; -} HEVCSEIMasteringDisplay; - -typedef struct HEVCSEIContentLight { - int present; - uint16_t max_content_light_level; - uint16_t max_pic_average_light_level; -} HEVCSEIContentLight; - typedef struct HEVCSEIAlternativeTransfer { int present; int preferred_transfer_characteristics; @@ -96,8 +82,6 @@ typedef struct HEVCSEI { H2645SEI common; HEVCSEIPictureHash picture_hash; HEVCSEIPictureTiming picture_timing; - HEVCSEIMasteringDisplay mastering_display; - HEVCSEIContentLight content_light; int active_seq_parameter_set_id; HEVCSEITimeCode timecode; } HEVCSEI; diff --git a/src/third_party/ffmpeg/libavcodec/hevcdec.c b/src/third_party/ffmpeg/libavcodec/hevcdec.c index fcf19b4e..2be62ddf 100644 --- a/src/third_party/ffmpeg/libavcodec/hevcdec.c +++ b/src/third_party/ffmpeg/libavcodec/hevcdec.c @@ -31,7 +31,6 @@ #include "libavutil/display.h" #include "libavutil/film_grain_params.h" #include "libavutil/internal.h" -#include "libavutil/mastering_display_metadata.h" #include "libavutil/md5.h" #include "libavutil/opt.h" #include "libavutil/pixdesc.h" @@ -47,6 +46,7 @@ #include "hevc_data.h" #include "hevc_parse.h" #include "hevcdec.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "internal.h" #include "profiles.h" @@ -521,7 +521,7 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps) *fmt++ = sps->pix_fmt; *fmt = AV_PIX_FMT_NONE; - return ff_thread_get_format(s->avctx, pix_fmts); + return ff_get_format(s->avctx, pix_fmts); } static int set_sps(HEVCContext *s, const HEVCSPS *sps, @@ -1563,7 +1563,8 @@ static void luma_mc_uni(HEVCLocalContext *lc, uint8_t *dst, ptrdiff_t dststride, 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) { + y_off >= pic_height - block_h - QPEL_EXTRA_AFTER || + ref == s->frame) { const ptrdiff_t 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); @@ -1713,6 +1714,7 @@ static void chroma_mc_uni(HEVCLocalContext *lc, uint8_t *dst0, intptr_t my = av_mod_uintp2(mv->y, 2 + vshift); intptr_t _mx = mx << (1 - hshift); intptr_t _my = my << (1 - vshift); + int emu = src0 == s->frame->data[1] || src0 == s->frame->data[2]; x_off += mv->x >> (2 + hshift); y_off += mv->y >> (2 + vshift); @@ -1720,7 +1722,8 @@ static void chroma_mc_uni(HEVCLocalContext *lc, uint8_t *dst0, 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) { + y_off >= pic_height - block_h - EPEL_EXTRA_AFTER || + emu) { 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 * @@ -2761,73 +2764,15 @@ static int set_side_data(HEVCContext *s) AVFrame *out = s->ref->frame; int ret; - // Decrement the mastering display flag when IRAP frame has no_rasl_output_flag=1 - // so the side data persists for the entire coded video sequence. - if (s->sei.mastering_display.present > 0 && - IS_IRAP(s) && s->no_rasl_output_flag) { - s->sei.mastering_display.present--; - } - if (s->sei.mastering_display.present) { - // HEVC uses a g,b,r ordering, which we convert to a more natural r,g,b - const int mapping[3] = {2, 0, 1}; - const int chroma_den = 50000; - const int luma_den = 10000; - int i; - AVMasteringDisplayMetadata *metadata = - av_mastering_display_metadata_create_side_data(out); - if (!metadata) - return AVERROR(ENOMEM); + // Decrement the mastering display and content light level flag when IRAP + // frame has no_rasl_output_flag=1 so the side data persists for the entire + // coded video sequence. + if (IS_IRAP(s) && s->no_rasl_output_flag) { + if (s->sei.common.mastering_display.present > 0) + s->sei.common.mastering_display.present--; - for (i = 0; i < 3; i++) { - const int j = mapping[i]; - metadata->display_primaries[i][0].num = s->sei.mastering_display.display_primaries[j][0]; - metadata->display_primaries[i][0].den = chroma_den; - metadata->display_primaries[i][1].num = s->sei.mastering_display.display_primaries[j][1]; - metadata->display_primaries[i][1].den = chroma_den; - } - metadata->white_point[0].num = s->sei.mastering_display.white_point[0]; - metadata->white_point[0].den = chroma_den; - metadata->white_point[1].num = s->sei.mastering_display.white_point[1]; - metadata->white_point[1].den = chroma_den; - - metadata->max_luminance.num = s->sei.mastering_display.max_luminance; - metadata->max_luminance.den = luma_den; - metadata->min_luminance.num = s->sei.mastering_display.min_luminance; - metadata->min_luminance.den = luma_den; - metadata->has_luminance = 1; - metadata->has_primaries = 1; - - av_log(s->avctx, AV_LOG_DEBUG, "Mastering Display Metadata:\n"); - av_log(s->avctx, AV_LOG_DEBUG, - "r(%5.4f,%5.4f) g(%5.4f,%5.4f) b(%5.4f %5.4f) wp(%5.4f, %5.4f)\n", - av_q2d(metadata->display_primaries[0][0]), - av_q2d(metadata->display_primaries[0][1]), - av_q2d(metadata->display_primaries[1][0]), - av_q2d(metadata->display_primaries[1][1]), - av_q2d(metadata->display_primaries[2][0]), - av_q2d(metadata->display_primaries[2][1]), - av_q2d(metadata->white_point[0]), av_q2d(metadata->white_point[1])); - av_log(s->avctx, AV_LOG_DEBUG, - "min_luminance=%f, max_luminance=%f\n", - av_q2d(metadata->min_luminance), av_q2d(metadata->max_luminance)); - } - // Decrement the mastering display flag when IRAP frame has no_rasl_output_flag=1 - // so the side data persists for the entire coded video sequence. - if (s->sei.content_light.present > 0 && - IS_IRAP(s) && s->no_rasl_output_flag) { - s->sei.content_light.present--; - } - if (s->sei.content_light.present) { - AVContentLightMetadata *metadata = - av_content_light_metadata_create_side_data(out); - if (!metadata) - return AVERROR(ENOMEM); - metadata->MaxCLL = s->sei.content_light.max_content_light_level; - metadata->MaxFALL = s->sei.content_light.max_pic_average_light_level; - - av_log(s->avctx, AV_LOG_DEBUG, "Content Light Level Metadata:\n"); - av_log(s->avctx, AV_LOG_DEBUG, "MaxCLL=%d, MaxFALL=%d\n", - metadata->MaxCLL, metadata->MaxFALL); + if (s->sei.common.content_light.present > 0) + s->sei.common.content_light.present--; } ret = ff_h2645_sei_to_frame(out, &s->sei.common, AV_CODEC_ID_HEVC, NULL, @@ -2939,6 +2884,14 @@ static int hevc_frame_start(HEVCContext *s) !(s->avctx->export_side_data & AV_CODEC_EXPORT_DATA_FILM_GRAIN) && !s->avctx->hwaccel; + if (s->ref->needs_fg && + !ff_h274_film_grain_params_supported(s->sei.common.film_grain_characteristics.model_id, + s->ref->frame->format)) { + av_log_once(s->avctx, AV_LOG_WARNING, AV_LOG_DEBUG, &s->film_grain_warning_shown, + "Unsupported film grain parameters. Ignoring film grain.\n"); + s->ref->needs_fg = 0; + } + if (s->ref->needs_fg) { s->ref->frame_grain->format = s->ref->frame->format; s->ref->frame_grain->width = s->ref->frame->width; @@ -2977,19 +2930,14 @@ static int hevc_frame_end(HEVCContext *s) { HEVCFrame *out = s->ref; const AVFrameSideData *sd; - int ret; + av_unused int ret; if (out->needs_fg) { sd = av_frame_get_side_data(out->frame, AV_FRAME_DATA_FILM_GRAIN_PARAMS); av_assert0(out->frame_grain->buf[0] && sd); ret = ff_h274_apply_film_grain(out->frame_grain, out->frame, &s->h274db, (AVFilmGrainParams *) sd->data); - - if (ret < 0) { - av_log(s->avctx, AV_LOG_WARNING, "Failed synthesizing film " - "grain, ignoring: %s\n", av_err2str(ret)); - out->needs_fg = 0; - } + av_assert1(ret >= 0); } return 0; @@ -3007,11 +2955,9 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal) switch (s->nal_unit_type) { case HEVC_NAL_VPS: - if (s->avctx->hwaccel && s->avctx->hwaccel->decode_params) { - ret = s->avctx->hwaccel->decode_params(s->avctx, - nal->type, - nal->raw_data, - nal->raw_size); + if (FF_HW_HAS_CB(s->avctx, decode_params)) { + ret = FF_HW_CALL(s->avctx, decode_params, + nal->type, nal->raw_data, nal->raw_size); if (ret < 0) goto fail; } @@ -3020,11 +2966,9 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal) goto fail; break; case HEVC_NAL_SPS: - if (s->avctx->hwaccel && s->avctx->hwaccel->decode_params) { - ret = s->avctx->hwaccel->decode_params(s->avctx, - nal->type, - nal->raw_data, - nal->raw_size); + if (FF_HW_HAS_CB(s->avctx, decode_params)) { + ret = FF_HW_CALL(s->avctx, decode_params, + nal->type, nal->raw_data, nal->raw_size); if (ret < 0) goto fail; } @@ -3034,11 +2978,9 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal) goto fail; break; case HEVC_NAL_PPS: - if (s->avctx->hwaccel && s->avctx->hwaccel->decode_params) { - ret = s->avctx->hwaccel->decode_params(s->avctx, - nal->type, - nal->raw_data, - nal->raw_size); + if (FF_HW_HAS_CB(s->avctx, decode_params)) { + ret = FF_HW_CALL(s->avctx, decode_params, + nal->type, nal->raw_data, nal->raw_size); if (ret < 0) goto fail; } @@ -3048,11 +2990,9 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal) break; case HEVC_NAL_SEI_PREFIX: case HEVC_NAL_SEI_SUFFIX: - if (s->avctx->hwaccel && s->avctx->hwaccel->decode_params) { - ret = s->avctx->hwaccel->decode_params(s->avctx, - nal->type, - nal->raw_data, - nal->raw_size); + if (FF_HW_HAS_CB(s->avctx, decode_params)) { + ret = FF_HW_CALL(s->avctx, decode_params, + nal->type, nal->raw_data, nal->raw_size); if (ret < 0) goto fail; } @@ -3138,17 +3078,17 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal) } if (s->sh.first_slice_in_pic_flag && s->avctx->hwaccel) { - ret = s->avctx->hwaccel->start_frame(s->avctx, NULL, 0); + ret = FF_HW_CALL(s->avctx, start_frame, NULL, 0); if (ret < 0) goto fail; } if (s->avctx->hwaccel) { - ret = s->avctx->hwaccel->decode_slice(s->avctx, nal->raw_data, nal->raw_size); + ret = FF_HW_CALL(s->avctx, decode_slice, nal->raw_data, nal->raw_size); if (ret < 0) goto fail; } else { - if (s->avctx->profile == FF_PROFILE_HEVC_SCC) { + if (s->avctx->profile == AV_PROFILE_HEVC_SCC) { av_log(s->avctx, AV_LOG_ERROR, "SCC profile is not yet implemented in hevc native decoder.\n"); ret = AVERROR_PATCHWELCOME; @@ -3412,7 +3352,7 @@ static int hevc_decode_frame(AVCodecContext *avctx, AVFrame *rframe, return ret; if (avctx->hwaccel) { - if (s->ref && (ret = avctx->hwaccel->end_frame(avctx)) < 0) { + if (s->ref && (ret = FF_HW_SIMPLE_CALL(avctx, end_frame)) < 0) { av_log(avctx, AV_LOG_ERROR, "hardware accelerator failed to decode picture\n"); ff_hevc_unref_frame(s, s->ref, ~0); @@ -3637,6 +3577,8 @@ static int hevc_update_thread_context(AVCodecContext *dst, s->threads_number = s0->threads_number; s->threads_type = s0->threads_type; + s->film_grain_warning_shown = s0->film_grain_warning_shown; + if (s0->eos) { s->seq_decode = (s->seq_decode + 1) & HEVC_SEQUENCE_COUNTER_MASK; s->max_ra = INT_MAX; @@ -3667,8 +3609,8 @@ static int hevc_update_thread_context(AVCodecContext *dst, s->sei.common.frame_packing = s0->sei.common.frame_packing; s->sei.common.display_orientation = s0->sei.common.display_orientation; s->sei.common.alternative_transfer = s0->sei.common.alternative_transfer; - s->sei.mastering_display = s0->sei.mastering_display; - s->sei.content_light = s0->sei.content_light; + s->sei.common.mastering_display = s0->sei.common.mastering_display; + s->sei.common.content_light = s0->sei.common.content_light; ret = export_stream_params_from_sei(s); if (ret < 0) @@ -3728,8 +3670,8 @@ static void hevc_decode_flush(AVCodecContext *avctx) s->max_ra = INT_MAX; s->eos = 1; - if (avctx->hwaccel && avctx->hwaccel->flush) - avctx->hwaccel->flush(avctx); + if (FF_HW_HAS_CB(avctx, flush)) + FF_HW_SIMPLE_CALL(avctx, flush); } #define OFFSET(x) offsetof(HEVCContext, x) diff --git a/src/third_party/ffmpeg/libavcodec/hevcdec.h b/src/third_party/ffmpeg/libavcodec/hevcdec.h index 94609e46..9b232df6 100644 --- a/src/third_party/ffmpeg/libavcodec/hevcdec.h +++ b/src/third_party/ffmpeg/libavcodec/hevcdec.h @@ -596,6 +596,8 @@ typedef struct HEVCContext { int nal_length_size; ///< Number of bytes used for nal length (1, 2 or 4) int nuh_layer_id; + int film_grain_warning_shown; + AVBufferRef *rpu_buf; ///< 0 or 1 Dolby Vision RPUs. DOVIContext dovi_ctx; ///< Dolby Vision decoding context } HEVCContext; diff --git a/src/third_party/ffmpeg/libavcodec/hevcpred_template.c b/src/third_party/ffmpeg/libavcodec/hevcpred_template.c index 16d1c7f3..46bd8065 100644 --- a/src/third_party/ffmpeg/libavcodec/hevcpred_template.c +++ b/src/third_party/ffmpeg/libavcodec/hevcpred_template.c @@ -213,13 +213,10 @@ do { \ j = 0; while (j < size_max_x && !IS_INTRA(j, -1)) j++; - if (j > 0) - if (cand_up_left) { - EXTEND_LEFT_CIP(top, j, j + 1); - } else { - EXTEND_LEFT_CIP(top, j, j); - top[-1] = top[0]; - } + if (j > 0) { + EXTEND_LEFT_CIP(top, j, j); + top[-1] = top[0]; + } left[-1] = top[-1]; } left[-1] = top[-1]; diff --git a/src/third_party/ffmpeg/libavcodec/hq_hqa.c b/src/third_party/ffmpeg/libavcodec/hq_hqa.c index db0ac7d9..0df7995f 100644 --- a/src/third_party/ffmpeg/libavcodec/hq_hqa.c +++ b/src/third_party/ffmpeg/libavcodec/hq_hqa.c @@ -376,8 +376,8 @@ static av_cold int hq_hqa_decode_close(AVCodecContext *avctx) { HQContext *ctx = avctx->priv_data; - ff_free_vlc(&ctx->hq_ac_vlc); - ff_free_vlc(&ctx->hqa_cbp_vlc); + ff_vlc_free(&ctx->hq_ac_vlc); + ff_vlc_free(&ctx->hqa_cbp_vlc); return 0; } diff --git a/src/third_party/ffmpeg/libavcodec/hq_hqadata.c b/src/third_party/ffmpeg/libavcodec/hq_hqadata.c index 56470ead..438bdf09 100644 --- a/src/third_party/ffmpeg/libavcodec/hq_hqadata.c +++ b/src/third_party/ffmpeg/libavcodec/hq_hqadata.c @@ -8367,11 +8367,11 @@ const HQProfile ff_hq_profile[NUM_HQ_PROFILES] = { av_cold int ff_hq_init_vlcs(HQContext *c) { - int ret = init_vlc(&c->hqa_cbp_vlc, 5, FF_ARRAY_ELEMS(cbp_vlc_lens), + int ret = vlc_init(&c->hqa_cbp_vlc, 5, FF_ARRAY_ELEMS(cbp_vlc_lens), cbp_vlc_lens, 1, 1, cbp_vlc_bits, 1, 1, 0); if (ret < 0) return ret; - return init_vlc(&c->hq_ac_vlc, 9, NUM_HQ_AC_ENTRIES, + return vlc_init(&c->hq_ac_vlc, 9, NUM_HQ_AC_ENTRIES, hq_ac_bits, 1, 1, hq_ac_codes, 2, 2, 0); } diff --git a/src/third_party/ffmpeg/libavcodec/hqx.c b/src/third_party/ffmpeg/libavcodec/hqx.c index 6554b15e..51099aa6 100644 --- a/src/third_party/ffmpeg/libavcodec/hqx.c +++ b/src/third_party/ffmpeg/libavcodec/hqx.c @@ -517,9 +517,9 @@ static av_cold int hqx_decode_close(AVCodecContext *avctx) int i; HQXContext *ctx = avctx->priv_data; - ff_free_vlc(&ctx->cbp_vlc); + ff_vlc_free(&ctx->cbp_vlc); for (i = 0; i < 3; i++) { - ff_free_vlc(&ctx->dc_vlc[i]); + ff_vlc_free(&ctx->dc_vlc[i]); } return 0; diff --git a/src/third_party/ffmpeg/libavcodec/hqxvlc.c b/src/third_party/ffmpeg/libavcodec/hqxvlc.c index 7ab24276..1eeda4fc 100644 --- a/src/third_party/ffmpeg/libavcodec/hqxvlc.c +++ b/src/third_party/ffmpeg/libavcodec/hqxvlc.c @@ -2140,7 +2140,7 @@ const HQXAC ff_hqx_ac[NUM_HQX_AC] = { #define INIT_DC_TABLE(idx, name) \ do { \ - ret = init_vlc(&ctx->dc_vlc[idx], HQX_DC_VLC_BITS, \ + ret = vlc_init(&ctx->dc_vlc[idx], HQX_DC_VLC_BITS, \ FF_ARRAY_ELEMS(name ## _vlc_lens), \ name ## _vlc_lens, 1, 1, \ name ## _vlc_bits, 2, 2, 0); \ @@ -2150,7 +2150,7 @@ const HQXAC ff_hqx_ac[NUM_HQX_AC] = { av_cold int ff_hqx_init_vlcs(HQXContext *ctx) { - int ret = init_vlc(&ctx->cbp_vlc, HQX_CBP_VLC_BITS, FF_ARRAY_ELEMS(cbp_vlc_lens), + int ret = vlc_init(&ctx->cbp_vlc, HQX_CBP_VLC_BITS, FF_ARRAY_ELEMS(cbp_vlc_lens), cbp_vlc_lens, 1, 1, cbp_vlc_bits, 1, 1, 0); if (ret < 0) return ret; diff --git a/src/third_party/ffmpeg/libavcodec/huffman.c b/src/third_party/ffmpeg/libavcodec/huffman.c index 99aa39c5..d47fe100 100644 --- a/src/third_party/ffmpeg/libavcodec/huffman.c +++ b/src/third_party/ffmpeg/libavcodec/huffman.c @@ -148,7 +148,7 @@ static int build_huff_tree(VLC *vlc, Node *nodes, int head, int flags, int nb_bi get_tree_codes(bits, lens, xlat, nodes, head, 0, 0, &pos, no_zero_count); - return ff_init_vlc_sparse(vlc, nb_bits, pos, lens, 2, 2, bits, 4, 4, xlat, 1, 1, 0); + return ff_vlc_init_sparse(vlc, nb_bits, pos, lens, 2, 2, bits, 4, 4, xlat, 1, 1, 0); } diff --git a/src/third_party/ffmpeg/libavcodec/huffyuvdec.c b/src/third_party/ffmpeg/libavcodec/huffyuvdec.c index c9fcec30..9e9047c5 100644 --- a/src/third_party/ffmpeg/libavcodec/huffyuvdec.c +++ b/src/third_party/ffmpeg/libavcodec/huffyuvdec.c @@ -42,6 +42,7 @@ #include "huffyuvdsp.h" #include "lossless_videodsp.h" #include "thread.h" +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/pixdesc.h" @@ -168,8 +169,9 @@ static int generate_joint_tables(HYuvDecContext *s) len = (uint8_t *)(bits + (1 << VLC_BITS)); if (s->bitstream_bpp < 24 || s->version > 2) { + int count = 1 + s->alpha + 2 * s->chroma; int p, i, y, u; - for (p = 0; p < 4; p++) { + for (p = 0; p < count; p++) { int p0 = s->version > 2 ? p : 0; for (i = y = 0; y < s->vlc_n; y++) { int len0 = s->len[p0][y]; @@ -191,8 +193,8 @@ static int generate_joint_tables(HYuvDecContext *s) i++; } } - ff_free_vlc(&s->vlc[4 + p]); - if ((ret = ff_init_vlc_sparse(&s->vlc[4 + p], VLC_BITS, i, len, 1, 1, + ff_vlc_free(&s->vlc[4 + p]); + if ((ret = ff_vlc_init_sparse(&s->vlc[4 + p], VLC_BITS, i, len, 1, 1, bits, 2, 2, symbols, 2, 2, 0)) < 0) goto out; } @@ -235,8 +237,8 @@ static int generate_joint_tables(HYuvDecContext *s) } } } - ff_free_vlc(&s->vlc[4]); - if ((ret = init_vlc(&s->vlc[4], VLC_BITS, i, len, 1, 1, + ff_vlc_free(&s->vlc[4]); + if ((ret = vlc_init(&s->vlc[4], VLC_BITS, i, len, 1, 1, bits, 2, 2, 0)) < 0) goto out; } @@ -263,8 +265,8 @@ static int read_huffman_tables(HYuvDecContext *s, const uint8_t *src, int length return ret; if ((ret = ff_huffyuv_generate_bits_table(s->bits[i], s->len[i], s->vlc_n)) < 0) return ret; - ff_free_vlc(&s->vlc[i]); - if ((ret = init_vlc(&s->vlc[i], VLC_BITS, s->vlc_n, s->len[i], 1, 1, + ff_vlc_free(&s->vlc[i]); + if ((ret = vlc_init(&s->vlc[i], VLC_BITS, s->vlc_n, s->len[i], 1, 1, s->bits[i], 4, 4, 0)) < 0) return ret; } @@ -303,8 +305,8 @@ static int read_old_huffman_tables(HYuvDecContext *s) memcpy(s->len[2], s->len[1], 256 * sizeof(uint8_t)); for (i = 0; i < 4; i++) { - ff_free_vlc(&s->vlc[i]); - if ((ret = init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1, + ff_vlc_free(&s->vlc[i]); + if ((ret = vlc_init(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1, s->bits[i], 4, 4, 0)) < 0) return ret; } @@ -324,7 +326,7 @@ static av_cold int decode_end(AVCodecContext *avctx) av_freep(&s->bitstream_buffer); for (i = 0; i < 8; i++) - ff_free_vlc(&s->vlc[i]); + ff_vlc_free(&s->vlc[i]); return 0; } @@ -755,7 +757,7 @@ static void decode_plane_bitstream(HYuvDecContext *s, int width, int plane) } } if( width&1 && get_bits_left(&s->gb)>0 ) { - int dst = get_vlc2(&s->gb, s->vlc[plane].table, VLC_BITS, 3)<<2; + int dst = (unsigned)get_vlc2(&s->gb, s->vlc[plane].table, VLC_BITS, 3)<<2; s->temp16[0][width-1] = dst + get_bits(&s->gb, 2); } } diff --git a/src/third_party/ffmpeg/libavcodec/huffyuvenc.c b/src/third_party/ffmpeg/libavcodec/huffyuvenc.c index 72d6246e..b02b3c7a 100644 --- a/src/third_party/ffmpeg/libavcodec/huffyuvenc.c +++ b/src/third_party/ffmpeg/libavcodec/huffyuvenc.c @@ -39,6 +39,7 @@ #include "huffyuvencdsp.h" #include "lossless_videoencdsp.h" #include "put_bits.h" +#include "libavutil/emms.h" #include "libavutil/opt.h" #include "libavutil/pixdesc.h" diff --git a/src/third_party/ffmpeg/libavcodec/hwaccel_internal.h b/src/third_party/ffmpeg/libavcodec/hwaccel_internal.h new file mode 100644 index 00000000..edfe2831 --- /dev/null +++ b/src/third_party/ffmpeg/libavcodec/hwaccel_internal.h @@ -0,0 +1,179 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * Header providing the internals of AVHWAccel. + */ + +#ifndef AVCODEC_HWACCEL_INTERNAL_H +#define AVCODEC_HWACCEL_INTERNAL_H + +#include + +#include "avcodec.h" + +#define HWACCEL_CAP_ASYNC_SAFE (1 << 0) +#define HWACCEL_CAP_THREAD_SAFE (1 << 1) + +typedef struct FFHWAccel { + /** + * The public AVHWAccel. See avcodec.h for it. + */ + AVHWAccel p; + + /** + * Allocate a custom buffer + */ + int (*alloc_frame)(AVCodecContext *avctx, AVFrame *frame); + + /** + * Called at the beginning of each frame or field picture. + * + * Meaningful frame information (codec specific) is guaranteed to + * be parsed at this point. This function is mandatory. + * + * Note that buf can be NULL along with buf_size set to 0. + * Otherwise, this means the whole frame is available at this point. + * + * @param avctx the codec context + * @param buf the frame data buffer base + * @param buf_size the size of the frame in bytes + * @return zero if successful, a negative value otherwise + */ + int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size); + + /** + * Callback for parameter data (SPS/PPS/VPS etc). + * + * Useful for hardware decoders which keep persistent state about the + * video parameters, and need to receive any changes to update that state. + * + * @param avctx the codec context + * @param type the nal unit type + * @param buf the nal unit data buffer + * @param buf_size the size of the nal unit in bytes + * @return zero if successful, a negative value otherwise + */ + int (*decode_params)(AVCodecContext *avctx, int type, const uint8_t *buf, uint32_t buf_size); + + /** + * Callback for each slice. + * + * Meaningful slice information (codec specific) is guaranteed to + * be parsed at this point. This function is mandatory. + * + * @param avctx the codec context + * @param buf the slice data buffer base + * @param buf_size the size of the slice in bytes + * @return zero if successful, a negative value otherwise + */ + int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size); + + /** + * Called at the end of each frame or field picture. + * + * The whole picture is parsed at this point and can now be sent + * to the hardware accelerator. This function is mandatory. + * + * @param avctx the codec context + * @return zero if successful, a negative value otherwise + */ + int (*end_frame)(AVCodecContext *avctx); + + /** + * Size of per-frame hardware accelerator private data. + * + * Private data is allocated with av_mallocz() before + * AVCodecContext.get_buffer() and deallocated after + * AVCodecContext.release_buffer(). + */ + int frame_priv_data_size; + + /** + * Size of the private data to allocate in + * AVCodecInternal.hwaccel_priv_data. + */ + int priv_data_size; + + /** + * Internal hwaccel capabilities. + */ + int caps_internal; + + /** + * Initialize the hwaccel private data. + * + * This will be called from ff_get_format(), after hwaccel and + * hwaccel_context are set and the hwaccel private data in AVCodecInternal + * is allocated. + */ + int (*init)(AVCodecContext *avctx); + + /** + * Uninitialize the hwaccel private data. + * + * This will be called from get_format() or avcodec_close(), after hwaccel + * and hwaccel_context are already uninitialized. + */ + int (*uninit)(AVCodecContext *avctx); + + /** + * Fill the given hw_frames context with current codec parameters. Called + * from get_format. Refer to avcodec_get_hw_frames_parameters() for + * details. + * + * This CAN be called before AVHWAccel.init is called, and you must assume + * that avctx->hwaccel_priv_data is invalid. + */ + int (*frame_params)(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx); + + /** + * Copy necessary context variables from a previous thread context to the current one. + * For thread-safe hwaccels only. + */ + int (*update_thread_context)(AVCodecContext *dst, const AVCodecContext *src); + + /** + * Callback to free the hwaccel-specific frame data. + * + * @param hwctx a pointer to an AVHWDeviceContext. + * @param data the per-frame hardware accelerator private data to be freed. + */ + void (*free_frame_priv)(void *hwctx, uint8_t *data); + + /** + * Callback to flush the hwaccel state. + */ + void (*flush)(AVCodecContext *avctx); +} FFHWAccel; + +static inline const FFHWAccel *ffhwaccel(const AVHWAccel *codec) +{ + return (const FFHWAccel*)codec; +} + +#define FF_HW_CALL(avctx, function, ...) \ + (ffhwaccel((avctx)->hwaccel)->function((avctx), __VA_ARGS__)) + +#define FF_HW_SIMPLE_CALL(avctx, function) \ + (ffhwaccel((avctx)->hwaccel)->function(avctx)) + +#define FF_HW_HAS_CB(avctx, function) \ + ((avctx)->hwaccel && ffhwaccel((avctx)->hwaccel)->function) + +#endif /* AVCODEC_HWACCEL_INTERNAL */ diff --git a/src/third_party/ffmpeg/libavcodec/hwaccels.h b/src/third_party/ffmpeg/libavcodec/hwaccels.h index 48dfc17f..c4630718 100644 --- a/src/third_party/ffmpeg/libavcodec/hwaccels.h +++ b/src/third_party/ffmpeg/libavcodec/hwaccels.h @@ -19,70 +19,68 @@ #ifndef AVCODEC_HWACCELS_H #define AVCODEC_HWACCELS_H -#include "avcodec.h" - -extern const AVHWAccel ff_av1_d3d11va_hwaccel; -extern const AVHWAccel ff_av1_d3d11va2_hwaccel; -extern const AVHWAccel ff_av1_dxva2_hwaccel; -extern const AVHWAccel ff_av1_nvdec_hwaccel; -extern const AVHWAccel ff_av1_vaapi_hwaccel; -extern const AVHWAccel ff_av1_vdpau_hwaccel; -extern const AVHWAccel ff_av1_vulkan_hwaccel; -extern const AVHWAccel ff_h263_vaapi_hwaccel; -extern const AVHWAccel ff_h263_videotoolbox_hwaccel; -extern const AVHWAccel ff_h264_d3d11va_hwaccel; -extern const AVHWAccel ff_h264_d3d11va2_hwaccel; -extern const AVHWAccel ff_h264_dxva2_hwaccel; -extern const AVHWAccel ff_h264_nvdec_hwaccel; -extern const AVHWAccel ff_h264_vaapi_hwaccel; -extern const AVHWAccel ff_h264_vdpau_hwaccel; -extern const AVHWAccel ff_h264_videotoolbox_hwaccel; -extern const AVHWAccel ff_h264_vulkan_hwaccel; -extern const AVHWAccel ff_hevc_d3d11va_hwaccel; -extern const AVHWAccel ff_hevc_d3d11va2_hwaccel; -extern const AVHWAccel ff_hevc_dxva2_hwaccel; -extern const AVHWAccel ff_hevc_nvdec_hwaccel; -extern const AVHWAccel ff_hevc_vaapi_hwaccel; -extern const AVHWAccel ff_hevc_vdpau_hwaccel; -extern const AVHWAccel ff_hevc_videotoolbox_hwaccel; -extern const AVHWAccel ff_hevc_vulkan_hwaccel; -extern const AVHWAccel ff_mjpeg_nvdec_hwaccel; -extern const AVHWAccel ff_mjpeg_vaapi_hwaccel; -extern const AVHWAccel ff_mpeg1_nvdec_hwaccel; -extern const AVHWAccel ff_mpeg1_vdpau_hwaccel; -extern const AVHWAccel ff_mpeg1_videotoolbox_hwaccel; -extern const AVHWAccel ff_mpeg2_d3d11va_hwaccel; -extern const AVHWAccel ff_mpeg2_d3d11va2_hwaccel; -extern const AVHWAccel ff_mpeg2_nvdec_hwaccel; -extern const AVHWAccel ff_mpeg2_dxva2_hwaccel; -extern const AVHWAccel ff_mpeg2_vaapi_hwaccel; -extern const AVHWAccel ff_mpeg2_vdpau_hwaccel; -extern const AVHWAccel ff_mpeg2_videotoolbox_hwaccel; -extern const AVHWAccel ff_mpeg4_nvdec_hwaccel; -extern const AVHWAccel ff_mpeg4_vaapi_hwaccel; -extern const AVHWAccel ff_mpeg4_vdpau_hwaccel; -extern const AVHWAccel ff_mpeg4_videotoolbox_hwaccel; -extern const AVHWAccel ff_prores_videotoolbox_hwaccel; -extern const AVHWAccel ff_vc1_d3d11va_hwaccel; -extern const AVHWAccel ff_vc1_d3d11va2_hwaccel; -extern const AVHWAccel ff_vc1_dxva2_hwaccel; -extern const AVHWAccel ff_vc1_nvdec_hwaccel; -extern const AVHWAccel ff_vc1_vaapi_hwaccel; -extern const AVHWAccel ff_vc1_vdpau_hwaccel; -extern const AVHWAccel ff_vp8_nvdec_hwaccel; -extern const AVHWAccel ff_vp8_vaapi_hwaccel; -extern const AVHWAccel ff_vp9_d3d11va_hwaccel; -extern const AVHWAccel ff_vp9_d3d11va2_hwaccel; -extern const AVHWAccel ff_vp9_dxva2_hwaccel; -extern const AVHWAccel ff_vp9_nvdec_hwaccel; -extern const AVHWAccel ff_vp9_vaapi_hwaccel; -extern const AVHWAccel ff_vp9_vdpau_hwaccel; -extern const AVHWAccel ff_vp9_videotoolbox_hwaccel; -extern const AVHWAccel ff_wmv3_d3d11va_hwaccel; -extern const AVHWAccel ff_wmv3_d3d11va2_hwaccel; -extern const AVHWAccel ff_wmv3_dxva2_hwaccel; -extern const AVHWAccel ff_wmv3_nvdec_hwaccel; -extern const AVHWAccel ff_wmv3_vaapi_hwaccel; -extern const AVHWAccel ff_wmv3_vdpau_hwaccel; +extern const struct FFHWAccel ff_av1_d3d11va_hwaccel; +extern const struct FFHWAccel ff_av1_d3d11va2_hwaccel; +extern const struct FFHWAccel ff_av1_dxva2_hwaccel; +extern const struct FFHWAccel ff_av1_nvdec_hwaccel; +extern const struct FFHWAccel ff_av1_vaapi_hwaccel; +extern const struct FFHWAccel ff_av1_vdpau_hwaccel; +extern const struct FFHWAccel ff_av1_vulkan_hwaccel; +extern const struct FFHWAccel ff_h263_vaapi_hwaccel; +extern const struct FFHWAccel ff_h263_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_h264_d3d11va_hwaccel; +extern const struct FFHWAccel ff_h264_d3d11va2_hwaccel; +extern const struct FFHWAccel ff_h264_dxva2_hwaccel; +extern const struct FFHWAccel ff_h264_nvdec_hwaccel; +extern const struct FFHWAccel ff_h264_vaapi_hwaccel; +extern const struct FFHWAccel ff_h264_vdpau_hwaccel; +extern const struct FFHWAccel ff_h264_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_h264_vulkan_hwaccel; +extern const struct FFHWAccel ff_hevc_d3d11va_hwaccel; +extern const struct FFHWAccel ff_hevc_d3d11va2_hwaccel; +extern const struct FFHWAccel ff_hevc_dxva2_hwaccel; +extern const struct FFHWAccel ff_hevc_nvdec_hwaccel; +extern const struct FFHWAccel ff_hevc_vaapi_hwaccel; +extern const struct FFHWAccel ff_hevc_vdpau_hwaccel; +extern const struct FFHWAccel ff_hevc_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_hevc_vulkan_hwaccel; +extern const struct FFHWAccel ff_mjpeg_nvdec_hwaccel; +extern const struct FFHWAccel ff_mjpeg_vaapi_hwaccel; +extern const struct FFHWAccel ff_mpeg1_nvdec_hwaccel; +extern const struct FFHWAccel ff_mpeg1_vdpau_hwaccel; +extern const struct FFHWAccel ff_mpeg1_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_mpeg2_d3d11va_hwaccel; +extern const struct FFHWAccel ff_mpeg2_d3d11va2_hwaccel; +extern const struct FFHWAccel ff_mpeg2_dxva2_hwaccel; +extern const struct FFHWAccel ff_mpeg2_nvdec_hwaccel; +extern const struct FFHWAccel ff_mpeg2_vaapi_hwaccel; +extern const struct FFHWAccel ff_mpeg2_vdpau_hwaccel; +extern const struct FFHWAccel ff_mpeg2_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_mpeg4_nvdec_hwaccel; +extern const struct FFHWAccel ff_mpeg4_vaapi_hwaccel; +extern const struct FFHWAccel ff_mpeg4_vdpau_hwaccel; +extern const struct FFHWAccel ff_mpeg4_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_prores_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_vc1_d3d11va_hwaccel; +extern const struct FFHWAccel ff_vc1_d3d11va2_hwaccel; +extern const struct FFHWAccel ff_vc1_dxva2_hwaccel; +extern const struct FFHWAccel ff_vc1_nvdec_hwaccel; +extern const struct FFHWAccel ff_vc1_vaapi_hwaccel; +extern const struct FFHWAccel ff_vc1_vdpau_hwaccel; +extern const struct FFHWAccel ff_vp8_nvdec_hwaccel; +extern const struct FFHWAccel ff_vp8_vaapi_hwaccel; +extern const struct FFHWAccel ff_vp9_d3d11va_hwaccel; +extern const struct FFHWAccel ff_vp9_d3d11va2_hwaccel; +extern const struct FFHWAccel ff_vp9_dxva2_hwaccel; +extern const struct FFHWAccel ff_vp9_nvdec_hwaccel; +extern const struct FFHWAccel ff_vp9_vaapi_hwaccel; +extern const struct FFHWAccel ff_vp9_vdpau_hwaccel; +extern const struct FFHWAccel ff_vp9_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_wmv3_d3d11va_hwaccel; +extern const struct FFHWAccel ff_wmv3_d3d11va2_hwaccel; +extern const struct FFHWAccel ff_wmv3_dxva2_hwaccel; +extern const struct FFHWAccel ff_wmv3_nvdec_hwaccel; +extern const struct FFHWAccel ff_wmv3_vaapi_hwaccel; +extern const struct FFHWAccel ff_wmv3_vdpau_hwaccel; #endif /* AVCODEC_HWACCELS_H */ diff --git a/src/third_party/ffmpeg/libavcodec/hwconfig.h b/src/third_party/ffmpeg/libavcodec/hwconfig.h index e8c61861..e164722a 100644 --- a/src/third_party/ffmpeg/libavcodec/hwconfig.h +++ b/src/third_party/ffmpeg/libavcodec/hwconfig.h @@ -22,11 +22,6 @@ #include "avcodec.h" #include "hwaccels.h" - -#define HWACCEL_CAP_ASYNC_SAFE (1 << 0) -#define HWACCEL_CAP_THREAD_SAFE (1 << 1) - - typedef struct AVCodecHWConfigInternal { /** * This is the structure which will be returned to the user by @@ -37,7 +32,7 @@ typedef struct AVCodecHWConfigInternal { * If this configuration uses a hwaccel, a pointer to it. * If not, NULL. */ - const AVHWAccel *hwaccel; + const struct FFHWAccel *hwaccel; } AVCodecHWConfigInternal; void ff_hwaccel_uninit(AVCodecContext *avctx); diff --git a/src/third_party/ffmpeg/libavcodec/idctdsp.h b/src/third_party/ffmpeg/libavcodec/idctdsp.h index 72244633..c840a518 100644 --- a/src/third_party/ffmpeg/libavcodec/idctdsp.h +++ b/src/third_party/ffmpeg/libavcodec/idctdsp.h @@ -19,11 +19,12 @@ #ifndef AVCODEC_IDCTDSP_H #define AVCODEC_IDCTDSP_H +#include #include #include "config.h" -#include "avcodec.h" +struct AVCodecContext; enum idct_permutation_type { FF_IDCT_PERM_NONE, @@ -95,23 +96,23 @@ void ff_put_pixels_clamped_c(const int16_t *block, uint8_t *av_restrict pixels, void ff_add_pixels_clamped_c(const int16_t *block, uint8_t *av_restrict pixels, ptrdiff_t line_size); -void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx); +void ff_idctdsp_init(IDCTDSPContext *c, struct AVCodecContext *avctx); -void ff_idctdsp_init_aarch64(IDCTDSPContext *c, AVCodecContext *avctx, +void ff_idctdsp_init_aarch64(IDCTDSPContext *c, struct AVCodecContext *avctx, unsigned high_bit_depth); -void ff_idctdsp_init_alpha(IDCTDSPContext *c, AVCodecContext *avctx, +void ff_idctdsp_init_alpha(IDCTDSPContext *c, struct AVCodecContext *avctx, unsigned high_bit_depth); -void ff_idctdsp_init_arm(IDCTDSPContext *c, AVCodecContext *avctx, +void ff_idctdsp_init_arm(IDCTDSPContext *c, struct AVCodecContext *avctx, unsigned high_bit_depth); -void ff_idctdsp_init_ppc(IDCTDSPContext *c, AVCodecContext *avctx, +void ff_idctdsp_init_ppc(IDCTDSPContext *c, struct AVCodecContext *avctx, unsigned high_bit_depth); -void ff_idctdsp_init_riscv(IDCTDSPContext *c, AVCodecContext *avctx, +void ff_idctdsp_init_riscv(IDCTDSPContext *c, struct AVCodecContext *avctx, unsigned high_bit_depth); -void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx, +void ff_idctdsp_init_x86(IDCTDSPContext *c, struct AVCodecContext *avctx, unsigned high_bit_depth); -void ff_idctdsp_init_mips(IDCTDSPContext *c, AVCodecContext *avctx, +void ff_idctdsp_init_mips(IDCTDSPContext *c, struct AVCodecContext *avctx, unsigned high_bit_depth); -void ff_idctdsp_init_loongarch(IDCTDSPContext *c, AVCodecContext *avctx, +void ff_idctdsp_init_loongarch(IDCTDSPContext *c, struct AVCodecContext *avctx, unsigned high_bit_depth); #endif /* AVCODEC_IDCTDSP_H */ diff --git a/src/third_party/ffmpeg/libavcodec/iirfilter.c b/src/third_party/ffmpeg/libavcodec/iirfilter.c index 903d64e8..727a3704 100644 --- a/src/third_party/ffmpeg/libavcodec/iirfilter.c +++ b/src/third_party/ffmpeg/libavcodec/iirfilter.c @@ -26,8 +26,12 @@ #include +#include "config.h" + #include "libavutil/attributes.h" #include "libavutil/common.h" +#include "libavutil/log.h" +#include "libavutil/mem.h" #include "iirfilter.h" diff --git a/src/third_party/ffmpeg/libavcodec/imc.c b/src/third_party/ffmpeg/libavcodec/imc.c index 174332de..754ceff9 100644 --- a/src/third_party/ffmpeg/libavcodec/imc.c +++ b/src/third_party/ffmpeg/libavcodec/imc.c @@ -176,10 +176,10 @@ static av_cold void imc_init_static(void) for (int j = 0; j < 4; j++) { huffman_vlc[i][j].table = &vlc_tables[offset]; huffman_vlc[i][j].table_allocated = VLC_TABLES_SIZE - offset; - ff_init_vlc_from_lengths(&huffman_vlc[i][j], IMC_VLC_BITS, imc_huffman_sizes[i], + ff_vlc_init_from_lengths(&huffman_vlc[i][j], IMC_VLC_BITS, imc_huffman_sizes[i], imc_huffman_lens[i][j], 1, imc_huffman_syms[i][j], 1, 1, - 0, INIT_VLC_STATIC_OVERLONG, NULL); + 0, VLC_INIT_STATIC_OVERLONG, NULL); offset += huffman_vlc[i][j].table_size; } } @@ -1038,6 +1038,7 @@ const FFCodec ff_imc_decoder = { .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; #endif #if CONFIG_IAC_DECODER @@ -1054,5 +1055,6 @@ const FFCodec ff_iac_decoder = { .p.capabilities = AV_CODEC_CAP_DR1, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; #endif diff --git a/src/third_party/ffmpeg/libavcodec/imm4.c b/src/third_party/ffmpeg/libavcodec/imm4.c index b95ad869..d4011b33 100644 --- a/src/third_party/ffmpeg/libavcodec/imm4.c +++ b/src/third_party/ffmpeg/libavcodec/imm4.c @@ -453,8 +453,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, if (ret < 0) return ret; - av_frame_unref(s->prev_frame); - if ((ret = av_frame_ref(s->prev_frame, frame)) < 0) + if ((ret = av_frame_replace(s->prev_frame, frame)) < 0) return ret; } else { if (!s->prev_frame->data[0]) { @@ -474,18 +473,18 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, static av_cold void imm4_init_static_data(void) { - INIT_VLC_STATIC_FROM_LENGTHS(&cbplo_tab, CBPLO_VLC_BITS, FF_ARRAY_ELEMS(cbplo), + VLC_INIT_STATIC_FROM_LENGTHS(&cbplo_tab, CBPLO_VLC_BITS, FF_ARRAY_ELEMS(cbplo), &cbplo[0][1], 2, &cbplo[0][0], 2, 1, 0, 0, 1 << CBPLO_VLC_BITS); - INIT_VLC_SPARSE_STATIC(&cbphi_tab, CBPHI_VLC_BITS, FF_ARRAY_ELEMS(cbphi_bits), + VLC_INIT_SPARSE_STATIC(&cbphi_tab, CBPHI_VLC_BITS, FF_ARRAY_ELEMS(cbphi_bits), cbphi_bits, 1, 1, cbphi_codes, 1, 1, NULL, 0, 0, 64); - INIT_VLC_STATIC_FROM_LENGTHS(&blktype_tab, BLKTYPE_VLC_BITS, FF_ARRAY_ELEMS(blktype), + VLC_INIT_STATIC_FROM_LENGTHS(&blktype_tab, BLKTYPE_VLC_BITS, FF_ARRAY_ELEMS(blktype), &blktype[0][1], 2, &blktype[0][0], 2, 1, 0, 0, 1 << BLKTYPE_VLC_BITS); - INIT_VLC_STATIC_FROM_LENGTHS(&block_tab, BLOCK_VLC_BITS, FF_ARRAY_ELEMS(block_bits), + VLC_INIT_STATIC_FROM_LENGTHS(&block_tab, BLOCK_VLC_BITS, FF_ARRAY_ELEMS(block_bits), block_bits, 1, block_symbols, 2, 2, 0, 0, 1 << BLOCK_VLC_BITS); } diff --git a/src/third_party/ffmpeg/libavcodec/indeo2.c b/src/third_party/ffmpeg/libavcodec/indeo2.c index dd88ebf7..2f643206 100644 --- a/src/third_party/ffmpeg/libavcodec/indeo2.c +++ b/src/third_party/ffmpeg/libavcodec/indeo2.c @@ -226,9 +226,9 @@ static int ir2_decode_frame(AVCodecContext *avctx, AVFrame *picture, static av_cold void ir2_init_static(void) { - INIT_VLC_STATIC_FROM_LENGTHS(&ir2_vlc, CODE_VLC_BITS, IR2_CODES, + VLC_INIT_STATIC_FROM_LENGTHS(&ir2_vlc, CODE_VLC_BITS, IR2_CODES, &ir2_tab[0][1], 2, &ir2_tab[0][0], 2, 1, - 0, INIT_VLC_OUTPUT_LE, 1 << CODE_VLC_BITS); + 0, VLC_INIT_OUTPUT_LE, 1 << CODE_VLC_BITS); } static av_cold int ir2_decode_init(AVCodecContext *avctx) diff --git a/src/third_party/ffmpeg/libavcodec/internal.h b/src/third_party/ffmpeg/libavcodec/internal.h index 4dce9f6f..83e0bc3f 100644 --- a/src/third_party/ffmpeg/libavcodec/internal.h +++ b/src/third_party/ffmpeg/libavcodec/internal.h @@ -157,15 +157,6 @@ int ff_match_2uint16(const uint16_t (*tab)[2], int size, int a, int b); unsigned int ff_toupper4(unsigned int x); -void ff_color_frame(AVFrame *frame, const int color[4]); - -/** - * Maximum size in bytes of extradata. - * 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) - AV_INPUT_BUFFER_PADDING_SIZE) - /** * 2^(x) for integer x * @return correctly rounded float @@ -189,11 +180,6 @@ int avpriv_h264_has_num_reorder_frames(AVCodecContext *avctx); int avpriv_codec_get_cap_skip_frame_fill_param(const AVCodec *codec); -/** - * Add a CPB properties side data to an encoding context. - */ -AVCPBProperties *ff_add_cpb_side_data(AVCodecContext *avctx); - /** * Check AVFrame for S12M timecode side data and allocate and fill TC SEI message with timecode info * @@ -216,16 +202,4 @@ int ff_alloc_timecode_sei(const AVFrame *frame, AVRational rate, size_t prefix_l */ int64_t ff_guess_coded_bitrate(AVCodecContext *avctx); -/** - * Check if a value is in the list. If not, return the default value - * - * @param ctx Context for the log msg - * @param val_name Name of the checked value, for log msg - * @param array_valid_values Array of valid int, ended with INT_MAX - * @param default_value Value return if checked value is not in the array - * @return Value or default_value. - */ -int ff_int_from_list_or_default(void *ctx, const char * val_name, int val, - const int * array_valid_values, int default_value); - #endif /* AVCODEC_INTERNAL_H */ diff --git a/src/third_party/ffmpeg/libavcodec/interplayvideo.c b/src/third_party/ffmpeg/libavcodec/interplayvideo.c index 1f0414bb..9c13707f 100644 --- a/src/third_party/ffmpeg/libavcodec/interplayvideo.c +++ b/src/third_party/ffmpeg/libavcodec/interplayvideo.c @@ -1340,9 +1340,8 @@ FF_ENABLE_DEPRECATION_WARNINGS *got_frame = send_buffer; /* shuffle frames */ - av_frame_unref(s->second_last_frame); FFSWAP(AVFrame*, s->second_last_frame, s->last_frame); - if ((ret = av_frame_ref(s->last_frame, frame)) < 0) + if ((ret = av_frame_replace(s->last_frame, frame)) < 0) return ret; /* report that the buffer was completely consumed */ diff --git a/src/third_party/ffmpeg/libavcodec/intrax8.c b/src/third_party/ffmpeg/libavcodec/intrax8.c index c5c67272..0d90e370 100644 --- a/src/third_party/ffmpeg/libavcodec/intrax8.c +++ b/src/third_party/ffmpeg/libavcodec/intrax8.c @@ -56,8 +56,8 @@ static av_cold void x8_init_vlc(VLC *vlc, int nb_bits, int nb_codes, vlc->table = &vlc_buf[*offset]; vlc->table_allocated = VLC_BUFFER_SIZE - *offset; - ff_init_vlc_from_lengths(vlc, nb_bits, nb_codes, &table[0][1], 2, - &table[0][0], 2, 1, 0, INIT_VLC_STATIC_OVERLONG, NULL); + ff_vlc_init_from_lengths(vlc, nb_bits, nb_codes, &table[0][1], 2, + &table[0][0], 2, 1, 0, VLC_INIT_STATIC_OVERLONG, NULL); *offset += vlc->table_size; } diff --git a/src/third_party/ffmpeg/libavcodec/ituh263dec.c b/src/third_party/ffmpeg/libavcodec/ituh263dec.c index c7c0a549..80fd78dd 100644 --- a/src/third_party/ffmpeg/libavcodec/ituh263dec.c +++ b/src/third_party/ffmpeg/libavcodec/ituh263dec.c @@ -110,25 +110,25 @@ static VLC cbpc_b_vlc; static av_cold void h263_decode_init_vlc(void) { - INIT_VLC_STATIC(&ff_h263_intra_MCBPC_vlc, INTRA_MCBPC_VLC_BITS, 9, + VLC_INIT_STATIC(&ff_h263_intra_MCBPC_vlc, INTRA_MCBPC_VLC_BITS, 9, ff_h263_intra_MCBPC_bits, 1, 1, ff_h263_intra_MCBPC_code, 1, 1, 72); - INIT_VLC_STATIC(&ff_h263_inter_MCBPC_vlc, INTER_MCBPC_VLC_BITS, 28, + VLC_INIT_STATIC(&ff_h263_inter_MCBPC_vlc, INTER_MCBPC_VLC_BITS, 28, ff_h263_inter_MCBPC_bits, 1, 1, ff_h263_inter_MCBPC_code, 1, 1, 198); - INIT_VLC_STATIC(&ff_h263_cbpy_vlc, CBPY_VLC_BITS, 16, + VLC_INIT_STATIC(&ff_h263_cbpy_vlc, CBPY_VLC_BITS, 16, &ff_h263_cbpy_tab[0][1], 2, 1, &ff_h263_cbpy_tab[0][0], 2, 1, 64); - INIT_VLC_STATIC(&ff_h263_mv_vlc, H263_MV_VLC_BITS, 33, + VLC_INIT_STATIC(&ff_h263_mv_vlc, H263_MV_VLC_BITS, 33, &ff_mvtab[0][1], 2, 1, &ff_mvtab[0][0], 2, 1, 538); ff_h263_init_rl_inter(); - INIT_VLC_RL(ff_h263_rl_inter, 554); + VLC_INIT_RL(ff_h263_rl_inter, 554); INIT_FIRST_VLC_RL(ff_rl_intra_aic, 554); - INIT_VLC_STATIC(&h263_mbtype_b_vlc, H263_MBTYPE_B_VLC_BITS, 15, + VLC_INIT_STATIC(&h263_mbtype_b_vlc, H263_MBTYPE_B_VLC_BITS, 15, &ff_h263_mbtype_b_tab[0][1], 2, 1, &ff_h263_mbtype_b_tab[0][0], 2, 1, 80); - INIT_VLC_STATIC(&cbpc_b_vlc, CBPC_B_VLC_BITS, 4, + VLC_INIT_STATIC(&cbpc_b_vlc, CBPC_B_VLC_BITS, 4, &ff_cbpc_b_tab[0][1], 2, 1, &ff_cbpc_b_tab[0][0], 2, 1, 8); } diff --git a/src/third_party/ffmpeg/libavcodec/ivi.c b/src/third_party/ffmpeg/libavcodec/ivi.c index 43f3cb1d..60769664 100644 --- a/src/third_party/ffmpeg/libavcodec/ivi.c +++ b/src/third_party/ffmpeg/libavcodec/ivi.c @@ -154,8 +154,8 @@ static int ivi_create_huff_from_desc(const IVIHuffDesc *cb, VLC *vlc, int flag) }//for i /* number of codewords = pos */ - return init_vlc(vlc, IVI_VLC_BITS, pos, bits, 1, 1, codewords, 2, 2, - (flag ? INIT_VLC_USE_NEW_STATIC : 0) | INIT_VLC_OUTPUT_LE); + return vlc_init(vlc, IVI_VLC_BITS, pos, bits, 1, 1, codewords, 2, 2, + (flag ? VLC_INIT_USE_STATIC : 0) | VLC_INIT_OUTPUT_LE); } static av_cold void ivi_init_static_vlc(void) @@ -237,7 +237,7 @@ int ff_ivi_dec_huff_desc(GetBitContext *gb, int desc_coded, int which_tab, ivi_huff_desc_copy(&huff_tab->cust_desc, &new_huff); if (huff_tab->cust_tab.table) - ff_free_vlc(&huff_tab->cust_tab); + ff_vlc_free(&huff_tab->cust_tab); result = ivi_create_huff_from_desc(&huff_tab->cust_desc, &huff_tab->cust_tab, 0); if (result) { @@ -277,7 +277,7 @@ static av_cold void ivi_free_buffers(IVIPlaneDesc *planes) av_freep(&band->bufs[3]); if (band->blk_vlc.cust_tab.table) - ff_free_vlc(&band->blk_vlc.cust_tab); + ff_vlc_free(&band->blk_vlc.cust_tab); for (t = 0; t < band->num_tiles; t++) av_freep(&band->tiles[t].mbs); av_freep(&band->tiles); @@ -1215,10 +1215,10 @@ av_cold int ff_ivi_decode_close(AVCodecContext *avctx) ivi_free_buffers(&ctx->planes[0]); if (ctx->mb_vlc.cust_tab.table) - ff_free_vlc(&ctx->mb_vlc.cust_tab); + ff_vlc_free(&ctx->mb_vlc.cust_tab); if (ctx->blk_vlc.cust_tab.table) - ff_free_vlc(&ctx->blk_vlc.cust_tab); + ff_vlc_free(&ctx->blk_vlc.cust_tab); av_frame_free(&ctx->p_frame); diff --git a/src/third_party/ffmpeg/libavcodec/jfdctfst.c b/src/third_party/ffmpeg/libavcodec/jfdctfst.c index 805e0580..946b12f3 100644 --- a/src/third_party/ffmpeg/libavcodec/jfdctfst.c +++ b/src/third_party/ffmpeg/libavcodec/jfdctfst.c @@ -68,7 +68,7 @@ #include #include "libavutil/attributes.h" -#include "dct.h" +#include "fdctdsp.h" #define DCTSIZE 8 #define GLOBAL(x) x diff --git a/src/third_party/ffmpeg/libavcodec/jfdctint_template.c b/src/third_party/ffmpeg/libavcodec/jfdctint_template.c index 67fb77b5..ca17300c 100644 --- a/src/third_party/ffmpeg/libavcodec/jfdctint_template.c +++ b/src/third_party/ffmpeg/libavcodec/jfdctint_template.c @@ -60,7 +60,7 @@ */ #include "libavutil/common.h" -#include "dct.h" +#include "fdctdsp.h" #include "bit_depth_template.c" diff --git a/src/third_party/ffmpeg/libavcodec/jni.c b/src/third_party/ffmpeg/libavcodec/jni.c index 85dcf2ab..ae6490de 100644 --- a/src/third_party/ffmpeg/libavcodec/jni.c +++ b/src/third_party/ffmpeg/libavcodec/jni.c @@ -34,8 +34,8 @@ #include "libavutil/log.h" #include "ffjni.h" -void *java_vm; -pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; +static void *java_vm; +static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; int av_jni_set_java_vm(void *vm, void *log_ctx) { diff --git a/src/third_party/ffmpeg/libavcodec/jpeg2000dec.c b/src/third_party/ffmpeg/libavcodec/jpeg2000dec.c index d6f2a593..eda959e5 100644 --- a/src/third_party/ffmpeg/libavcodec/jpeg2000dec.c +++ b/src/third_party/ffmpeg/libavcodec/jpeg2000dec.c @@ -308,12 +308,12 @@ static int get_siz(Jpeg2000DecoderContext *s) dimy = FFMAX(dimy, ff_jpeg2000_ceildiv(o_dimy, s->cdy[i])); } - ret = ff_set_dimensions(s->avctx, dimx, dimy); + ret = ff_set_dimensions(s->avctx, dimx << s->avctx->lowres, dimy << s->avctx->lowres); if (ret < 0) return ret; - if (s->avctx->profile == FF_PROFILE_JPEG2000_DCINEMA_2K || - s->avctx->profile == FF_PROFILE_JPEG2000_DCINEMA_4K) { + if (s->avctx->profile == AV_PROFILE_JPEG2000_DCINEMA_2K || + s->avctx->profile == AV_PROFILE_JPEG2000_DCINEMA_4K) { possible_fmts = xyz_pix_fmts; possible_fmts_nb = FF_ARRAY_ELEMS(xyz_pix_fmts); } else { @@ -2426,6 +2426,14 @@ static av_cold int jpeg2000_decode_init(AVCodecContext *avctx) { Jpeg2000DecoderContext *s = avctx->priv_data; + if (avctx->lowres) + av_log(avctx, AV_LOG_WARNING, "lowres is overriden by reduction_factor but set anyway\n"); + if (!s->reduction_factor && avctx->lowres < JPEG2000_MAX_RESLEVELS) { + s->reduction_factor = avctx->lowres; + } + if (avctx->lowres != s->reduction_factor && avctx->lowres) + return AVERROR(EINVAL); + ff_jpeg2000dsp_init(&s->dsp); ff_jpeg2000_init_tier1_luts(); diff --git a/src/third_party/ffmpeg/libavcodec/jpeg2000htdec.c b/src/third_party/ffmpeg/libavcodec/jpeg2000htdec.c index 4c4e5471..2c4cea5d 100644 --- a/src/third_party/ffmpeg/libavcodec/jpeg2000htdec.c +++ b/src/third_party/ffmpeg/libavcodec/jpeg2000htdec.c @@ -144,36 +144,20 @@ static void jpeg2000_init_mel_decoder(MelDecoderState *mel_state) static int jpeg2000_bitbuf_refill_backwards(StateVars *buffer, const uint8_t *array) { uint64_t tmp = 0; - int32_t position = buffer->pos; + int32_t position = buffer->pos - 4; uint32_t new_bits = 32; if (buffer->bits_left >= 32) return 0; // enough data, no need to pull in more bits - /** - * We are reading bytes from end to start and need to handle being close to - * the end. Subtracting by 4 means we will read some of the bytes of the MEL - * byte stream since the MEL byte stream ends at the start of the VLC byte - * stream. This is okay as they are masked away since we check for cases - * where that occurs (when the position is less than 4). - */ - position -= 4; - - tmp = AV_RB32(&array[position + 1]); - - if (buffer->pos < 4){ - /* mask un-needed bits if we are close to input end */ - uint64_t mask = (1ull << (buffer->pos + 1) * 8) - 1; - tmp &= mask; - } - /** * Unstuff bits. Load a temporary byte, which precedes the position we * currently at, to ensure that we can also un-stuff if the stuffed bit is * the bottom most bits. */ - tmp <<= 8; - tmp |= array[buffer->pos + 1]; + + for(int i = FFMAX(0, position + 1); i <= buffer->pos + 1; i++) + tmp = 256*tmp + array[i]; if ((tmp & 0x7FFF000000) > 0x7F8F000000) { tmp &= 0x7FFFFFFFFF; @@ -1174,8 +1158,8 @@ ff_jpeg2000_decode_htj2k(const Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c int ret; /* Temporary buffers */ - int32_t *sample_buf; - uint8_t *block_states; + int32_t *sample_buf = NULL; + uint8_t *block_states = NULL; int32_t n, val; // Post-processing diff --git a/src/third_party/ffmpeg/libavcodec/jpegls.c b/src/third_party/ffmpeg/libavcodec/jpegls.c index cc598f3c..7b4bc30e 100644 --- a/src/third_party/ffmpeg/libavcodec/jpegls.c +++ b/src/third_party/ffmpeg/libavcodec/jpegls.c @@ -28,6 +28,7 @@ #include #include "libavutil/internal.h" #include "libavutil/intmath.h" +#include "libavutil/log.h" #include "jpegls.h" void ff_jpegls_init_state(JLSState *state) diff --git a/src/third_party/ffmpeg/libavcodec/jpegxl.h b/src/third_party/ffmpeg/libavcodec/jpegxl.h new file mode 100644 index 00000000..66a6be35 --- /dev/null +++ b/src/third_party/ffmpeg/libavcodec/jpegxl.h @@ -0,0 +1,94 @@ +/* + * JPEG XL Common Header Definitions + * Copyright (c) 2023 Leo Izen + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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_JPEGXL_H +#define AVCODEC_JPEGXL_H + +#define FF_JPEGXL_CODESTREAM_SIGNATURE_LE 0x0aff +#define FF_JPEGXL_CONTAINER_SIGNATURE_LE 0x204c584a0c000000 +#define FF_JPEGXL_CODESTREAM_SIGNATURE_BE 0xff0a +#define FF_JPEGXL_CONTAINER_SIGNATURE_BE 0x0000000c4a584c20 + +typedef enum FFJXLFrameEncoding { + JPEGXL_ENC_VARDCT, + JPEGXL_ENC_MODULAR +} FFJXLFrameEncoding; + +typedef enum FFJXLFrameType { + JPEGXL_FRAME_REGULAR, + JPEGXL_FRAME_LF, + JPEGXL_FRAME_REFERENCE_ONLY, + JPEGXL_FRAME_SKIP_PROGRESSIVE +} FFJXLFrameType; + +typedef enum FFJXLBlendMode { + JPEGXL_BM_REPLACE, + JPEGXL_BM_ADD, + JPEGXL_BM_BLEND, + JPEGXL_BM_MULADD, + JPEGXL_BM_MUL +} FFJXLBlendMode; + +typedef enum FFJXLExtraChannelType { + JPEGXL_CT_ALPHA = 0, + JPEGXL_CT_DEPTH, + JPEGXL_CT_SPOT_COLOR, + JPEGXL_CT_SELECTION_MASK, + JPEGXL_CT_BLACK, + JPEGXL_CT_CFA, + JPEGXL_CT_THERMAL, + JPEGXL_CT_NON_OPTIONAL = 15, + JPEGXL_CT_OPTIONAL +} FFJXLExtraChannelType; + +typedef enum FFJXLColorSpace { + JPEGXL_CS_RGB = 0, + JPEGXL_CS_GRAY, + JPEGXL_CS_XYB, + JPEGXL_CS_UNKNOWN +} FFJXLColorSpace; + +typedef enum FFJXLWhitePoint { + JPEGXL_WP_D65 = 1, + JPEGXL_WP_CUSTOM, + JPEGXL_WP_E = 10, + JPEGXL_WP_DCI = 11 +} FFJXLWhitePoint; + +typedef enum FFJXLPrimaries { + JPEGXL_PR_SRGB = 1, + JPEGXL_PR_CUSTOM, + JPEGXL_PR_2100 = 9, + JPEGXL_PR_P3 = 11, +} FFJXLPrimaries; + +typedef enum FFJXLTransferCharacteristic { + JPEGXL_TR_BT709 = 1, + JPEGXL_TR_UNKNOWN, + JPEGXL_TR_LINEAR = 8, + JPEGXL_TR_SRGB = 13, + JPEGXL_TR_PQ = 16, + JPEGXL_TR_DCI, + JPEGXL_TR_HLG, + JPEGXL_TR_GAMMA = 1 << 24, +} FFJXLTransferCharacteristic; + +#endif /* AVCODEC_JPEGXL_H */ diff --git a/src/third_party/ffmpeg/libavcodec/jpegxl_parse.c b/src/third_party/ffmpeg/libavcodec/jpegxl_parse.c new file mode 100644 index 00000000..eb28e808 --- /dev/null +++ b/src/third_party/ffmpeg/libavcodec/jpegxl_parse.c @@ -0,0 +1,520 @@ +/* + * JPEG XL Header Parser + * Copyright (c) 2023 Leo Izen + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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 + +#include "bytestream.h" +#define UNCHECKED_BITSTREAM_READER 0 +#define BITSTREAM_READER_LE +#include "get_bits.h" +#include "jpegxl.h" +#include "jpegxl_parse.h" + +/* read a U32(c_i + u(u_i)) */ +static av_always_inline uint32_t jxl_u32(GetBitContext *gb, + uint32_t c0, uint32_t c1, uint32_t c2, uint32_t c3, + uint32_t u0, uint32_t u1, uint32_t u2, uint32_t u3) +{ + const uint32_t constants[4] = {c0, c1, c2, c3}; + const uint32_t ubits [4] = {u0, u1, u2, u3}; + uint32_t ret, choice = get_bits(gb, 2); + + ret = constants[choice]; + if (ubits[choice]) + ret += get_bits_long(gb, ubits[choice]); + + return ret; +} + +static av_always_inline uint32_t jxl_enum(GetBitContext *gb) +{ + return jxl_u32(gb, 0, 1, 2, 18, 0, 0, 4, 6); +} + +/* read a U64() */ +static uint64_t jxl_u64(GetBitContext *gb) +{ + uint64_t shift = 12, ret; + + switch (get_bits(gb, 2)) { + case 1: + ret = 1 + get_bits(gb, 4); + break; + case 2: + ret = 17 + get_bits(gb, 8); + break; + case 3: + ret = get_bits(gb, 12); + while (get_bits1(gb)) { + if (shift < 60) { + ret |= (uint64_t)get_bits(gb, 8) << shift; + shift += 8; + } else { + ret |= (uint64_t)get_bits(gb, 4) << shift; + break; + } + } + break; + default: + ret = 0; + } + + return ret; +} + +static uint32_t jpegxl_width_from_ratio(uint32_t height, int ratio) +{ + uint64_t height64 = height; /* avoid integer overflow */ + switch (ratio) { + case 1: + return height; + case 2: + return (uint32_t)((height64 * 12) / 10); + case 3: + return (uint32_t)((height64 * 4) / 3); + case 4: + return (uint32_t)((height64 * 3) / 2); + case 5: + return (uint32_t)((height64 * 16) / 9); + case 6: + return (uint32_t)((height64 * 5) / 4); + case 7: + return (uint32_t)(height64 * 2); + default: + break; + } + + return 0; /* manual width */ +} + +/** + * validate a Jpeg XL Size Header + * @return >= 0 upon valid size, < 0 upon invalid size found + */ +static int jpegxl_read_size_header(GetBitContext *gb, FFJXLMetadata *meta, int validate) +{ + uint32_t width, height; + + if (get_bits1(gb)) { + /* small size header */ + height = (get_bits(gb, 5) + 1) << 3; + width = jpegxl_width_from_ratio(height, get_bits(gb, 3)); + if (!width) + width = (get_bits(gb, 5) + 1) << 3; + } else { + /* large size header */ + height = 1 + jxl_u32(gb, 0, 0, 0, 0, 9, 13, 18, 30); + width = jpegxl_width_from_ratio(height, get_bits(gb, 3)); + if (!width) + width = 1 + jxl_u32(gb, 0, 0, 0, 0, 9, 13, 18, 30); + } + if (validate && (width > (1 << 18) || height > (1 << 18) + || (width >> 4) * (height >> 4) > (1 << 20))) + return AVERROR_INVALIDDATA; + + if (meta) { + meta->width = meta->coded_width = width; + meta->height = meta->coded_height = height; + } + + return 0; +} + +/** + * validate a Jpeg XL Preview Header + * @return >= 0 upon valid size, < 0 upon invalid size found + */ +static int jpegxl_read_preview_header(GetBitContext *gb, int validate) +{ + uint32_t width, height; + + if (get_bits1(gb)) { + /* coded height and width divided by eight */ + height = jxl_u32(gb, 16, 32, 1, 33, 0, 0, 5, 9) << 3; + width = jpegxl_width_from_ratio(height, get_bits(gb, 3)); + if (!width) + width = jxl_u32(gb, 16, 32, 1, 33, 0, 0, 5, 9) << 3; + } else { + /* full height and width coded */ + height = jxl_u32(gb, 1, 65, 321, 1345, 6, 8, 10, 12); + width = jpegxl_width_from_ratio(height, get_bits(gb, 3)); + if (!width) + width = jxl_u32(gb, 1, 65, 321, 1345, 6, 8, 10, 12); + } + if (validate && (width > 4096 || height > 4096)) + return AVERROR_INVALIDDATA; + + return 0; +} + +/** + * get a Jpeg XL BitDepth Header. These cannot be invalid. + */ +static void jpegxl_get_bit_depth(GetBitContext *gb, FFJXLMetadata *meta) +{ + int bit_depth; + if (get_bits1(gb)) { + /* float samples */ + bit_depth = jxl_u32(gb, 32, 16, 24, 1, 0, 0, 0, 6); /* mantissa */ + skip_bits_long(gb, 4); /* exponent */ + } else { + /* integer samples */ + bit_depth = jxl_u32(gb, 8, 10, 12, 1, 0, 0, 0, 6); + } + if (meta) + meta->bit_depth = bit_depth; +} + +/** + * validate a Jpeg XL Extra Channel Info bundle + * @return >= 0 upon valid, < 0 upon invalid + */ +static int jpegxl_read_extra_channel_info(GetBitContext *gb, FFJXLMetadata *meta, int validate) +{ + int default_alpha = get_bits1(gb); + uint32_t type, name_len = 0; + + if (!default_alpha) { + type = jxl_enum(gb); + if (validate && type > 63) + return AVERROR_INVALIDDATA; /* enum types cannot be 64+ */ + if (validate && validate < 10 && type == JPEGXL_CT_BLACK) + return AVERROR_INVALIDDATA; + jpegxl_get_bit_depth(gb, NULL); + jxl_u32(gb, 0, 3, 4, 1, 0, 0, 0, 3); /* dim-shift */ + /* max of name_len is 1071 = 48 + 2^10 - 1 */ + name_len = 8 * jxl_u32(gb, 0, 0, 16, 48, 0, 4, 5, 10); + } else { + type = JPEGXL_CT_ALPHA; + } + + if (get_bits_left(gb) < name_len) + return AVERROR_BUFFER_TOO_SMALL; + + /* skip over the name */ + skip_bits_long(gb, name_len); + + if (!default_alpha && type == JPEGXL_CT_ALPHA) + skip_bits1(gb); + + if (type == JPEGXL_CT_SPOT_COLOR) + skip_bits_long(gb, 16 * 4); + + if (type == JPEGXL_CT_CFA) + jxl_u32(gb, 1, 0, 3, 19, 0, 2, 4, 8); + + if (meta && type == JPEGXL_CT_ALPHA) + meta->have_alpha = 1; + + return 0; +} + +static int jpegxl_skip_extensions(GetBitContext *gb) +{ + uint64_t extensions = jxl_u64(gb), extensions_len = 0; + + if (get_bits_left(gb) <= 0) + return AVERROR_BUFFER_TOO_SMALL; + + if (!extensions) + return 0; + + for (int i = 0; i < 64; i++) { + if (extensions & (UINT64_C(1) << i)) + extensions_len += jxl_u64(gb); + if (get_bits_left(gb) <= 0) + return AVERROR_BUFFER_TOO_SMALL; + } + + if (extensions_len > INT_MAX || get_bits_left(gb) <= extensions_len) + return AVERROR_BUFFER_TOO_SMALL; + + skip_bits_long(gb, extensions_len); + + return 0; +} + +int ff_jpegxl_parse_codestream_header(const uint8_t *buf, int buflen, FFJXLMetadata *meta, int validate) +{ + GetBitContext gbi, *gb = &gbi; + + int all_default, extra_fields = 0; + int xyb_encoded = 1, have_icc_profile = 0; + int animation_offset = 0, have_timecodes = 0; + + FFJXLPrimaries primaries = JPEGXL_PR_SRGB; + FFJXLTransferCharacteristic trc = JPEGXL_TR_SRGB + (1U << 24); + FFJXLWhitePoint white_point = JPEGXL_WP_D65; + FFJXLColorSpace color_space = JPEGXL_CS_RGB; + + AVRational tb; + uint32_t num_extra_channels = 0; + int ret; + + ret = init_get_bits8(gb, buf, buflen); + if (ret < 0) + return ret; + + if (get_bits(gb, 16) != FF_JPEGXL_CODESTREAM_SIGNATURE_LE && validate) + return AVERROR_INVALIDDATA; + + ret = jpegxl_read_size_header(gb, meta, validate); + if (ret < 0) + return ret; + + all_default = get_bits1(gb); + if (!all_default) + extra_fields = get_bits1(gb); + + if (extra_fields) { + int orientation = get_bits(gb, 3); + if (orientation > 3 && meta) + FFSWAP(uint32_t, meta->width, meta->height); + + /* + * intrinstic size + * any size header here is valid, but as it + * is variable length we have to read it + */ + if (get_bits1(gb)) + jpegxl_read_size_header(gb, NULL, 0); + + /* preview header */ + if (get_bits1(gb)) { + ret = jpegxl_read_preview_header(gb, 0); + if (ret < 0) + return ret; + } + + /* animation header */ + if (get_bits1(gb)) { + animation_offset = get_bits_count(gb); + tb.den = jxl_u32(gb, 100, 1000, 1, 1, 0, 0, 10, 30); + tb.num = jxl_u32(gb, 1, 1001, 1, 1, 0, 0, 8, 10); + jxl_u32(gb, 0, 0, 0, 0, 0, 3, 16, 32); + have_timecodes = get_bits1(gb); + } + } + + if (animation_offset && meta) { + meta->animation_offset = animation_offset; + meta->timebase = tb; + meta->have_timecodes = have_timecodes; + } + + if (get_bits_left(gb) <= 0) + return AVERROR_BUFFER_TOO_SMALL; + + if (!all_default) { + jpegxl_get_bit_depth(gb, meta); + + /* modular_16bit_buffers must equal 1 */ + if (!get_bits1(gb) && validate && validate < 10) + return AVERROR_INVALIDDATA; + + num_extra_channels = jxl_u32(gb, 0, 1, 2, 1, 0, 0, 4, 12); + if (num_extra_channels > 4 && validate && validate < 10) + return AVERROR_INVALIDDATA; + for (uint32_t i = 0; i < num_extra_channels; i++) { + ret = jpegxl_read_extra_channel_info(gb, meta, validate); + if (ret < 0) + return ret; + if (get_bits_left(gb) <= 0) + return AVERROR_BUFFER_TOO_SMALL; + } + + xyb_encoded = get_bits1(gb); + + /* color encoding bundle */ + if (!get_bits1(gb)) { + have_icc_profile = get_bits1(gb); + color_space = jxl_enum(gb); + if (color_space > 63 && validate) + return AVERROR_INVALIDDATA; + if (!have_icc_profile) { + if (color_space != JPEGXL_CS_XYB) { + white_point = jxl_enum(gb); + if (white_point > 63 && validate) + return AVERROR_INVALIDDATA; + if (white_point == JPEGXL_WP_CUSTOM) { + /* ux and uy values */ + jxl_u32(gb, 0, 524288, 1048576, 2097152, 19, 19, 20, 21); + jxl_u32(gb, 0, 524288, 1048576, 2097152, 19, 19, 20, 21); + } + if (color_space != JPEGXL_CS_GRAY) { + /* primaries */ + primaries = jxl_enum(gb); + if (primaries > 63 && validate) + return AVERROR_INVALIDDATA; + if (primaries == JPEGXL_PR_CUSTOM) { + /* ux/uy values for r,g,b */ + for (int i = 0; i < 6; i++) { + jxl_u32(gb, 0, 524288, 1048576, 2097152, 19, 19, 20, 21); + if (get_bits_left(gb) <= 0) + return AVERROR_BUFFER_TOO_SMALL; + } + } + } + } + + /* transfer characteristics */ + if (get_bits1(gb)) { + /* gamma */ + trc = get_bits(gb, 24); + } else { + /* transfer function */ + trc = jxl_enum(gb); + if (trc > 63 && validate) + return AVERROR_INVALIDDATA; + trc += (1U << 24); + } + + /* rendering intent */ + if (jxl_enum(gb) > 63 && validate) + return AVERROR_INVALIDDATA; + } + } + + /* tone mapping bundle */ + if (extra_fields && !get_bits1(gb)) + skip_bits_long(gb, 16 + 16 + 1 + 16); + + ret = jpegxl_skip_extensions(gb); + if (ret < 0) + return ret; + } + + if (meta) { + meta->xyb_encoded = xyb_encoded; + meta->have_icc_profile = have_icc_profile; + meta->csp = color_space; + meta->primaries = primaries; + meta->wp = white_point; + meta->trc = trc; + if (!meta->bit_depth) + meta->bit_depth = 8; + meta->num_extra_channels = num_extra_channels; + } + + /* default transform */ + if (!get_bits1(gb)) { + /* opsin inverse matrix */ + if (xyb_encoded && !get_bits1(gb)) + skip_bits_long(gb, 16 * 16); + /* cw_mask and default weights */ + if (get_bits1(gb)) + skip_bits_long(gb, 16 * 15); + if (get_bits1(gb)) + skip_bits_long(gb, 16 * 55); + if (get_bits1(gb)) + skip_bits_long(gb, 16 * 210); + } + + if (!have_icc_profile) { + int bits_remaining = 7 - ((get_bits_count(gb) - 1) & 0x7); + if (bits_remaining && get_bits(gb, bits_remaining)) + return AVERROR_INVALIDDATA; + } + + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + + return get_bits_count(gb); +} + +/* + * copies as much of the codestream into the buffer as possible + * pass a shorter buflen to request less + * returns the number of bytes consumed from input, may be greater than input_len + * if the input doesn't end on an ISOBMFF-box boundary + */ +int ff_jpegxl_collect_codestream_header(const uint8_t *input_buffer, int input_len, + uint8_t *buffer, int buflen, int *copied) +{ + GetByteContext gb; + int pos = 0, last_box = 0; + bytestream2_init(&gb, input_buffer, input_len); + + while (1) { + uint64_t size; + uint32_t tag; + int head_size = 8; + + if (bytestream2_get_bytes_left(&gb) < 8) + return AVERROR_BUFFER_TOO_SMALL; + + size = bytestream2_get_be32(&gb); + if (size == 1) { + if (bytestream2_get_bytes_left(&gb) < 12) + return AVERROR_BUFFER_TOO_SMALL; + size = bytestream2_get_be64(&gb); + head_size = 16; + } + /* invalid ISOBMFF size */ + if (size && size <= head_size) + return AVERROR_INVALIDDATA; + if (size) + size -= head_size; + + tag = bytestream2_get_le32(&gb); + + if (tag == MKTAG('j','x','l','p')) { + uint32_t idx; + if (bytestream2_get_bytes_left(&gb) < 4) + return AVERROR_BUFFER_TOO_SMALL; + idx = bytestream2_get_be32(&gb); + if (idx >= UINT32_C(0x80000000)) + last_box = 1; + if (size) { + if (size <= 4) + return AVERROR_INVALIDDATA; + size -= 4; + } + } + if (tag == MKTAG('j','x','l','c')) + last_box = 1; + + /* + * size = 0 means "until EOF". this is legal but uncommon + * here we just set it to the remaining size of the probe buffer + */ + if (!size) + size = bytestream2_get_bytes_left(&gb); + else + pos += size + head_size; + + if (tag == MKTAG('j','x','l','c') || tag == MKTAG('j','x','l','p')) { + if (size > buflen - *copied) + size = buflen - *copied; + /* + * arbitrary chunking of the payload makes this memcpy hard to avoid + * in practice this will only be performed one or two times at most + */ + *copied += bytestream2_get_buffer(&gb, buffer + *copied, size); + } else { + bytestream2_skip(&gb, size); + } + if (last_box || bytestream2_get_bytes_left(&gb) <= 0 || *copied >= buflen) + break; + } + + return pos; +} diff --git a/src/third_party/ffmpeg/libavcodec/jpegxl_parse.h b/src/third_party/ffmpeg/libavcodec/jpegxl_parse.h new file mode 100644 index 00000000..0602f4d4 --- /dev/null +++ b/src/third_party/ffmpeg/libavcodec/jpegxl_parse.h @@ -0,0 +1,72 @@ +/* + * JPEG XL Header Parser + * Copyright (c) 2023 Leo Izen + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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_JPEGXL_PARSE_H +#define AVCODEC_JPEGXL_PARSE_H + +#include + +#include "libavutil/rational.h" + +#include "jpegxl.h" + +typedef struct FFJXLMetadata { + uint32_t width; + uint32_t height; + uint32_t coded_width; + uint32_t coded_height; + int bit_depth; + int have_alpha; + /* + * offset, in bits, of the animation header + * zero if not animated + */ + int animation_offset; + AVRational timebase; + FFJXLColorSpace csp; + FFJXLWhitePoint wp; + FFJXLPrimaries primaries; + FFJXLTransferCharacteristic trc; + + /* used by the parser */ + int xyb_encoded; + int have_icc_profile; + int have_timecodes; + uint32_t num_extra_channels; +} FFJXLMetadata; + +/* + * copies as much of the codestream into the buffer as possible + * pass a shorter buflen to request less + * returns the number of bytes consumed from input, may be greater than input_len + * if the input doesn't end on an ISOBMFF-box boundary + */ +int ff_jpegxl_collect_codestream_header(const uint8_t *input_buffer, int input_len, + uint8_t *buffer, int buflen, int *copied); + +/* + * Parse the codestream header with the provided buffer. Returns negative upon failure, + * or the number of bits consumed upon success. + * The FFJXLMetadata parameter may be NULL, in which case it's ignored. + */ +int ff_jpegxl_parse_codestream_header(const uint8_t *buf, int buflen, FFJXLMetadata *meta, int validate); + +#endif /* AVCODEC_JPEGXL_PARSE_H */ diff --git a/src/third_party/ffmpeg/libavcodec/jpegxl_parser.c b/src/third_party/ffmpeg/libavcodec/jpegxl_parser.c new file mode 100644 index 00000000..d25a1b6e --- /dev/null +++ b/src/third_party/ffmpeg/libavcodec/jpegxl_parser.c @@ -0,0 +1,1472 @@ +/** + * JPEG XL parser + * Copyright (c) 2023 Leo Izen + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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 +#include +#include + +#include "libavutil/attributes.h" +#include "libavutil/error.h" +#include "libavutil/intmath.h" +#include "libavutil/macros.h" +#include "libavutil/mem.h" +#include "libavutil/pixfmt.h" + +#include "bytestream.h" +#include "codec_id.h" +#define UNCHECKED_BITSTREAM_READER 0 +#define BITSTREAM_READER_LE +#include "get_bits.h" +#include "jpegxl.h" +#include "jpegxl_parse.h" +#include "parser.h" +#include "vlc.h" + +#define JXL_FLAG_NOISE 1 +#define JXL_FLAG_PATCHES 2 +#define JXL_FLAG_SPLINES 16 +#define JXL_FLAG_USE_LF_FRAME 32 +#define JXL_FLAG_SKIP_ADAPTIVE_LF_SMOOTH 128 + +#define clog1p(x) (ff_log2(x) + !!(x)) +#define unpack_signed(x) (((x) & 1 ? -(x)-1 : (x))/2) +#define div_ceil(x, y) (((x) - 1) / (y) + 1) +#define vlm(a,b) {.sym = (a), .len = (b)} + +typedef struct JXLHybridUintConf { + int split_exponent; + uint32_t msb_in_token; + uint32_t lsb_in_token; +} JXLHybridUintConf; + +typedef struct JXLSymbolDistribution { + JXLHybridUintConf config; + int log_bucket_size; + /* this is the actual size of the alphabet */ + int alphabet_size; + /* ceil(log(alphabet_size)) */ + int log_alphabet_size; + + /* for prefix code distributions */ + VLC vlc; + /* in case bits == 0 */ + uint32_t default_symbol; + + /* + * each (1 << log_alphabet_size) length + * with log_alphabet_size <= 8 + */ + /* frequencies associated with this Distribution */ + uint32_t freq[258]; + /* cutoffs for using the symbol table */ + uint16_t cutoffs[258]; + /* the symbol table for this distribution */ + uint16_t symbols[258]; + /* the offset for symbols */ + uint16_t offsets[258]; + + /* if this distribution contains only one symbol this is its index */ + int uniq_pos; +} JXLSymbolDistribution; + +typedef struct JXLDistributionBundle { + /* lz77 flags */ + int lz77_enabled; + uint32_t lz77_min_symbol; + uint32_t lz77_min_length; + JXLHybridUintConf lz_len_conf; + + /* one entry for each distribution */ + uint8_t *cluster_map; + /* length of cluster_map */ + int num_dist; + + /* one for each cluster */ + JXLSymbolDistribution *dists; + int num_clusters; + + /* whether to use brotli prefixes or ans */ + int use_prefix_code; + /* bundle log alphabet size, dist ones may be smaller */ + int log_alphabet_size; +} JXLDistributionBundle; + +typedef struct JXLEntropyDecoder { + + /* state is a positive 32-bit integer, or -1 if unset */ + int64_t state; + + /* lz77 values */ + uint32_t num_to_copy; + uint32_t copy_pos; + uint32_t num_decoded; + + /* length is (1 << 20) */ + /* if lz77 is enabled for this bundle */ + /* if lz77 is disabled it's NULL */ + uint32_t *window; + + /* primary bundle associated with this distribution */ + JXLDistributionBundle bundle; + + /* for av_log */ + void *logctx; +} JXLEntropyDecoder; + +typedef struct JXLFrame { + FFJXLFrameType type; + FFJXLFrameEncoding encoding; + + int is_last; + int full_frame; + + uint32_t total_length; + uint32_t body_length; +} JXLFrame; + +typedef struct JXLCodestream { + FFJXLMetadata meta; + JXLFrame frame; +} JXLCodestream; + +typedef struct JXLParseContext { + ParseContext pc; + JXLCodestream codestream; + + /* using ISOBMFF-based container */ + int container; + int skip; + int copied; + int collected_size; + int codestream_length; + int skipped_icc; + int next; + + uint8_t cs_buffer[4096]; +} JXLParseContext; + +/* used for reading brotli prefixes */ +static const VLCElem level0_table[16] = { + vlm(0, 2), vlm(4, 2), vlm(3, 2), vlm(2, 3), vlm(0, 2), vlm(4, 2), vlm(3, 2), vlm(1, 4), + vlm(0, 2), vlm(4, 2), vlm(3, 2), vlm(2, 3), vlm(0, 2), vlm(4, 2), vlm(3, 2), vlm(5, 4), +}; + +/* prefix table for populating ANS distribution */ +static const VLCElem dist_prefix_table[128] = { + vlm(10, 3), vlm(12, 7), vlm(7, 3), vlm(3, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(5, 4), + vlm(10, 3), vlm(4, 4), vlm(7, 3), vlm(1, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(2, 4), + vlm(10, 3), vlm(0, 5), vlm(7, 3), vlm(3, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(5, 4), + vlm(10, 3), vlm(4, 4), vlm(7, 3), vlm(1, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(2, 4), + vlm(10, 3), vlm(11, 6), vlm(7, 3), vlm(3, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(5, 4), + vlm(10, 3), vlm(4, 4), vlm(7, 3), vlm(1, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(2, 4), + vlm(10, 3), vlm(0, 5), vlm(7, 3), vlm(3, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(5, 4), + vlm(10, 3), vlm(4, 4), vlm(7, 3), vlm(1, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(2, 4), + vlm(10, 3), vlm(13, 7), vlm(7, 3), vlm(3, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(5, 4), + vlm(10, 3), vlm(4, 4), vlm(7, 3), vlm(1, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(2, 4), + vlm(10, 3), vlm(0, 5), vlm(7, 3), vlm(3, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(5, 4), + vlm(10, 3), vlm(4, 4), vlm(7, 3), vlm(1, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(2, 4), + vlm(10, 3), vlm(11, 6), vlm(7, 3), vlm(3, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(5, 4), + vlm(10, 3), vlm(4, 4), vlm(7, 3), vlm(1, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(2, 4), + vlm(10, 3), vlm(0, 5), vlm(7, 3), vlm(3, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(5, 4), + vlm(10, 3), vlm(4, 4), vlm(7, 3), vlm(1, 4), vlm(6, 3), vlm(8, 3), vlm(9, 3), vlm(2, 4), +}; + +static const uint8_t prefix_codelen_map[18] = { + 1, 2, 3, 4, 0, 5, 17, 6, 16, 7, 8, 9, 10, 11, 12, 13, 14, 15, +}; + +/** + * Read a variable-length 8-bit integer. + * Used when populating the ANS frequency tables. + */ +static av_always_inline uint8_t jxl_u8(GetBitContext *gb) +{ + int n; + if (!get_bits1(gb)) + return 0; + n = get_bits(gb, 3); + + return get_bitsz(gb, n) | (1 << n); +} + +/* read a U32(c_i + u(u_i)) */ +static av_always_inline uint32_t jxl_u32(GetBitContext *gb, + uint32_t c0, uint32_t c1, uint32_t c2, uint32_t c3, + uint32_t u0, uint32_t u1, uint32_t u2, uint32_t u3) +{ + const uint32_t constants[4] = {c0, c1, c2, c3}; + const uint32_t ubits [4] = {u0, u1, u2, u3}; + uint32_t ret, choice = get_bits(gb, 2); + + ret = constants[choice]; + if (ubits[choice]) + ret += get_bits_long(gb, ubits[choice]); + + return ret; +} + +/* read a U64() */ +static uint64_t jxl_u64(GetBitContext *gb) +{ + uint64_t shift = 12, ret; + + switch (get_bits(gb, 2)) { + case 1: + ret = 1 + get_bits(gb, 4); + break; + case 2: + ret = 17 + get_bits(gb, 8); + break; + case 3: + ret = get_bits(gb, 12); + while (get_bits1(gb)) { + if (shift < 60) { + ret |= (uint64_t)get_bits(gb, 8) << shift; + shift += 8; + } else { + ret |= (uint64_t)get_bits(gb, 4) << shift; + break; + } + } + break; + default: + ret = 0; + } + + return ret; +} + +static int read_hybrid_uint_conf(GetBitContext *gb, JXLHybridUintConf *conf, int log_alphabet_size) +{ + conf->split_exponent = get_bitsz(gb, clog1p(log_alphabet_size)); + if (conf->split_exponent == log_alphabet_size) { + conf->msb_in_token = conf->lsb_in_token = 0; + return 0; + } + + conf->msb_in_token = get_bitsz(gb, clog1p(conf->split_exponent)); + if (conf->msb_in_token > conf->split_exponent) + return AVERROR_INVALIDDATA; + conf->lsb_in_token = get_bitsz(gb, clog1p(conf->split_exponent - conf->msb_in_token)); + if (conf->msb_in_token + conf->lsb_in_token > conf->split_exponent) + return AVERROR_INVALIDDATA; + + return 0; +} + +static int read_hybrid_uint(GetBitContext *gb, const JXLHybridUintConf *conf, uint32_t token, uint32_t *hybrid_uint) +{ + uint32_t n, low, split = 1 << conf->split_exponent; + + if (token < split) { + *hybrid_uint = token; + return 0; + } + + n = conf->split_exponent - conf->lsb_in_token - conf->msb_in_token + + ((token - split) >> (conf->msb_in_token + conf->lsb_in_token)); + if (n >= 32) + return AVERROR_INVALIDDATA; + low = token & ((1 << conf->lsb_in_token) - 1); + token >>= conf->lsb_in_token; + token &= (1 << conf->msb_in_token) - 1; + token |= 1 << conf->msb_in_token; + *hybrid_uint = (((token << n) | get_bits_long(gb, n)) << conf->lsb_in_token ) | low; + + return 0; +} + +static inline uint32_t read_prefix_symbol(GetBitContext *gb, const JXLSymbolDistribution *dist) +{ + if (!dist->vlc.bits) + return dist->default_symbol; + + return get_vlc2(gb, dist->vlc.table, dist->vlc.bits, 1); +} + +static uint32_t read_ans_symbol(GetBitContext *gb, JXLEntropyDecoder *dec, const JXLSymbolDistribution *dist) +{ + uint32_t index, i, pos, symbol, offset; + + if (dec->state < 0) + dec->state = get_bits_long(gb, 32); + + index = dec->state & 0xFFF; + i = index >> dist->log_bucket_size; + pos = index & ((1 << dist->log_bucket_size) - 1); + symbol = pos >= dist->cutoffs[i] ? dist->symbols[i] : i; + offset = pos >= dist->cutoffs[i] ? dist->offsets[i] + pos : pos; + dec->state = dist->freq[symbol] * (dec->state >> 12) + offset; + if (dec->state < (1 << 16)) + dec->state = (dec->state << 16) | get_bits(gb, 16); + dec->state &= 0xFFFFFFFF; + + return symbol; +} + +static int decode_hybrid_varlen_uint(GetBitContext *gb, JXLEntropyDecoder *dec, + const JXLDistributionBundle *bundle, + uint32_t context, uint32_t *hybrid_uint) +{ + int ret; + uint32_t token, distance; + const JXLSymbolDistribution *dist; + + if (dec->num_to_copy > 0) { + *hybrid_uint = dec->window[dec->copy_pos++ & 0xFFFFF]; + dec->num_to_copy--; + dec->window[dec->num_decoded++ & 0xFFFFF] = *hybrid_uint; + return 0; + } + + if (context >= bundle->num_dist) + return AVERROR(EINVAL); + if (bundle->cluster_map[context] >= bundle->num_clusters) + return AVERROR_INVALIDDATA; + + dist = &bundle->dists[bundle->cluster_map[context]]; + if (bundle->use_prefix_code) + token = read_prefix_symbol(gb, dist); + else + token = read_ans_symbol(gb, dec, dist); + + if (bundle->lz77_enabled && token >= bundle->lz77_min_symbol) { + const JXLSymbolDistribution *lz77dist = &bundle->dists[bundle->cluster_map[bundle->num_dist - 1]]; + ret = read_hybrid_uint(gb, &bundle->lz_len_conf, token - bundle->lz77_min_symbol, &dec->num_to_copy); + if (ret < 0) + return ret; + dec->num_to_copy += bundle->lz77_min_length; + if (bundle->use_prefix_code) + token = read_prefix_symbol(gb, lz77dist); + else + token = read_ans_symbol(gb, dec, lz77dist); + ret = read_hybrid_uint(gb, &lz77dist->config, token, &distance); + if (ret < 0) + return ret; + distance++; + distance = FFMIN3(distance, dec->num_decoded, 1 << 20); + dec->copy_pos = dec->num_decoded - distance; + return decode_hybrid_varlen_uint(gb, dec, bundle, context, hybrid_uint); + } + ret = read_hybrid_uint(gb, &dist->config, token, hybrid_uint); + if (ret < 0) + return ret; + if (bundle->lz77_enabled) + dec->window[dec->num_decoded++ & 0xFFFFF] = *hybrid_uint; + + return 0; +} + +static int populate_distribution(GetBitContext *gb, JXLSymbolDistribution *dist, int log_alphabet_size) +{ + int len = 0, shift, omit_log = -1, omit_pos = -1; + int prev = 0, num_same = 0; + uint32_t total_count = 0; + uint8_t logcounts[258] = { 0 }; + uint8_t same[258] = { 0 }; + dist->uniq_pos = -1; + + if (get_bits1(gb)) { + /* simple code */ + dist->alphabet_size = 256; + if (get_bits1(gb)) { + uint8_t v1 = jxl_u8(gb); + uint8_t v2 = jxl_u8(gb); + if (v1 == v2) + return AVERROR_INVALIDDATA; + dist->freq[v1] = get_bits(gb, 12); + dist->freq[v2] = (1 << 12) - dist->freq[v1]; + if (!dist->freq[v1]) + dist->uniq_pos = v2; + } else { + uint8_t x = jxl_u8(gb); + dist->freq[x] = 1 << 12; + dist->uniq_pos = x; + } + return 0; + } + + if (get_bits1(gb)) { + /* flat code */ + dist->alphabet_size = jxl_u8(gb) + 1; + for (int i = 0; i < dist->alphabet_size; i++) + dist->freq[i] = (1 << 12) / dist->alphabet_size; + for (int i = 0; i < (1 << 12) % dist->alphabet_size; i++) + dist->freq[i]++; + return 0; + } + + do { + if (!get_bits1(gb)) + break; + } while (++len < 3); + + shift = (get_bitsz(gb, len) | (1 << len)) - 1; + if (shift > 13) + return AVERROR_INVALIDDATA; + + dist->alphabet_size = jxl_u8(gb) + 3; + for (int i = 0; i < dist->alphabet_size; i++) { + logcounts[i] = get_vlc2(gb, dist_prefix_table, 7, 1); + if (logcounts[i] == 13) { + int rle = jxl_u8(gb); + same[i] = rle + 5; + i += rle + 3; + continue; + } + if (logcounts[i] > omit_log) { + omit_log = logcounts[i]; + omit_pos = i; + } + } + if (omit_pos < 0 || omit_pos + 1 < dist->alphabet_size && logcounts[omit_pos + 1] == 13) + return AVERROR_INVALIDDATA; + + for (int i = 0; i < dist->alphabet_size; i++) { + if (same[i]) { + num_same = same[i] - 1; + prev = i > 0 ? dist->freq[i - 1] : 0; + } + if (num_same) { + dist->freq[i] = prev; + num_same--; + } else { + if (i == omit_pos || !logcounts[i]) + continue; + if (logcounts[i] == 1) { + dist->freq[i] = 1; + } else { + int bitcount = FFMIN(FFMAX(0, shift - ((12 - logcounts[i] + 1) >> 1)), logcounts[i] - 1); + dist->freq[i] = (1 << (logcounts[i] - 1)) + (get_bitsz(gb, bitcount) << (logcounts[i] - 1 - bitcount)); + } + } + total_count += dist->freq[i]; + } + dist->freq[omit_pos] = (1 << 12) - total_count; + + return 0; +} + +static void dist_bundle_close(JXLDistributionBundle *bundle) +{ + if (bundle->use_prefix_code && bundle->dists) + for (int i = 0; i < bundle->num_clusters; i++) + ff_vlc_free(&bundle->dists[i].vlc); + av_freep(&bundle->dists); + av_freep(&bundle->cluster_map); +} + + +static int read_distribution_bundle(GetBitContext *gb, JXLEntropyDecoder *dec, + JXLDistributionBundle *bundle, int num_dist, int disallow_lz77); + +static int read_dist_clustering(GetBitContext *gb, JXLEntropyDecoder *dec, JXLDistributionBundle *bundle) +{ + int ret; + + bundle->cluster_map = av_malloc(bundle->num_dist); + if (!bundle->cluster_map) + return AVERROR(ENOMEM); + + if (bundle->num_dist == 1) { + bundle->cluster_map[0] = 0; + bundle->num_clusters = 1; + return 0; + } + + if (get_bits1(gb)) { + /* simple clustering */ + uint32_t nbits = get_bits(gb, 2); + for (int i = 0; i < bundle->num_dist; i++) + bundle->cluster_map[i] = get_bitsz(gb, nbits); + } else { + /* complex clustering */ + int use_mtf = get_bits1(gb); + JXLDistributionBundle nested = { 0 }; + /* num_dist == 1 prevents this from recursing again */ + ret = read_distribution_bundle(gb, dec, &nested, 1, bundle->num_dist <= 2); + if (ret < 0) { + dist_bundle_close(&nested); + return ret; + } + for (int i = 0; i < bundle->num_dist; i++) { + uint32_t clust; + ret = decode_hybrid_varlen_uint(gb, dec, &nested, 0, &clust); + if (ret < 0) { + dist_bundle_close(&nested); + return ret; + } + bundle->cluster_map[i] = clust; + } + dec->state = -1; + /* it's not going to necessarily be zero after reading */ + dec->num_to_copy = 0; + dist_bundle_close(&nested); + if (use_mtf) { + uint8_t mtf[256]; + for (int i = 0; i < 256; i++) + mtf[i] = i; + for (int i = 0; i < bundle->num_dist; i++) { + int index = bundle->cluster_map[i]; + bundle->cluster_map[i] = mtf[index]; + if (index) { + int value = mtf[index]; + for (int j = index; j > 0; j--) + mtf[j] = mtf[j - 1]; + mtf[0] = value; + } + } + } + } + for (int i = 0; i < bundle->num_dist; i++) { + if (bundle->cluster_map[i] >= bundle->num_clusters) + bundle->num_clusters = bundle->cluster_map[i] + 1; + } + + if (bundle->num_clusters > bundle->num_dist) + return AVERROR_INVALIDDATA; + + return 0; +} + +static int gen_alias_map(JXLEntropyDecoder *dec, JXLSymbolDistribution *dist, int log_alphabet_size) +{ + uint32_t bucket_size, table_size; + uint8_t overfull[256], underfull[256]; + int overfull_pos = 0, underfull_pos = 0; + dist->log_bucket_size = 12 - log_alphabet_size; + bucket_size = 1 << dist->log_bucket_size; + table_size = 1 << log_alphabet_size; + + if (dist->uniq_pos >= 0) { + for (int i = 0; i < table_size; i++) { + dist->symbols[i] = dist->uniq_pos; + dist->offsets[i] = bucket_size * i; + dist->cutoffs[i] = 0; + } + return 0; + } + + for (int i = 0; i < dist->alphabet_size; i++) { + dist->cutoffs[i] = dist->freq[i]; + dist->symbols[i] = i; + if (dist->cutoffs[i] > bucket_size) + overfull[overfull_pos++] = i; + else if (dist->cutoffs[i] < bucket_size) + underfull[underfull_pos++] = i; + } + + for (int i = dist->alphabet_size; i < table_size; i++) { + dist->cutoffs[i] = 0; + underfull[underfull_pos++] = i; + } + + while (overfull_pos) { + int o, u, by; + /* this should be impossible */ + if (!underfull_pos) + return AVERROR_INVALIDDATA; + u = underfull[--underfull_pos]; + o = overfull[--overfull_pos]; + by = bucket_size - dist->cutoffs[u]; + dist->cutoffs[o] -= by; + dist->symbols[u] = o; + dist->offsets[u] = dist->cutoffs[o]; + if (dist->cutoffs[o] < bucket_size) + underfull[underfull_pos++] = o; + else if (dist->cutoffs[o] > bucket_size) + overfull[overfull_pos++] = o; + } + + for (int i = 0; i < table_size; i++) { + if (dist->cutoffs[i] == bucket_size) { + dist->symbols[i] = i; + dist->offsets[i] = 0; + dist->cutoffs[i] = 0; + } else { + dist->offsets[i] -= dist->cutoffs[i]; + } + } + + return 0; +} + +static int read_simple_vlc_prefix(GetBitContext *gb, JXLEntropyDecoder *dec, JXLSymbolDistribution *dist) +{ + int nsym, tree_select, bits; + + int8_t lens[4]; + int16_t symbols[4]; + + nsym = 1 + get_bits(gb, 2); + for (int i = 0; i < nsym; i++) + symbols[i] = get_bitsz(gb, dist->log_alphabet_size); + if (nsym == 4) + tree_select = get_bits1(gb); + switch (nsym) { + case 1: + dist->vlc.bits = 0; + dist->default_symbol = symbols[0]; + return 0; + case 2: + bits = 1; + lens[0] = 1, lens[1] = 1, lens[2] = 0, lens[3] = 0; + if (symbols[1] < symbols[0]) + FFSWAP(int16_t, symbols[0], symbols[1]); + break; + case 3: + bits = 2; + lens[0] = 1, lens[1] = 2, lens[2] = 2, lens[3] = 0; + if (symbols[2] < symbols[1]) + FFSWAP(int16_t, symbols[1], symbols[2]); + break; + case 4: + if (tree_select) { + bits = 3; + lens[0] = 1, lens[1] = 2, lens[2] = 3, lens[3] = 3; + if (symbols[3] < symbols[2]) + FFSWAP(int16_t, symbols[2], symbols[3]); + } else { + bits = 2; + lens[0] = 2, lens[1] = 2, lens[2] = 2, lens[3] = 2; + while (1) { + if (symbols[1] < symbols[0]) + FFSWAP(int16_t, symbols[0], symbols[1]); + if (symbols[3] < symbols[2]) + FFSWAP(int16_t, symbols[2], symbols[3]); + if (symbols[1] <= symbols[2]) + break; + FFSWAP(int16_t, symbols[1], symbols[2]); + } + } + break; + default: + // Challenge Complete! How did we get here? + return AVERROR_BUG; + } + + return ff_vlc_init_from_lengths(&dist->vlc, bits, nsym, lens, 1, symbols, + 2, 2, 0, VLC_INIT_LE, dec->logctx); +} + +static int read_vlc_prefix(GetBitContext *gb, JXLEntropyDecoder *dec, JXLSymbolDistribution *dist) +{ + int8_t level1_lens[18] = { 0 }; + int8_t level1_lens_s[18] = { 0 }; + int16_t level1_syms[18] = { 0 }; + uint32_t level1_codecounts[19] = { 0 }; + uint8_t *buf = NULL; + int8_t *level2_lens, *level2_lens_s; + int16_t *level2_syms; + uint32_t *level2_codecounts; + + int repeat_count_prev = 0, repeat_count_zero = 0, prev = 8; + int total_code = 0, len, hskip, num_codes = 0, ret; + + VLC level1_vlc; + + if (dist->alphabet_size == 1) { + dist->vlc.bits = 0; + dist->default_symbol = 0; + return 0; + } + + hskip = get_bits(gb, 2); + if (hskip == 1) + return read_simple_vlc_prefix(gb, dec, dist); + + level1_codecounts[0] = hskip; + for (int i = hskip; i < 18; i++) { + len = level1_lens[prefix_codelen_map[i]] = get_vlc2(gb, level0_table, 4, 1); + level1_codecounts[len]++; + if (len) { + total_code += (32 >> len); + num_codes++; + } + if (total_code >= 32) { + level1_codecounts[0] += 18 - i - 1; + break; + } + } + + if (total_code != 32 && num_codes >= 2 || num_codes < 1) + return AVERROR_INVALIDDATA; + + for (int i = 1; i < 19; i++) + level1_codecounts[i] += level1_codecounts[i - 1]; + + for (int i = 17; i >= 0; i--) { + int idx = --level1_codecounts[level1_lens[i]]; + level1_lens_s[idx] = level1_lens[i]; + level1_syms[idx] = i; + } + + ret = ff_vlc_init_from_lengths(&level1_vlc, 5, 18, level1_lens_s, 1, level1_syms, 2, 2, + 0, VLC_INIT_LE, dec->logctx); + if (ret < 0) + goto end; + + buf = av_calloc(1, 262148); // 32768 * 8 + 4 + if (!buf) { + ret = AVERROR(ENOMEM); + goto end; + } + + level2_lens = (int8_t *)buf; + level2_lens_s = (int8_t *)(buf + 32768); + level2_syms = (int16_t *)(buf + 65536); + level2_codecounts = (uint32_t *)(buf + 131072); + + total_code = 0; + for (int i = 0; i < dist->alphabet_size; i++) { + len = get_vlc2(gb, level1_vlc.table, 5, 1); + if (len == 16) { + int extra = 3 + get_bits(gb, 2); + if (repeat_count_prev) + extra = 4 * (repeat_count_prev - 2) - repeat_count_prev + extra; + for (int j = 0; j < extra; j++) + level2_lens[i + j] = prev; + total_code += (32768 >> prev) * extra; + i += extra - 1; + repeat_count_prev += extra; + repeat_count_zero = 0; + level2_codecounts[prev] += extra; + } else if (len == 17) { + int extra = 3 + get_bits(gb, 3); + if (repeat_count_zero > 0) + extra = 8 * (repeat_count_zero - 2) - repeat_count_zero + extra; + i += extra - 1; + repeat_count_prev = 0; + repeat_count_zero += extra; + level2_codecounts[0] += extra; + } else { + level2_lens[i] = len; + repeat_count_prev = repeat_count_zero = 0; + if (len) { + total_code += (32768 >> len); + prev = len; + } + level2_codecounts[len]++; + } + if (total_code >= 32768) { + level2_codecounts[0] += dist->alphabet_size - i - 1; + break; + } + } + + if (total_code != 32768 && level2_codecounts[0] < dist->alphabet_size - 1) + return AVERROR_INVALIDDATA; + + for (int i = 1; i < dist->alphabet_size + 1; i++) + level2_codecounts[i] += level2_codecounts[i - 1]; + + for (int i = dist->alphabet_size - 1; i >= 0; i--) { + int idx = --level2_codecounts[level2_lens[i]]; + level2_lens_s[idx] = level2_lens[i]; + level2_syms[idx] = i; + } + + ret = ff_vlc_init_from_lengths(&dist->vlc, 15, dist->alphabet_size, level2_lens_s, + 1, level2_syms, 2, 2, 0, VLC_INIT_LE, dec->logctx); + +end: + av_freep(&buf); + ff_vlc_free(&level1_vlc); + + return ret; +} + +static int read_distribution_bundle(GetBitContext *gb, JXLEntropyDecoder *dec, + JXLDistributionBundle *bundle, int num_dist, int disallow_lz77) +{ + int ret; + + if (num_dist <= 0) + return AVERROR(EINVAL); + + bundle->num_dist = num_dist; + bundle->lz77_enabled = get_bits1(gb); + if (bundle->lz77_enabled) { + if (disallow_lz77) + return AVERROR_INVALIDDATA; + bundle->lz77_min_symbol = jxl_u32(gb, 224, 512, 4096, 8, 0, 0, 0, 15); + bundle->lz77_min_length = jxl_u32(gb, 3, 4, 5, 9, 0, 0, 2, 8); + bundle->num_dist++; + ret = read_hybrid_uint_conf(gb, &bundle->lz_len_conf, 8); + if (ret < 0) + return ret; + } + + if (bundle->lz77_enabled && !dec->window) { + dec->window = av_malloc_array(1 << 20, sizeof(uint32_t)); + if (!dec->window) + return AVERROR(ENOMEM); + } + + ret = read_dist_clustering(gb, dec, bundle); + if (ret < 0) + return ret; + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + + bundle->dists = av_calloc(bundle->num_clusters, sizeof(JXLSymbolDistribution)); + if (!bundle->dists) + return AVERROR(ENOMEM); + + bundle->use_prefix_code = get_bits1(gb); + bundle->log_alphabet_size = bundle->use_prefix_code ? 15 : 5 + get_bits(gb, 2); + + for (int i = 0; i < bundle->num_clusters; i++) { + ret = read_hybrid_uint_conf(gb, &bundle->dists[i].config, bundle->log_alphabet_size); + if (ret < 0) + return ret; + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + } + + if (bundle->use_prefix_code) { + for (int i = 0; i < bundle->num_clusters; i++) { + JXLSymbolDistribution *dist = &bundle->dists[i]; + if (get_bits1(gb)) { + int n = get_bits(gb, 4); + dist->alphabet_size = 1 + (1 << n) + get_bitsz(gb, n); + } else { + dist->alphabet_size = 1; + } + dist->log_alphabet_size = clog1p(dist->alphabet_size - 1); + } + for (int i = 0; i < bundle->num_clusters; i++) { + ret = read_vlc_prefix(gb, dec, &bundle->dists[i]); + if (ret < 0) + return ret; + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + } + } else { + for (int i = 0; i < bundle->num_clusters; i++) { + ret = populate_distribution(gb, &bundle->dists[i], bundle->log_alphabet_size); + if (ret < 0) + return ret; + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + } + for (int i = 0; i < bundle->num_clusters; i++) { + ret = gen_alias_map(dec, &bundle->dists[i], bundle->log_alphabet_size); + if (ret < 0) + return ret; + } + } + + return 0; +} + +static void entropy_decoder_close(JXLEntropyDecoder *dec) +{ + if (!dec) + return; + av_freep(&dec->window); + dist_bundle_close(&dec->bundle); +} + +static int entropy_decoder_init(void *avctx, GetBitContext *gb, JXLEntropyDecoder *dec, int num_dist) +{ + int ret; + + memset(dec, 0, sizeof(*dec)); + dec->logctx = avctx; + dec->state = -1; + + ret = read_distribution_bundle(gb, dec, &dec->bundle, num_dist, 0); + if (ret < 0) { + entropy_decoder_close(dec); + return ret; + } + + return 0; +} + +static int64_t entropy_decoder_read_symbol(GetBitContext *gb, JXLEntropyDecoder *dec, uint32_t context) +{ + int ret; + uint32_t hybrid_uint; + + ret = decode_hybrid_varlen_uint(gb, dec, &dec->bundle, context, &hybrid_uint); + if (ret < 0) + return ret; + + return hybrid_uint; +} + +static inline uint32_t icc_context(uint64_t i, uint32_t b1, uint32_t b2) +{ + uint32_t p1, p2; + if (i <= 128) + return 0; + if (b1 >= 'a' && b1 <= 'z' || b1 >= 'A' && b1 <= 'Z') + p1 = 0; + else if (b1 >= '0' && b1 <= '9' || b1 == '.' || b1 == ',') + p1 = 1; + else if (b1 <= 1) + p1 = b1 + 2; + else if (b1 > 1 && b1 < 16) + p1 = 4; + else if (b1 > 240 && b1 < 255) + p1 = 5; + else if (b1 == 255) + p1 = 6; + else + p1 = 7; + + if (b2 >= 'a' && b2 <= 'z' || b2 >= 'A' && b2 <= 'Z') + p2 = 0; + else if (b2 >= '0' && b2 <= '9' || b2 == '.' || b2 == ',') + p2 = 1; + else if (b2 < 16) + p2 = 2; + else if (b2 > 240) + p2 = 3; + else + p2 = 4; + + return 1 + p1 + p2 * 8; +} + +static inline uint32_t toc_context(uint32_t x) +{ + return FFMIN(7, clog1p(x)); +} + +static void populate_fields(AVCodecParserContext *s, AVCodecContext *avctx, const FFJXLMetadata *meta) +{ + s->width = meta->width; + s->height = meta->height; + + switch (meta->csp) { + case JPEGXL_CS_RGB: + case JPEGXL_CS_XYB: + avctx->colorspace = AVCOL_SPC_RGB; + break; + default: + avctx->colorspace = AVCOL_SPC_UNSPECIFIED; + } + + if (meta->wp == JPEGXL_WP_D65) { + switch (meta->primaries) { + case JPEGXL_PR_SRGB: + avctx->color_primaries = AVCOL_PRI_BT709; + break; + case JPEGXL_PR_P3: + avctx->color_primaries = AVCOL_PRI_SMPTE432; + break; + case JPEGXL_PR_2100: + avctx->color_primaries = AVCOL_PRI_BT2020; + break; + default: + avctx->color_primaries = AVCOL_PRI_UNSPECIFIED; + } + } else if (meta->wp == JPEGXL_WP_DCI && meta->primaries == JPEGXL_PR_P3) { + avctx->color_primaries = AVCOL_PRI_SMPTE431; + } else { + avctx->color_primaries = AVCOL_PRI_UNSPECIFIED; + } + + if (meta->trc > JPEGXL_TR_GAMMA) { + FFJXLTransferCharacteristic trc = meta->trc - JPEGXL_TR_GAMMA; + switch (trc) { + case JPEGXL_TR_BT709: + avctx->color_trc = AVCOL_TRC_BT709; + break; + case JPEGXL_TR_LINEAR: + avctx->color_trc = AVCOL_TRC_LINEAR; + break; + case JPEGXL_TR_SRGB: + avctx->color_trc = AVCOL_TRC_IEC61966_2_1; + break; + case JPEGXL_TR_PQ: + avctx->color_trc = AVCOL_TRC_SMPTEST2084; + break; + case JPEGXL_TR_DCI: + avctx->color_trc = AVCOL_TRC_SMPTE428; + break; + case JPEGXL_TR_HLG: + avctx->color_trc = AVCOL_TRC_ARIB_STD_B67; + break; + default: + avctx->color_trc = AVCOL_TRC_UNSPECIFIED; + } + } else if (meta->trc > 0) { + if (meta->trc > 45355 && meta->trc < 45555) + avctx->color_trc = AVCOL_TRC_GAMMA22; + else if (meta->trc > 35614 && meta->trc < 35814) + avctx->color_trc = AVCOL_TRC_GAMMA28; + else + avctx->color_trc = AVCOL_TRC_UNSPECIFIED; + } else { + avctx->color_trc = AVCOL_TRC_UNSPECIFIED; + } + + if (meta->csp == JPEGXL_CS_GRAY) { + if (meta->bit_depth <= 8) + s->format = meta->have_alpha ? AV_PIX_FMT_YA8 : AV_PIX_FMT_GRAY8; + else if (meta->bit_depth <= 16) + s->format = meta->have_alpha ? AV_PIX_FMT_YA16 : AV_PIX_FMT_GRAY16; + else + s->format = meta->have_alpha ? AV_PIX_FMT_NONE : AV_PIX_FMT_GRAYF32; + } else { + if (meta->bit_depth <= 8) + s->format = meta->have_alpha ? AV_PIX_FMT_RGBA : AV_PIX_FMT_RGB24; + else if (meta->bit_depth <= 16) + s->format = meta->have_alpha ? AV_PIX_FMT_RGBA64 : AV_PIX_FMT_RGB48; + else + s->format = meta->have_alpha ? AV_PIX_FMT_RGBAF32 : AV_PIX_FMT_RGBF32; + } +} + +static int skip_icc_profile(void *avctx, JXLParseContext *ctx, GetBitContext *gb) +{ + int64_t ret; + uint32_t last = 0, last2 = 0; + JXLEntropyDecoder dec; + uint64_t enc_size = jxl_u64(gb); + + if (!enc_size) + return AVERROR_INVALIDDATA; + + ret = entropy_decoder_init(avctx, gb, &dec, 41); + if (ret < 0) + return ret; + + if (get_bits_left(gb) < 0) { + entropy_decoder_close(&dec); + return AVERROR_BUFFER_TOO_SMALL; + } + + for (uint64_t read = 0; read < enc_size; read++) { + ret = entropy_decoder_read_symbol(gb, &dec, icc_context(read, last, last2)); + if (ret < 0 || get_bits_left(gb) < 0) { + entropy_decoder_close(&dec); + return ret < 0 ? ret : AVERROR_BUFFER_TOO_SMALL; + } + last2 = last; + last = ret; + } + + entropy_decoder_close(&dec); + + return 0; +} + +static int skip_extensions(GetBitContext *gb) +{ + uint64_t extensions = jxl_u64(gb), extensions_len = 0; + + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + + if (!extensions) + return 0; + + for (int i = 0; i < 64; i++) { + if (extensions & (UINT64_C(1) << i)) + extensions_len += jxl_u64(gb); + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + } + + if (extensions_len > INT_MAX || get_bits_left(gb) < extensions_len) + return AVERROR_BUFFER_TOO_SMALL; + + skip_bits_long(gb, extensions_len); + + return 0; +} + +static int parse_frame_header(void *avctx, JXLParseContext *ctx, GetBitContext *gb) +{ + int all_default, do_yCbCr = 0, num_passes = 1, ret; + int group_size_shift = 1, lf_level = 0, save_as_ref = 0; + int have_crop = 0, full_frame = 1, resets_canvas = 1, upsampling = 1; + JXLFrame *frame = &ctx->codestream.frame; + const FFJXLMetadata *meta = &ctx->codestream.meta; + int32_t x0 = 0, y0 = 0; + uint32_t duration = 0, width = meta->coded_width, height = meta->coded_height; + uint32_t name_len, num_groups, num_lf_groups, group_dim, lf_group_dim, toc_count; + uint64_t flags = 0; + int start_len = get_bits_count(gb); + + memset(frame, 0, sizeof(*frame)); + frame->is_last = 1; + + all_default = get_bits1(gb); + if (!all_default) { + frame->type = get_bits(gb, 2); + frame->encoding = get_bits1(gb); + flags = jxl_u64(gb); + if (!meta->xyb_encoded) + do_yCbCr = get_bits1(gb); + if (!(flags & JXL_FLAG_USE_LF_FRAME)) { + if (do_yCbCr) + skip_bits(gb, 6); // jpeg upsampling + upsampling = jxl_u32(gb, 1, 2, 4, 8, 0, 0, 0, 0); + skip_bits_long(gb, 2 * meta->num_extra_channels); + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + } + if (frame->encoding == JPEGXL_ENC_MODULAR) + group_size_shift = get_bits(gb, 2); + else if (meta->xyb_encoded) + skip_bits(gb, 6); // xqm and bqm scales + if (frame->type != JPEGXL_FRAME_REFERENCE_ONLY) { + num_passes = jxl_u32(gb, 1, 2, 3, 4, 0, 0, 0, 3); + if (num_passes != 1) { + int num_ds = jxl_u32(gb, 0, 1, 2, 3, 0, 0, 0, 1); + skip_bits(gb, 2 * (num_passes - 1)); // shift + skip_bits(gb, 2 * num_ds); // downsample + for (int i = 0; i < num_ds; i++) + jxl_u32(gb, 0, 1, 2, 0, 0, 0, 0, 3); + } + } + if (frame->type == JPEGXL_FRAME_LF) + lf_level = 1 + get_bits(gb, 2); + else + have_crop = get_bits1(gb); + if (have_crop) { + if (frame->type != JPEGXL_FRAME_REFERENCE_ONLY) { + uint32_t ux0 = jxl_u32(gb, 0, 256, 2304, 18688, 8, 11, 14, 30); + uint32_t uy0 = jxl_u32(gb, 0, 256, 2304, 18688, 8, 11, 14, 30); + x0 = unpack_signed(ux0); + y0 = unpack_signed(uy0); + } + width = jxl_u32(gb, 0, 256, 2304, 18688, 8, 11, 14, 30); + height = jxl_u32(gb, 0, 256, 2304, 18688, 8, 11, 14, 30); + full_frame = x0 <= 0 && y0 <= 0 && width + x0 >= meta->coded_width + && height + y0 >= meta->coded_height; + } + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + if (frame->type == JPEGXL_FRAME_REGULAR || frame->type == JPEGXL_FRAME_SKIP_PROGRESSIVE) { + for (int i = 0; i <= meta->num_extra_channels; i++) { + int mode = jxl_u32(gb, 0, 1, 2, 3, 0, 0, 0, 2); + if (meta->num_extra_channels && (mode == JPEGXL_BM_BLEND || mode == JPEGXL_BM_MULADD)) + jxl_u32(gb, 0, 1, 2, 3, 0, 0, 0, 2); + if (meta->num_extra_channels && (mode == JPEGXL_BM_BLEND || mode == JPEGXL_BM_MULADD + || mode == JPEGXL_BM_MUL)) + skip_bits1(gb); + if (!i) + resets_canvas = mode == JPEGXL_BM_REPLACE && full_frame; + if (!resets_canvas) + skip_bits(gb, 2); + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + } + if (meta->animation_offset) + duration = jxl_u32(gb, 0, 1, 0, 0, 0, 0, 8, 32); + if (meta->have_timecodes) + skip_bits_long(gb, 32); + frame->is_last = get_bits1(gb); + } else { + frame->is_last = 0; + } + if (frame->type != JPEGXL_FRAME_LF && !frame->is_last) + save_as_ref = get_bits(gb, 2); + if (frame->type == JPEGXL_FRAME_REFERENCE_ONLY || + (resets_canvas && !frame->is_last && (!duration || save_as_ref) + && frame->type != JPEGXL_FRAME_LF)) + skip_bits1(gb); // save before color transform + name_len = 8 * jxl_u32(gb, 0, 0, 16, 48, 0, 4, 5, 10); + if (get_bits_left(gb) < name_len) + return AVERROR_BUFFER_TOO_SMALL; + skip_bits_long(gb, name_len); + } + + if (!all_default) { + int restd = get_bits1(gb), gab = 1; + if (!restd) + gab = get_bits1(gb); + if (gab && !restd && get_bits1(gb)) + // gab custom + skip_bits_long(gb, 16 * 6); + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + if (!restd) { + int epf = get_bits(gb, 2); + if (epf) { + if (frame->encoding == JPEGXL_ENC_VARDCT && get_bits1(gb)) { + skip_bits_long(gb, 16 * 8); // custom epf sharpness + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + } + if (get_bits1(gb)) { + skip_bits_long(gb, 3 * 16 + 32); // custom epf weight + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + } + if (get_bits1(gb)) { // custom epf sigma + if (frame->encoding == JPEGXL_ENC_VARDCT) + skip_bits(gb, 16); + skip_bits_long(gb, 16 * 3); + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + } + if (frame->encoding == JPEGXL_ENC_MODULAR) + skip_bits(gb, 16); + } + ret = skip_extensions(gb); + if (ret < 0) + return ret; + } + ret = skip_extensions(gb); + if (ret < 0) + return ret; + } + + width = div_ceil(div_ceil(width, upsampling), 1 << (3 * lf_level)); + height = div_ceil(div_ceil(height, upsampling), 1 << (3 * lf_level)); + group_dim = 128 << group_size_shift; + lf_group_dim = group_dim << 3; + num_groups = div_ceil(width, group_dim) * div_ceil(height, group_dim); + num_lf_groups = div_ceil(width, lf_group_dim) * div_ceil(height, lf_group_dim); + if (num_groups == 1 && num_passes == 1) + toc_count = 1; + else + toc_count = 2 + num_lf_groups + num_groups * num_passes; + + // permuted toc + if (get_bits1(gb)) { + JXLEntropyDecoder dec; + uint32_t end, lehmer = 0; + ret = entropy_decoder_init(avctx, gb, &dec, 8); + if (ret < 0) + return ret; + if (get_bits_left(gb) < 0) { + entropy_decoder_close(&dec); + return AVERROR_BUFFER_TOO_SMALL; + } + end = entropy_decoder_read_symbol(gb, &dec, toc_context(toc_count)); + if (end > toc_count) { + entropy_decoder_close(&dec); + return AVERROR_INVALIDDATA; + } + for (uint32_t i = 0; i < end; i++) { + lehmer = entropy_decoder_read_symbol(gb, &dec, toc_context(lehmer)); + if (get_bits_left(gb) < 0) { + entropy_decoder_close(&dec); + return AVERROR_BUFFER_TOO_SMALL; + } + } + entropy_decoder_close(&dec); + } + align_get_bits(gb); + + for (uint32_t i = 0; i < toc_count; i++) { + frame->body_length += 8 * jxl_u32(gb, 0, 1024, 17408, 4211712, 10, 14, 22, 30); + if (get_bits_left(gb) < 0) + return AVERROR_BUFFER_TOO_SMALL; + } + align_get_bits(gb); + + frame->total_length = frame->body_length + get_bits_count(gb) - start_len; + + return 0; +} + +static int skip_boxes(JXLParseContext *ctx, const uint8_t *buf, int buf_size) +{ + GetByteContext gb; + + if (ctx->skip > buf_size) + return AVERROR_BUFFER_TOO_SMALL; + + buf += ctx->skip; + buf_size -= ctx->skip; + bytestream2_init(&gb, buf, buf_size); + + while (1) { + uint64_t size; + int head_size = 4; + + if (bytestream2_peek_le16(&gb) == FF_JPEGXL_CODESTREAM_SIGNATURE_LE) + break; + if (bytestream2_peek_le64(&gb) == FF_JPEGXL_CONTAINER_SIGNATURE_LE) + break; + + if (bytestream2_get_bytes_left(&gb) < 8) + return AVERROR_BUFFER_TOO_SMALL; + + size = bytestream2_get_be32(&gb); + if (size == 1) { + if (bytestream2_get_bytes_left(&gb) < 12) + return AVERROR_BUFFER_TOO_SMALL; + size = bytestream2_get_be64(&gb); + head_size = 12; + } + if (!size) + return AVERROR_INVALIDDATA; + /* invalid ISOBMFF size */ + if (size <= head_size + 4 || size > INT_MAX - ctx->skip) + return AVERROR_INVALIDDATA; + + ctx->skip += size; + bytestream2_skip(&gb, size - head_size); + if (bytestream2_get_bytes_left(&gb) <= 0) + return AVERROR_BUFFER_TOO_SMALL; + } + + return 0; +} + +static int try_parse(AVCodecParserContext *s, AVCodecContext *avctx, JXLParseContext *ctx, + const uint8_t *buf, int buf_size) +{ + int ret, cs_buflen, header_skip; + const uint8_t *cs_buffer; + GetBitContext gb; + + if (ctx->skip > buf_size) + return AVERROR_BUFFER_TOO_SMALL; + + buf += ctx->skip; + buf_size -= ctx->skip; + + if (ctx->container || AV_RL64(buf) == FF_JPEGXL_CONTAINER_SIGNATURE_LE) { + ctx->container = 1; + ret = ff_jpegxl_collect_codestream_header(buf, buf_size, ctx->cs_buffer, + sizeof(ctx->cs_buffer), &ctx->copied); + if (ret < 0) + return ret; + ctx->collected_size = ret; + if (!ctx->copied) { + ctx->skip += ret; + return AVERROR_BUFFER_TOO_SMALL; + } + cs_buffer = ctx->cs_buffer; + cs_buflen = FFMIN(sizeof(ctx->cs_buffer), ctx->copied); + } else { + cs_buffer = buf; + cs_buflen = buf_size; + } + + if (!ctx->codestream_length) { + header_skip = ff_jpegxl_parse_codestream_header(cs_buffer, cs_buflen, &ctx->codestream.meta, 0); + if (header_skip < 0) + return header_skip; + ctx->codestream_length = header_skip; + populate_fields(s, avctx, &ctx->codestream.meta); + } + + if (ctx->container) + return ctx->collected_size; + + ret = init_get_bits8(&gb, cs_buffer, cs_buflen); + if (ret < 0) + return ret; + + skip_bits_long(&gb, ctx->codestream_length); + + if (!ctx->skipped_icc && ctx->codestream.meta.have_icc_profile) { + ret = skip_icc_profile(avctx, ctx, &gb); + if (ret < 0) + return ret; + ctx->skipped_icc = 1; + align_get_bits(&gb); + ctx->codestream_length = get_bits_count(&gb); + } + + if (get_bits_left(&gb) <= 0) + return AVERROR_BUFFER_TOO_SMALL; + + while (1) { + ret = parse_frame_header(avctx, ctx, &gb); + if (ret < 0) + return ret; + ctx->codestream_length += ctx->codestream.frame.total_length; + if (ctx->codestream.frame.is_last) + return ctx->codestream_length / 8; + if (get_bits_left(&gb) <= ctx->codestream.frame.body_length) + return AVERROR_BUFFER_TOO_SMALL; + skip_bits_long(&gb, ctx->codestream.frame.body_length); + } +} + +static int jpegxl_parse(AVCodecParserContext *s, AVCodecContext *avctx, + const uint8_t **poutbuf, int *poutbuf_size, + const uint8_t *buf, int buf_size) +{ + JXLParseContext *ctx = s->priv_data; + int next = END_NOT_FOUND, ret; + + *poutbuf_size = 0; + *poutbuf = NULL; + + if (!ctx->pc.index) + goto flush; + + if ((!ctx->container || !ctx->codestream_length) && !ctx->next) { + ret = try_parse(s, avctx, ctx, ctx->pc.buffer, ctx->pc.index); + if (ret < 0) + goto flush; + ctx->next = ret; + if (ctx->container) + ctx->skip += ctx->next; + } + + if (ctx->container && ctx->next >= 0) { + ret = skip_boxes(ctx, ctx->pc.buffer, ctx->pc.index); + if (ret < 0) { + if (ret == AVERROR_INVALIDDATA) + ctx->next = -1; + goto flush; + } + ctx->next = ret + ctx->skip; + } + + if (ctx->next >= 0) + next = ctx->next - ctx->pc.index; + +flush: + if (next > buf_size) + next = END_NOT_FOUND; + + ret = ff_combine_frame(&ctx->pc, next, &buf, &buf_size); + if (ret < 0) + return buf_size; + + *poutbuf = buf; + *poutbuf_size = buf_size; + + ctx->codestream_length = 0; + ctx->collected_size = 0; + ctx->container = 0; + ctx->copied = 0; + ctx->skip = 0; + ctx->skipped_icc = 0; + ctx->next = 0; + memset(&ctx->codestream, 0, sizeof(ctx->codestream)); + + return next; +} + +const AVCodecParser ff_jpegxl_parser = { + .codec_ids = { AV_CODEC_ID_JPEGXL }, + .priv_data_size = sizeof(JXLParseContext), + .parser_parse = jpegxl_parse, + .parser_close = ff_parse_close, +}; diff --git a/src/third_party/ffmpeg/libavcodec/kbdwin.c b/src/third_party/ffmpeg/libavcodec/kbdwin.c index 163f9d52..ff7a7d61 100644 --- a/src/third_party/ffmpeg/libavcodec/kbdwin.c +++ b/src/third_party/ffmpeg/libavcodec/kbdwin.c @@ -17,22 +17,27 @@ */ #include "libavutil/avassert.h" +#include "libavutil/error.h" +#include "libavutil/libm.h" #include "libavutil/mathematics.h" #include "libavutil/attributes.h" +#include "libavutil/mem.h" #include "kbdwin.h" -av_cold static void kbd_window_init(float *float_window, int *int_window, float alpha, int n) +av_cold static int kbd_window_init(float *float_window, int *int_window, float alpha, int n) { int i; double sum = 0.0, tmp; double scale = 0.0; - double temp[FF_KBD_WINDOW_MAX / 2 + 1]; + double temp_small[FF_KBD_WINDOW_MAX / 2 + 1]; + double *temp= n<=FF_KBD_WINDOW_MAX ? temp_small : av_malloc((n/2+1) * sizeof(*temp)); double alpha2 = 4 * (alpha * M_PI / n) * (alpha * M_PI / n); - av_assert0(n <= FF_KBD_WINDOW_MAX); + if (!temp) + return AVERROR(ENOMEM); for (i = 0; i <= n / 2; i++) { - tmp = i * (n - i) * alpha2; + tmp = alpha2 * i * (n - i); temp[i] = av_bessel_i0(sqrt(tmp)); scale += temp[i] * (1 + (i && i /** - * Maximum window size for ff_kbd_window_init. + * Maximum window size for avpriv_kbd_window_init. */ #define FF_KBD_WINDOW_MAX 1024 @@ -30,9 +30,11 @@ * Generate a Kaiser-Bessel Derived Window. * @param window pointer to half window * @param alpha determines window shape - * @param n size of half window, max FF_KBD_WINDOW_MAX + * @param n size of half window + * + * @return if n is larger than FF_KBD_WINDOW_MAX then AVERROR(ENOMEM) is possible */ -void ff_kbd_window_init(float *window, float alpha, int n); -void ff_kbd_window_init_fixed(int32_t *window, float alpha, int n); +int avpriv_kbd_window_init(float *window, float alpha, int n); +int avpriv_kbd_window_init_fixed(int32_t *window, float alpha, int n); #endif /* AVCODEC_KBDWIN_H */ diff --git a/src/third_party/ffmpeg/libavcodec/lagarith.c b/src/third_party/ffmpeg/libavcodec/lagarith.c index ebc1f761..9574f788 100644 --- a/src/third_party/ffmpeg/libavcodec/lagarith.c +++ b/src/third_party/ffmpeg/libavcodec/lagarith.c @@ -27,6 +27,8 @@ #include +#include "libavutil/thread.h" + #include "avcodec.h" #include "codec_internal.h" #include "get_bits.h" @@ -35,6 +37,8 @@ #include "lossless_videodsp.h" #include "thread.h" +#define VLC_BITS 7 + enum LagarithFrameType { FRAME_RAW = 1, /**< uncompressed */ FRAME_U_RGB24 = 2, /**< unaligned RGB24 */ @@ -56,6 +60,35 @@ typedef struct LagarithContext { int zeros_rem; /**< number of zero bytes remaining to output */ } LagarithContext; +static VLC lag_tab; + +static const uint8_t lag_bits[] = { + 7, 7, 2, 7, 3, 4, 5, 6, 7, 7, 7, 7, 7, 6, 7, 4, 5, 7, 7, 7, 7, + 5, 6, 7, 7, 7, 7, 7, 7, 6, 7, 7, 7, 7, 7, 6, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, +}; + +static const uint8_t lag_codes[] = { + 0x01, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x05, + 0x08, 0x09, 0x0A, 0x0B, 0x0B, 0x0B, 0x0B, 0x10, 0x11, 0x12, 0x13, + 0x13, 0x13, 0x14, 0x15, 0x20, 0x21, 0x22, 0x23, 0x23, 0x24, 0x25, + 0x28, 0x29, 0x2A, 0x2B, 0x2B, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, + 0x48, 0x49, 0x4A, 0x4B, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, +}; + +static const uint8_t lag_symbols[] = { + 20, 12, 0, 12, 1, 2, 4, 7, 7, 28, 4, 25, 17, + 10, 17, 3, 6, 2, 23, 15, 15, 5, 9, 10, 31, 1, 22, + 14, 14, 8, 9, 30, 6, 27, 19, 11, 19, 0, 21, 13, 13, + 8, 29, 5, 26, 18, 18, 3, 24, 16, 16, 11, 32, +}; + +static av_cold void lag_init_static_data(void) +{ + VLC_INIT_SPARSE_STATIC(&lag_tab, VLC_BITS, FF_ARRAY_ELEMS(lag_bits), + lag_bits, 1, 1, lag_codes, 1, 1, lag_symbols, 1, 1, 128); +} + /** * Compute the 52-bit mantissa of 1/(double)denom. * This crazy format uses floats in an entropy coder and we have to match x86 @@ -101,23 +134,10 @@ static uint8_t lag_calc_zero_run(int8_t x) static int lag_decode_prob(GetBitContext *gb, uint32_t *value) { - static const uint8_t series[] = { 1, 2, 3, 5, 8, 13, 21 }; - int i; - int bit = 0; - int bits = 0; - int prevbit = 0; - unsigned val; + unsigned val, bits; - for (i = 0; i < 7; i++) { - if (prevbit && bit) - break; - prevbit = bit; - bit = get_bits1(gb); - if (bit && !prevbit) - bits += series[i]; - } - bits--; - if (bits < 0 || bits > 31) { + bits = get_vlc2(gb, lag_tab.table, VLC_BITS, 1); + if (bits > 31) { *value = 0; return AVERROR_INVALIDDATA; } else if (bits == 0) { @@ -146,17 +166,17 @@ static int lag_read_prob_header(lag_rac *rac, GetBitContext *gb) /* Read probabilities from bitstream */ for (i = 1; i < 257; i++) { if (lag_decode_prob(gb, &rac->prob[i]) < 0) { - av_log(rac->avctx, AV_LOG_ERROR, "Invalid probability encountered.\n"); + av_log(rac->logctx, AV_LOG_ERROR, "Invalid probability encountered.\n"); return AVERROR_INVALIDDATA; } if ((uint64_t)cumul_prob + rac->prob[i] > UINT_MAX) { - av_log(rac->avctx, AV_LOG_ERROR, "Integer overflow encountered in cumulative probability calculation.\n"); + av_log(rac->logctx, AV_LOG_ERROR, "Integer overflow encountered in cumulative probability calculation.\n"); return AVERROR_INVALIDDATA; } cumul_prob += rac->prob[i]; if (!rac->prob[i]) { if (lag_decode_prob(gb, &prob)) { - av_log(rac->avctx, AV_LOG_ERROR, "Invalid probability run encountered.\n"); + av_log(rac->logctx, AV_LOG_ERROR, "Invalid probability run encountered.\n"); return AVERROR_INVALIDDATA; } if (prob > 256 - i) @@ -169,7 +189,7 @@ static int lag_read_prob_header(lag_rac *rac, GetBitContext *gb) } if (!cumul_prob) { - av_log(rac->avctx, AV_LOG_ERROR, "All probabilities are 0!\n"); + av_log(rac->logctx, AV_LOG_ERROR, "All probabilities are 0!\n"); return AVERROR_INVALIDDATA; } @@ -187,7 +207,7 @@ static int lag_read_prob_header(lag_rac *rac, GetBitContext *gb) scaled_cumul_prob += rac->prob[i]; } if (scaled_cumul_prob <= 0) { - av_log(rac->avctx, AV_LOG_ERROR, "Scaled probabilities invalid\n"); + av_log(rac->logctx, AV_LOG_ERROR, "Scaled probabilities invalid\n"); return AVERROR_INVALIDDATA; } for (; i < 257; i++) { @@ -201,7 +221,7 @@ static int lag_read_prob_header(lag_rac *rac, GetBitContext *gb) cumulative_target = 1U << scale_factor; if (scaled_cumul_prob > cumulative_target) { - av_log(rac->avctx, AV_LOG_ERROR, + av_log(rac->logctx, AV_LOG_ERROR, "Scaled probabilities are larger than target!\n"); return AVERROR_INVALIDDATA; } @@ -443,7 +463,7 @@ static int lag_decode_arith_plane(LagarithContext *l, uint8_t *dst, const uint8_t *src_end = src + src_size; int ret; - rac.avctx = l->avctx; + rac.logctx = l->avctx; l->zeros = 0; if(src_size < 2) @@ -720,10 +740,12 @@ static int lag_decode_frame(AVCodecContext *avctx, AVFrame *p, static av_cold int lag_decode_init(AVCodecContext *avctx) { + static AVOnce init_static_once = AV_ONCE_INIT; LagarithContext *l = avctx->priv_data; l->avctx = avctx; ff_llviddsp_init(&l->llviddsp); + ff_thread_once(&init_static_once, lag_init_static_data); return 0; } diff --git a/src/third_party/ffmpeg/libavcodec/lagarithrac.h b/src/third_party/ffmpeg/libavcodec/lagarithrac.h index a31b054d..2c8cb738 100644 --- a/src/third_party/ffmpeg/libavcodec/lagarithrac.h +++ b/src/third_party/ffmpeg/libavcodec/lagarithrac.h @@ -32,11 +32,10 @@ #include #include "libavutil/intreadwrite.h" -#include "avcodec.h" #include "get_bits.h" typedef struct lag_rac { - AVCodecContext *avctx; + void *logctx; unsigned low; unsigned range; unsigned scale; /**< Number of bits of precision in range. */ diff --git a/src/third_party/ffmpeg/libavcodec/lcldec.c b/src/third_party/ffmpeg/libavcodec/lcldec.c index ed78d9d5..b4304618 100644 --- a/src/third_party/ffmpeg/libavcodec/lcldec.c +++ b/src/third_party/ffmpeg/libavcodec/lcldec.c @@ -167,7 +167,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; LclDecContext * const c = avctx->priv_data; - unsigned int pixel_ptr; + ptrdiff_t pixel_ptr; int row, col; unsigned char *encoded = avpkt->data, *outptr; uint8_t *y_out, *u_out, *v_out; @@ -231,16 +231,19 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, break; case COMP_MSZH_NOCOMP: { int bppx2; + int aligned_width = width; switch (c->imgtype) { case IMGTYPE_YUV111: case IMGTYPE_RGB24: bppx2 = 6; break; case IMGTYPE_YUV422: + aligned_width &= ~3; case IMGTYPE_YUV211: bppx2 = 4; break; case IMGTYPE_YUV411: + aligned_width &= ~3; case IMGTYPE_YUV420: bppx2 = 3; break; @@ -248,7 +251,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, bppx2 = 0; // will error out below break; } - if (len < ((width * height * bppx2) >> 1)) + if (len < ((aligned_width * height * bppx2) >> 1)) return AVERROR_INVALIDDATA; break; } @@ -314,8 +317,8 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, } break; case IMGTYPE_YUV422: + pixel_ptr = 0; for (row = 0; row < height; row++) { - pixel_ptr = row * width * 2; yq = uq = vq =0; for (col = 0; col < width/4; col++) { encoded[pixel_ptr] = yq -= encoded[pixel_ptr]; @@ -331,8 +334,8 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, } break; case IMGTYPE_YUV411: + pixel_ptr = 0; for (row = 0; row < height; row++) { - pixel_ptr = row * width / 2 * 3; yq = uq = vq =0; for (col = 0; col < width/4; col++) { encoded[pixel_ptr] = yq -= encoded[pixel_ptr]; diff --git a/src/third_party/ffmpeg/libavcodec/libaomdec.c b/src/third_party/ffmpeg/libavcodec/libaomdec.c index 767c216a..695d9010 100644 --- a/src/third_party/ffmpeg/libavcodec/libaomdec.c +++ b/src/third_party/ffmpeg/libavcodec/libaomdec.c @@ -78,17 +78,17 @@ static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img) if (img->bit_depth == 8) { avctx->pix_fmt = img->monochrome ? AV_PIX_FMT_GRAY8 : AV_PIX_FMT_YUV420P; - avctx->profile = FF_PROFILE_AV1_MAIN; + avctx->profile = AV_PROFILE_AV1_MAIN; return 0; } else if (img->bit_depth == 10) { avctx->pix_fmt = img->monochrome ? AV_PIX_FMT_GRAY10 : AV_PIX_FMT_YUV420P10; - avctx->profile = FF_PROFILE_AV1_MAIN; + avctx->profile = AV_PROFILE_AV1_MAIN; return 0; } else if (img->bit_depth == 12) { avctx->pix_fmt = img->monochrome ? AV_PIX_FMT_GRAY12 : AV_PIX_FMT_YUV420P12; - avctx->profile = FF_PROFILE_AV1_PROFESSIONAL; + avctx->profile = AV_PROFILE_AV1_PROFESSIONAL; return 0; } else { return AVERROR_INVALIDDATA; @@ -97,15 +97,15 @@ static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img) case AOM_IMG_FMT_I42216: if (img->bit_depth == 8) { avctx->pix_fmt = AV_PIX_FMT_YUV422P; - avctx->profile = FF_PROFILE_AV1_PROFESSIONAL; + avctx->profile = AV_PROFILE_AV1_PROFESSIONAL; return 0; } else if (img->bit_depth == 10) { avctx->pix_fmt = AV_PIX_FMT_YUV422P10; - avctx->profile = FF_PROFILE_AV1_PROFESSIONAL; + avctx->profile = AV_PROFILE_AV1_PROFESSIONAL; return 0; } else if (img->bit_depth == 12) { avctx->pix_fmt = AV_PIX_FMT_YUV422P12; - avctx->profile = FF_PROFILE_AV1_PROFESSIONAL; + avctx->profile = AV_PROFILE_AV1_PROFESSIONAL; return 0; } else { return AVERROR_INVALIDDATA; @@ -115,18 +115,18 @@ static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img) if (img->bit_depth == 8) { avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ? AV_PIX_FMT_GBRP : AV_PIX_FMT_YUV444P; - avctx->profile = FF_PROFILE_AV1_HIGH; + avctx->profile = AV_PROFILE_AV1_HIGH; return 0; } else if (img->bit_depth == 10) { avctx->pix_fmt = AV_PIX_FMT_YUV444P10; avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ? AV_PIX_FMT_GBRP10 : AV_PIX_FMT_YUV444P10; - avctx->profile = FF_PROFILE_AV1_HIGH; + avctx->profile = AV_PROFILE_AV1_HIGH; return 0; } else if (img->bit_depth == 12) { avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ? AV_PIX_FMT_GBRP12 : AV_PIX_FMT_YUV444P12; - avctx->profile = FF_PROFILE_AV1_PROFESSIONAL; + avctx->profile = AV_PROFILE_AV1_PROFESSIONAL; return 0; } else { return AVERROR_INVALIDDATA; diff --git a/src/third_party/ffmpeg/libavcodec/libaomenc.c b/src/third_party/ffmpeg/libavcodec/libaomenc.c index 16747e7e..aa800834 100644 --- a/src/third_party/ffmpeg/libavcodec/libaomenc.c +++ b/src/third_party/ffmpeg/libavcodec/libaomenc.c @@ -451,16 +451,16 @@ static int set_pix_fmt(AVCodecContext *avctx, aom_codec_caps_t codec_caps, enccfg->monochrome = 1; /* Fall-through */ case AV_PIX_FMT_YUV420P: - enccfg->g_profile = FF_PROFILE_AV1_MAIN; + enccfg->g_profile = AV_PROFILE_AV1_MAIN; *img_fmt = AOM_IMG_FMT_I420; return 0; case AV_PIX_FMT_YUV422P: - enccfg->g_profile = FF_PROFILE_AV1_PROFESSIONAL; + enccfg->g_profile = AV_PROFILE_AV1_PROFESSIONAL; *img_fmt = AOM_IMG_FMT_I422; return 0; case AV_PIX_FMT_YUV444P: case AV_PIX_FMT_GBRP: - enccfg->g_profile = FF_PROFILE_AV1_HIGH; + enccfg->g_profile = AV_PROFILE_AV1_HIGH; *img_fmt = AOM_IMG_FMT_I444; return 0; case AV_PIX_FMT_GRAY10: @@ -471,7 +471,7 @@ static int set_pix_fmt(AVCodecContext *avctx, aom_codec_caps_t codec_caps, case AV_PIX_FMT_YUV420P12: if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) { enccfg->g_profile = - enccfg->g_bit_depth == 10 ? FF_PROFILE_AV1_MAIN : FF_PROFILE_AV1_PROFESSIONAL; + enccfg->g_bit_depth == 10 ? AV_PROFILE_AV1_MAIN : AV_PROFILE_AV1_PROFESSIONAL; *img_fmt = AOM_IMG_FMT_I42016; *flags |= AOM_CODEC_USE_HIGHBITDEPTH; return 0; @@ -480,7 +480,7 @@ static int set_pix_fmt(AVCodecContext *avctx, aom_codec_caps_t codec_caps, case AV_PIX_FMT_YUV422P10: case AV_PIX_FMT_YUV422P12: if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) { - enccfg->g_profile = FF_PROFILE_AV1_PROFESSIONAL; + enccfg->g_profile = AV_PROFILE_AV1_PROFESSIONAL; *img_fmt = AOM_IMG_FMT_I42216; *flags |= AOM_CODEC_USE_HIGHBITDEPTH; return 0; @@ -492,7 +492,7 @@ static int set_pix_fmt(AVCodecContext *avctx, aom_codec_caps_t codec_caps, case AV_PIX_FMT_GBRP12: if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) { enccfg->g_profile = - enccfg->g_bit_depth == 10 ? FF_PROFILE_AV1_HIGH : FF_PROFILE_AV1_PROFESSIONAL; + enccfg->g_bit_depth == 10 ? AV_PROFILE_AV1_HIGH : AV_PROFILE_AV1_PROFESSIONAL; *img_fmt = AOM_IMG_FMT_I44416; *flags |= AOM_CODEC_USE_HIGHBITDEPTH; return 0; @@ -842,7 +842,7 @@ static av_cold int aom_init(AVCodecContext *avctx, /* 0-3: For non-zero values the encoder increasingly optimizes for reduced * complexity playback on low powered devices at the expense of encode * quality. */ - if (avctx->profile != FF_PROFILE_UNKNOWN) + if (avctx->profile != AV_PROFILE_UNKNOWN) enccfg.g_profile = avctx->profile; enccfg.g_error_resilient = ctx->error_resilient; @@ -1018,7 +1018,7 @@ static av_cold int aom_init(AVCodecContext *avctx, if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) ctx->rawimg.bit_depth = enccfg.g_bit_depth; - cpb_props = ff_add_cpb_side_data(avctx); + cpb_props = ff_encode_add_cpb_side_data(avctx); if (!cpb_props) return AVERROR(ENOMEM); @@ -1299,7 +1299,7 @@ static int aom_encode(AVCodecContext *avctx, AVPacket *pkt, duration = frame->duration; else if (avctx->framerate.num > 0 && avctx->framerate.den > 0) duration = av_rescale_q(1, av_inv_q(avctx->framerate), avctx->time_base); - else + else { FF_DISABLE_DEPRECATION_WARNINGS duration = #if FF_API_TICKS_PER_FRAME @@ -1307,6 +1307,7 @@ FF_DISABLE_DEPRECATION_WARNINGS #endif 1; FF_ENABLE_DEPRECATION_WARNINGS + } switch (frame->color_range) { case AVCOL_RANGE_MPEG: diff --git a/src/third_party/ffmpeg/libavcodec/libaribb24.c b/src/third_party/ffmpeg/libavcodec/libaribb24.c index e3e244be..29479e37 100644 --- a/src/third_party/ffmpeg/libavcodec/libaribb24.c +++ b/src/third_party/ffmpeg/libavcodec/libaribb24.c @@ -49,13 +49,13 @@ static unsigned int get_profile_font_size(AVCodecContext *avctx) Libaribb24Context *b24 = avctx->priv_data; int profile = avctx->profile; - if (profile == FF_PROFILE_UNKNOWN) + if (profile == AV_PROFILE_UNKNOWN) profile = b24->default_profile; switch (profile) { - case FF_PROFILE_ARIB_PROFILE_A: + case AV_PROFILE_ARIB_PROFILE_A: return 36; - case FF_PROFILE_ARIB_PROFILE_C: + case AV_PROFILE_ARIB_PROFILE_C: return 18; default: return 0; @@ -75,15 +75,15 @@ static int libaribb24_generate_ass_header(AVCodecContext *avctx) unsigned int font_size = 0; int profile = avctx->profile; - if (profile == FF_PROFILE_UNKNOWN) + if (profile == AV_PROFILE_UNKNOWN) profile = b24->default_profile; switch (profile) { - case FF_PROFILE_ARIB_PROFILE_A: + case AV_PROFILE_ARIB_PROFILE_A: plane_width = 960; plane_height = 540; break; - case FF_PROFILE_ARIB_PROFILE_C: + case AV_PROFILE_ARIB_PROFILE_C: plane_width = 320; plane_height = 180; break; @@ -147,12 +147,12 @@ static int libaribb24_init(AVCodecContext *avctx) { Libaribb24Context *b24 = avctx->priv_data; void(* arib_dec_init)(arib_decoder_t* decoder) = NULL; - int ret_code = AVERROR_EXTERNAL; + int ret; int profile = avctx->profile; if (!(b24->lib_instance = arib_instance_new(avctx))) { av_log(avctx, AV_LOG_ERROR, "Failed to initialize libaribb24!\n"); - goto init_fail; + return AVERROR_EXTERNAL; } if (b24->aribb24_base_path) { @@ -165,46 +165,35 @@ static int libaribb24_init(AVCodecContext *avctx) if (!(b24->parser = arib_get_parser(b24->lib_instance))) { av_log(avctx, AV_LOG_ERROR, "Failed to initialize libaribb24 PES parser!\n"); - goto init_fail; + return AVERROR_EXTERNAL; } if (!(b24->decoder = arib_get_decoder(b24->lib_instance))) { av_log(avctx, AV_LOG_ERROR, "Failed to initialize libaribb24 decoder!\n"); - goto init_fail; + return AVERROR_EXTERNAL; } - if (profile == FF_PROFILE_UNKNOWN) + if (profile == AV_PROFILE_UNKNOWN) profile = b24->default_profile; switch (profile) { - case FF_PROFILE_ARIB_PROFILE_A: + case AV_PROFILE_ARIB_PROFILE_A: arib_dec_init = arib_initialize_decoder_a_profile; break; - case FF_PROFILE_ARIB_PROFILE_C: + case AV_PROFILE_ARIB_PROFILE_C: arib_dec_init = arib_initialize_decoder_c_profile; break; default: av_log(avctx, AV_LOG_ERROR, "Unknown or unsupported profile set!\n"); - ret_code = AVERROR(EINVAL); - goto init_fail; + return AVERROR(EINVAL); } arib_dec_init(b24->decoder); - if (libaribb24_generate_ass_header(avctx) < 0) { - ret_code = AVERROR(ENOMEM); - goto init_fail; - } + ret = libaribb24_generate_ass_header(avctx); + if (ret < 0) + return ret; return 0; - -init_fail: - if (b24->decoder) - arib_finalize_decoder(b24->decoder); - - if (b24->lib_instance) - arib_instance_destroy(b24->lib_instance); - - return ret_code; } static int libaribb24_close(AVCodecContext *avctx) @@ -227,7 +216,7 @@ static int libaribb24_handle_regions(AVCodecContext *avctx, AVSubtitle *sub) Libaribb24Context *b24 = avctx->priv_data; const arib_buf_region_t *region = arib_decoder_get_regions(b24->decoder); unsigned int profile_font_size = get_profile_font_size(avctx); - AVBPrint buf = { 0 }; + AVBPrint buf; int ret = 0; av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED); @@ -390,9 +379,9 @@ static const AVOption options[] = { { "aribb24-skip-ruby-text", "skip ruby text blocks during decoding", OFFSET(aribb24_skip_ruby), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, SD }, { "default_profile", "default profile to use if not specified in the stream parameters", - OFFSET(default_profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, FF_PROFILE_ARIB_PROFILE_C, SD, "profile" }, - {"a", "Profile A", 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_ARIB_PROFILE_A}, INT_MIN, INT_MAX, SD, "profile"}, - {"c", "Profile C", 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_ARIB_PROFILE_C}, INT_MIN, INT_MAX, SD, "profile"}, + OFFSET(default_profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, AV_PROFILE_ARIB_PROFILE_C, SD, "profile" }, + {"a", "Profile A", 0, AV_OPT_TYPE_CONST, {.i64 = AV_PROFILE_ARIB_PROFILE_A}, INT_MIN, INT_MAX, SD, "profile"}, + {"c", "Profile C", 0, AV_OPT_TYPE_CONST, {.i64 = AV_PROFILE_ARIB_PROFILE_C}, INT_MIN, INT_MAX, SD, "profile"}, { NULL } }; @@ -410,7 +399,7 @@ const FFCodec ff_libaribb24_decoder = { .p.id = AV_CODEC_ID_ARIB_CAPTION, .p.priv_class = &aribb24_class, .p.wrapper_name = "libaribb24", - .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_NOT_INIT_THREADSAFE, .priv_data_size = sizeof(Libaribb24Context), .init = libaribb24_init, .close = libaribb24_close, diff --git a/src/third_party/ffmpeg/libavcodec/libaribcaption.c b/src/third_party/ffmpeg/libavcodec/libaribcaption.c index 747ca8a2..8a8c8f8c 100644 --- a/src/third_party/ffmpeg/libavcodec/libaribcaption.c +++ b/src/third_party/ffmpeg/libavcodec/libaribcaption.c @@ -452,7 +452,7 @@ static int aribcaption_trans_bitmap_subtitle(ARIBCaptionContext *ctx) goto fail; } - if (ctx->avctx->profile == FF_PROFILE_ARIB_PROFILE_C) { + if (ctx->avctx->profile == AV_PROFILE_ARIB_PROFILE_C) { /* ARIB TR-B14 version 3.8 Fascicle 1-(2/2) Volume 3 [Section 4] */ /* No position information is provided for profile C */ rect->x = (ctx->frame_width - rect->w) / 2; @@ -594,7 +594,7 @@ static int aribcaption_trans_ass_subtitle(ARIBCaptionContext *ctx) /* ARIB TR-B14 version 3.8 Fascicle 1-(2/2) Volume 3 [Section 4] */ /* No position information is provided for profile C */ - if (ctx->avctx->profile == FF_PROFILE_ARIB_PROFILE_C) + if (ctx->avctx->profile == AV_PROFILE_ARIB_PROFILE_C) single_rect = true; sub->format = 1; /* text */ @@ -606,7 +606,7 @@ static int aribcaption_trans_ass_subtitle(ARIBCaptionContext *ctx) av_bprint_init(&buf, ARIBC_BPRINT_SIZE_INIT, ARIBC_BPRINT_SIZE_MAX); - if (single_rect && ctx->avctx->profile != FF_PROFILE_ARIB_PROFILE_C) { + if (single_rect && ctx->avctx->profile != AV_PROFILE_ARIB_PROFILE_C) { int x, y, rx, ry; x = ctx->plane_width; y = ctx->plane_height; @@ -660,7 +660,7 @@ static int aribcaption_trans_ass_subtitle(ARIBCaptionContext *ctx) for (int j = 0; j < region->char_count; j++) { aribcc_caption_char_t *ch = ®ion->chars[j]; - if (ctx->avctx->profile != FF_PROFILE_ARIB_PROFILE_C) { + if (ctx->avctx->profile != AV_PROFILE_ARIB_PROFILE_C) { if (ch->char_horizontal_spacing != char_horizontal_spacing) { av_bprintf(&buf, "{\\fsp%d}", (region->is_ruby) ? ch->char_horizontal_spacing / 2 : @@ -960,14 +960,14 @@ static int aribcaption_init(AVCodecContext *avctx) ctx->avctx = avctx; switch (avctx->profile) { - case FF_PROFILE_ARIB_PROFILE_A: + case AV_PROFILE_ARIB_PROFILE_A: profile = ARIBCC_PROFILE_A; /* assume 960x540 at initial state */ ctx->plane_width = 960; ctx->plane_height = 540; ctx->font_size = 36; break; - case FF_PROFILE_ARIB_PROFILE_C: + case AV_PROFILE_ARIB_PROFILE_C: profile = ARIBCC_PROFILE_C; ctx->plane_width = 320; ctx->plane_height = 180; diff --git a/src/third_party/ffmpeg/libavcodec/libfdk-aacenc.c b/src/third_party/ffmpeg/libavcodec/libfdk-aacenc.c index e08c6a0c..d400ac2e 100644 --- a/src/third_party/ffmpeg/libavcodec/libfdk-aacenc.c +++ b/src/third_party/ffmpeg/libavcodec/libfdk-aacenc.c @@ -179,7 +179,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) AACENC_InfoStruct info = { 0 }; CHANNEL_MODE mode; AACENC_ERROR err; - int aot = FF_PROFILE_AAC_LOW + 1; + int aot = AV_PROFILE_AAC_LOW + 1; int sce = 0, cpe = 0; if ((err = aacEncOpen(&s->handle, 0, avctx->ch_layout.nb_channels)) != AACENC_OK) { @@ -188,7 +188,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) goto error; } - if (avctx->profile != FF_PROFILE_UNKNOWN) + if (avctx->profile != AV_PROFILE_UNKNOWN) aot = avctx->profile + 1; if ((err = aacEncoder_SetParam(s->handle, AACENC_AOT, aot)) != AACENC_OK) { @@ -197,7 +197,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) goto error; } - if (aot == FF_PROFILE_AAC_ELD + 1 && s->eld_sbr) { + if (aot == AV_PROFILE_AAC_ELD + 1 && s->eld_sbr) { if ((err = aacEncoder_SetParam(s->handle, AACENC_SBR_MODE, 1)) != AACENC_OK) { av_log(avctx, AV_LOG_ERROR, "Unable to enable SBR for ELD: %s\n", @@ -227,7 +227,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) case 2: #if FDKENC_VER_AT_LEAST(4, 0) // 4.0.0 // (profile + 1) to map from profile range to AOT range - if (aot == FF_PROFILE_AAC_ELD + 1 && s->eld_v2) { + if (aot == AV_PROFILE_AAC_ELD + 1 && s->eld_v2) { if ((err = aacEncoder_SetParam(s->handle, AACENC_CHANNELMODE, 128)) != AACENC_OK) { av_log(avctx, AV_LOG_ERROR, "Unable to enable ELDv2: %s\n", @@ -310,14 +310,14 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) } } else { if (avctx->bit_rate <= 0) { - if (avctx->profile == FF_PROFILE_AAC_HE_V2) { + if (avctx->profile == AV_PROFILE_AAC_HE_V2) { sce = 1; cpe = 0; } avctx->bit_rate = (96*sce + 128*cpe) * avctx->sample_rate / 44; - if (avctx->profile == FF_PROFILE_AAC_HE || - avctx->profile == FF_PROFILE_AAC_HE_V2 || - avctx->profile == FF_PROFILE_MPEG2_AAC_HE || + if (avctx->profile == AV_PROFILE_AAC_HE || + avctx->profile == AV_PROFILE_AAC_HE_V2 || + avctx->profile == AV_PROFILE_MPEG2_AAC_HE || s->eld_sbr) avctx->bit_rate /= 2; } @@ -544,12 +544,12 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, } static const AVProfile profiles[] = { - { FF_PROFILE_AAC_LOW, "LC" }, - { 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 }, + { AV_PROFILE_AAC_LOW, "LC" }, + { AV_PROFILE_AAC_HE, "HE-AAC" }, + { AV_PROFILE_AAC_HE_V2, "HE-AACv2" }, + { AV_PROFILE_AAC_LD, "LD" }, + { AV_PROFILE_AAC_ELD, "ELD" }, + { AV_PROFILE_UNKNOWN }, }; static const FFCodecDefault aac_encode_defaults[] = { diff --git a/src/third_party/ffmpeg/libavcodec/libjxldec.c b/src/third_party/ffmpeg/libavcodec/libjxldec.c index e45ac02c..002740d9 100644 --- a/src/third_party/ffmpeg/libavcodec/libjxldec.c +++ b/src/third_party/ffmpeg/libavcodec/libjxldec.c @@ -58,6 +58,7 @@ typedef struct LibJxlDecodeContext { int64_t frame_duration; int prev_is_last; AVRational timebase; + AVFrame *frame; } LibJxlDecodeContext; static int libjxl_init_jxl_decoder(AVCodecContext *avctx) @@ -104,6 +105,9 @@ static av_cold int libjxl_decode_init(AVCodecContext *avctx) ctx->avpkt = avctx->internal->in_pkt; ctx->pts = 0; + ctx->frame = av_frame_alloc(); + if (!ctx->frame) + return AVERROR(ENOMEM); return libjxl_init_jxl_decoder(avctx); } @@ -298,7 +302,7 @@ static int libjxl_color_encoding_event(AVCodecContext *avctx, AVFrame *frame) } avctx->color_range = frame->color_range = AVCOL_RANGE_JPEG; - if (ctx->jxl_pixfmt.num_channels >= 3) + if (ctx->basic_info.num_color_channels > 1) avctx->colorspace = AVCOL_SPC_RGB; avctx->color_primaries = AVCOL_PRI_UNSPECIFIED; avctx->color_trc = AVCOL_TRC_UNSPECIFIED; @@ -334,7 +338,7 @@ static int libjxl_color_encoding_event(AVCodecContext *avctx, AVFrame *frame) } /* all colors will be in-gamut so we want accurate colors */ jxl_color.rendering_intent = JXL_RENDERING_INTENT_RELATIVE; - jxl_color.color_space = avctx->colorspace == AVCOL_SPC_RGB ? JXL_COLOR_SPACE_RGB : JXL_COLOR_SPACE_GRAY; + jxl_color.color_space = ctx->basic_info.num_color_channels > 1 ? JXL_COLOR_SPACE_RGB : JXL_COLOR_SPACE_GRAY; jret = JxlDecoderSetPreferredColorProfile(ctx->decoder, &jxl_color); if (jret != JXL_DEC_SUCCESS) { av_log(avctx, AV_LOG_WARNING, "Unable to set fallback color encoding\n"); @@ -406,10 +410,6 @@ static int libjxl_receive_frame(AVCodecContext *avctx, AVFrame *frame) return AVERROR_INVALIDDATA; case JXL_DEC_NEED_MORE_INPUT: av_log(avctx, AV_LOG_DEBUG, "NEED_MORE_INPUT event emitted\n"); - if (!pkt->size) { - av_packet_unref(pkt); - return AVERROR(EAGAIN); - } continue; case JXL_DEC_BASIC_INFO: av_log(avctx, AV_LOG_DEBUG, "BASIC_INFO event emitted\n"); @@ -438,16 +438,19 @@ static int libjxl_receive_frame(AVCodecContext *avctx, AVFrame *frame) continue; case JXL_DEC_COLOR_ENCODING: av_log(avctx, AV_LOG_DEBUG, "COLOR_ENCODING event emitted\n"); - if ((ret = libjxl_color_encoding_event(avctx, frame)) < 0) + ret = libjxl_color_encoding_event(avctx, ctx->frame); + if (ret < 0) return ret; continue; case JXL_DEC_NEED_IMAGE_OUT_BUFFER: av_log(avctx, AV_LOG_DEBUG, "NEED_IMAGE_OUT_BUFFER event emitted\n"); - if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) + ret = ff_get_buffer(avctx, ctx->frame, 0); + if (ret < 0) return ret; - ctx->jxl_pixfmt.align = frame->linesize[0]; - if (JxlDecoderSetImageOutBuffer(ctx->decoder, &ctx->jxl_pixfmt, frame->data[0], frame->buf[0]->size) - != JXL_DEC_SUCCESS) { + ctx->jxl_pixfmt.align = ctx->frame->linesize[0]; + if (JxlDecoderSetImageOutBuffer(ctx->decoder, &ctx->jxl_pixfmt, + ctx->frame->data[0], ctx->frame->buf[0]->size) + != JXL_DEC_SUCCESS) { av_log(avctx, AV_LOG_ERROR, "Bad libjxl dec need image out buffer event\n"); return AVERROR_EXTERNAL; } @@ -461,8 +464,8 @@ static int libjxl_receive_frame(AVCodecContext *avctx, AVFrame *frame) case JXL_DEC_FRAME: av_log(avctx, AV_LOG_DEBUG, "FRAME event emitted\n"); if (!ctx->basic_info.have_animation || ctx->prev_is_last) { - frame->pict_type = AV_PICTURE_TYPE_I; - frame->flags |= AV_FRAME_FLAG_KEY; + ctx->frame->pict_type = AV_PICTURE_TYPE_I; + ctx->frame->flags |= AV_FRAME_FLAG_KEY; } if (ctx->basic_info.have_animation) { JxlFrameHeader header; @@ -481,20 +484,21 @@ static int libjxl_receive_frame(AVCodecContext *avctx, AVFrame *frame) /* full image is one frame, even if animated */ av_log(avctx, AV_LOG_DEBUG, "FULL_IMAGE event emitted\n"); if (ctx->iccp) { - AVFrameSideData *sd = av_frame_new_side_data_from_buf(frame, AV_FRAME_DATA_ICC_PROFILE, ctx->iccp); + AVFrameSideData *sd = av_frame_new_side_data_from_buf(ctx->frame, AV_FRAME_DATA_ICC_PROFILE, ctx->iccp); if (!sd) return AVERROR(ENOMEM); /* ownership is transfered, and it is not ref-ed */ ctx->iccp = NULL; } if (avctx->pkt_timebase.num) { - frame->pts = av_rescale_q(ctx->pts, ctx->timebase, avctx->pkt_timebase); - frame->duration = av_rescale_q(ctx->frame_duration, ctx->timebase, avctx->pkt_timebase); + ctx->frame->pts = av_rescale_q(ctx->pts, ctx->timebase, avctx->pkt_timebase); + ctx->frame->duration = av_rescale_q(ctx->frame_duration, ctx->timebase, avctx->pkt_timebase); } else { - frame->pts = ctx->pts; - frame->duration = ctx->frame_duration; + ctx->frame->pts = ctx->pts; + ctx->frame->duration = ctx->frame_duration; } ctx->pts += ctx->frame_duration; + av_frame_move_ref(frame, ctx->frame); return 0; case JXL_DEC_SUCCESS: av_log(avctx, AV_LOG_DEBUG, "SUCCESS event emitted\n"); @@ -525,6 +529,7 @@ static av_cold int libjxl_decode_close(AVCodecContext *avctx) JxlDecoderDestroy(ctx->decoder); ctx->decoder = NULL; av_buffer_unref(&ctx->iccp); + av_frame_free(&ctx->frame); return 0; } diff --git a/src/third_party/ffmpeg/libavcodec/libkvazaar.c b/src/third_party/ffmpeg/libavcodec/libkvazaar.c index 2ef34dd8..0ebf3760 100644 --- a/src/third_party/ffmpeg/libavcodec/libkvazaar.c +++ b/src/third_party/ffmpeg/libavcodec/libkvazaar.c @@ -221,9 +221,9 @@ static int libkvazaar_encode(AVCodecContext *avctx, frame->width / 2, 0 }; - av_image_copy(dst, dst_linesizes, - (const uint8_t **)frame->data, frame->linesize, - frame->format, frame->width, frame->height); + av_image_copy2(dst, dst_linesizes, + frame->data, frame->linesize, + frame->format, frame->width, frame->height); } input_pic->pts = frame->pts; diff --git a/src/third_party/ffmpeg/libavcodec/libopenh264dec.c b/src/third_party/ffmpeg/libavcodec/libopenh264dec.c index af53219b..7d650ae0 100644 --- a/src/third_party/ffmpeg/libavcodec/libopenh264dec.c +++ b/src/third_party/ffmpeg/libavcodec/libopenh264dec.c @@ -141,7 +141,8 @@ static int svc_decode_frame(AVCodecContext *avctx, AVFrame *avframe, linesize[0] = info.UsrData.sSystemBuffer.iStride[0]; linesize[1] = linesize[2] = info.UsrData.sSystemBuffer.iStride[1]; linesize[3] = 0; - av_image_copy(avframe->data, avframe->linesize, (const uint8_t **) ptrs, linesize, avctx->pix_fmt, avctx->width, avctx->height); + av_image_copy2(avframe->data, avframe->linesize, ptrs, linesize, + avctx->pix_fmt, avctx->width, avctx->height); avframe->pts = info.uiOutYuvTimeStamp; avframe->pkt_dts = AV_NOPTS_VALUE; diff --git a/src/third_party/ffmpeg/libavcodec/libopenh264enc.c b/src/third_party/ffmpeg/libavcodec/libopenh264enc.c index 5b59af6f..f518d089 100644 --- a/src/third_party/ffmpeg/libavcodec/libopenh264enc.c +++ b/src/third_party/ffmpeg/libavcodec/libopenh264enc.c @@ -61,11 +61,11 @@ typedef struct SVCContext { #define DEPRECATED AV_OPT_FLAG_DEPRECATED static const AVOption options[] = { { "loopfilter", "enable loop filter", OFFSET(loopfilter), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE }, - { "profile", "set profile restrictions", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, 0xffff, VE, "profile" }, + { "profile", "set profile restrictions", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, 0xffff, VE, "profile" }, #define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, { .i64 = value }, 0, 0, VE, "profile" - { PROFILE("constrained_baseline", FF_PROFILE_H264_CONSTRAINED_BASELINE) }, - { PROFILE("main", FF_PROFILE_H264_MAIN) }, - { PROFILE("high", FF_PROFILE_H264_HIGH) }, + { PROFILE("constrained_baseline", AV_PROFILE_H264_CONSTRAINED_BASELINE) }, + { PROFILE("main", AV_PROFILE_H264_MAIN) }, + { PROFILE("high", AV_PROFILE_H264_HIGH) }, #undef PROFILE { "max_nal_size", "set maximum NAL size in bytes", OFFSET(max_nal_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE }, { "allow_skip_frames", "allow skipping frames to hit the target bitrate", OFFSET(skip_frames), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, @@ -177,12 +177,12 @@ FF_ENABLE_DEPRECATION_WARNINGS param.iMultipleThreadIdc = avctx->thread_count; /* Allow specifying the libopenh264 profile through AVCodecContext. */ - if (FF_PROFILE_UNKNOWN == s->profile && - FF_PROFILE_UNKNOWN != avctx->profile) + if (AV_PROFILE_UNKNOWN == s->profile && + AV_PROFILE_UNKNOWN != avctx->profile) switch (avctx->profile) { - case FF_PROFILE_H264_HIGH: - case FF_PROFILE_H264_MAIN: - case FF_PROFILE_H264_CONSTRAINED_BASELINE: + case AV_PROFILE_H264_HIGH: + case AV_PROFILE_H264_MAIN: + case AV_PROFILE_H264_CONSTRAINED_BASELINE: s->profile = avctx->profile; break; default: @@ -191,34 +191,34 @@ FF_ENABLE_DEPRECATION_WARNINGS break; } - if (s->profile == FF_PROFILE_UNKNOWN && s->coder >= 0) - s->profile = s->coder == 0 ? FF_PROFILE_H264_CONSTRAINED_BASELINE : + if (s->profile == AV_PROFILE_UNKNOWN && s->coder >= 0) + s->profile = s->coder == 0 ? AV_PROFILE_H264_CONSTRAINED_BASELINE : #if OPENH264_VER_AT_LEAST(1, 8) - FF_PROFILE_H264_HIGH; + AV_PROFILE_H264_HIGH; #else - FF_PROFILE_H264_MAIN; + AV_PROFILE_H264_MAIN; #endif switch (s->profile) { - case FF_PROFILE_H264_HIGH: + case AV_PROFILE_H264_HIGH: av_log(avctx, AV_LOG_VERBOSE, "Using %s, " "select EProfileIdc PRO_HIGH in libopenh264.\n", param.iEntropyCodingModeFlag ? "CABAC" : "CAVLC"); break; - case FF_PROFILE_H264_MAIN: + case AV_PROFILE_H264_MAIN: av_log(avctx, AV_LOG_VERBOSE, "Using %s, " "select EProfileIdc PRO_MAIN in libopenh264.\n", param.iEntropyCodingModeFlag ? "CABAC" : "CAVLC"); break; - case FF_PROFILE_H264_CONSTRAINED_BASELINE: - case FF_PROFILE_UNKNOWN: - s->profile = FF_PROFILE_H264_CONSTRAINED_BASELINE; + case AV_PROFILE_H264_CONSTRAINED_BASELINE: + case AV_PROFILE_UNKNOWN: + s->profile = AV_PROFILE_H264_CONSTRAINED_BASELINE; param.iEntropyCodingModeFlag = 0; av_log(avctx, AV_LOG_VERBOSE, "Using CAVLC, " "select EProfileIdc PRO_BASELINE in libopenh264.\n"); break; default: - s->profile = FF_PROFILE_H264_CONSTRAINED_BASELINE; + s->profile = AV_PROFILE_H264_CONSTRAINED_BASELINE; param.iEntropyCodingModeFlag = 0; av_log(avctx, AV_LOG_WARNING, "Unsupported profile, " "select EProfileIdc PRO_BASELINE in libopenh264.\n"); @@ -353,7 +353,7 @@ FF_ENABLE_DEPRECATION_WARNINGS memcpy(avctx->extradata, fbi.sLayerInfo[0].pBsBuf, size); } - props = ff_add_cpb_side_data(avctx); + props = ff_encode_add_cpb_side_data(avctx); if (!props) return AVERROR(ENOMEM); props->max_bitrate = param.iMaxBitrate; diff --git a/src/third_party/ffmpeg/libavcodec/libsvtav1.c b/src/third_party/ffmpeg/libavcodec/libsvtav1.c index f2b73361..50151692 100644 --- a/src/third_party/ffmpeg/libavcodec/libsvtav1.c +++ b/src/third_party/ffmpeg/libavcodec/libsvtav1.c @@ -236,10 +236,10 @@ static int config_enc_params(EbSvtAv1EncConfiguration *param, } #endif - if (avctx->profile != FF_PROFILE_UNKNOWN) + if (avctx->profile != AV_PROFILE_UNKNOWN) param->profile = avctx->profile; - if (avctx->level != FF_LEVEL_UNKNOWN) + if (avctx->level != AV_LEVEL_UNKNOWN) param->level = avctx->level; // gop_size == 1 case is handled when encoding each frame by setting @@ -310,12 +310,12 @@ FF_ENABLE_DEPRECATION_WARNINGS } if ((param->encoder_color_format == EB_YUV422 || param->encoder_bit_depth > 10) - && param->profile != FF_PROFILE_AV1_PROFESSIONAL ) { + && param->profile != AV_PROFILE_AV1_PROFESSIONAL ) { av_log(avctx, AV_LOG_WARNING, "Forcing Professional profile\n"); - param->profile = FF_PROFILE_AV1_PROFESSIONAL; - } else if (param->encoder_color_format == EB_YUV444 && param->profile != FF_PROFILE_AV1_HIGH) { + param->profile = AV_PROFILE_AV1_PROFESSIONAL; + } else if (param->encoder_color_format == EB_YUV444 && param->profile != AV_PROFILE_AV1_HIGH) { av_log(avctx, AV_LOG_WARNING, "Forcing High profile\n"); - param->profile = FF_PROFILE_AV1_HIGH; + param->profile = AV_PROFILE_AV1_HIGH; } avctx->bit_rate = param->rate_control_mode > 0 ? @@ -325,7 +325,7 @@ FF_ENABLE_DEPRECATION_WARNINGS FFMAX(avctx->bit_rate, avctx->rc_max_rate) / 1000LL; if (avctx->bit_rate || avctx->rc_max_rate || avctx->rc_buffer_size) { - AVCPBProperties *cpb_props = ff_add_cpb_side_data(avctx); + AVCPBProperties *cpb_props = ff_encode_add_cpb_side_data(avctx); if (!cpb_props) return AVERROR(ENOMEM); diff --git a/src/third_party/ffmpeg/libavcodec/libvpxdec.c b/src/third_party/ffmpeg/libavcodec/libvpxdec.c index f480545a..c6187fd5 100644 --- a/src/third_party/ffmpeg/libavcodec/libvpxdec.c +++ b/src/third_party/ffmpeg/libavcodec/libvpxdec.c @@ -127,26 +127,26 @@ static int set_pix_fmt(AVCodecContext *avctx, struct vpx_image *img, switch (img->fmt) { case VPX_IMG_FMT_I420: if (avctx->codec_id == AV_CODEC_ID_VP9) - avctx->profile = FF_PROFILE_VP9_0; + avctx->profile = AV_PROFILE_VP9_0; avctx->pix_fmt = has_alpha_channel ? AV_PIX_FMT_YUVA420P : AV_PIX_FMT_YUV420P; return 0; #if CONFIG_LIBVPX_VP9_DECODER case VPX_IMG_FMT_I422: - avctx->profile = FF_PROFILE_VP9_1; + avctx->profile = AV_PROFILE_VP9_1; avctx->pix_fmt = AV_PIX_FMT_YUV422P; return 0; case VPX_IMG_FMT_I440: - avctx->profile = FF_PROFILE_VP9_1; + avctx->profile = AV_PROFILE_VP9_1; avctx->pix_fmt = AV_PIX_FMT_YUV440P; return 0; case VPX_IMG_FMT_I444: - avctx->profile = FF_PROFILE_VP9_1; + avctx->profile = AV_PROFILE_VP9_1; avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ? AV_PIX_FMT_GBRP : AV_PIX_FMT_YUV444P; return 0; case VPX_IMG_FMT_I42016: - avctx->profile = FF_PROFILE_VP9_2; + avctx->profile = AV_PROFILE_VP9_2; if (img->bit_depth == 10) { avctx->pix_fmt = AV_PIX_FMT_YUV420P10; return 0; @@ -157,7 +157,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; + avctx->profile = AV_PROFILE_VP9_3; if (img->bit_depth == 10) { avctx->pix_fmt = AV_PIX_FMT_YUV422P10; return 0; @@ -168,7 +168,7 @@ static int set_pix_fmt(AVCodecContext *avctx, struct vpx_image *img, return AVERROR_INVALIDDATA; } case VPX_IMG_FMT_I44016: - avctx->profile = FF_PROFILE_VP9_3; + avctx->profile = AV_PROFILE_VP9_3; if (img->bit_depth == 10) { avctx->pix_fmt = AV_PIX_FMT_YUV440P10; return 0; @@ -179,7 +179,7 @@ static int set_pix_fmt(AVCodecContext *avctx, struct vpx_image *img, return AVERROR_INVALIDDATA; } case VPX_IMG_FMT_I44416: - avctx->profile = FF_PROFILE_VP9_3; + avctx->profile = AV_PROFILE_VP9_3; if (img->bit_depth == 10) { avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ? AV_PIX_FMT_GBRP10 : AV_PIX_FMT_YUV444P10; @@ -317,10 +317,8 @@ static int vpx_decode(AVCodecContext *avctx, AVFrame *picture, return AVERROR(ENOMEM); if (ctx->has_alpha_channel) { picture->buf[1] = av_buffer_ref(img_alpha->fb_priv); - if (!picture->buf[1]) { - av_frame_unref(picture); + if (!picture->buf[1]) return AVERROR(ENOMEM); - } } for (int i = 0; i < 4; i++) { picture->data[i] = planes[i]; @@ -329,8 +327,8 @@ static int vpx_decode(AVCodecContext *avctx, AVFrame *picture, } else { if ((ret = ff_get_buffer(avctx, picture, 0)) < 0) return ret; - av_image_copy(picture->data, picture->linesize, (const uint8_t**)planes, - linesizes, avctx->pix_fmt, img->d_w, img->d_h); + av_image_copy2(picture->data, picture->linesize, planes, + linesizes, avctx->pix_fmt, img->d_w, img->d_h); } *got_frame = 1; } diff --git a/src/third_party/ffmpeg/libavcodec/libvpxenc.c b/src/third_party/ffmpeg/libavcodec/libvpxenc.c index 549ac55a..80988a26 100644 --- a/src/third_party/ffmpeg/libavcodec/libvpxenc.c +++ b/src/third_party/ffmpeg/libavcodec/libvpxenc.c @@ -1145,7 +1145,7 @@ static av_cold int vpx_init(AVCodecContext *avctx, /* 0-3: For non-zero values the encoder increasingly optimizes for reduced complexity playback on low powered devices at the expense of encode quality. */ - if (avctx->profile != FF_PROFILE_UNKNOWN) + if (avctx->profile != AV_PROFILE_UNKNOWN) enccfg.g_profile = avctx->profile; enccfg.g_error_resilient = ctx->error_resilient || ctx->flags & VP8F_ERROR_RESILIENT; @@ -1273,7 +1273,7 @@ static av_cold int vpx_init(AVCodecContext *avctx, ctx->rawimg.bit_depth = enccfg.g_bit_depth; #endif - cpb_props = ff_add_cpb_side_data(avctx); + cpb_props = ff_encode_add_cpb_side_data(avctx); if (!cpb_props) return AVERROR(ENOMEM); @@ -1830,7 +1830,7 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket *pkt, duration = frame->duration; else if (avctx->framerate.num > 0 && avctx->framerate.den > 0) duration = av_rescale_q(1, av_inv_q(avctx->framerate), avctx->time_base); - else + else { FF_DISABLE_DEPRECATION_WARNINGS duration = #if FF_API_TICKS_PER_FRAME @@ -1838,6 +1838,7 @@ FF_DISABLE_DEPRECATION_WARNINGS #endif 1; FF_ENABLE_DEPRECATION_WARNINGS + } res = vpx_codec_encode(&ctx->encoder, rawimg, timestamp, duration, flags, ctx->deadline); diff --git a/src/third_party/ffmpeg/libavcodec/libx264.c b/src/third_party/ffmpeg/libavcodec/libx264.c index 774c23da..a505b7eb 100644 --- a/src/third_party/ffmpeg/libavcodec/libx264.c +++ b/src/third_party/ffmpeg/libavcodec/libx264.c @@ -30,6 +30,7 @@ #include "libavutil/stereo3d.h" #include "libavutil/time.h" #include "libavutil/intreadwrite.h" +#include "libavutil/video_hint.h" #include "avcodec.h" #include "codec_internal.h" #include "encode.h" @@ -48,6 +49,9 @@ // from x264.h, for quant_offsets, Macroblocks are 16x16 // blocks of pixels (with respect to the luma plane) #define MB_SIZE 16 +#define MB_LSIZE 4 +#define MB_FLOOR(x) ((x) >> (MB_LSIZE)) +#define MB_CEIL(x) MB_FLOOR((x) + (MB_SIZE - 1)) typedef struct X264Opaque { #if FF_API_REORDERED_OPAQUE @@ -123,6 +127,8 @@ typedef struct X264Context { * encounter a frame with ROI side data. */ int roi_warned; + + int mb_info; } X264Context; static void X264_log(void *p, int level, const char *fmt, va_list args) @@ -295,6 +301,7 @@ static void free_picture(x264_picture_t *pic) av_free(pic->extra_sei.payloads[i].payload); av_freep(&pic->extra_sei.payloads); av_freep(&pic->prop.quant_offsets); + av_freep(&pic->prop.mb_info); pic->extra_sei.num_payloads = 0; } @@ -320,6 +327,74 @@ static enum AVPixelFormat csp_to_pixfmt(int csp) return AV_PIX_FMT_NONE; } +static void av_always_inline mbinfo_compute_changed_coords(const AVVideoRect *rect, + int *min_x, + int *max_x, + int *min_y, + int *max_y) +{ + *min_y = MB_FLOOR(rect->y); + *max_y = MB_CEIL(rect->y + rect->height); + *min_x = MB_FLOOR(rect->x); + *max_x = MB_CEIL(rect->x + rect->width); +} + +static void av_always_inline mbinfo_compute_constant_coords(const AVVideoRect *rect, + int *min_x, + int *max_x, + int *min_y, + int *max_y) +{ + *min_y = MB_CEIL(rect->y); + *max_y = MB_FLOOR(rect->y + rect->height); + *min_x = MB_CEIL(rect->x); + *max_x = MB_FLOOR(rect->x + rect->width); +} + +static int setup_mb_info(AVCodecContext *ctx, x264_picture_t *pic, + const AVFrame *frame, + const AVVideoHint *info) +{ + int mb_width = (frame->width + MB_SIZE - 1) / MB_SIZE; + int mb_height = (frame->height + MB_SIZE - 1) / MB_SIZE; + + const AVVideoRect *mbinfo_rects; + int nb_rects; + uint8_t *mbinfo; + + mbinfo_rects = (const AVVideoRect *)av_video_hint_rects(info); + nb_rects = info->nb_rects; + + mbinfo = av_calloc(mb_width * mb_height, sizeof(*mbinfo)); + if (!mbinfo) + return AVERROR(ENOMEM); + +#define COMPUTE_MBINFO(mbinfo_filler_, mbinfo_marker_, compute_coords_fn_) \ + memset(mbinfo, mbinfo_filler_, sizeof(*mbinfo) * mb_width * mb_height); \ + \ + for (int i = 0; i < nb_rects; i++) { \ + int min_x, max_x, min_y, max_y; \ + \ + compute_coords_fn_(mbinfo_rects, &min_x, &max_x, &min_y, &max_y); \ + for (int mb_y = min_y; mb_y < max_y; ++mb_y) { \ + memset(mbinfo + mb_y * mb_width + min_x, mbinfo_marker_, max_x - min_x); \ + } \ + \ + mbinfo_rects++; \ + } \ + + if (info->type == AV_VIDEO_HINT_TYPE_CHANGED) { + COMPUTE_MBINFO(X264_MBINFO_CONSTANT, 0, mbinfo_compute_changed_coords); + } else /* if (info->type == AV_VIDEO_HINT_TYPE_CHANGED) */ { + COMPUTE_MBINFO(0, X264_MBINFO_CONSTANT, mbinfo_compute_constant_coords); + } + + pic->prop.mb_info = mbinfo; + pic->prop.mb_info_free = av_free; + + return 0; +} + static int setup_roi(AVCodecContext *ctx, x264_picture_t *pic, int bit_depth, const AVFrame *frame, const uint8_t *data, size_t size) { @@ -404,6 +479,7 @@ static int setup_frame(AVCodecContext *ctx, const AVFrame *frame, int64_t wallclock = 0; int bit_depth, ret; AVFrameSideData *sd; + AVFrameSideData *mbinfo_sd; *ppic = NULL; if (!frame) @@ -495,7 +571,7 @@ FF_ENABLE_DEPRECATION_WARNINGS sei->payloads[0].payload_size = sei_size; sei->payloads[0].payload = sei_data; - sei->payloads[0].payload_type = 4; + sei->payloads[0].payload_type = SEI_TYPE_USER_DATA_REGISTERED_ITU_T_T35; sei->num_payloads = 1; } } @@ -507,6 +583,17 @@ FF_ENABLE_DEPRECATION_WARNINGS goto fail; } + mbinfo_sd = av_frame_get_side_data(frame, AV_FRAME_DATA_VIDEO_HINT); + if (mbinfo_sd) { + int ret = setup_mb_info(ctx, pic, frame, (const AVVideoHint *)mbinfo_sd->data); + if (ret < 0) { + /* No need to fail here, this is not fatal. We just proceed with no + * mb_info and log a message */ + + av_log(ctx, AV_LOG_WARNING, "setup_mb_info failed with error: %s\n", av_err2str(ret)); + } + } + if (x4->udu_sei) { for (int j = 0; j < frame->nb_side_data; j++) { AVFrameSideData *side_data = frame->side_data[j]; @@ -977,22 +1064,22 @@ static av_cold int X264_init(AVCodecContext *avctx) /* Allow specifying the x264 profile through AVCodecContext. */ if (!x4->profile) switch (avctx->profile) { - case FF_PROFILE_H264_BASELINE: + case AV_PROFILE_H264_BASELINE: x4->profile = "baseline"; break; - case FF_PROFILE_H264_HIGH: + case AV_PROFILE_H264_HIGH: x4->profile = "high"; break; - case FF_PROFILE_H264_HIGH_10: + case AV_PROFILE_H264_HIGH_10: x4->profile = "high10"; break; - case FF_PROFILE_H264_HIGH_422: + case AV_PROFILE_H264_HIGH_422: x4->profile = "high422"; break; - case FF_PROFILE_H264_HIGH_444: + case AV_PROFILE_H264_HIGH_444: x4->profile = "high444"; break; - case FF_PROFILE_H264_MAIN: + case AV_PROFILE_H264_MAIN: x4->profile = "main"; break; default: @@ -1118,6 +1205,8 @@ FF_ENABLE_DEPRECATION_WARNINGS } } + x4->params.analyse.b_mb_info = x4->mb_info; + // update AVCodecContext with x264 parameters avctx->has_b_frames = x4->params.i_bframe ? x4->params.i_bframe_pyramid ? 2 : 1 : 0; @@ -1157,7 +1246,7 @@ FF_ENABLE_DEPRECATION_WARNINGS avctx->extradata_size = p - avctx->extradata; } - cpb_props = ff_add_cpb_side_data(avctx); + cpb_props = ff_encode_add_cpb_side_data(avctx); if (!cpb_props) return AVERROR(ENOMEM); cpb_props->buffer_size = x4->params.rc.i_vbv_buffer_size * 1000; @@ -1327,6 +1416,7 @@ static const AVOption options[] = { { "noise_reduction", "Noise reduction", OFFSET(noise_reduction), AV_OPT_TYPE_INT, { .i64 = -1 }, INT_MIN, INT_MAX, VE }, { "udu_sei", "Use user data unregistered SEI if available", OFFSET(udu_sei), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, { "x264-params", "Override the x264 configuration using a :-separated list of key=value parameters", OFFSET(x264_params), AV_OPT_TYPE_DICT, { 0 }, 0, 0, VE }, + { "mb_info", "Set mb_info data through AVSideData, only useful when used from the API", OFFSET(mb_info), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, { NULL }, }; diff --git a/src/third_party/ffmpeg/libavcodec/libx265.c b/src/third_party/ffmpeg/libavcodec/libx265.c index 873b3021..447e6da2 100644 --- a/src/third_party/ffmpeg/libavcodec/libx265.c +++ b/src/third_party/ffmpeg/libavcodec/libx265.c @@ -395,7 +395,7 @@ FF_ENABLE_DEPRECATION_WARNINGS ctx->params->rc.vbvBufferSize = avctx->rc_buffer_size / 1000; ctx->params->rc.vbvMaxBitrate = avctx->rc_max_rate / 1000; - cpb_props = ff_add_cpb_side_data(avctx); + cpb_props = ff_encode_add_cpb_side_data(avctx); if (!cpb_props) return AVERROR(ENOMEM); cpb_props->buffer_size = ctx->params->rc.vbvBufferSize * 1000; diff --git a/src/third_party/ffmpeg/libavcodec/magicyuv.c b/src/third_party/ffmpeg/libavcodec/magicyuv.c index 7898cd5b..3573db0f 100644 --- a/src/third_party/ffmpeg/libavcodec/magicyuv.c +++ b/src/third_party/ffmpeg/libavcodec/magicyuv.c @@ -34,6 +34,8 @@ #include "lossless_videodsp.h" #include "thread.h" +#define VLC_BITS 12 + typedef struct Slice { uint32_t start; uint32_t size; @@ -67,15 +69,20 @@ typedef struct MagicYUVContext { Slice *slices[4]; // slice bitstream positions for each plane unsigned int slices_size[4]; // slice sizes for each plane VLC vlc[4]; // VLC for each plane + VLC_MULTI multi[4]; // Buffer for joint VLC data int (*magy_decode_slice)(AVCodecContext *avctx, void *tdata, int j, int threadnr); LLVidDSPContext llviddsp; + HuffEntry he[1 << 14]; + uint8_t len[1 << 14]; } MagicYUVContext; -static int huff_build(const uint8_t len[], uint16_t codes_pos[33], - VLC *vlc, int nb_elems, void *logctx) +static int huff_build(AVCodecContext *avctx, + const uint8_t len[], uint16_t codes_pos[33], + VLC *vlc, VLC_MULTI *multi, int nb_elems, void *logctx) { - HuffEntry he[4096]; + MagicYUVContext *s = avctx->priv_data; + HuffEntry *he = s->he; for (int i = 31; i > 0; i--) codes_pos[i] += codes_pos[i + 1]; @@ -83,8 +90,9 @@ static int huff_build(const uint8_t len[], uint16_t codes_pos[33], for (unsigned i = nb_elems; i-- > 0;) he[--codes_pos[len[i]]] = (HuffEntry){ len[i], i }; - ff_free_vlc(vlc); - return ff_init_vlc_from_lengths(vlc, FFMIN(he[0].len, 12), nb_elems, + ff_vlc_free(vlc); + ff_vlc_free_multi(multi); + return ff_vlc_init_multi_from_lengths(vlc, multi, FFMIN(he[0].len, VLC_BITS), nb_elems, nb_elems, &he[0].len, sizeof(he[0]), &he[0].sym, sizeof(he[0]), sizeof(he[0].sym), 0, 0, logctx); @@ -111,6 +119,22 @@ static void magicyuv_median_pred16(uint16_t *dst, const uint16_t *src1, *left_top = lt; } +#define READ_PLANE(dst, plane, b, c) \ +{ \ + x = 0; \ + for (; CACHED_BITSTREAM_READER && x < width-c && get_bits_left(&gb) > 0;) {\ + ret = get_vlc_multi(&gb, (uint8_t *)dst + x * b, multi, \ + vlc, vlc_bits, 3); \ + if (ret > 0) \ + x += ret; \ + if (ret <= 0) \ + return AVERROR_INVALIDDATA; \ + } \ + for (; x < width && get_bits_left(&gb) > 0; x++) \ + dst[x] = get_vlc2(&gb, vlc, vlc_bits, 3); \ + dst += stride; \ +} + static int magy_decode_slice10(AVCodecContext *avctx, void *tdata, int j, int threadnr) { @@ -130,6 +154,9 @@ static int magy_decode_slice10(AVCodecContext *avctx, void *tdata, int sheight = AV_CEIL_RSHIFT(s->slice_height, s->vshift[i]); ptrdiff_t fake_stride = (p->linesize[i] / 2) * (1 + interlaced); ptrdiff_t stride = p->linesize[i] / 2; + const VLC_MULTI_ELEM *const multi = s->multi[i].table; + const VLCElem *const vlc = s->vlc[i].table; + const int vlc_bits = s->vlc[i].bits; int flags, pred; int ret = init_get_bits8(&gb, s->buf + s->slices[i][j].start, s->slices[i][j].size); @@ -151,20 +178,8 @@ static int magy_decode_slice10(AVCodecContext *avctx, void *tdata, dst += stride; } } else { - for (k = 0; k < height; k++) { - for (x = 0; x < width; x++) { - int pix; - if (get_bits_left(&gb) <= 0) - return AVERROR_INVALIDDATA; - - pix = get_vlc2(&gb, s->vlc[i].table, s->vlc[i].bits, 3); - if (pix < 0) - return AVERROR_INVALIDDATA; - - dst[x] = pix; - } - dst += stride; - } + for (k = 0; k < height; k++) + READ_PLANE(dst, i, 2, 3) } switch (pred) { @@ -261,6 +276,9 @@ static int magy_decode_slice(AVCodecContext *avctx, void *tdata, ptrdiff_t fake_stride = p->linesize[i] * (1 + interlaced); ptrdiff_t stride = p->linesize[i]; const uint8_t *slice = s->buf + s->slices[i][j].start; + const VLC_MULTI_ELEM *const multi = s->multi[i].table; + const VLCElem *const vlc = s->vlc[i].table; + const int vlc_bits = s->vlc[i].bits; int flags, pred; flags = bytestream_get_byte(&slice); @@ -280,20 +298,8 @@ static int magy_decode_slice(AVCodecContext *avctx, void *tdata, if (ret < 0) return ret; - for (k = 0; k < height; k++) { - for (x = 0; x < width; x++) { - int pix; - if (get_bits_left(&gb) <= 0) - return AVERROR_INVALIDDATA; - - pix = get_vlc2(&gb, s->vlc[i].table, s->vlc[i].bits, 3); - if (pix < 0) - return AVERROR_INVALIDDATA; - - dst[x] = pix; - } - dst += stride; - } + for (k = 0; k < height; k++) + READ_PLANE(dst, i, 1, 5) } switch (pred) { @@ -379,7 +385,7 @@ static int build_huffman(AVCodecContext *avctx, const uint8_t *table, { MagicYUVContext *s = avctx->priv_data; GetByteContext gb; - uint8_t len[4096]; + uint8_t *len = s->len; uint16_t length_count[33] = { 0 }; int i = 0, j = 0, k; @@ -407,7 +413,7 @@ static int build_huffman(AVCodecContext *avctx, const uint8_t *table, if (j == max) { j = 0; - if (huff_build(len, length_count, &s->vlc[i], max, avctx)) { + if (huff_build(avctx, len, length_count, &s->vlc[i], &s->multi[i], max, avctx)) { av_log(avctx, AV_LOG_ERROR, "Cannot build Huffman codes\n"); return AVERROR_INVALIDDATA; } @@ -524,6 +530,16 @@ static int magy_decode_frame(AVCodecContext *avctx, AVFrame *p, s->decorrelate = 1; s->bps = 12; break; + case 0x71: + avctx->pix_fmt = AV_PIX_FMT_GBRP14; + s->decorrelate = 1; + s->bps = 14; + break; + case 0x72: + avctx->pix_fmt = AV_PIX_FMT_GBRAP14; + s->decorrelate = 1; + s->bps = 14; + break; case 0x73: avctx->pix_fmt = AV_PIX_FMT_GRAY10; s->bps = 10; @@ -651,7 +667,9 @@ static int magy_decode_frame(AVCodecContext *avctx, AVFrame *p, avctx->pix_fmt == AV_PIX_FMT_GBRP10 || avctx->pix_fmt == AV_PIX_FMT_GBRAP10|| avctx->pix_fmt == AV_PIX_FMT_GBRAP12|| - avctx->pix_fmt == AV_PIX_FMT_GBRP12) { + avctx->pix_fmt == AV_PIX_FMT_GBRAP14|| + avctx->pix_fmt == AV_PIX_FMT_GBRP12|| + avctx->pix_fmt == AV_PIX_FMT_GBRP14) { FFSWAP(uint8_t*, p->data[0], p->data[1]); FFSWAP(int, p->linesize[0], p->linesize[1]); } else { @@ -686,7 +704,8 @@ static av_cold int magy_decode_end(AVCodecContext *avctx) for (i = 0; i < FF_ARRAY_ELEMS(s->slices); i++) { av_freep(&s->slices[i]); s->slices_size[i] = 0; - ff_free_vlc(&s->vlc[i]); + ff_vlc_free(&s->vlc[i]); + ff_vlc_free_multi(&s->multi[i]); } return 0; diff --git a/src/third_party/ffmpeg/libavcodec/magicyuvenc.c b/src/third_party/ffmpeg/libavcodec/magicyuvenc.c index 082e2846..ccd6a549 100644 --- a/src/third_party/ffmpeg/libavcodec/magicyuvenc.c +++ b/src/third_party/ffmpeg/libavcodec/magicyuvenc.c @@ -53,10 +53,17 @@ typedef struct PTable { int64_t prob; ///< number of occurences of this value in input } PTable; +typedef struct Slice { + unsigned pos; + unsigned size; + uint8_t *slice; + uint8_t *bitslice; + PTable counts[256]; +} Slice; + typedef struct MagicYUVContext { const AVClass *class; int frame_pred; - PutBitContext pb; int planes; uint8_t format; int slice_height; @@ -64,14 +71,9 @@ typedef struct MagicYUVContext { int correlate; int hshift[4]; int vshift[4]; - uint8_t **slices; - uint8_t **bitslices; unsigned bitslice_size; - unsigned *slice_pos; - unsigned *slice_size; - unsigned tables_size; - PTable *counts; uint8_t *decorrelate_buf[2]; + Slice *slices; HuffEntry he[4][256]; LLVidEncDSPContext llvidencdsp; void (*predict)(struct MagicYUVContext *s, const uint8_t *src, uint8_t *dst, @@ -194,12 +196,6 @@ static av_cold int magy_encode_init(AVCodecContext *avctx) s->format = 0x6b; break; } - if (s->correlate) { - s->decorrelate_buf[0] = av_calloc(2U * avctx->height, FFALIGN(avctx->width, 16)); - if (!s->decorrelate_buf[0]) - return AVERROR(ENOMEM); - s->decorrelate_buf[1] = s->decorrelate_buf[0] + avctx->height * FFALIGN(avctx->width, 16); - } ff_llvidencdsp_init(&s->llvidencdsp); @@ -209,21 +205,27 @@ static av_cold int magy_encode_init(AVCodecContext *avctx) s->nb_slices = FFMIN(s->nb_slices, avctx->height >> s->vshift[1]); s->nb_slices = FFMAX(1, s->nb_slices); s->slice_height = FFALIGN((avctx->height + s->nb_slices - 1) / s->nb_slices, 1 << s->vshift[1]); - s->slice_pos = av_calloc(s->nb_slices * s->planes, sizeof(*s->slice_pos)); - s->slice_size = av_calloc(s->nb_slices * s->planes, sizeof(*s->slice_size)); + s->nb_slices = (avctx->height + s->slice_height - 1) / s->slice_height; s->slices = av_calloc(s->nb_slices * s->planes, sizeof(*s->slices)); - s->bitslices = av_calloc(s->nb_slices * s->planes, sizeof(*s->bitslices)); - s->counts = av_calloc(s->nb_slices * s->planes * 256, sizeof(*s->counts)); - if (!s->slices || !s->slice_pos || !s->counts || !s->slice_size) + if (!s->slices) return AVERROR(ENOMEM); - s->bitslice_size = avctx->width * (s->slice_height + 2) + AV_INPUT_BUFFER_PADDING_SIZE; + if (s->correlate) { + s->decorrelate_buf[0] = av_calloc(2U * (s->nb_slices * s->slice_height), FFALIGN(avctx->width, av_cpu_max_align())); + if (!s->decorrelate_buf[0]) + return AVERROR(ENOMEM); + s->decorrelate_buf[1] = s->decorrelate_buf[0] + (s->nb_slices * s->slice_height) * FFALIGN(avctx->width, av_cpu_max_align()); + } + + s->bitslice_size = avctx->width * s->slice_height + 2; for (int n = 0; n < s->nb_slices; n++) { for (int i = 0; i < s->planes; i++) { - s->bitslices[n * s->planes + i] = av_malloc(s->bitslice_size); - s->slices[n * s->planes + i] = av_malloc(avctx->width * (s->slice_height + 2) + + Slice *sl = &s->slices[n * s->planes + i]; + + sl->bitslice = av_malloc(s->bitslice_size + AV_INPUT_BUFFER_PADDING_SIZE); + sl->slice = av_malloc(avctx->width * (s->slice_height + 2) + AV_INPUT_BUFFER_PADDING_SIZE); - if (!s->slices[n * s->planes + i] || !s->bitslices[n * s->planes + i]) { + if (!sl->slice || !sl->bitslice) { av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer.\n"); return AVERROR(ENOMEM); } @@ -370,10 +372,11 @@ static void magy_huffman_compute_bits(PTable *prob_table, HuffEntry *distincts, static int count_plane_slice(AVCodecContext *avctx, int n, int plane) { MagicYUVContext *s = avctx->priv_data; - const uint8_t *dst = s->slices[n * s->planes + plane]; - PTable *counts = s->counts + 256 * (n * s->planes + plane); + Slice *sl = &s->slices[n * s->planes + plane]; + const uint8_t *dst = sl->slice; + PTable *counts = sl->counts; - memset(counts, 0, sizeof(*counts) * 256); + memset(counts, 0, sizeof(sl->counts)); count_usage(dst, AV_CEIL_RSHIFT(avctx->width, s->hshift[plane]), AV_CEIL_RSHIFT(s->slice_height, s->vshift[plane]), counts); @@ -389,7 +392,8 @@ static int encode_table(AVCodecContext *avctx, uint16_t codes_counts[33] = { 0 }; for (int n = 0; n < s->nb_slices; n++) { - PTable *slice_counts = s->counts + 256 * (n * s->planes + plane); + Slice *sl = &s->slices[n * s->planes + plane]; + PTable *slice_counts = sl->counts; for (int i = 0; i < 256; i++) counts[i].prob = slice_counts[i].prob; @@ -412,11 +416,28 @@ static int encode_table(AVCodecContext *avctx, return 0; } -static int encode_plane_slice(uint8_t *src, uint8_t *dst, int dst_size, +static int encode_plane_slice_raw(const uint8_t *src, uint8_t *dst, unsigned dst_size, + int width, int height, int prediction) +{ + unsigned count = width * height; + + dst[0] = 1; + dst[1] = prediction; + + memcpy(dst + 2, src, count); + count += 2; + AV_WN32(dst + count, 0); + if (count & 3) + count += 4 - (count & 3); + + return count; +} + +static int encode_plane_slice(const uint8_t *src, uint8_t *dst, unsigned dst_size, int width, int height, HuffEntry *he, int prediction) { + const uint8_t *osrc = src; PutBitContext pb; - int i, j; int count; init_put_bits(&pb, dst, dst_size); @@ -424,10 +445,13 @@ static int encode_plane_slice(uint8_t *src, uint8_t *dst, int dst_size, put_bits(&pb, 8, 0); put_bits(&pb, 8, prediction); - for (j = 0; j < height; j++) { - for (i = 0; i < width; i++) { + for (int j = 0; j < height; j++) { + for (int i = 0; i < width; i++) { const int idx = src[i]; - put_bits(&pb, he[idx].len, he[idx].code); + const int len = he[idx].len; + if (put_bits_left(&pb) < len + 32) + return encode_plane_slice_raw(osrc, dst, dst_size, width, height, prediction); + put_bits(&pb, len, he[idx].code); } src += width; @@ -450,16 +474,14 @@ static int encode_slice(AVCodecContext *avctx, void *tdata, const int slice_height = s->slice_height; const int last_height = FFMIN(slice_height, avctx->height - n * slice_height); const int height = (n < (s->nb_slices - 1)) ? slice_height : last_height; - PutByteContext pb; for (int i = 0; i < s->planes; i++) { - bytestream2_init_writer(&pb, s->bitslices[n + s->planes + i], - s->bitslice_size); + Slice *sl = &s->slices[n * s->planes + i]; - s->slice_size[n * s->planes + i] = - encode_plane_slice(s->slices[n * s->planes + i], - s->bitslices[n * s->planes + i], - bytestream2_get_bytes_left_p(&pb), + sl->size = + encode_plane_slice(sl->slice, + sl->bitslice, + s->bitslice_size, AV_CEIL_RSHIFT(avctx->width, s->hshift[i]), AV_CEIL_RSHIFT(height, s->vshift[i]), s->he[i], s->frame_pred); @@ -471,7 +493,7 @@ static int encode_slice(AVCodecContext *avctx, void *tdata, static int predict_slice(AVCodecContext *avctx, void *tdata, int n, int threadnr) { - const int aligned_width = FFALIGN(avctx->width, 16); + const int aligned_width = FFALIGN(avctx->width, av_cpu_max_align()); MagicYUVContext *s = avctx->priv_data; const int slice_height = s->slice_height; const int last_height = FFMIN(slice_height, avctx->height - n * slice_height); @@ -484,7 +506,7 @@ static int predict_slice(AVCodecContext *avctx, void *tdata, s->decorrelate_buf[1] + n * slice_height * aligned_width }; const int decorrelate_linesize = aligned_width; const uint8_t *const data[4] = { decorrelated[0], frame->data[0] + n * slice_height * frame->linesize[0], - decorrelated[1], frame->data[3] + n * slice_height * frame->linesize[3] }; + decorrelated[1], s->planes == 4 ? frame->data[3] + n * slice_height * frame->linesize[3] : NULL }; const uint8_t *r, *g, *b; const int linesize[4] = { decorrelate_linesize, frame->linesize[0], decorrelate_linesize, frame->linesize[3] }; @@ -493,7 +515,7 @@ static int predict_slice(AVCodecContext *avctx, void *tdata, b = frame->data[1] + n * slice_height * frame->linesize[1]; r = frame->data[2] + n * slice_height * frame->linesize[2]; - for (int i = 0; i < slice_height; i++) { + for (int i = 0; i < height; i++) { s->llvidencdsp.diff_bytes(decorrelated[0], b, g, width); s->llvidencdsp.diff_bytes(decorrelated[1], r, g, width); g += frame->linesize[0]; @@ -504,13 +526,17 @@ static int predict_slice(AVCodecContext *avctx, void *tdata, } for (int i = 0; i < s->planes; i++) { - s->predict(s, data[i], s->slices[n * s->planes + i], linesize[i], + Slice *sl = &s->slices[n * s->planes + i]; + + s->predict(s, data[i], sl->slice, linesize[i], frame->width, height); } } else { for (int i = 0; i < s->planes; i++) { + Slice *sl = &s->slices[n * s->planes + i]; + s->predict(s, frame->data[i] + n * (slice_height >> s->vshift[i]) * frame->linesize[i], - s->slices[n * s->planes + i], + sl->slice, frame->linesize[i], AV_CEIL_RSHIFT(frame->width, s->hshift[i]), AV_CEIL_RSHIFT(height, s->vshift[i])); @@ -527,9 +553,11 @@ static int magy_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet) { MagicYUVContext *s = avctx->priv_data; - PutByteContext pb; const int width = avctx->width, height = avctx->height; const int slice_height = s->slice_height; + unsigned tables_size; + PutBitContext pbit; + PutByteContext pb; int pos, ret = 0; ret = ff_alloc_packet(avctx, pkt, (256 + 4 * s->nb_slices + width * height) * @@ -571,31 +599,35 @@ static int magy_encode_frame(AVCodecContext *avctx, AVPacket *pkt, avctx->execute2(avctx, predict_slice, (void *)frame, NULL, s->nb_slices); - init_put_bits(&s->pb, pkt->data + bytestream2_tell_p(&pb), bytestream2_get_bytes_left_p(&pb)); + init_put_bits(&pbit, pkt->data + bytestream2_tell_p(&pb), bytestream2_get_bytes_left_p(&pb)); for (int i = 0; i < s->planes; i++) - encode_table(avctx, &s->pb, s->he[i], i); + encode_table(avctx, &pbit, s->he[i], i); - s->tables_size = put_bytes_count(&s->pb, 1); - bytestream2_skip_p(&pb, s->tables_size); + tables_size = put_bytes_count(&pbit, 1); + bytestream2_skip_p(&pb, tables_size); avctx->execute2(avctx, encode_slice, NULL, NULL, s->nb_slices); for (int n = 0; n < s->nb_slices; n++) { for (int i = 0; i < s->planes; i++) { - s->slice_pos[n * s->planes + i] = bytestream2_tell_p(&pb); + Slice *sl = &s->slices[n * s->planes + i]; - bytestream2_put_buffer(&pb, s->bitslices[n * s->planes + i], - s->slice_size[n * s->planes + i]); + sl->pos = bytestream2_tell_p(&pb); + + bytestream2_put_buffer(&pb, sl->bitslice, sl->size); } } pos = bytestream2_tell_p(&pb); bytestream2_seek_p(&pb, 32, SEEK_SET); - bytestream2_put_le32(&pb, s->slice_pos[0] - 32); + bytestream2_put_le32(&pb, s->slices[0].pos - 32); for (int i = 0; i < s->planes; i++) { - for (int n = 0; n < s->nb_slices; n++) - bytestream2_put_le32(&pb, s->slice_pos[n * s->planes + i] - 32); + for (int n = 0; n < s->nb_slices; n++) { + Slice *sl = &s->slices[n * s->planes + i]; + + bytestream2_put_le32(&pb, sl->pos - 32); + } } bytestream2_seek_p(&pb, pos, SEEK_SET); @@ -610,15 +642,13 @@ static av_cold int magy_encode_close(AVCodecContext *avctx) { MagicYUVContext *s = avctx->priv_data; - av_freep(&s->slice_pos); - av_freep(&s->slice_size); - for (int i = 0; i < s->planes * s->nb_slices && s->slices; i++) - av_freep(&s->slices[i]); - for (int i = 0; i < s->planes * s->nb_slices && s->bitslices; i++) - av_freep(&s->bitslices[i]); - av_freep(&s->counts); + for (int i = 0; i < s->planes * s->nb_slices && s->slices; i++) { + Slice *sl = &s->slices[i]; + + av_freep(&sl->slice); + av_freep(&sl->bitslice); + } av_freep(&s->slices); - av_freep(&s->bitslices); av_freep(&s->decorrelate_buf); return 0; diff --git a/src/third_party/ffmpeg/libavcodec/mediacodec_wrapper.c b/src/third_party/ffmpeg/libavcodec/mediacodec_wrapper.c index eb69ad7e..0880ddd3 100644 --- a/src/third_party/ffmpeg/libavcodec/mediacodec_wrapper.c +++ b/src/third_party/ffmpeg/libavcodec/mediacodec_wrapper.c @@ -365,82 +365,82 @@ int ff_AMediaCodecProfile_getProfileFromAVCodecContext(AVCodecContext *avctx) if (avctx->codec_id == AV_CODEC_ID_H264) { switch(avctx->profile) { - case FF_PROFILE_H264_BASELINE: + case AV_PROFILE_H264_BASELINE: return AVCProfileBaseline; - case FF_PROFILE_H264_CONSTRAINED_BASELINE: + case AV_PROFILE_H264_CONSTRAINED_BASELINE: return AVCProfileConstrainedBaseline; - case FF_PROFILE_H264_MAIN: + case AV_PROFILE_H264_MAIN: return AVCProfileMain; break; - case FF_PROFILE_H264_EXTENDED: + case AV_PROFILE_H264_EXTENDED: return AVCProfileExtended; - case FF_PROFILE_H264_HIGH: + case AV_PROFILE_H264_HIGH: return AVCProfileHigh; - case FF_PROFILE_H264_HIGH_10: - case FF_PROFILE_H264_HIGH_10_INTRA: + case AV_PROFILE_H264_HIGH_10: + case AV_PROFILE_H264_HIGH_10_INTRA: return AVCProfileHigh10; - case FF_PROFILE_H264_HIGH_422: - case FF_PROFILE_H264_HIGH_422_INTRA: + case AV_PROFILE_H264_HIGH_422: + case AV_PROFILE_H264_HIGH_422_INTRA: return AVCProfileHigh422; - case FF_PROFILE_H264_HIGH_444: - case FF_PROFILE_H264_HIGH_444_INTRA: - case FF_PROFILE_H264_HIGH_444_PREDICTIVE: + case AV_PROFILE_H264_HIGH_444: + case AV_PROFILE_H264_HIGH_444_INTRA: + case AV_PROFILE_H264_HIGH_444_PREDICTIVE: return AVCProfileHigh444; } } else if (avctx->codec_id == AV_CODEC_ID_HEVC) { switch (avctx->profile) { - case FF_PROFILE_HEVC_MAIN: + case AV_PROFILE_HEVC_MAIN: return HEVCProfileMain; - case FF_PROFILE_HEVC_MAIN_STILL_PICTURE: + case AV_PROFILE_HEVC_MAIN_STILL_PICTURE: return HEVCProfileMainStill; - case FF_PROFILE_HEVC_MAIN_10: + case AV_PROFILE_HEVC_MAIN_10: return HEVCProfileMain10; } } else if (avctx->codec_id == AV_CODEC_ID_VP9) { switch (avctx->profile) { - case FF_PROFILE_VP9_0: + case AV_PROFILE_VP9_0: return VP9Profile0; - case FF_PROFILE_VP9_1: + case AV_PROFILE_VP9_1: return VP9Profile1; - case FF_PROFILE_VP9_2: + case AV_PROFILE_VP9_2: return VP9Profile2; - case FF_PROFILE_VP9_3: + case AV_PROFILE_VP9_3: return VP9Profile3; } } else if(avctx->codec_id == AV_CODEC_ID_MPEG4) { switch (avctx->profile) { - case FF_PROFILE_MPEG4_SIMPLE: + case AV_PROFILE_MPEG4_SIMPLE: return MPEG4ProfileSimple; - case FF_PROFILE_MPEG4_SIMPLE_SCALABLE: + case AV_PROFILE_MPEG4_SIMPLE_SCALABLE: return MPEG4ProfileSimpleScalable; - case FF_PROFILE_MPEG4_CORE: + case AV_PROFILE_MPEG4_CORE: return MPEG4ProfileCore; - case FF_PROFILE_MPEG4_MAIN: + case AV_PROFILE_MPEG4_MAIN: return MPEG4ProfileMain; - case FF_PROFILE_MPEG4_N_BIT: + case AV_PROFILE_MPEG4_N_BIT: return MPEG4ProfileNbit; - case FF_PROFILE_MPEG4_SCALABLE_TEXTURE: + case AV_PROFILE_MPEG4_SCALABLE_TEXTURE: return MPEG4ProfileScalableTexture; - case FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION: + case AV_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION: return MPEG4ProfileSimpleFBA; - case FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE: + case AV_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE: return MPEG4ProfileBasicAnimated; - case FF_PROFILE_MPEG4_HYBRID: + case AV_PROFILE_MPEG4_HYBRID: return MPEG4ProfileHybrid; - case FF_PROFILE_MPEG4_ADVANCED_REAL_TIME: + case AV_PROFILE_MPEG4_ADVANCED_REAL_TIME: return MPEG4ProfileAdvancedRealTime; - case FF_PROFILE_MPEG4_CORE_SCALABLE: + case AV_PROFILE_MPEG4_CORE_SCALABLE: return MPEG4ProfileCoreScalable; - case FF_PROFILE_MPEG4_ADVANCED_CODING: + case AV_PROFILE_MPEG4_ADVANCED_CODING: return MPEG4ProfileAdvancedCoding; - case FF_PROFILE_MPEG4_ADVANCED_CORE: + case AV_PROFILE_MPEG4_ADVANCED_CORE: return MPEG4ProfileAdvancedCore; - case FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE: + case AV_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE: return MPEG4ProfileAdvancedScalable; - case FF_PROFILE_MPEG4_ADVANCED_SIMPLE: + case AV_PROFILE_MPEG4_ADVANCED_SIMPLE: return MPEG4ProfileAdvancedSimple; - case FF_PROFILE_MPEG4_SIMPLE_STUDIO: + case AV_PROFILE_MPEG4_SIMPLE_STUDIO: // Studio profiles are not supported by mediacodec. default: break; @@ -448,10 +448,10 @@ int ff_AMediaCodecProfile_getProfileFromAVCodecContext(AVCodecContext *avctx) } else if(avctx->codec_id == AV_CODEC_ID_AV1) { switch (avctx->profile) { - case FF_PROFILE_AV1_MAIN: + case AV_PROFILE_AV1_MAIN: return AV1ProfileMain8; - case FF_PROFILE_AV1_HIGH: - case FF_PROFILE_AV1_PROFESSIONAL: + case AV_PROFILE_AV1_HIGH: + case AV_PROFILE_AV1_PROFESSIONAL: default: break; } diff --git a/src/third_party/ffmpeg/libavcodec/mediacodecenc.c b/src/third_party/ffmpeg/libavcodec/mediacodecenc.c index 1da705d1..a1ae5d5e 100644 --- a/src/third_party/ffmpeg/libavcodec/mediacodecenc.c +++ b/src/third_party/ffmpeg/libavcodec/mediacodecenc.c @@ -428,9 +428,6 @@ static void copy_frame_to_buffer(AVCodecContext *avctx, const AVFrame *frame, ui MediaCodecEncContext *s = avctx->priv_data; uint8_t *dst_data[4] = {}; int dst_linesize[4] = {}; - const uint8_t *src_data[4] = { - frame->data[0], frame->data[1], frame->data[2], frame->data[3] - }; if (avctx->pix_fmt == AV_PIX_FMT_YUV420P) { dst_data[0] = dst; @@ -449,8 +446,8 @@ static void copy_frame_to_buffer(AVCodecContext *avctx, const AVFrame *frame, ui av_assert0(0); } - av_image_copy(dst_data, dst_linesize, src_data, frame->linesize, - avctx->pix_fmt, avctx->width, avctx->height); + av_image_copy2(dst_data, dst_linesize, frame->data, frame->linesize, + avctx->pix_fmt, avctx->width, avctx->height); } static int mediacodec_send(AVCodecContext *avctx, @@ -660,14 +657,14 @@ enum MediaCodecAvcLevel { static const AVOption h264_options[] = { COMMON_OPTION - FF_AVCTX_PROFILE_OPTION("baseline", NULL, VIDEO, FF_PROFILE_H264_BASELINE) - FF_AVCTX_PROFILE_OPTION("constrained_baseline", NULL, VIDEO, FF_PROFILE_H264_CONSTRAINED_BASELINE) - FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, FF_PROFILE_H264_MAIN) - FF_AVCTX_PROFILE_OPTION("extended", NULL, VIDEO, FF_PROFILE_H264_EXTENDED) - FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, FF_PROFILE_H264_HIGH) - FF_AVCTX_PROFILE_OPTION("high10", NULL, VIDEO, FF_PROFILE_H264_HIGH_10) - FF_AVCTX_PROFILE_OPTION("high422", NULL, VIDEO, FF_PROFILE_H264_HIGH_422) - FF_AVCTX_PROFILE_OPTION("high444", NULL, VIDEO, FF_PROFILE_H264_HIGH_444) + FF_AVCTX_PROFILE_OPTION("baseline", NULL, VIDEO, AV_PROFILE_H264_BASELINE) + FF_AVCTX_PROFILE_OPTION("constrained_baseline", NULL, VIDEO, AV_PROFILE_H264_CONSTRAINED_BASELINE) + FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, AV_PROFILE_H264_MAIN) + FF_AVCTX_PROFILE_OPTION("extended", NULL, VIDEO, AV_PROFILE_H264_EXTENDED) + FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, AV_PROFILE_H264_HIGH) + FF_AVCTX_PROFILE_OPTION("high10", NULL, VIDEO, AV_PROFILE_H264_HIGH_10) + FF_AVCTX_PROFILE_OPTION("high422", NULL, VIDEO, AV_PROFILE_H264_HIGH_422) + FF_AVCTX_PROFILE_OPTION("high444", NULL, VIDEO, AV_PROFILE_H264_HIGH_444) { "level", "Specify level", OFFSET(level), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, VE, "level" }, @@ -732,8 +729,8 @@ enum MediaCodecHevcLevel { static const AVOption hevc_options[] = { COMMON_OPTION - FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, FF_PROFILE_HEVC_MAIN) - FF_AVCTX_PROFILE_OPTION("main10", NULL, VIDEO, FF_PROFILE_HEVC_MAIN_10) + FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, AV_PROFILE_HEVC_MAIN) + FF_AVCTX_PROFILE_OPTION("main10", NULL, VIDEO, AV_PROFILE_HEVC_MAIN_10) { "level", "Specify tier and level", OFFSET(level), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, VE, "level" }, @@ -846,10 +843,10 @@ enum MediaCodecVP9Level { static const AVOption vp9_options[] = { COMMON_OPTION - FF_AVCTX_PROFILE_OPTION("profile0", NULL, VIDEO, FF_PROFILE_VP9_0) - FF_AVCTX_PROFILE_OPTION("profile1", NULL, VIDEO, FF_PROFILE_VP9_1) - FF_AVCTX_PROFILE_OPTION("profile2", NULL, VIDEO, FF_PROFILE_VP9_2) - FF_AVCTX_PROFILE_OPTION("profile3", NULL, VIDEO, FF_PROFILE_VP9_3) + FF_AVCTX_PROFILE_OPTION("profile0", NULL, VIDEO, AV_PROFILE_VP9_0) + FF_AVCTX_PROFILE_OPTION("profile1", NULL, VIDEO, AV_PROFILE_VP9_1) + FF_AVCTX_PROFILE_OPTION("profile2", NULL, VIDEO, AV_PROFILE_VP9_2) + FF_AVCTX_PROFILE_OPTION("profile3", NULL, VIDEO, AV_PROFILE_VP9_3) { "level", "Specify tier and level", OFFSET(level), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, VE, "level" }, diff --git a/src/third_party/ffmpeg/libavcodec/mfenc.c b/src/third_party/ffmpeg/libavcodec/mfenc.c index 8d950a31..3c50a6c0 100644 --- a/src/third_party/ffmpeg/libavcodec/mfenc.c +++ b/src/third_party/ffmpeg/libavcodec/mfenc.c @@ -672,10 +672,10 @@ FF_ENABLE_DEPRECATION_WARNINGS if (avctx->codec_id == AV_CODEC_ID_H264) { UINT32 profile = ff_eAVEncH264VProfile_Base; switch (avctx->profile) { - case FF_PROFILE_H264_MAIN: + case AV_PROFILE_H264_MAIN: profile = ff_eAVEncH264VProfile_Main; break; - case FF_PROFILE_H264_HIGH: + case AV_PROFILE_H264_HIGH: profile = ff_eAVEncH264VProfile_High; break; } diff --git a/src/third_party/ffmpeg/libavcodec/mimic.c b/src/third_party/ffmpeg/libavcodec/mimic.c index 891471b3..a846a07a 100644 --- a/src/third_party/ffmpeg/libavcodec/mimic.c +++ b/src/third_party/ffmpeg/libavcodec/mimic.c @@ -120,7 +120,7 @@ static av_cold int mimic_decode_end(AVCodecContext *avctx) static av_cold void mimic_init_static(void) { - INIT_VLC_STATIC_FROM_LENGTHS(&block_vlc, MIMIC_VLC_BITS, FF_ARRAY_ELEMS(huffbits), + VLC_INIT_STATIC_FROM_LENGTHS(&block_vlc, MIMIC_VLC_BITS, FF_ARRAY_ELEMS(huffbits), huffbits, 1, huffsyms, 1, 1, 0, 0, 4368); } diff --git a/src/third_party/ffmpeg/libavcodec/mips/Makefile b/src/third_party/ffmpeg/libavcodec/mips/Makefile index 05ed63bf..45c56e8a 100644 --- a/src/third_party/ffmpeg/libavcodec/mips/Makefile +++ b/src/third_party/ffmpeg/libavcodec/mips/Makefile @@ -13,7 +13,6 @@ MIPSFPU-OBJS-$(CONFIG_AMRWB_DECODER) += mips/acelp_filters_mips.o \ mips/acelp_vectors_mips.o MIPSFPU-OBJS-$(CONFIG_MPEGAUDIODSP) += mips/mpegaudiodsp_mips_float.o MIPSDSP-OBJS-$(CONFIG_MPEGAUDIODSP) += mips/mpegaudiodsp_mips_fixed.o -MIPSFPU-OBJS-$(CONFIG_FFT) += mips/fft_mips.o MIPSFPU-OBJS-$(CONFIG_FMTCONVERT) += mips/fmtconvert_mips.o OBJS-$(CONFIG_AC3DSP) += mips/ac3dsp_mips.o OBJS-$(CONFIG_AAC_DECODER) += mips/aacdec_mips.o \ diff --git a/src/third_party/ffmpeg/libavcodec/mjpegdec.c b/src/third_party/ffmpeg/libavcodec/mjpegdec.c index b42e75bc..8676155e 100644 --- a/src/third_party/ffmpeg/libavcodec/mjpegdec.c +++ b/src/third_party/ffmpeg/libavcodec/mjpegdec.c @@ -33,6 +33,7 @@ #include "config_components.h" #include "libavutil/display.h" +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/avassert.h" #include "libavutil/opt.h" @@ -41,6 +42,7 @@ #include "codec_internal.h" #include "copy_block.h" #include "decode.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "idctdsp.h" #include "internal.h" @@ -81,7 +83,7 @@ static int init_default_huffman_tables(MJpegDecodeContext *s) int i, ret; for (i = 0; i < FF_ARRAY_ELEMS(ht); i++) { - ff_free_vlc(&s->vlcs[ht[i].class][ht[i].index]); + ff_vlc_free(&s->vlcs[ht[i].class][ht[i].index]); ret = ff_mjpeg_build_vlc(&s->vlcs[ht[i].class][ht[i].index], ht[i].bits, ht[i].values, ht[i].class == 1, s->avctx); @@ -275,7 +277,7 @@ int ff_mjpeg_decode_dht(MJpegDecodeContext *s) len -= n; /* build VLC and flush previous vlc if present */ - ff_free_vlc(&s->vlcs[class][index]); + ff_vlc_free(&s->vlcs[class][index]); av_log(s->avctx, AV_LOG_DEBUG, "class=%d index=%d nb_codes=%d\n", class, index, n); if ((ret = ff_mjpeg_build_vlc(&s->vlcs[class][index], bits_table, @@ -283,7 +285,7 @@ int ff_mjpeg_decode_dht(MJpegDecodeContext *s) return ret; if (class > 0) { - ff_free_vlc(&s->vlcs[2][index]); + ff_vlc_free(&s->vlcs[2][index]); if ((ret = ff_mjpeg_build_vlc(&s->vlcs[2][index], bits_table, val_table, 0, s->avctx)) < 0) return ret; @@ -796,13 +798,14 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) } if (s->avctx->hwaccel) { + const FFHWAccel *hwaccel = ffhwaccel(s->avctx->hwaccel); s->hwaccel_picture_private = - av_mallocz(s->avctx->hwaccel->frame_priv_data_size); + av_mallocz(hwaccel->frame_priv_data_size); if (!s->hwaccel_picture_private) return AVERROR(ENOMEM); - ret = s->avctx->hwaccel->start_frame(s->avctx, s->raw_image_buffer, - s->raw_image_buffer_size); + ret = hwaccel->start_frame(s->avctx, s->raw_image_buffer, + s->raw_image_buffer_size); if (ret < 0) return ret; } @@ -1774,9 +1777,9 @@ next_field: av_assert0(bytes_to_start >= 0 && s->raw_scan_buffer_size >= bytes_to_start); - ret = s->avctx->hwaccel->decode_slice(s->avctx, - s->raw_scan_buffer + bytes_to_start, - s->raw_scan_buffer_size - bytes_to_start); + ret = FF_HW_CALL(s->avctx, decode_slice, + s->raw_scan_buffer + bytes_to_start, + s->raw_scan_buffer_size - bytes_to_start); if (ret < 0) return ret; @@ -2483,9 +2486,9 @@ redo_for_pal8: case SOF0: case SOF1: if (start_code == SOF0) - s->avctx->profile = FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT; + s->avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT; else - s->avctx->profile = FF_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT; + s->avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT; s->lossless = 0; s->ls = 0; s->progressive = 0; @@ -2493,7 +2496,7 @@ redo_for_pal8: goto fail; break; case SOF2: - s->avctx->profile = FF_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT; + s->avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT; s->lossless = 0; s->ls = 0; s->progressive = 1; @@ -2501,7 +2504,7 @@ redo_for_pal8: goto fail; break; case SOF3: - s->avctx->profile = FF_PROFILE_MJPEG_HUFFMAN_LOSSLESS; + s->avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_LOSSLESS; s->avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS; s->lossless = 1; s->ls = 0; @@ -2510,7 +2513,7 @@ redo_for_pal8: goto fail; break; case SOF48: - s->avctx->profile = FF_PROFILE_MJPEG_JPEG_LS; + s->avctx->profile = AV_PROFILE_MJPEG_JPEG_LS; s->avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS; s->lossless = 1; s->ls = 1; @@ -2547,7 +2550,7 @@ eoi_parser: goto the_end_no_picture; } if (s->avctx->hwaccel) { - ret = s->avctx->hwaccel->end_frame(s->avctx); + ret = FF_HW_SIMPLE_CALL(s->avctx, end_frame); if (ret < 0) return ret; @@ -2952,7 +2955,7 @@ av_cold int ff_mjpeg_decode_end(AVCodecContext *avctx) for (i = 0; i < 3; i++) { for (j = 0; j < 4; j++) - ff_free_vlc(&s->vlcs[i][j]); + ff_vlc_free(&s->vlcs[i][j]); } for (i = 0; i < MAX_COMPONENTS; i++) { av_freep(&s->blocks[i]); diff --git a/src/third_party/ffmpeg/libavcodec/mjpegdec_common.c b/src/third_party/ffmpeg/libavcodec/mjpegdec_common.c index 701ddfec..ef2a0ad5 100644 --- a/src/third_party/ffmpeg/libavcodec/mjpegdec_common.c +++ b/src/third_party/ffmpeg/libavcodec/mjpegdec_common.c @@ -52,6 +52,6 @@ int ff_mjpeg_build_vlc(VLC *vlc, const uint8_t *bits_table, huff_sym[i] = 16 * 256; } - return ff_init_vlc_from_lengths(vlc, 9, nb_codes, huff_size, 1, + return ff_vlc_init_from_lengths(vlc, 9, nb_codes, huff_size, 1, huff_sym, 2, 2, 0, 0, logctx); } diff --git a/src/third_party/ffmpeg/libavcodec/mlpdec.c b/src/third_party/ffmpeg/libavcodec/mlpdec.c index 966ee0f0..a24ae0be 100644 --- a/src/third_party/ffmpeg/libavcodec/mlpdec.c +++ b/src/third_party/ffmpeg/libavcodec/mlpdec.c @@ -230,9 +230,9 @@ static av_cold void init_static(void) static VLCElem vlc_buf[3 * VLC_STATIC_SIZE]; huff_vlc[i].table = &vlc_buf[i * VLC_STATIC_SIZE]; huff_vlc[i].table_allocated = VLC_STATIC_SIZE; - init_vlc(&huff_vlc[i], VLC_BITS, 18, + vlc_init(&huff_vlc[i], VLC_BITS, 18, &ff_mlp_huffman_tables[i][0][1], 2, 1, - &ff_mlp_huffman_tables[i][0][0], 2, 1, INIT_VLC_USE_NEW_STATIC); + &ff_mlp_huffman_tables[i][0][0], 2, 1, VLC_INIT_USE_STATIC); } ff_mlp_init_crc(); @@ -398,7 +398,7 @@ static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb) */ if (m->avctx->codec_id == AV_CODEC_ID_TRUEHD && m->num_substreams == 4 && m->substream_info >> 7 == 1) { - m->avctx->profile = FF_PROFILE_TRUEHD_ATMOS; + m->avctx->profile = AV_PROFILE_TRUEHD_ATMOS; } /* limit to decoding 3 substreams, as the 4th is used by Dolby Atmos for non-audio data */ diff --git a/src/third_party/ffmpeg/libavcodec/mlpenc.c b/src/third_party/ffmpeg/libavcodec/mlpenc.c index 5995a6b5..89b55750 100644 --- a/src/third_party/ffmpeg/libavcodec/mlpenc.c +++ b/src/third_party/ffmpeg/libavcodec/mlpenc.c @@ -32,6 +32,7 @@ #include "libavutil/crc.h" #include "libavutil/avstring.h" #include "libavutil/intmath.h" +#include "libavutil/opt.h" #include "libavutil/samplefmt.h" #include "libavutil/thread.h" #include "mlp.h" @@ -41,7 +42,7 @@ #define MLP_MIN_LPC_ORDER 1 #define MLP_MAX_LPC_ORDER 8 -#define MLP_MIN_LPC_SHIFT 8 +#define MLP_MIN_LPC_SHIFT 0 #define MLP_MAX_LPC_SHIFT 15 typedef struct { @@ -108,8 +109,13 @@ typedef struct BestOffset { #define NUM_CODEBOOKS 4 typedef struct MLPEncodeContext { + AVClass *class; AVCodecContext *avctx; + int lpc_type; + int lpc_passes; + int prediction_order; + int num_substreams; ///< Number of substreams contained within this stream. int num_channels; /**< Number of channels in major_scratch_buffer. @@ -573,8 +579,6 @@ static av_cold int mlp_encode_init(AVCodecContext *avctx) ctx->min_restart_interval = MAJOR_HEADER_INTERVAL; ctx->restart_intervals = ctx->max_restart_interval / ctx->min_restart_interval; - /* TODO Let user pass parameters for LPC filter. */ - size = avctx->frame_size * ctx->max_restart_interval; ctx->lpc_sample_buffer = av_calloc(size, sizeof(*ctx->lpc_sample_buffer)); if (!ctx->lpc_sample_buffer) @@ -682,7 +686,7 @@ static av_cold int mlp_encode_init(AVCodecContext *avctx) rh->max_matrix_channel = rh->max_channel; if ((ret = ff_lpc_init(&ctx->lpc_ctx, ctx->number_of_samples, - MLP_MAX_LPC_ORDER, FF_LPC_TYPE_LEVINSON)) < 0) + MLP_MAX_LPC_ORDER, ctx->lpc_type)) < 0) return ret; for (int i = 0; i < NUM_FILTERS; i++) { @@ -1086,7 +1090,7 @@ static uint8_t *write_substr(MLPEncodeContext *ctx, uint8_t *buf, int buf_size, put_bits(&pb, 16, END_OF_STREAM & 0xFFFF); put_bits(&pb, 16, (ctx->shorten_by & 0x1FFF) | 0x2000); } else { - put_bits(&pb, 32, END_OF_STREAM); + put_bits32(&pb, END_OF_STREAM); } } @@ -1261,14 +1265,7 @@ static void input_to_sample_buffer(MLPEncodeContext *ctx) /** Counts the number of trailing zeroes in a value */ static int number_trailing_zeroes(int32_t sample) { - int bits = ff_ctz(sample); - - /* All samples are 0. TODO Return previous quant_step_size to avoid - * writing a new header. */ - if (bits >= 24) - return 0; - - return bits; + return FFMIN(15, ff_ctz(sample)); } /** Determines how many bits are zero at the end of all samples so they can be @@ -1341,13 +1338,12 @@ static void set_filter_params(MLPEncodeContext *ctx, } else if (filter == IIR) { fp->order = 0; } else if (filter == FIR) { - const int max_order = (ctx->substream_info & SUBSTREAM_INFO_HIGH_RATE) - ? 4 : MLP_MAX_LPC_ORDER; + const int max_order = MAX_FIR_ORDER; int32_t *sample_buffer = ctx->sample_buffer + channel; int32_t coefs[MAX_LPC_ORDER][MAX_LPC_ORDER]; int32_t *lpc_samples = ctx->lpc_sample_buffer; int32_t *fcoeff = ctx->cur_channel_params[channel].coeff[filter]; - int shift[MLP_MAX_LPC_ORDER]; + int shift[MAX_LPC_ORDER]; int order; for (unsigned int i = 0; i < ctx->number_of_samples; i++) { @@ -1357,8 +1353,8 @@ static void set_filter_params(MLPEncodeContext *ctx, order = ff_lpc_calc_coefs(&ctx->lpc_ctx, ctx->lpc_sample_buffer, ctx->number_of_samples, MLP_MIN_LPC_ORDER, - max_order, 11, coefs, shift, FF_LPC_TYPE_LEVINSON, 0, - ORDER_METHOD_EST, MLP_MIN_LPC_SHIFT, + max_order, 11, coefs, shift, ctx->lpc_type, ctx->lpc_passes, + ctx->prediction_order, MLP_MIN_LPC_SHIFT, MLP_MAX_LPC_SHIFT, MLP_MIN_LPC_SHIFT); fp->order = order; @@ -2238,6 +2234,26 @@ static av_cold int mlp_encode_close(AVCodecContext *avctx) return 0; } +#define FLAGS AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM +#define OFFSET(x) offsetof(MLPEncodeContext, x) +static const AVOption mlp_options[] = { +{ "lpc_type", "LPC algorithm", OFFSET(lpc_type), AV_OPT_TYPE_INT, {.i64 = FF_LPC_TYPE_LEVINSON }, FF_LPC_TYPE_LEVINSON, FF_LPC_TYPE_CHOLESKY, FLAGS, "lpc_type" }, +{ "levinson", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_LPC_TYPE_LEVINSON }, 0, 0, FLAGS, "lpc_type" }, +{ "cholesky", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_LPC_TYPE_CHOLESKY }, 0, 0, FLAGS, "lpc_type" }, +{ "lpc_passes", "Number of passes to use for Cholesky factorization during LPC analysis", OFFSET(lpc_passes), AV_OPT_TYPE_INT, {.i64 = 2 }, 1, INT_MAX, FLAGS }, +{ "prediction_order", "Search method for selecting prediction order", OFFSET(prediction_order), AV_OPT_TYPE_INT, {.i64 = ORDER_METHOD_EST }, ORDER_METHOD_EST, ORDER_METHOD_SEARCH, FLAGS, "predm" }, +{ "estimation", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = ORDER_METHOD_EST }, 0, 0, FLAGS, "predm" }, +{ "search", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = ORDER_METHOD_SEARCH }, 0, 0, FLAGS, "predm" }, +{ NULL }, +}; + +static const AVClass mlp_class = { + .class_name = "mlpenc", + .item_name = av_default_item_name, + .option = mlp_options, + .version = LIBAVUTIL_VERSION_INT, +}; + #if CONFIG_MLP_ENCODER const FFCodec ff_mlp_encoder = { .p.name ="mlp", @@ -2250,6 +2266,7 @@ const FFCodec ff_mlp_encoder = { .init = mlp_encode_init, FF_CODEC_ENCODE_CB(mlp_encode_frame), .close = mlp_encode_close, + .p.priv_class = &mlp_class, .p.sample_fmts = (const enum AVSampleFormat[]) {AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE}, .p.supported_samplerates = (const int[]) {44100, 48000, 88200, 96000, 176400, 192000, 0}, CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(ff_mlp_channel_layouts) @@ -2270,6 +2287,7 @@ const FFCodec ff_truehd_encoder = { .init = mlp_encode_init, FF_CODEC_ENCODE_CB(mlp_encode_frame), .close = mlp_encode_close, + .p.priv_class = &mlp_class, .p.sample_fmts = (const enum AVSampleFormat[]) {AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE}, .p.supported_samplerates = (const int[]) {44100, 48000, 88200, 96000, 176400, 192000, 0}, CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_5POINT0, AV_CH_LAYOUT_5POINT1) diff --git a/src/third_party/ffmpeg/libavcodec/mmaldec.c b/src/third_party/ffmpeg/libavcodec/mmaldec.c index 8d67d10c..4bb3eb22 100644 --- a/src/third_party/ffmpeg/libavcodec/mmaldec.c +++ b/src/third_party/ffmpeg/libavcodec/mmaldec.c @@ -648,8 +648,8 @@ static int ffmal_copy_frame(AVCodecContext *avctx, AVFrame *frame, av_image_fill_arrays(src, linesize, buffer->data + buffer->type->video.offset[0], avctx->pix_fmt, w, h, 1); - av_image_copy(frame->data, frame->linesize, (const uint8_t **)src, linesize, - avctx->pix_fmt, avctx->width, avctx->height); + av_image_copy2(frame->data, frame->linesize, src, linesize, + avctx->pix_fmt, avctx->width, avctx->height); } frame->sample_aspect_ratio = avctx->sample_aspect_ratio; diff --git a/src/third_party/ffmpeg/libavcodec/mobiclip.c b/src/third_party/ffmpeg/libavcodec/mobiclip.c index 381b492d..98c0f55a 100644 --- a/src/third_party/ffmpeg/libavcodec/mobiclip.c +++ b/src/third_party/ffmpeg/libavcodec/mobiclip.c @@ -279,11 +279,11 @@ static VLC mv_vlc[2][16]; static av_cold void mobiclip_init_static(void) { - INIT_VLC_STATIC_FROM_LENGTHS(&rl_vlc[0], MOBI_RL_VLC_BITS, 104, + VLC_INIT_STATIC_FROM_LENGTHS(&rl_vlc[0], MOBI_RL_VLC_BITS, 104, bits0, sizeof(*bits0), syms0, sizeof(*syms0), sizeof(*syms0), 0, 0, 1 << MOBI_RL_VLC_BITS); - INIT_VLC_STATIC_FROM_LENGTHS(&rl_vlc[1], MOBI_RL_VLC_BITS, 104, + VLC_INIT_STATIC_FROM_LENGTHS(&rl_vlc[1], MOBI_RL_VLC_BITS, 104, bits0, sizeof(*bits0), syms1, sizeof(*syms1), sizeof(*syms1), 0, 0, 1 << MOBI_RL_VLC_BITS); @@ -292,10 +292,10 @@ static av_cold void mobiclip_init_static(void) for (int j = 0; j < 16; j++) { mv_vlc[i][j].table = &vlc_buf[(16 * i + j) << MOBI_MV_VLC_BITS]; mv_vlc[i][j].table_allocated = 1 << MOBI_MV_VLC_BITS; - ff_init_vlc_from_lengths(&mv_vlc[i][j], MOBI_MV_VLC_BITS, mv_len[j], + ff_vlc_init_from_lengths(&mv_vlc[i][j], MOBI_MV_VLC_BITS, mv_len[j], mv_bits[i][j], sizeof(*mv_bits[i][j]), mv_syms[i][j], sizeof(*mv_syms[i][j]), sizeof(*mv_syms[i][j]), - 0, INIT_VLC_USE_NEW_STATIC, NULL); + 0, VLC_INIT_USE_STATIC, NULL); } } } diff --git a/src/third_party/ffmpeg/libavcodec/motionpixels.c b/src/third_party/ffmpeg/libavcodec/motionpixels.c index a947ca05..9df0b206 100644 --- a/src/third_party/ffmpeg/libavcodec/motionpixels.c +++ b/src/third_party/ffmpeg/libavcodec/motionpixels.c @@ -328,7 +328,7 @@ static int mp_decode_frame(AVCodecContext *avctx, AVFrame *rframe, if (mp->codes_count > 1) { /* The entries of the mp->codes array are sorted from right to left * in the Huffman tree, hence -(int)sizeof(HuffCode). */ - ret = ff_init_vlc_from_lengths(&mp->vlc, mp->max_codes_bits, mp->codes_count, + ret = ff_vlc_init_from_lengths(&mp->vlc, mp->max_codes_bits, mp->codes_count, &mp->codes[mp->codes_count - 1].size, -(int)sizeof(HuffCode), &mp->codes[mp->codes_count - 1].delta, -(int)sizeof(HuffCode), 1, 0, 0, avctx); @@ -336,7 +336,7 @@ static int mp_decode_frame(AVCodecContext *avctx, AVFrame *rframe, goto end; } mp_decode_frame_helper(mp, &gb); - ff_free_vlc(&mp->vlc); + ff_vlc_free(&mp->vlc); end: if ((ret = av_frame_ref(rframe, mp->frame)) < 0) diff --git a/src/third_party/ffmpeg/libavcodec/mpc.c b/src/third_party/ffmpeg/libavcodec/mpc.c index 6aa3e809..46cb967c 100644 --- a/src/third_party/ffmpeg/libavcodec/mpc.c +++ b/src/third_party/ffmpeg/libavcodec/mpc.c @@ -27,7 +27,7 @@ */ #include -#include "libavutil/intmath.h" +#include "libavutil/common.h" #include "mpegaudiodsp.h" #include "mpc.h" diff --git a/src/third_party/ffmpeg/libavcodec/mpc7.c b/src/third_party/ffmpeg/libavcodec/mpc7.c index d2745366..59782c67 100644 --- a/src/third_party/ffmpeg/libavcodec/mpc7.c +++ b/src/third_party/ffmpeg/libavcodec/mpc7.c @@ -47,24 +47,24 @@ static av_cold void mpc7_init_static(void) static VLCElem quant_tables[7224]; const uint8_t *raw_quant_table = mpc7_quant_vlcs; - INIT_VLC_STATIC_FROM_LENGTHS(&scfi_vlc, MPC7_SCFI_BITS, MPC7_SCFI_SIZE, + VLC_INIT_STATIC_FROM_LENGTHS(&scfi_vlc, MPC7_SCFI_BITS, MPC7_SCFI_SIZE, &mpc7_scfi[1], 2, &mpc7_scfi[0], 2, 1, 0, 0, 1 << MPC7_SCFI_BITS); - INIT_VLC_STATIC_FROM_LENGTHS(&dscf_vlc, MPC7_DSCF_BITS, MPC7_DSCF_SIZE, + VLC_INIT_STATIC_FROM_LENGTHS(&dscf_vlc, MPC7_DSCF_BITS, MPC7_DSCF_SIZE, &mpc7_dscf[1], 2, &mpc7_dscf[0], 2, 1, -7, 0, 1 << MPC7_DSCF_BITS); - INIT_VLC_STATIC_FROM_LENGTHS(&hdr_vlc, MPC7_HDR_BITS, MPC7_HDR_SIZE, + VLC_INIT_STATIC_FROM_LENGTHS(&hdr_vlc, MPC7_HDR_BITS, MPC7_HDR_SIZE, &mpc7_hdr[1], 2, &mpc7_hdr[0], 2, 1, -5, 0, 1 << MPC7_HDR_BITS); for (unsigned i = 0, offset = 0; i < MPC7_QUANT_VLC_TABLES; i++){ for (int j = 0; j < 2; j++) { quant_vlc[i][j].table = &quant_tables[offset]; quant_vlc[i][j].table_allocated = FF_ARRAY_ELEMS(quant_tables) - offset; - ff_init_vlc_from_lengths(&quant_vlc[i][j], 9, mpc7_quant_vlc_sizes[i], + ff_vlc_init_from_lengths(&quant_vlc[i][j], 9, mpc7_quant_vlc_sizes[i], &raw_quant_table[1], 2, &raw_quant_table[0], 2, 1, mpc7_quant_vlc_off[i], - INIT_VLC_STATIC_OVERLONG, NULL); + VLC_INIT_STATIC_OVERLONG, NULL); raw_quant_table += 2 * mpc7_quant_vlc_sizes[i]; offset += quant_vlc[i][j].table_size; } diff --git a/src/third_party/ffmpeg/libavcodec/mpc8.c b/src/third_party/ffmpeg/libavcodec/mpc8.c index c1b787c3..27852591 100644 --- a/src/third_party/ffmpeg/libavcodec/mpc8.c +++ b/src/third_party/ffmpeg/libavcodec/mpc8.c @@ -103,8 +103,8 @@ static av_cold void build_vlc(VLC *vlc, unsigned *buf_offset, for (unsigned tmp = num + codes_counts[i - 1]; num < tmp; num++) len[num] = i; - ff_init_vlc_from_lengths(vlc, FFMIN(len[0], 9), num, len, 1, - *syms, 1, 1, offset, INIT_VLC_STATIC_OVERLONG, NULL); + ff_vlc_init_from_lengths(vlc, FFMIN(len[0], 9), num, len, 1, + *syms, 1, 1, offset, VLC_INIT_STATIC_OVERLONG, NULL); *buf_offset += vlc->table_size; *syms += num; } diff --git a/src/third_party/ffmpeg/libavcodec/mpeg12.c b/src/third_party/ffmpeg/libavcodec/mpeg12.c index 305876dd..80b3a1ad 100644 --- a/src/third_party/ffmpeg/libavcodec/mpeg12.c +++ b/src/third_party/ffmpeg/libavcodec/mpeg12.c @@ -72,7 +72,7 @@ av_cold void ff_init_2d_vlc_rl(const uint16_t table_vlc[][2], RL_VLC_ELEM rl_vlc VLCElem table[680] = { 0 }; VLC vlc = { .table = table, .table_allocated = static_size }; av_assert0(static_size <= FF_ARRAY_ELEMS(table)); - init_vlc(&vlc, TEX_VLC_BITS, n + 2, &table_vlc[0][1], 4, 2, &table_vlc[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC | flags); + vlc_init(&vlc, TEX_VLC_BITS, n + 2, &table_vlc[0][1], 4, 2, &table_vlc[0][0], 4, 2, VLC_INIT_USE_STATIC | flags); for (i = 0; i < vlc.table_size; i++) { int code = vlc.table[i].sym; @@ -130,26 +130,26 @@ RL_VLC_ELEM ff_mpeg2_rl_vlc[674]; static av_cold void mpeg12_init_vlcs(void) { - INIT_VLC_STATIC(&ff_dc_lum_vlc, DC_VLC_BITS, 12, + VLC_INIT_STATIC(&ff_dc_lum_vlc, DC_VLC_BITS, 12, ff_mpeg12_vlc_dc_lum_bits, 1, 1, ff_mpeg12_vlc_dc_lum_code, 2, 2, 512); - INIT_VLC_STATIC(&ff_dc_chroma_vlc, DC_VLC_BITS, 12, + VLC_INIT_STATIC(&ff_dc_chroma_vlc, DC_VLC_BITS, 12, ff_mpeg12_vlc_dc_chroma_bits, 1, 1, ff_mpeg12_vlc_dc_chroma_code, 2, 2, 514); - INIT_VLC_STATIC(&ff_mv_vlc, MV_VLC_BITS, 17, + VLC_INIT_STATIC(&ff_mv_vlc, MV_VLC_BITS, 17, &ff_mpeg12_mbMotionVectorTable[0][1], 2, 1, &ff_mpeg12_mbMotionVectorTable[0][0], 2, 1, 266); - INIT_VLC_STATIC(&ff_mbincr_vlc, MBINCR_VLC_BITS, 36, + VLC_INIT_STATIC(&ff_mbincr_vlc, MBINCR_VLC_BITS, 36, &ff_mpeg12_mbAddrIncrTable[0][1], 2, 1, &ff_mpeg12_mbAddrIncrTable[0][0], 2, 1, 538); - INIT_VLC_STATIC(&ff_mb_pat_vlc, MB_PAT_VLC_BITS, 64, + VLC_INIT_STATIC(&ff_mb_pat_vlc, MB_PAT_VLC_BITS, 64, &ff_mpeg12_mbPatTable[0][1], 2, 1, &ff_mpeg12_mbPatTable[0][0], 2, 1, 512); - INIT_VLC_STATIC(&ff_mb_ptype_vlc, MB_PTYPE_VLC_BITS, 7, + VLC_INIT_STATIC(&ff_mb_ptype_vlc, MB_PTYPE_VLC_BITS, 7, &table_mb_ptype[0][1], 2, 1, &table_mb_ptype[0][0], 2, 1, 64); - INIT_VLC_STATIC(&ff_mb_btype_vlc, MB_BTYPE_VLC_BITS, 11, + VLC_INIT_STATIC(&ff_mb_btype_vlc, MB_BTYPE_VLC_BITS, 11, &table_mb_btype[0][1], 2, 1, &table_mb_btype[0][0], 2, 1, 64); diff --git a/src/third_party/ffmpeg/libavcodec/mpeg12dec.c b/src/third_party/ffmpeg/libavcodec/mpeg12dec.c index 736a1754..5a1cae99 100644 --- a/src/third_party/ffmpeg/libavcodec/mpeg12dec.c +++ b/src/third_party/ffmpeg/libavcodec/mpeg12dec.c @@ -31,6 +31,7 @@ #include #include "libavutil/attributes.h" +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/internal.h" #include "libavutil/mem_internal.h" @@ -42,6 +43,7 @@ #include "codec_internal.h" #include "decode.h" #include "error_resilience.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "idctdsp.h" #include "internal.h" @@ -74,7 +76,6 @@ typedef struct Mpeg1Context { unsigned aspect_ratio_info; AVRational save_aspect; int save_width, save_height, save_progressive_seq; - int rc_buffer_size; AVRational frame_rate_ext; /* MPEG-2 specific framerate modificator */ unsigned frame_rate_index; int sync; /* Did we reach a sync point like a GOP/SEQ/KEYFrame? */ @@ -1167,7 +1168,7 @@ static enum AVPixelFormat mpeg_get_pixelformat(AVCodecContext *avctx) else pix_fmts = mpeg12_pixfmt_list_444; - return ff_thread_get_format(avctx, pix_fmts); + return ff_get_format(avctx, pix_fmts); } /* Call this function when we know all parameters. @@ -1247,7 +1248,8 @@ static int mpeg_decode_postinit(AVCodecContext *avctx) if (ret < 0) return ret; - if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO && s->bit_rate) { + if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO && s->bit_rate && + (s->bit_rate != 0x3FFFF*400)) { avctx->rc_max_rate = s->bit_rate; } else if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO && s->bit_rate && (s->bit_rate != 0x3FFFF*400 || s->vbv_delay != 0xFFFF)) { @@ -1370,7 +1372,6 @@ static void mpeg_decode_sequence_extension(Mpeg1Context *s1) MpegEncContext *s = &s1->mpeg_enc_ctx; int horiz_size_ext, vert_size_ext; int bit_rate_ext; - AVCPBProperties *cpb_props; skip_bits(&s->gb, 1); /* profile and level esc*/ s->avctx->profile = get_bits(&s->gb, 3); @@ -1390,7 +1391,7 @@ static void mpeg_decode_sequence_extension(Mpeg1Context *s1) bit_rate_ext = get_bits(&s->gb, 12); /* XXX: handle it */ s->bit_rate += (bit_rate_ext << 18) * 400LL; check_marker(s->avctx, &s->gb, "after bit rate extension"); - s1->rc_buffer_size += get_bits(&s->gb, 8) * 1024 * 16 << 10; + s->avctx->rc_buffer_size += get_bits(&s->gb, 8) * 1024 * 16 << 10; s->low_delay = get_bits1(&s->gb); if (s->avctx->flags & AV_CODEC_FLAG_LOW_DELAY) @@ -1402,17 +1403,11 @@ static void mpeg_decode_sequence_extension(Mpeg1Context *s1) ff_dlog(s->avctx, "sequence extension\n"); s->codec_id = s->avctx->codec_id = AV_CODEC_ID_MPEG2VIDEO; - if (cpb_props = ff_add_cpb_side_data(s->avctx)) { - cpb_props->buffer_size = s1->rc_buffer_size; - if (s->bit_rate != 0x3FFFF*400) - cpb_props->max_bitrate = s->bit_rate; - } - 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:%"PRId64"\n", s->avctx->profile, s->avctx->level, s->progressive_sequence, s->chroma_format, - s1->rc_buffer_size, s->bit_rate); + s->avctx->rc_buffer_size, s->bit_rate); } static void mpeg_decode_sequence_display_extension(Mpeg1Context *s1) @@ -1656,7 +1651,7 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) } if (s->avctx->hwaccel) { - if ((ret = s->avctx->hwaccel->end_frame(s->avctx)) < 0) { + if ((ret = FF_HW_SIMPLE_CALL(s->avctx, end_frame)) < 0) { av_log(avctx, AV_LOG_ERROR, "hardware accelerator failed to decode first field\n"); return ret; @@ -1672,7 +1667,7 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) } if (avctx->hwaccel) { - if ((ret = avctx->hwaccel->start_frame(avctx, buf, buf_size)) < 0) + if ((ret = FF_HW_CALL(avctx, start_frame, buf, buf_size)) < 0) return ret; } @@ -1750,14 +1745,14 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y, return AVERROR_INVALIDDATA; } - if (avctx->hwaccel && avctx->hwaccel->decode_slice) { + if (avctx->hwaccel) { const uint8_t *buf_end, *buf_start = *buf - 4; /* include start_code */ int start_code = -1; buf_end = avpriv_find_start_code(buf_start + 2, *buf + buf_size, &start_code); if (buf_end < *buf + buf_size) buf_end -= 4; s->mb_y = mb_y; - if (avctx->hwaccel->decode_slice(avctx, buf_start, buf_end - buf_start) < 0) + if (FF_HW_CALL(avctx, decode_slice, buf_start, buf_end - buf_start) < 0) return DECODE_SLICE_ERROR; *buf = buf_end; return DECODE_SLICE_OK; @@ -2026,7 +2021,7 @@ static int slice_end(AVCodecContext *avctx, AVFrame *pict) return 0; if (s->avctx->hwaccel) { - int ret = s->avctx->hwaccel->end_frame(s->avctx); + int ret = FF_HW_SIMPLE_CALL(s->avctx, end_frame); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "hardware accelerator failed to decode picture\n"); @@ -2038,7 +2033,7 @@ static int slice_end(AVCodecContext *avctx, AVFrame *pict) if (/* s->mb_y << field_pic == s->mb_height && */ !s->first_field && !s1->first_slice) { /* end of image */ - ff_er_frame_end(&s->er); + ff_er_frame_end(&s->er, NULL); ff_mpv_frame_end(s); @@ -2102,7 +2097,7 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx, return AVERROR_INVALIDDATA; } - s1->rc_buffer_size = get_bits(&s->gb, 10) * 1024 * 16; + s->avctx->rc_buffer_size = get_bits(&s->gb, 10) * 1024 * 16; skip_bits(&s->gb, 1); /* get matrix */ @@ -2150,7 +2145,7 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx, if (s->avctx->debug & FF_DEBUG_PICT_INFO) av_log(s->avctx, AV_LOG_DEBUG, "vbv buffer: %d, bitrate:%"PRId64", aspect_ratio_info: %d \n", - s1->rc_buffer_size, s->bit_rate, s1->aspect_ratio_info); + s->avctx->rc_buffer_size, s->bit_rate, s1->aspect_ratio_info); return 0; } diff --git a/src/third_party/ffmpeg/libavcodec/mpeg12enc.c b/src/third_party/ffmpeg/libavcodec/mpeg12enc.c index 4aa45e9e..0135623c 100644 --- a/src/third_party/ffmpeg/libavcodec/mpeg12enc.c +++ b/src/third_party/ffmpeg/libavcodec/mpeg12enc.c @@ -203,23 +203,23 @@ static av_cold int encode_init(AVCodecContext *avctx) } } - if (avctx->profile == FF_PROFILE_UNKNOWN) { - if (avctx->level != FF_LEVEL_UNKNOWN) { + if (avctx->profile == AV_PROFILE_UNKNOWN) { + if (avctx->level != AV_LEVEL_UNKNOWN) { av_log(avctx, AV_LOG_ERROR, "Set profile and level\n"); return AVERROR(EINVAL); } /* Main or 4:2:2 */ - avctx->profile = avctx->pix_fmt == AV_PIX_FMT_YUV420P ? FF_PROFILE_MPEG2_MAIN - : FF_PROFILE_MPEG2_422; + avctx->profile = avctx->pix_fmt == AV_PIX_FMT_YUV420P ? AV_PROFILE_MPEG2_MAIN + : AV_PROFILE_MPEG2_422; } - if (avctx->level == FF_LEVEL_UNKNOWN) { - if (avctx->profile == FF_PROFILE_MPEG2_422) { /* 4:2:2 */ + if (avctx->level == AV_LEVEL_UNKNOWN) { + if (avctx->profile == AV_PROFILE_MPEG2_422) { /* 4:2:2 */ if (avctx->width <= 720 && avctx->height <= 608) avctx->level = 5; /* Main */ else avctx->level = 2; /* High */ } else { - if (avctx->profile != FF_PROFILE_MPEG2_HIGH && + if (avctx->profile != AV_PROFILE_MPEG2_HIGH && avctx->pix_fmt != AV_PIX_FMT_YUV420P) { av_log(avctx, AV_LOG_ERROR, "Only High(1) and 4:2:2(0) profiles support 4:2:2 color sampling\n"); @@ -366,7 +366,7 @@ static void mpeg1_encode_sequence_header(MpegEncContext *s) put_header(s, EXT_START_CODE); put_bits(&s->pb, 4, 1); // seq ext - put_bits(&s->pb, 1, s->avctx->profile == FF_PROFILE_MPEG2_422); // escx 1 for 4:2:2 profile + put_bits(&s->pb, 1, s->avctx->profile == AV_PROFILE_MPEG2_422); // escx 1 for 4:2:2 profile put_bits(&s->pb, 3, s->avctx->profile); // profile put_bits(&s->pb, 4, s->avctx->level); // level diff --git a/src/third_party/ffmpeg/libavcodec/mpeg4videodec.c b/src/third_party/ffmpeg/libavcodec/mpeg4videodec.c index 5ce244d0..c946b127 100644 --- a/src/third_party/ffmpeg/libavcodec/mpeg4videodec.c +++ b/src/third_party/ffmpeg/libavcodec/mpeg4videodec.c @@ -295,7 +295,7 @@ void ff_mpeg4_decode_studio(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb int hsub = i ? s->chroma_x_shift : 0; int lowres = s->avctx->lowres; int step = 1 << lowres; - dest_pcm[i] += (linesize[i] / 2) * ((16 >> vsub) - 1); + dest_pcm[i] += (linesize[i] / 2) * ((16 >> vsub + lowres) - 1); for (int h = (16 >> (vsub + lowres)) - 1; h >= 0; h--){ for (int w = (16 >> (hsub + lowres)) - 1, idx = 0; w >= 0; w--, idx += step) dest_pcm[i][w] = src[idx]; @@ -861,7 +861,7 @@ static inline int get_amv(Mpeg4DecContext *ctx, int n) for (y = 0; y < 16; y++) { int v; - v = mb_v + dy * y; + v = mb_v + (unsigned)dy * y; // FIXME optimize for (x = 0; x < 16; x++) { sum += v >> shift; @@ -2564,10 +2564,10 @@ static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb) */ if (ctx->vo_type == CORE_STUDIO_VO_TYPE || ctx->vo_type == SIMPLE_STUDIO_VO_TYPE) { - if (s->avctx->profile != FF_PROFILE_UNKNOWN && s->avctx->profile != FF_PROFILE_MPEG4_SIMPLE_STUDIO) + if (s->avctx->profile != AV_PROFILE_UNKNOWN && s->avctx->profile != AV_PROFILE_MPEG4_SIMPLE_STUDIO) return AVERROR_INVALIDDATA; s->studio_profile = 1; - s->avctx->profile = FF_PROFILE_MPEG4_SIMPLE_STUDIO; + s->avctx->profile = AV_PROFILE_MPEG4_SIMPLE_STUDIO; return decode_studio_vol_header(ctx, gb); } else if (s->studio_profile) { return AVERROR_PATCHWELCOME; @@ -3141,9 +3141,6 @@ static int decode_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb, av_log(s->avctx, AV_LOG_WARNING, "time_increment_bits set to %d bits, based on bitstream analysis\n", ctx->time_increment_bits); - if (s->avctx->framerate.num && 4*s->avctx->framerate.num < 1<time_increment_bits) { - s->avctx->framerate.num = 1<time_increment_bits; - } } if (IS_3IV1) @@ -3605,7 +3602,7 @@ int ff_mpeg4_decode_picture_header(Mpeg4DecContext *ctx, GetBitContext *gb, } else if (startcode == VOS_STARTCODE) { int profile, level; mpeg4_decode_profile_level(s, gb, &profile, &level); - if (profile == FF_PROFILE_MPEG4_SIMPLE_STUDIO && + if (profile == AV_PROFILE_MPEG4_SIMPLE_STUDIO && (level > 0 && level < 9)) { s->studio_profile = 1; next_start_code_studio(gb); @@ -3761,12 +3758,12 @@ static av_cold void mpeg4_init_static(void) { static uint8_t mpeg4_rvlc_rl_tables[2][2][2 * MAX_RUN + MAX_LEVEL + 3]; - INIT_VLC_STATIC_FROM_LENGTHS(&studio_luma_dc, STUDIO_INTRA_BITS, 19, + VLC_INIT_STATIC_FROM_LENGTHS(&studio_luma_dc, STUDIO_INTRA_BITS, 19, &ff_mpeg4_studio_dc_luma[0][1], 2, &ff_mpeg4_studio_dc_luma[0][0], 2, 1, 0, 0, 528); - INIT_VLC_STATIC_FROM_LENGTHS(&studio_chroma_dc, STUDIO_INTRA_BITS, 19, + VLC_INIT_STATIC_FROM_LENGTHS(&studio_chroma_dc, STUDIO_INTRA_BITS, 19, &ff_mpeg4_studio_dc_chroma[0][1], 2, &ff_mpeg4_studio_dc_chroma[0][0], 2, 1, 0, 0, 528); @@ -3776,11 +3773,11 @@ static av_cold void mpeg4_init_static(void) studio_intra_tab[i].table = &vlc_buf[offset]; studio_intra_tab[i].table_allocated = FF_ARRAY_ELEMS(vlc_buf) - offset; - ff_init_vlc_from_lengths(&studio_intra_tab[i], + ff_vlc_init_from_lengths(&studio_intra_tab[i], STUDIO_INTRA_BITS, 24, &ff_mpeg4_studio_intra[i][0][1], 2, &ff_mpeg4_studio_intra[i][0][0], 2, 1, - 0, INIT_VLC_STATIC_OVERLONG, NULL); + 0, VLC_INIT_STATIC_OVERLONG, NULL); offset += studio_intra_tab[i].table_size; } @@ -3788,18 +3785,18 @@ static av_cold void mpeg4_init_static(void) ff_rl_init(&ff_rvlc_rl_inter, mpeg4_rvlc_rl_tables[0]); ff_rl_init(&ff_rvlc_rl_intra, mpeg4_rvlc_rl_tables[1]); INIT_FIRST_VLC_RL(ff_mpeg4_rl_intra, 554); - INIT_VLC_RL(ff_rvlc_rl_inter, 1072); + VLC_INIT_RL(ff_rvlc_rl_inter, 1072); INIT_FIRST_VLC_RL(ff_rvlc_rl_intra, 1072); - INIT_VLC_STATIC(&dc_lum, DC_VLC_BITS, 10 /* 13 */, + VLC_INIT_STATIC(&dc_lum, DC_VLC_BITS, 10 /* 13 */, &ff_mpeg4_DCtab_lum[0][1], 2, 1, &ff_mpeg4_DCtab_lum[0][0], 2, 1, 512); - INIT_VLC_STATIC(&dc_chrom, DC_VLC_BITS, 10 /* 13 */, + VLC_INIT_STATIC(&dc_chrom, DC_VLC_BITS, 10 /* 13 */, &ff_mpeg4_DCtab_chrom[0][1], 2, 1, &ff_mpeg4_DCtab_chrom[0][0], 2, 1, 512); - INIT_VLC_STATIC_FROM_LENGTHS(&sprite_trajectory, SPRITE_TRAJ_VLC_BITS, 15, + VLC_INIT_STATIC_FROM_LENGTHS(&sprite_trajectory, SPRITE_TRAJ_VLC_BITS, 15, ff_sprite_trajectory_lens, 1, NULL, 0, 0, 0, 0, 128); - INIT_VLC_STATIC(&mb_type_b_vlc, MB_TYPE_B_VLC_BITS, 4, + VLC_INIT_STATIC(&mb_type_b_vlc, MB_TYPE_B_VLC_BITS, 4, &ff_mb_type_b_tab[0][1], 2, 1, &ff_mb_type_b_tab[0][0], 2, 1, 16); } diff --git a/src/third_party/ffmpeg/libavcodec/mpeg4videoenc.c b/src/third_party/ffmpeg/libavcodec/mpeg4videoenc.c index 777635c4..d1e50612 100644 --- a/src/third_party/ffmpeg/libavcodec/mpeg4videoenc.c +++ b/src/third_party/ffmpeg/libavcodec/mpeg4videoenc.c @@ -916,7 +916,7 @@ static void mpeg4_encode_visual_object_header(MpegEncContext *s) int profile_and_level_indication; int vo_ver_id; - if (s->avctx->profile != FF_PROFILE_UNKNOWN) { + if (s->avctx->profile != AV_PROFILE_UNKNOWN) { profile_and_level_indication = s->avctx->profile << 4; } else if (s->max_b_frames || s->quarter_sample) { profile_and_level_indication = 0xF0; // adv simple @@ -924,7 +924,7 @@ static void mpeg4_encode_visual_object_header(MpegEncContext *s) profile_and_level_indication = 0x00; // simple } - if (s->avctx->level != FF_LEVEL_UNKNOWN) + if (s->avctx->level != AV_LEVEL_UNKNOWN) profile_and_level_indication |= s->avctx->level; else profile_and_level_indication |= 1; // level 1 diff --git a/src/third_party/ffmpeg/libavcodec/mpegaudiodec_common.c b/src/third_party/ffmpeg/libavcodec/mpegaudiodec_common.c index 5fcb39b3..3a60b03e 100644 --- a/src/third_party/ffmpeg/libavcodec/mpegaudiodec_common.c +++ b/src/third_party/ffmpeg/libavcodec/mpegaudiodec_common.c @@ -428,9 +428,9 @@ static av_cold void mpegaudiodec_common_init_static(void) ff_huff_vlc[++i].table = huff_vlc_tables + offset; ff_huff_vlc[i].table_allocated = FF_ARRAY_ELEMS(huff_vlc_tables) - offset; - ff_init_vlc_from_lengths(&ff_huff_vlc[i], 7, j, + ff_vlc_init_from_lengths(&ff_huff_vlc[i], 7, j, huff_lens, 1, tmp_symbols, 2, 2, - 0, INIT_VLC_STATIC_OVERLONG, NULL); + 0, VLC_INIT_STATIC_OVERLONG, NULL); offset += ff_huff_vlc[i].table_size; huff_lens += j; huff_sym += j; @@ -443,9 +443,9 @@ static av_cold void mpegaudiodec_common_init_static(void) ff_huff_quad_vlc[i].table = huff_quad_vlc_tables + offset; ff_huff_quad_vlc[i].table_allocated = 1 << bits; offset += 1 << bits; - init_vlc(&ff_huff_quad_vlc[i], bits, 16, + vlc_init(&ff_huff_quad_vlc[i], bits, 16, mpa_quad_bits[i], 1, 1, mpa_quad_codes[i], 1, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); } av_assert0(offset == FF_ARRAY_ELEMS(huff_quad_vlc_tables)); diff --git a/src/third_party/ffmpeg/libavcodec/mpegaudiodsp.c b/src/third_party/ffmpeg/libavcodec/mpegaudiodsp.c index 5a5a679d..0971c287 100644 --- a/src/third_party/ffmpeg/libavcodec/mpegaudiodsp.c +++ b/src/third_party/ffmpeg/libavcodec/mpegaudiodsp.c @@ -23,7 +23,6 @@ #include "libavutil/thread.h" #include "mpegaudio.h" #include "mpegaudiodsp.h" -#include "dct.h" #include "dct32.h" static AVOnce mpadsp_table_init = AV_ONCE_INIT; @@ -81,15 +80,12 @@ static av_cold void mpadsp_init_tabs(void) av_cold void ff_mpadsp_init(MPADSPContext *s) { - DCTContext dct; - - ff_dct_init(&dct, 5, DCT_II); ff_thread_once(&mpadsp_table_init, &mpadsp_init_tabs); s->apply_window_float = ff_mpadsp_apply_window_float; s->apply_window_fixed = ff_mpadsp_apply_window_fixed; - s->dct32_float = dct.dct32; + s->dct32_float = ff_dct32_float; s->dct32_fixed = ff_dct32_fixed; s->imdct36_blocks_float = ff_imdct36_blocks_float; diff --git a/src/third_party/ffmpeg/libavcodec/mpegpicture.c b/src/third_party/ffmpeg/libavcodec/mpegpicture.c index 71c7a3fd..b7c804c8 100644 --- a/src/third_party/ffmpeg/libavcodec/mpegpicture.c +++ b/src/third_party/ffmpeg/libavcodec/mpegpicture.c @@ -171,17 +171,10 @@ static int alloc_frame_buffer(AVCodecContext *avctx, Picture *pic, pic->f->height = avctx->height; } - if (avctx->hwaccel) { - assert(!pic->hwaccel_picture_private); - if (avctx->hwaccel->frame_priv_data_size) { - pic->hwaccel_priv_buf = ff_hwaccel_frame_priv_alloc(avctx, avctx->hwaccel); - if (!pic->hwaccel_priv_buf) { - av_log(avctx, AV_LOG_ERROR, "alloc_frame_buffer() failed (hwaccel private data allocation)\n"); - return -1; - } - pic->hwaccel_picture_private = pic->hwaccel_priv_buf->data; - } - } + ret = ff_hwaccel_frame_priv_alloc(avctx, &pic->hwaccel_picture_private, + &pic->hwaccel_priv_buf); + if (ret < 0) + return ret; if ((linesize && linesize != pic->f->linesize[0]) || (uvlinesize && uvlinesize != pic->f->linesize[1])) { diff --git a/src/third_party/ffmpeg/libavcodec/mpegutils.c b/src/third_party/ffmpeg/libavcodec/mpegutils.c index 2d812a25..5e76d7ac 100644 --- a/src/third_party/ffmpeg/libavcodec/mpegutils.c +++ b/src/third_party/ffmpeg/libavcodec/mpegutils.c @@ -21,6 +21,7 @@ #include #include "libavutil/common.h" +#include "libavutil/emms.h" #include "libavutil/frame.h" #include "libavutil/pixdesc.h" #include "libavutil/motion_vector.h" diff --git a/src/third_party/ffmpeg/libavcodec/mpegvideo_dec.c b/src/third_party/ffmpeg/libavcodec/mpegvideo_dec.c index 670b0912..f9fccff5 100644 --- a/src/third_party/ffmpeg/libavcodec/mpegvideo_dec.c +++ b/src/third_party/ffmpeg/libavcodec/mpegvideo_dec.c @@ -25,6 +25,7 @@ #include "config_components.h" #include "libavutil/avassert.h" +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/internal.h" #include "libavutil/video_enc_params.h" @@ -36,6 +37,7 @@ #include "mpegvideo.h" #include "mpegvideodec.h" #include "mpeg4videodec.h" +#include "thread.h" #include "threadframe.h" #include "wmv2dec.h" @@ -154,21 +156,16 @@ do {\ s->divx_packed = s1->divx_packed; if (s1->bitstream_buffer) { - if (s1->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); - if (!s->bitstream_buffer) { - s->bitstream_buffer_size = 0; - return AVERROR(ENOMEM); - } + av_fast_padded_malloc(&s->bitstream_buffer, + &s->allocated_bitstream_buffer_size, + s1->bitstream_buffer_size); + if (!s->bitstream_buffer) { + s->bitstream_buffer_size = 0; + return AVERROR(ENOMEM); } s->bitstream_buffer_size = s1->bitstream_buffer_size; memcpy(s->bitstream_buffer, s1->bitstream_buffer, s1->bitstream_buffer_size); - memset(s->bitstream_buffer + s->bitstream_buffer_size, 0, - AV_INPUT_BUFFER_PADDING_SIZE); } // linesize-dependent scratch buffer allocation @@ -248,14 +245,16 @@ static int alloc_picture(MpegEncContext *s, Picture *pic) &s->linesize, &s->uvlinesize); } -static void gray_frame(AVFrame *frame) +static void color_frame(AVFrame *frame, int luma) { int h_chroma_shift, v_chroma_shift; - av_pix_fmt_get_chroma_sub_sample(frame->format, &h_chroma_shift, &v_chroma_shift); - for (int i = 0; i < frame->height; i++) - memset(frame->data[0] + frame->linesize[0] * i, 0x80, frame->width); + memset(frame->data[0] + frame->linesize[0] * i, luma, frame->width); + + if (!frame->data[1]) + return; + av_pix_fmt_get_chroma_sub_sample(frame->format, &h_chroma_shift, &v_chroma_shift); for (int i = 0; i < AV_CEIL_RSHIFT(frame->height, v_chroma_shift); i++) { memset(frame->data[1] + frame->linesize[1] * i, 0x80, AV_CEIL_RSHIFT(frame->width, h_chroma_shift)); @@ -366,9 +365,6 @@ FF_ENABLE_DEPRECATION_WARNINGS if ((!s->last_picture_ptr || !s->last_picture_ptr->f->buf[0]) && (s->pict_type != AV_PICTURE_TYPE_I)) { - int h_chroma_shift, v_chroma_shift; - av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, - &h_chroma_shift, &v_chroma_shift); if (s->pict_type == AV_PICTURE_TYPE_B && s->next_picture_ptr && s->next_picture_ptr->f->buf[0]) av_log(avctx, AV_LOG_DEBUG, "allocating dummy last picture for B frame\n"); @@ -394,23 +390,8 @@ FF_ENABLE_DEPRECATION_WARNINGS } if (!avctx->hwaccel) { - for (int 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); - if (s->last_picture_ptr->f->data[2]) { - for (int i = 0; i < AV_CEIL_RSHIFT(avctx->height, v_chroma_shift); i++) { - memset(s->last_picture_ptr->f->data[1] + s->last_picture_ptr->f->linesize[1]*i, - 0x80, AV_CEIL_RSHIFT(avctx->width, h_chroma_shift)); - memset(s->last_picture_ptr->f->data[2] + s->last_picture_ptr->f->linesize[2]*i, - 0x80, AV_CEIL_RSHIFT(avctx->width, h_chroma_shift)); - } - } - - if (s->codec_id == AV_CODEC_ID_FLV1 || s->codec_id == AV_CODEC_ID_H263) { - for (int i = 0; i < avctx->height; i++) - memset(s->last_picture_ptr->f->data[0] + s->last_picture_ptr->f->linesize[0] * i, - 16, avctx->width); - } + int luma_val = s->codec_id == AV_CODEC_ID_FLV1 || s->codec_id == AV_CODEC_ID_H263 ? 16 : 0x80; + color_frame(s->last_picture_ptr->f, luma_val); } ff_thread_report_progress(&s->last_picture_ptr->tf, INT_MAX, 0); @@ -438,10 +419,6 @@ FF_ENABLE_DEPRECATION_WARNINGS ff_thread_report_progress(&s->next_picture_ptr->tf, INT_MAX, 1); } -#if 0 // BUFREF-FIXME - memset(s->last_picture.f->data, 0, sizeof(s->last_picture.f->data)); - memset(s->next_picture.f->data, 0, sizeof(s->next_picture.f->data)); -#endif if (s->last_picture_ptr) { if (s->last_picture_ptr->f->buf[0] && (ret = ff_mpeg_ref_picture(s->avctx, &s->last_picture, @@ -485,7 +462,7 @@ FF_ENABLE_DEPRECATION_WARNINGS } if (s->avctx->debug & FF_DEBUG_NOMC) - gray_frame(s->current_picture_ptr->f); + color_frame(s->current_picture_ptr->f, 0x80); return 0; } diff --git a/src/third_party/ffmpeg/libavcodec/mpegvideo_enc.c b/src/third_party/ffmpeg/libavcodec/mpegvideo_enc.c index 9bdf5dbe..5bf4b06a 100644 --- a/src/third_party/ffmpeg/libavcodec/mpegvideo_enc.c +++ b/src/third_party/ffmpeg/libavcodec/mpegvideo_enc.c @@ -35,6 +35,7 @@ #include +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "libavutil/intmath.h" #include "libavutil/mathematics.h" @@ -43,7 +44,6 @@ #include "libavutil/opt.h" #include "libavutil/thread.h" #include "avcodec.h" -#include "dct.h" #include "encode.h" #include "idctdsp.h" #include "mpeg12codecs.h" @@ -973,7 +973,7 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx) } } - cpb_props = ff_add_cpb_side_data(avctx); + cpb_props = ff_encode_add_cpb_side_data(avctx); if (!cpb_props) return AVERROR(ENOMEM); cpb_props->max_bitrate = avctx->rc_max_rate; diff --git a/src/third_party/ffmpeg/libavcodec/mpegvideo_parser.c b/src/third_party/ffmpeg/libavcodec/mpegvideo_parser.c index 1204789c..2cd03483 100644 --- a/src/third_party/ffmpeg/libavcodec/mpegvideo_parser.c +++ b/src/third_party/ffmpeg/libavcodec/mpegvideo_parser.c @@ -105,22 +105,23 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s, { struct MpvParseContext *pc = s->priv_data; const uint8_t *buf_end = buf + buf_size; - uint32_t start_code; - int frame_rate_index, ext_type, bytes_left; - int frame_rate_ext_n, frame_rate_ext_d; - int top_field_first, repeat_first_field, progressive_frame; - int horiz_size_ext, vert_size_ext, bit_rate_ext; + int bytes_left; int did_set_size=0; 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; + // number of picture coding extensions (i.e. MPEG2 pictures) + // in this packet - should be 1 or 2 + int nb_pic_ext = 0; + // when there are two pictures in the packet this indicates + // which field is in the first of them + int first_field = AV_FIELD_UNKNOWN; + +//FIXME replace the crap with get_bits() while (buf < buf_end) { - start_code= -1; + uint32_t start_code = -1; buf= avpriv_find_start_code(buf, buf_end, &start_code); bytes_left = buf_end - buf; switch(start_code) { @@ -129,11 +130,12 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s, s->pict_type = (buf[1] >> 3) & 7; if (bytes_left >= 4) vbv_delay = ((buf[1] & 0x07) << 13) | (buf[2] << 5) | (buf[3] >> 3); - s->repeat_pict = 1; } break; case SEQ_START_CODE: if (bytes_left >= 7) { + int frame_rate_index; + pc->width = (buf[0] << 4) | (buf[1] >> 4); pc->height = ((buf[1] & 0x0f) << 8) | buf[2]; if(!avctx->width || !avctx->height || !avctx->coded_width || !avctx->coded_height){ @@ -154,20 +156,18 @@ FF_ENABLE_DEPRECATION_WARNINGS break; case EXT_START_CODE: if (bytes_left >= 1) { - ext_type = (buf[0] >> 4); - switch(ext_type) { + switch (buf[0] >> 4) { // ext_type case 0x1: /* sequence extension */ if (bytes_left >= 6) { - horiz_size_ext = ((buf[1] & 1) << 1) | (buf[2] >> 7); - vert_size_ext = (buf[2] >> 5) & 3; - bit_rate_ext = ((buf[2] & 0x1F)<<7) | (buf[3]>>1); - frame_rate_ext_n = (buf[5] >> 5) & 3; - frame_rate_ext_d = (buf[5] & 0x1f); + int horiz_size_ext = ((buf[1] & 1) << 1) | (buf[2] >> 7); + int vert_size_ext = (buf[2] >> 5) & 3; + int bit_rate_ext = ((buf[2] & 0x1F)<<7) | (buf[3]>>1); + int frame_rate_ext_n = (buf[5] >> 5) & 3; + int frame_rate_ext_d = (buf[5] & 0x1f); pc->progressive_sequence = buf[1] & (1 << 3); avctx->has_b_frames= !(buf[5] >> 7); - chroma_format = (buf[1] >> 1) & 3; - switch (chroma_format) { + switch ((buf[1] >> 1) & 3) { // 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; @@ -190,11 +190,12 @@ FF_ENABLE_DEPRECATION_WARNINGS break; case 0x8: /* picture coding extension */ if (bytes_left >= 5) { - top_field_first = buf[3] & (1 << 7); - repeat_first_field = buf[3] & (1 << 1); - progressive_frame = buf[4] & (1 << 7); + int top_field_first = buf[3] & (1 << 7); + int repeat_first_field = buf[3] & (1 << 1); + int progressive_frame = buf[4] & (1 << 7); /* check if we must repeat the frame */ + s->repeat_pict = 1; if (repeat_first_field) { if (pc->progressive_sequence) { if (top_field_first) @@ -213,6 +214,19 @@ FF_ENABLE_DEPRECATION_WARNINGS s->field_order = AV_FIELD_BB; } else s->field_order = AV_FIELD_PROGRESSIVE; + + s->picture_structure = buf[2] & 3; + + if (!nb_pic_ext) { + // remember parity of the first field for the case + // when there are 2 fields in packet + switch (s->picture_structure) { + case AV_PICTURE_STRUCTURE_BOTTOM_FIELD: first_field = AV_FIELD_BB; break; + case AV_PICTURE_STRUCTURE_TOP_FIELD: first_field = AV_FIELD_TT; break; + } + } + + nb_pic_ext++; } break; } @@ -233,7 +247,7 @@ FF_ENABLE_DEPRECATION_WARNINGS if (set_dim_ret < 0) av_log(avctx, AV_LOG_ERROR, "Failed to set dimensions\n"); - if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO && bit_rate) { + if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO && bit_rate && bit_rate != 0x3FFFF) { avctx->rc_max_rate = 400LL*bit_rate; } if (bit_rate && @@ -248,6 +262,12 @@ FF_ENABLE_DEPRECATION_WARNINGS s->coded_width = FFALIGN(pc->width, 16); s->coded_height = FFALIGN(pc->height, 16); } + + if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO || nb_pic_ext > 1) { + s->repeat_pict = 1; + s->picture_structure = AV_PICTURE_STRUCTURE_FRAME; + s->field_order = nb_pic_ext > 1 ? first_field : AV_FIELD_PROGRESSIVE; + } } static int mpegvideo_parse(AVCodecParserContext *s, diff --git a/src/third_party/ffmpeg/libavcodec/msmpeg4_vc1_data.c b/src/third_party/ffmpeg/libavcodec/msmpeg4_vc1_data.c index 059c6f32..e6436687 100644 --- a/src/third_party/ffmpeg/libavcodec/msmpeg4_vc1_data.c +++ b/src/third_party/ffmpeg/libavcodec/msmpeg4_vc1_data.c @@ -38,20 +38,20 @@ VLC ff_msmp4_dc_chroma_vlc[2]; static av_cold void msmp4_vc1_vlcs_init(void) { - INIT_VLC_STATIC(&ff_msmp4_dc_luma_vlc[0], MSMP4_DC_VLC_BITS, 120, + VLC_INIT_STATIC(&ff_msmp4_dc_luma_vlc[0], MSMP4_DC_VLC_BITS, 120, &ff_table0_dc_lum[0][1], 8, 4, &ff_table0_dc_lum[0][0], 8, 4, 1158); - INIT_VLC_STATIC(&ff_msmp4_dc_chroma_vlc[0], MSMP4_DC_VLC_BITS, 120, + VLC_INIT_STATIC(&ff_msmp4_dc_chroma_vlc[0], MSMP4_DC_VLC_BITS, 120, &ff_table0_dc_chroma[0][1], 8, 4, &ff_table0_dc_chroma[0][0], 8, 4, 1118); - INIT_VLC_STATIC(&ff_msmp4_dc_luma_vlc[1], MSMP4_DC_VLC_BITS, 120, + VLC_INIT_STATIC(&ff_msmp4_dc_luma_vlc[1], MSMP4_DC_VLC_BITS, 120, &ff_table1_dc_lum[0][1], 8, 4, &ff_table1_dc_lum[0][0], 8, 4, 1476); - INIT_VLC_STATIC(&ff_msmp4_dc_chroma_vlc[1], MSMP4_DC_VLC_BITS, 120, + VLC_INIT_STATIC(&ff_msmp4_dc_chroma_vlc[1], MSMP4_DC_VLC_BITS, 120, &ff_table1_dc_chroma[0][1], 8, 4, &ff_table1_dc_chroma[0][0], 8, 4, 1216); - INIT_VLC_STATIC(&ff_msmp4_mb_i_vlc, MSMP4_MB_INTRA_VLC_BITS, 64, + VLC_INIT_STATIC(&ff_msmp4_mb_i_vlc, MSMP4_MB_INTRA_VLC_BITS, 64, &ff_msmp4_mb_i_table[0][1], 4, 2, &ff_msmp4_mb_i_table[0][0], 4, 2, 536); } diff --git a/src/third_party/ffmpeg/libavcodec/msmpeg4dec.c b/src/third_party/ffmpeg/libavcodec/msmpeg4dec.c index 26a196a3..a81241b1 100644 --- a/src/third_party/ffmpeg/libavcodec/msmpeg4dec.c +++ b/src/third_party/ffmpeg/libavcodec/msmpeg4dec.c @@ -301,33 +301,33 @@ static av_cold void msmpeg4_decode_init_static(void) INIT_FIRST_VLC_RL(ff_rl_table[0], 642); INIT_FIRST_VLC_RL(ff_rl_table[1], 1104); INIT_FIRST_VLC_RL(ff_rl_table[2], 554); - INIT_VLC_RL(ff_rl_table[3], 940); - INIT_VLC_RL(ff_rl_table[4], 962); + VLC_INIT_RL(ff_rl_table[3], 940); + VLC_INIT_RL(ff_rl_table[4], 962); /* ff_rl_table[5] coincides with ff_h263_rl_inter which has just been * initialized in ff_h263_decode_init() earlier. So just copy the VLCs. */ av_assert1(ff_h263_rl_inter.rl_vlc[0]); memcpy(ff_rl_table[5].rl_vlc, ff_h263_rl_inter.rl_vlc, sizeof(ff_rl_table[5].rl_vlc)); mv = &ff_mv_tables[0]; - INIT_VLC_STATIC(&mv->vlc, MV_VLC_BITS, MSMPEG4_MV_TABLES_NB_ELEMS + 1, + VLC_INIT_STATIC(&mv->vlc, MV_VLC_BITS, MSMPEG4_MV_TABLES_NB_ELEMS + 1, mv->table_mv_bits, 1, 1, mv->table_mv_code, 2, 2, 3714); mv = &ff_mv_tables[1]; - INIT_VLC_STATIC(&mv->vlc, MV_VLC_BITS, MSMPEG4_MV_TABLES_NB_ELEMS + 1, + VLC_INIT_STATIC(&mv->vlc, MV_VLC_BITS, MSMPEG4_MV_TABLES_NB_ELEMS + 1, mv->table_mv_bits, 1, 1, mv->table_mv_code, 2, 2, 2694); - INIT_VLC_STATIC(&v2_dc_lum_vlc, MSMP4_DC_VLC_BITS, 512, + VLC_INIT_STATIC(&v2_dc_lum_vlc, MSMP4_DC_VLC_BITS, 512, &ff_v2_dc_lum_table[0][1], 8, 4, &ff_v2_dc_lum_table[0][0], 8, 4, 1472); - INIT_VLC_STATIC(&v2_dc_chroma_vlc, MSMP4_DC_VLC_BITS, 512, + VLC_INIT_STATIC(&v2_dc_chroma_vlc, MSMP4_DC_VLC_BITS, 512, &ff_v2_dc_chroma_table[0][1], 8, 4, &ff_v2_dc_chroma_table[0][0], 8, 4, 1506); - INIT_VLC_STATIC(&v2_intra_cbpc_vlc, V2_INTRA_CBPC_VLC_BITS, 4, + VLC_INIT_STATIC(&v2_intra_cbpc_vlc, V2_INTRA_CBPC_VLC_BITS, 4, &ff_v2_intra_cbpc[0][1], 2, 1, &ff_v2_intra_cbpc[0][0], 2, 1, 8); - INIT_VLC_STATIC(&v2_mb_type_vlc, V2_MB_TYPE_VLC_BITS, 8, + VLC_INIT_STATIC(&v2_mb_type_vlc, V2_MB_TYPE_VLC_BITS, 8, &ff_v2_mb_type[0][1], 2, 1, &ff_v2_mb_type[0][0], 2, 1, 128); @@ -335,14 +335,14 @@ static av_cold void msmpeg4_decode_init_static(void) static VLCElem vlc_buf[1636 + 2648 + 1532 + 2488]; ff_mb_non_intra_vlc[i].table = &vlc_buf[offset]; ff_mb_non_intra_vlc[i].table_allocated = FF_ARRAY_ELEMS(vlc_buf) - offset; - init_vlc(&ff_mb_non_intra_vlc[i], MB_NON_INTRA_VLC_BITS, 128, + vlc_init(&ff_mb_non_intra_vlc[i], MB_NON_INTRA_VLC_BITS, 128, &ff_wmv2_inter_table[i][0][1], 8, 4, &ff_wmv2_inter_table[i][0][0], 8, 4, - INIT_VLC_STATIC_OVERLONG); + VLC_INIT_STATIC_OVERLONG); offset += ff_mb_non_intra_vlc[i].table_size; } - INIT_VLC_STATIC(&ff_inter_intra_vlc, INTER_INTRA_VLC_BITS, 4, + VLC_INIT_STATIC(&ff_inter_intra_vlc, INTER_INTRA_VLC_BITS, 4, &ff_table_inter_intra[0][1], 2, 1, &ff_table_inter_intra[0][0], 2, 1, 8); ff_msmp4_vc1_vlcs_init_once(); diff --git a/src/third_party/ffmpeg/libavcodec/msmpeg4enc.c b/src/third_party/ffmpeg/libavcodec/msmpeg4enc.c index 9828901b..a8ddb8d8 100644 --- a/src/third_party/ffmpeg/libavcodec/msmpeg4enc.c +++ b/src/third_party/ffmpeg/libavcodec/msmpeg4enc.c @@ -284,7 +284,7 @@ void ff_msmpeg4_encode_ext_header(MpegEncContext * s) if (s->avctx->framerate.num > 0 && s->avctx->framerate.den > 0) fps = s->avctx->framerate.num / s->avctx->framerate.den; - else + else { FF_DISABLE_DEPRECATION_WARNINGS fps = s->avctx->time_base.den / s->avctx->time_base.num #if FF_API_TICKS_PER_FRAME @@ -292,6 +292,7 @@ FF_DISABLE_DEPRECATION_WARNINGS #endif ; FF_ENABLE_DEPRECATION_WARNINGS + } put_bits(&s->pb, 5, FFMIN(fps, 31)); //yes 29.97 -> 29 diff --git a/src/third_party/ffmpeg/libavcodec/mss2.c b/src/third_party/ffmpeg/libavcodec/mss2.c index 98103f7f..2237cc8b 100644 --- a/src/third_party/ffmpeg/libavcodec/mss2.c +++ b/src/third_party/ffmpeg/libavcodec/mss2.c @@ -324,7 +324,7 @@ static int decode_rle(GetBitContext *gb, uint8_t *pal_dst, ptrdiff_t pal_stride, if (next_code != 1 << current_length) return AVERROR_INVALIDDATA; - if ((i = init_vlc(&vlc, 9, alphabet_size, bits, 1, 1, codes, 4, 4, 0)) < 0) + if ((i = vlc_init(&vlc, 9, alphabet_size, bits, 1, 1, codes, 4, 4, 0)) < 0) return i; /* frame decode */ @@ -371,7 +371,7 @@ static int decode_rle(GetBitContext *gb, uint8_t *pal_dst, ptrdiff_t pal_stride, prev_avail = 1; } while (--h); - ff_free_vlc(&vlc); + ff_vlc_free(&vlc); return 0; } @@ -422,7 +422,7 @@ static int decode_wmv9(AVCodecContext *avctx, const uint8_t *buf, int buf_size, ff_vc1_decode_blocks(v); if (v->end_mb_x == s->mb_width && s->end_mb_y == s->mb_height) { - ff_er_frame_end(&s->er); + ff_er_frame_end(&s->er, NULL); } else { av_log(v->s.avctx, AV_LOG_WARNING, "disabling error correction due to block count mismatch %dx%d != %dx%d\n", @@ -797,8 +797,7 @@ static int mss2_decode_frame(AVCodecContext *avctx, AVFrame *frame, av_log(avctx, AV_LOG_WARNING, "buffer not fully consumed\n"); if (c->mvX < 0 || c->mvY < 0) { - av_frame_unref(ctx->last_pic); - ret = av_frame_ref(ctx->last_pic, frame); + ret = av_frame_replace(ctx->last_pic, frame); if (ret < 0) return ret; } diff --git a/src/third_party/ffmpeg/libavcodec/mss4.c b/src/third_party/ffmpeg/libavcodec/mss4.c index 75f31bed..0e7cc3e1 100644 --- a/src/third_party/ffmpeg/libavcodec/mss4.c +++ b/src/third_party/ffmpeg/libavcodec/mss4.c @@ -115,9 +115,9 @@ static av_cold void mss4_init_vlc(VLC *vlc, unsigned *offset, vlc->table = &vlc_buf[*offset]; vlc->table_allocated = FF_ARRAY_ELEMS(vlc_buf) - *offset; - ff_init_vlc_from_lengths(vlc, FFMIN(bits[idx - 1], 9), idx, + ff_vlc_init_from_lengths(vlc, FFMIN(bits[idx - 1], 9), idx, bits, 1, syms, 1, 1, - 0, INIT_VLC_STATIC_OVERLONG, NULL); + 0, VLC_INIT_STATIC_OVERLONG, NULL); *offset += vlc->table_size; } diff --git a/src/third_party/ffmpeg/libavcodec/mv30.c b/src/third_party/ffmpeg/libavcodec/mv30.c index c2d05470..9c72c008 100644 --- a/src/third_party/ffmpeg/libavcodec/mv30.c +++ b/src/third_party/ffmpeg/libavcodec/mv30.c @@ -643,8 +643,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, return ret; } - av_frame_unref(s->prev_frame); - if ((ret = av_frame_ref(s->prev_frame, frame)) < 0) + if ((ret = av_frame_replace(s->prev_frame, frame)) < 0) return ret; *got_frame = 1; @@ -658,7 +657,7 @@ static const uint8_t cbp_bits[] = { static av_cold void init_static_data(void) { - INIT_VLC_STATIC_FROM_LENGTHS(&cbp_tab, CBP_VLC_BITS, FF_ARRAY_ELEMS(cbp_bits), + VLC_INIT_STATIC_FROM_LENGTHS(&cbp_tab, CBP_VLC_BITS, FF_ARRAY_ELEMS(cbp_bits), cbp_bits, 1, NULL, 0, 0, 0, 0, 1 << CBP_VLC_BITS); } diff --git a/src/third_party/ffmpeg/libavcodec/mvha.c b/src/third_party/ffmpeg/libavcodec/mvha.c index 8fb4a69e..356cebc6 100644 --- a/src/third_party/ffmpeg/libavcodec/mvha.c +++ b/src/third_party/ffmpeg/libavcodec/mvha.c @@ -83,7 +83,7 @@ static int build_vlc(AVCodecContext *avctx, VLC *vlc) uint8_t xlat[256]; int cur_node, i, j, pos = 0; - ff_free_vlc(vlc); + ff_vlc_free(vlc); for (i = 0; i < s->nb_symbols; i++) { nodes[i].count = s->prob[i]; @@ -140,7 +140,7 @@ static int build_vlc(AVCodecContext *avctx, VLC *vlc) get_tree_codes(bits, lens, xlat, nodes, cur_node - 1, 0, 0, &pos); - return ff_init_vlc_sparse(vlc, 12, pos, lens, 2, 2, bits, 4, 4, xlat, 1, 1, 0); + return ff_vlc_init_sparse(vlc, 12, pos, lens, 2, 2, bits, 4, 4, xlat, 1, 1, 0); } static int decode_frame(AVCodecContext *avctx, AVFrame *frame, @@ -294,7 +294,7 @@ static av_cold int decode_close(AVCodecContext *avctx) MVHAContext *s = avctx->priv_data; ff_inflate_end(&s->zstream); - ff_free_vlc(&s->vlc); + ff_vlc_free(&s->vlc); return 0; } diff --git a/src/third_party/ffmpeg/libavcodec/mwsc.c b/src/third_party/ffmpeg/libavcodec/mwsc.c index c7045ac7..f8c53c33 100644 --- a/src/third_party/ffmpeg/libavcodec/mwsc.c +++ b/src/third_party/ffmpeg/libavcodec/mwsc.c @@ -127,8 +127,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, frame->pict_type = (frame->flags & AV_FRAME_FLAG_KEY) ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P; - av_frame_unref(s->prev_frame); - if ((ret = av_frame_ref(s->prev_frame, frame)) < 0) + if ((ret = av_frame_replace(s->prev_frame, frame)) < 0) return ret; *got_frame = 1; diff --git a/src/third_party/ffmpeg/libavcodec/notchlc.c b/src/third_party/ffmpeg/libavcodec/notchlc.c index d973c83a..0feb0918 100644 --- a/src/third_party/ffmpeg/libavcodec/notchlc.c +++ b/src/third_party/ffmpeg/libavcodec/notchlc.c @@ -76,12 +76,13 @@ static int lz4_decompress(AVCodecContext *avctx, GetByteContext *gb, PutByteContext *pb) { - unsigned reference_pos, match_length, delta, pos = 0; + unsigned reference_pos, delta, pos = 0; uint8_t history[64 * 1024]; + int match_length; while (bytestream2_get_bytes_left(gb) > 0) { uint8_t token = bytestream2_get_byte(gb); - unsigned num_literals = token >> 4; + int num_literals = token >> 4; if (num_literals == 15) { unsigned char current; diff --git a/src/third_party/ffmpeg/libavcodec/nuv.c b/src/third_party/ffmpeg/libavcodec/nuv.c index 82048e93..1dda770c 100644 --- a/src/third_party/ffmpeg/libavcodec/nuv.c +++ b/src/third_party/ffmpeg/libavcodec/nuv.c @@ -56,8 +56,8 @@ static void copy_frame(AVFrame *f, const uint8_t *src, int width, int height) int src_linesize[4]; av_image_fill_arrays(src_data, src_linesize, src, f->format, width, height, 1); - av_image_copy(f->data, f->linesize, (const uint8_t **)src_data, src_linesize, - f->format, width, height); + av_image_copy2(f->data, f->linesize, src_data, src_linesize, + f->format, width, height); } /** diff --git a/src/third_party/ffmpeg/libavcodec/nvdec_av1.c b/src/third_party/ffmpeg/libavcodec/nvdec_av1.c index 3bbcd761..74b04421 100644 --- a/src/third_party/ffmpeg/libavcodec/nvdec_av1.c +++ b/src/third_party/ffmpeg/libavcodec/nvdec_av1.c @@ -23,6 +23,7 @@ #include "avcodec.h" #include "nvdec.h" #include "decode.h" +#include "hwaccel_internal.h" #include "internal.h" #include "av1dec.h" @@ -337,11 +338,11 @@ static int nvdec_av1_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ return ff_nvdec_frame_params(avctx, hw_frames_ctx, 8 * 2, 0); } -const AVHWAccel ff_av1_nvdec_hwaccel = { - .name = "av1_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AV1, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_av1_nvdec_hwaccel = { + .p.name = "av1_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_av1_start_frame, .end_frame = ff_nvdec_simple_end_frame, .decode_slice = nvdec_av1_decode_slice, diff --git a/src/third_party/ffmpeg/libavcodec/nvdec_h264.c b/src/third_party/ffmpeg/libavcodec/nvdec_h264.c index 116bd4fb..f022619b 100644 --- a/src/third_party/ffmpeg/libavcodec/nvdec_h264.c +++ b/src/third_party/ffmpeg/libavcodec/nvdec_h264.c @@ -28,6 +28,7 @@ #include "decode.h" #include "internal.h" #include "h264dec.h" +#include "hwaccel_internal.h" static void dpb_add(const H264Context *h, CUVIDH264DPBENTRY *dst, const H264Picture *src, int frame_idx) @@ -169,11 +170,11 @@ static int nvdec_h264_frame_params(AVCodecContext *avctx, return ff_nvdec_frame_params(avctx, hw_frames_ctx, sps->ref_frame_count + sps->num_reorder_frames, 0); } -const AVHWAccel ff_h264_nvdec_hwaccel = { - .name = "h264_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_h264_nvdec_hwaccel = { + .p.name = "h264_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_h264_start_frame, .end_frame = ff_nvdec_end_frame, .decode_slice = nvdec_h264_decode_slice, diff --git a/src/third_party/ffmpeg/libavcodec/nvdec_hevc.c b/src/third_party/ffmpeg/libavcodec/nvdec_hevc.c index cd549d2e..91fb9f53 100644 --- a/src/third_party/ffmpeg/libavcodec/nvdec_hevc.c +++ b/src/third_party/ffmpeg/libavcodec/nvdec_hevc.c @@ -29,6 +29,7 @@ #include "internal.h" #include "hevcdec.h" #include "hevc_data.h" +#include "hwaccel_internal.h" static void dpb_add(CUVIDHEVCPICPARAMS *pp, int idx, const HEVCFrame *src) { @@ -308,11 +309,11 @@ static int nvdec_hevc_decode_init(AVCodecContext *avctx) { return ff_nvdec_decode_init(avctx); } -const AVHWAccel ff_hevc_nvdec_hwaccel = { - .name = "hevc_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_hevc_nvdec_hwaccel = { + .p.name = "hevc_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_hevc_start_frame, .end_frame = ff_nvdec_end_frame, .decode_slice = nvdec_hevc_decode_slice, diff --git a/src/third_party/ffmpeg/libavcodec/nvdec_mjpeg.c b/src/third_party/ffmpeg/libavcodec/nvdec_mjpeg.c index fce464c1..850634bf 100644 --- a/src/third_party/ffmpeg/libavcodec/nvdec_mjpeg.c +++ b/src/third_party/ffmpeg/libavcodec/nvdec_mjpeg.c @@ -25,6 +25,7 @@ #include "mjpegdec.h" #include "nvdec.h" #include "decode.h" +#include "hwaccel_internal.h" static int nvdec_mjpeg_start_frame(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size) { @@ -69,11 +70,11 @@ static int nvdec_mjpeg_frame_params(AVCodecContext *avctx, return ff_nvdec_frame_params(avctx, hw_frames_ctx, 1, 0); } -AVHWAccel ff_mjpeg_nvdec_hwaccel = { - .name = "mjpeg_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MJPEG, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_mjpeg_nvdec_hwaccel = { + .p.name = "mjpeg_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MJPEG, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_mjpeg_start_frame, .end_frame = ff_nvdec_simple_end_frame, .decode_slice = nvdec_mjpeg_decode_slice, diff --git a/src/third_party/ffmpeg/libavcodec/nvdec_mpeg12.c b/src/third_party/ffmpeg/libavcodec/nvdec_mpeg12.c index 3b9ff607..a4603c7e 100644 --- a/src/third_party/ffmpeg/libavcodec/nvdec_mpeg12.c +++ b/src/third_party/ffmpeg/libavcodec/nvdec_mpeg12.c @@ -23,6 +23,7 @@ #include "config_components.h" #include "avcodec.h" +#include "hwaccel_internal.h" #include "internal.h" #include "mpegvideo.h" #include "nvdec.h" @@ -99,11 +100,11 @@ static int nvdec_mpeg12_frame_params(AVCodecContext *avctx, } #if CONFIG_MPEG2_NVDEC_HWACCEL -const AVHWAccel ff_mpeg2_nvdec_hwaccel = { - .name = "mpeg2_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG2VIDEO, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_mpeg2_nvdec_hwaccel = { + .p.name = "mpeg2_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG2VIDEO, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_mpeg12_start_frame, .end_frame = ff_nvdec_simple_end_frame, .decode_slice = ff_nvdec_simple_decode_slice, @@ -115,11 +116,11 @@ const AVHWAccel ff_mpeg2_nvdec_hwaccel = { #endif #if CONFIG_MPEG1_NVDEC_HWACCEL -const AVHWAccel ff_mpeg1_nvdec_hwaccel = { - .name = "mpeg1_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG1VIDEO, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_mpeg1_nvdec_hwaccel = { + .p.name = "mpeg1_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG1VIDEO, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_mpeg12_start_frame, .end_frame = ff_nvdec_simple_end_frame, .decode_slice = ff_nvdec_simple_decode_slice, diff --git a/src/third_party/ffmpeg/libavcodec/nvdec_mpeg4.c b/src/third_party/ffmpeg/libavcodec/nvdec_mpeg4.c index c193f6b6..20a04994 100644 --- a/src/third_party/ffmpeg/libavcodec/nvdec_mpeg4.c +++ b/src/third_party/ffmpeg/libavcodec/nvdec_mpeg4.c @@ -26,6 +26,7 @@ #include "mpeg4videodefs.h" #include "nvdec.h" #include "decode.h" +#include "hwaccel_internal.h" static int nvdec_mpeg4_start_frame(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size) { @@ -109,11 +110,11 @@ static int nvdec_mpeg4_frame_params(AVCodecContext *avctx, return ff_nvdec_frame_params(avctx, hw_frames_ctx, 2, 0); } -const AVHWAccel ff_mpeg4_nvdec_hwaccel = { - .name = "mpeg4_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG4, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_mpeg4_nvdec_hwaccel = { + .p.name = "mpeg4_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG4, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_mpeg4_start_frame, .end_frame = ff_nvdec_simple_end_frame, .decode_slice = nvdec_mpeg4_decode_slice, diff --git a/src/third_party/ffmpeg/libavcodec/nvdec_vc1.c b/src/third_party/ffmpeg/libavcodec/nvdec_vc1.c index fae1cb0a..5096d784 100644 --- a/src/third_party/ffmpeg/libavcodec/nvdec_vc1.c +++ b/src/third_party/ffmpeg/libavcodec/nvdec_vc1.c @@ -23,6 +23,7 @@ #include "config_components.h" #include "avcodec.h" +#include "hwaccel_internal.h" #include "internal.h" #include "nvdec.h" #include "decode.h" @@ -113,11 +114,11 @@ static int nvdec_vc1_frame_params(AVCodecContext *avctx, return ff_nvdec_frame_params(avctx, hw_frames_ctx, 2, 0); } -const AVHWAccel ff_vc1_nvdec_hwaccel = { - .name = "vc1_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VC1, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_vc1_nvdec_hwaccel = { + .p.name = "vc1_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VC1, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_vc1_start_frame, .end_frame = ff_nvdec_simple_end_frame, .decode_slice = ff_nvdec_simple_decode_slice, @@ -128,11 +129,11 @@ const AVHWAccel ff_vc1_nvdec_hwaccel = { }; #if CONFIG_WMV3_NVDEC_HWACCEL -const AVHWAccel ff_wmv3_nvdec_hwaccel = { - .name = "wmv3_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WMV3, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_wmv3_nvdec_hwaccel = { + .p.name = "wmv3_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WMV3, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_vc1_start_frame, .end_frame = ff_nvdec_simple_end_frame, .decode_slice = ff_nvdec_simple_decode_slice, diff --git a/src/third_party/ffmpeg/libavcodec/nvdec_vp8.c b/src/third_party/ffmpeg/libavcodec/nvdec_vp8.c index f174ca43..ff3b3f25 100644 --- a/src/third_party/ffmpeg/libavcodec/nvdec_vp8.c +++ b/src/third_party/ffmpeg/libavcodec/nvdec_vp8.c @@ -23,6 +23,7 @@ #include "avcodec.h" #include "nvdec.h" #include "decode.h" +#include "hwaccel_internal.h" #include "internal.h" #include "vp8.h" @@ -90,11 +91,11 @@ static int nvdec_vp8_frame_params(AVCodecContext *avctx, return ff_nvdec_frame_params(avctx, hw_frames_ctx, 3, 0); } -AVHWAccel ff_vp8_nvdec_hwaccel = { - .name = "vp8_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP8, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_vp8_nvdec_hwaccel = { + .p.name = "vp8_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP8, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_vp8_start_frame, .end_frame = ff_nvdec_simple_end_frame, .decode_slice = ff_nvdec_simple_decode_slice, diff --git a/src/third_party/ffmpeg/libavcodec/nvdec_vp9.c b/src/third_party/ffmpeg/libavcodec/nvdec_vp9.c index a76bcf99..e196391c 100644 --- a/src/third_party/ffmpeg/libavcodec/nvdec_vp9.c +++ b/src/third_party/ffmpeg/libavcodec/nvdec_vp9.c @@ -25,6 +25,7 @@ #include "avcodec.h" #include "nvdec.h" #include "decode.h" +#include "hwaccel_internal.h" #include "internal.h" #include "vp9shared.h" @@ -169,11 +170,11 @@ static int nvdec_vp9_frame_params(AVCodecContext *avctx, return ff_nvdec_frame_params(avctx, hw_frames_ctx, 8, 0); } -const AVHWAccel ff_vp9_nvdec_hwaccel = { - .name = "vp9_nvdec", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP9, - .pix_fmt = AV_PIX_FMT_CUDA, +const FFHWAccel ff_vp9_nvdec_hwaccel = { + .p.name = "vp9_nvdec", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP9, + .p.pix_fmt = AV_PIX_FMT_CUDA, .start_frame = nvdec_vp9_start_frame, .end_frame = ff_nvdec_simple_end_frame, .decode_slice = ff_nvdec_simple_decode_slice, diff --git a/src/third_party/ffmpeg/libavcodec/nvenc.c b/src/third_party/ffmpeg/libavcodec/nvenc.c index 0b641767..02486c20 100644 --- a/src/third_party/ffmpeg/libavcodec/nvenc.c +++ b/src/third_party/ffmpeg/libavcodec/nvenc.c @@ -36,6 +36,7 @@ #include "libavutil/pixdesc.h" #include "libavutil/mathematics.h" #include "atsc_a53.h" +#include "codec_desc.h" #include "encode.h" #include "internal.h" #include "packet_internal.h" @@ -1166,8 +1167,13 @@ static av_cold int nvenc_setup_h264_config(AVCodecContext *avctx) || vui->videoFormat != 5 || vui->videoFullRangeFlag != 0); - h264->sliceMode = 3; - h264->sliceModeData = avctx->slices > 0 ? avctx->slices : 1; + if (ctx->max_slice_size > 0) { + h264->sliceMode = 1; + h264->sliceModeData = ctx->max_slice_size; + } else { + h264->sliceMode = 3; + h264->sliceModeData = avctx->slices > 0 ? avctx->slices : 1; + } if (ctx->intra_refresh) { h264->enableIntraRefresh = 1; @@ -1214,19 +1220,19 @@ static av_cold int nvenc_setup_h264_config(AVCodecContext *avctx) switch(ctx->profile) { case NV_ENC_H264_PROFILE_BASELINE: cc->profileGUID = NV_ENC_H264_PROFILE_BASELINE_GUID; - avctx->profile = FF_PROFILE_H264_BASELINE; + avctx->profile = AV_PROFILE_H264_BASELINE; break; case NV_ENC_H264_PROFILE_MAIN: cc->profileGUID = NV_ENC_H264_PROFILE_MAIN_GUID; - avctx->profile = FF_PROFILE_H264_MAIN; + avctx->profile = AV_PROFILE_H264_MAIN; break; case NV_ENC_H264_PROFILE_HIGH: cc->profileGUID = NV_ENC_H264_PROFILE_HIGH_GUID; - avctx->profile = FF_PROFILE_H264_HIGH; + avctx->profile = AV_PROFILE_H264_HIGH; break; case NV_ENC_H264_PROFILE_HIGH_444P: cc->profileGUID = NV_ENC_H264_PROFILE_HIGH_444_GUID; - avctx->profile = FF_PROFILE_H264_HIGH_444_PREDICTIVE; + avctx->profile = AV_PROFILE_H264_HIGH_444_PREDICTIVE; break; } } @@ -1234,10 +1240,10 @@ static av_cold int nvenc_setup_h264_config(AVCodecContext *avctx) // force setting profile as high444p if input is AV_PIX_FMT_YUV444P if (IS_YUV444(ctx->data_pix_fmt)) { cc->profileGUID = NV_ENC_H264_PROFILE_HIGH_444_GUID; - avctx->profile = FF_PROFILE_H264_HIGH_444_PREDICTIVE; + avctx->profile = AV_PROFILE_H264_HIGH_444_PREDICTIVE; } - h264->chromaFormatIDC = avctx->profile == FF_PROFILE_H264_HIGH_444_PREDICTIVE ? 3 : 1; + h264->chromaFormatIDC = avctx->profile == AV_PROFILE_H264_HIGH_444_PREDICTIVE ? 3 : 1; h264->level = ctx->level; @@ -1287,8 +1293,13 @@ static av_cold int nvenc_setup_hevc_config(AVCodecContext *avctx) || vui->videoFormat != 5 || vui->videoFullRangeFlag != 0); - hevc->sliceMode = 3; - hevc->sliceModeData = avctx->slices > 0 ? avctx->slices : 1; + if (ctx->max_slice_size > 0) { + hevc->sliceMode = 1; + hevc->sliceModeData = ctx->max_slice_size; + } else { + hevc->sliceMode = 3; + hevc->sliceModeData = avctx->slices > 0 ? avctx->slices : 1; + } if (ctx->intra_refresh) { hevc->enableIntraRefresh = 1; @@ -1325,28 +1336,28 @@ static av_cold int nvenc_setup_hevc_config(AVCodecContext *avctx) switch (ctx->profile) { case NV_ENC_HEVC_PROFILE_MAIN: cc->profileGUID = NV_ENC_HEVC_PROFILE_MAIN_GUID; - avctx->profile = FF_PROFILE_HEVC_MAIN; + avctx->profile = AV_PROFILE_HEVC_MAIN; break; case NV_ENC_HEVC_PROFILE_MAIN_10: cc->profileGUID = NV_ENC_HEVC_PROFILE_MAIN10_GUID; - avctx->profile = FF_PROFILE_HEVC_MAIN_10; + avctx->profile = AV_PROFILE_HEVC_MAIN_10; break; case NV_ENC_HEVC_PROFILE_REXT: cc->profileGUID = NV_ENC_HEVC_PROFILE_FREXT_GUID; - avctx->profile = FF_PROFILE_HEVC_REXT; + avctx->profile = AV_PROFILE_HEVC_REXT; break; } // force setting profile as main10 if input is 10 bit if (IS_10BIT(ctx->data_pix_fmt)) { cc->profileGUID = NV_ENC_HEVC_PROFILE_MAIN10_GUID; - avctx->profile = FF_PROFILE_HEVC_MAIN_10; + avctx->profile = AV_PROFILE_HEVC_MAIN_10; } // force setting profile as rext if input is yuv444 if (IS_YUV444(ctx->data_pix_fmt)) { cc->profileGUID = NV_ENC_HEVC_PROFILE_FREXT_GUID; - avctx->profile = FF_PROFILE_HEVC_REXT; + avctx->profile = AV_PROFILE_HEVC_REXT; } hevc->chromaFormatIDC = IS_YUV444(ctx->data_pix_fmt) ? 3 : 1; @@ -1397,7 +1408,7 @@ static av_cold int nvenc_setup_av1_config(AVCodecContext *avctx) return AVERROR(ENOTSUP); } else { cc->profileGUID = NV_ENC_AV1_PROFILE_MAIN_GUID; - avctx->profile = FF_PROFILE_AV1_MAIN; + avctx->profile = AV_PROFILE_AV1_MAIN; } if (ctx->dpb_size >= 0) { @@ -1656,7 +1667,7 @@ FF_ENABLE_DEPRECATION_WARNINGS if (ctx->encode_config.rcParams.averageBitRate > 0) avctx->bit_rate = ctx->encode_config.rcParams.averageBitRate; - cpb_props = ff_add_cpb_side_data(avctx); + cpb_props = ff_encode_add_cpb_side_data(avctx); if (!cpb_props) return AVERROR(ENOMEM); cpb_props->max_bitrate = ctx->encode_config.rcParams.maxBitRate; @@ -1998,9 +2009,9 @@ static int nvenc_copy_frame(AVCodecContext *avctx, NvencSurface *nv_surface, if (frame->format == AV_PIX_FMT_YUV420P) FFSWAP(uint8_t*, dst_data[1], dst_data[2]); - av_image_copy(dst_data, dst_linesize, - (const uint8_t**)frame->data, frame->linesize, frame->format, - avctx->width, avctx->height); + av_image_copy2(dst_data, dst_linesize, + frame->data, frame->linesize, frame->format, + avctx->width, avctx->height); return 0; } @@ -2249,7 +2260,7 @@ static int nvenc_store_frame_data(AVCodecContext *avctx, NV_ENC_PIC_PARAMS *pic_ // in case the encoder got reconfigured, there might be leftovers av_buffer_unref(&frame_data->frame_opaque_ref); - if (frame && frame->opaque_ref && avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { + if (frame->opaque_ref && avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { frame_data->frame_opaque_ref = av_buffer_ref(frame->opaque_ref); if (!frame_data->frame_opaque_ref) return AVERROR(ENOMEM); diff --git a/src/third_party/ffmpeg/libavcodec/nvenc.h b/src/third_party/ffmpeg/libavcodec/nvenc.h index 3a4b456a..cf0e8e59 100644 --- a/src/third_party/ffmpeg/libavcodec/nvenc.h +++ b/src/third_party/ffmpeg/libavcodec/nvenc.h @@ -262,6 +262,7 @@ typedef struct NvencContext int udu_sei; int timing_info; int highbitdepth; + int max_slice_size; } NvencContext; int ff_nvenc_encode_init(AVCodecContext *avctx); diff --git a/src/third_party/ffmpeg/libavcodec/nvenc_h264.c b/src/third_party/ffmpeg/libavcodec/nvenc_h264.c index a9986099..4440e49b 100644 --- a/src/third_party/ffmpeg/libavcodec/nvenc_h264.c +++ b/src/third_party/ffmpeg/libavcodec/nvenc_h264.c @@ -206,6 +206,8 @@ static const AVOption options[] = { OFFSET(intra_refresh),AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, { "single-slice-intra-refresh", "Use single slice intra refresh", OFFSET(single_slice_intra_refresh), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, + { "max_slice_size", "Maximum encoded slice size in bytes", + OFFSET(max_slice_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE }, { "constrained-encoding", "Enable constrainedFrame encoding where each slice in the constrained picture is independent of other slices", OFFSET(constrained_encoding), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, { NULL } diff --git a/src/third_party/ffmpeg/libavcodec/nvenc_hevc.c b/src/third_party/ffmpeg/libavcodec/nvenc_hevc.c index a02f2778..e88f7e97 100644 --- a/src/third_party/ffmpeg/libavcodec/nvenc_hevc.c +++ b/src/third_party/ffmpeg/libavcodec/nvenc_hevc.c @@ -57,7 +57,7 @@ static const AVOption options[] = { { "ull", "Ultra low latency", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_TUNING_INFO_ULTRA_LOW_LATENCY }, 0, 0, VE, "tune" }, { "lossless", "Lossless", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_TUNING_INFO_LOSSLESS }, 0, 0, VE, "tune" }, #endif - { "profile", "Set the encoding profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = NV_ENC_HEVC_PROFILE_MAIN }, NV_ENC_HEVC_PROFILE_MAIN, FF_PROFILE_HEVC_REXT, VE, "profile" }, + { "profile", "Set the encoding profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = NV_ENC_HEVC_PROFILE_MAIN }, NV_ENC_HEVC_PROFILE_MAIN, AV_PROFILE_HEVC_REXT, VE, "profile" }, { "main", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_HEVC_PROFILE_MAIN }, 0, 0, VE, "profile" }, { "main10", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_HEVC_PROFILE_MAIN_10 }, 0, 0, VE, "profile" }, { "rext", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_HEVC_PROFILE_REXT }, 0, 0, VE, "profile" }, @@ -187,6 +187,8 @@ static const AVOption options[] = { OFFSET(intra_refresh),AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, { "single-slice-intra-refresh", "Use single slice intra refresh", OFFSET(single_slice_intra_refresh), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, + { "max_slice_size", "Maximum encoded slice size in bytes", + OFFSET(max_slice_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE }, { "constrained-encoding", "Enable constrainedFrame encoding where each slice in the constrained picture is independent of other slices", OFFSET(constrained_encoding), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, { NULL } diff --git a/src/third_party/ffmpeg/libavcodec/omx.c b/src/third_party/ffmpeg/libavcodec/omx.c index 6e667971..82fd4920 100644 --- a/src/third_party/ffmpeg/libavcodec/omx.c +++ b/src/third_party/ffmpeg/libavcodec/omx.c @@ -531,14 +531,14 @@ static av_cold int omx_component_init(AVCodecContext *avctx, const char *role) CHECK(err); avc.nBFrames = 0; avc.nPFrames = avctx->gop_size - 1; - switch (s->profile == FF_PROFILE_UNKNOWN ? avctx->profile : s->profile) { - case FF_PROFILE_H264_BASELINE: + switch (s->profile == AV_PROFILE_UNKNOWN ? avctx->profile : s->profile) { + case AV_PROFILE_H264_BASELINE: avc.eProfile = OMX_VIDEO_AVCProfileBaseline; break; - case FF_PROFILE_H264_MAIN: + case AV_PROFILE_H264_MAIN: avc.eProfile = OMX_VIDEO_AVCProfileMain; break; - case FF_PROFILE_H264_HIGH: + case AV_PROFILE_H264_HIGH: avc.eProfile = OMX_VIDEO_AVCProfileHigh; break; default: @@ -793,7 +793,8 @@ static int omx_encode_frame(AVCodecContext *avctx, AVPacket *pkt, need_copy = 1; } if (need_copy) - av_image_copy(dst, linesize, (const uint8_t**) frame->data, frame->linesize, avctx->pix_fmt, avctx->width, avctx->height); + av_image_copy2(dst, linesize, frame->data, frame->linesize, + avctx->pix_fmt, avctx->width, avctx->height); buffer->nFlags = OMX_BUFFERFLAG_ENDOFFRAME; buffer->nOffset = 0; // Convert the timestamps to microseconds; some encoders can ignore @@ -919,10 +920,10 @@ static const AVOption options[] = { { "omx_libname", "OpenMAX library name", OFFSET(libname), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VDE }, { "omx_libprefix", "OpenMAX library prefix", OFFSET(libprefix), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VDE }, { "zerocopy", "Try to avoid copying input frames if possible", OFFSET(input_zerocopy), AV_OPT_TYPE_INT, { .i64 = CONFIG_OMX_RPI }, 0, 1, VE }, - { "profile", "Set the encoding profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, FF_PROFILE_H264_HIGH, VE, "profile" }, - { "baseline", "", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_BASELINE }, 0, 0, VE, "profile" }, - { "main", "", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_MAIN }, 0, 0, VE, "profile" }, - { "high", "", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_HIGH }, 0, 0, VE, "profile" }, + { "profile", "Set the encoding profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, AV_PROFILE_H264_HIGH, VE, "profile" }, + { "baseline", "", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_BASELINE }, 0, 0, VE, "profile" }, + { "main", "", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_MAIN }, 0, 0, VE, "profile" }, + { "high", "", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_HIGH }, 0, 0, VE, "profile" }, { NULL } }; diff --git a/src/third_party/ffmpeg/libavcodec/on2avc.c b/src/third_party/ffmpeg/libavcodec/on2avc.c index 74be1dcb..8d0c8812 100644 --- a/src/third_party/ffmpeg/libavcodec/on2avc.c +++ b/src/third_party/ffmpeg/libavcodec/on2avc.c @@ -51,9 +51,9 @@ typedef struct On2AVCContext { AVCodecContext *avctx; AVFloatDSPContext *fdsp; AVTXContext *mdct, *mdct_half, *mdct_small; - AVTXContext *fft128, *fft256, *fft512, *fft1024; + AVTXContext *fft64, *fft128, *fft256, *fft512; av_tx_fn mdct_fn, mdct_half_fn, mdct_small_fn; - av_tx_fn fft128_fn, fft256_fn, fft512_fn, fft1024_fn; + av_tx_fn fft64_fn, fft128_fn, fft256_fn, fft512_fn; void (*wtf)(struct On2AVCContext *ctx, float *out, float *in, int size); int is_av500; @@ -475,16 +475,16 @@ static void wtf_end_512(On2AVCContext *c, float *out, float *src, zero_head_and_tail(tmp1 + 256, 128, 13, 7); zero_head_and_tail(tmp1 + 384, 128, 15, 5); - c->fft128_fn(c->fft128, src + 0, tmp1 + 0, sizeof(float)); - c->fft128_fn(c->fft128, src + 128, tmp1 + 128, sizeof(float)); - c->fft128_fn(c->fft128, src + 256, tmp1 + 256, sizeof(float)); - c->fft128_fn(c->fft128, src + 384, tmp1 + 384, sizeof(float)); + c->fft64_fn(c->fft64, src + 0, tmp1 + 0, sizeof(float)); + c->fft64_fn(c->fft64, src + 128, tmp1 + 128, sizeof(float)); + c->fft64_fn(c->fft64, src + 256, tmp1 + 256, sizeof(float)); + c->fft64_fn(c->fft64, src + 384, tmp1 + 384, sizeof(float)); combine_fft(src, src + 128, src + 256, src + 384, tmp1, ff_on2avc_ctab_1, ff_on2avc_ctab_2, ff_on2avc_ctab_3, ff_on2avc_ctab_4, 512, 2); - c->fft512_fn(c->fft512, src, tmp1, sizeof(float)); + c->fft256_fn(c->fft256, src, tmp1, sizeof(float)); pretwiddle(&tmp0[ 0], src, 512, 84, 4, 16, 4, ff_on2avc_tabs_20_84_1); pretwiddle(&tmp0[128], src, 512, 84, 4, 16, 4, ff_on2avc_tabs_20_84_2); @@ -503,16 +503,16 @@ static void wtf_end_1024(On2AVCContext *c, float *out, float *src, zero_head_and_tail(tmp1 + 512, 256, 13, 7); zero_head_and_tail(tmp1 + 768, 256, 15, 5); - c->fft256_fn(c->fft256, src + 0, tmp1 + 0, sizeof(float)); - c->fft256_fn(c->fft256, src + 256, tmp1 + 256, sizeof(float)); - c->fft256_fn(c->fft256, src + 512, tmp1 + 512, sizeof(float)); - c->fft256_fn(c->fft256, src + 768, tmp1 + 768, sizeof(float)); + c->fft128_fn(c->fft128, src + 0, tmp1 + 0, sizeof(float)); + c->fft128_fn(c->fft128, src + 256, tmp1 + 256, sizeof(float)); + c->fft128_fn(c->fft128, src + 512, tmp1 + 512, sizeof(float)); + c->fft128_fn(c->fft128, src + 768, tmp1 + 768, sizeof(float)); combine_fft(src, src + 256, src + 512, src + 768, tmp1, ff_on2avc_ctab_1, ff_on2avc_ctab_2, ff_on2avc_ctab_3, ff_on2avc_ctab_4, 1024, 1); - c->fft1024_fn(c->fft1024, src, tmp1, sizeof(float)); + c->fft512_fn(c->fft512, src, tmp1, sizeof(float)); pretwiddle(&tmp0[ 0], src, 1024, 84, 4, 16, 4, ff_on2avc_tabs_20_84_1); pretwiddle(&tmp0[256], src, 1024, 84, 4, 16, 4, ff_on2avc_tabs_20_84_2); @@ -700,7 +700,7 @@ static int on2avc_reconstruct_channel_ext(On2AVCContext *c, AVFrame *dst, int of break; case WINDOW_TYPE_EXT5: c->wtf(c, buf, in, 512); - c->mdct_half_fn(c->mdct, buf + 512, in + 512, sizeof(float)); + c->mdct_half_fn(c->mdct_half, buf + 512, in + 512, sizeof(float)); for (i = 0; i < 256; i++) { FFSWAP(float, buf[i + 512], buf[1023 - i]); } @@ -892,9 +892,9 @@ static av_cold void on2avc_free_vlcs(On2AVCContext *c) { int i; - ff_free_vlc(&c->scale_diff); + ff_vlc_free(&c->scale_diff); for (i = 1; i < 16; i++) - ff_free_vlc(&c->cb_vlc[i]); + ff_vlc_free(&c->cb_vlc[i]); } static av_cold int on2avc_decode_init(AVCodecContext *avctx) @@ -956,27 +956,27 @@ static av_cold int on2avc_decode_init(AVCodecContext *avctx) if ((ret = av_tx_init(&c->mdct_small, &c->mdct_small_fn, AV_TX_FLOAT_MDCT, 1, 128, &scale, 0)) < 0) return ret; - if ((ret = av_tx_init(&c->fft1024, &c->fft1024_fn, AV_TX_FLOAT_FFT, 1, 1024, NULL, 0)) < 0) - return ret; if ((ret = av_tx_init(&c->fft512, &c->fft512_fn, AV_TX_FLOAT_FFT, 1, 512, NULL, 0)) < 0) return ret; - if ((ret = av_tx_init(&c->fft256, &c->fft256_fn, AV_TX_FLOAT_FFT, 0, 256, NULL, 0)) < 0) + if ((ret = av_tx_init(&c->fft256, &c->fft256_fn, AV_TX_FLOAT_FFT, 1, 256, NULL, 0)) < 0) return ret; if ((ret = av_tx_init(&c->fft128, &c->fft128_fn, AV_TX_FLOAT_FFT, 0, 128, NULL, 0)) < 0) return ret; + if ((ret = av_tx_init(&c->fft64, &c->fft64_fn, AV_TX_FLOAT_FFT, 0, 64, NULL, 0)) < 0) + return ret; c->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT); if (!c->fdsp) return AVERROR(ENOMEM); - ret = ff_init_vlc_from_lengths(&c->scale_diff, 9, ON2AVC_SCALE_DIFFS, + ret = ff_vlc_init_from_lengths(&c->scale_diff, 9, ON2AVC_SCALE_DIFFS, ff_on2avc_scale_diff_bits, 1, ff_on2avc_scale_diff_syms, 1, 1, -60, 0, avctx); if (ret < 0) goto vlc_fail; for (i = 1; i < 16; i++) { int idx = i - 1; - ret = ff_init_vlc_from_lengths(&c->cb_vlc[i], 9, ff_on2avc_cb_elems[idx], + ret = ff_vlc_init_from_lengths(&c->cb_vlc[i], 9, ff_on2avc_cb_elems[idx], lens, 1, syms, 2, 2, 0, 0, avctx); if (ret < 0) @@ -998,10 +998,10 @@ static av_cold int on2avc_decode_close(AVCodecContext *avctx) av_tx_uninit(&c->mdct); av_tx_uninit(&c->mdct_half); av_tx_uninit(&c->mdct_small); + av_tx_uninit(&c->fft64); av_tx_uninit(&c->fft128); av_tx_uninit(&c->fft256); av_tx_uninit(&c->fft512); - av_tx_uninit(&c->fft1024); av_freep(&c->fdsp); diff --git a/src/third_party/ffmpeg/libavcodec/options_table.h b/src/third_party/ffmpeg/libavcodec/options_table.h index bb4b894b..f2155232 100644 --- a/src/third_party/ffmpeg/libavcodec/options_table.h +++ b/src/third_party/ffmpeg/libavcodec/options_table.h @@ -223,9 +223,9 @@ static const AVOption avcodec_options[] = { {"nssew", "nsse weight", OFFSET(nsse_weight), AV_OPT_TYPE_INT, {.i64 = 8 }, INT_MIN, INT_MAX, V|E}, {"skip_top", "number of macroblock rows at the top which are skipped", OFFSET(skip_top), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|D}, {"skip_bottom", "number of macroblock rows at the bottom which are skipped", OFFSET(skip_bottom), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|D}, -{"profile", NULL, OFFSET(profile), AV_OPT_TYPE_INT, {.i64 = FF_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, V|A|E|CC, "avctx.profile"}, -{"unknown", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, "avctx.profile"}, -{"main10", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_HEVC_MAIN_10 }, INT_MIN, INT_MAX, V|E, "avctx.profile"}, +{"profile", NULL, OFFSET(profile), AV_OPT_TYPE_INT, {.i64 = AV_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, V|A|E|CC, "avctx.profile"}, +{"unknown", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AV_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, "avctx.profile"}, +{"main10", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AV_PROFILE_HEVC_MAIN_10 }, INT_MIN, INT_MAX, V|E, "avctx.profile"}, {"level", NULL, OFFSET(level), AV_OPT_TYPE_INT, {.i64 = FF_LEVEL_UNKNOWN }, INT_MIN, INT_MAX, V|A|E|CC, "avctx.level"}, {"unknown", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_LEVEL_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, "avctx.level"}, {"lowres", "decode at 1= 1/2, 2=1/4, 3=1/8 resolutions", OFFSET(lowres), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, V|A|D}, @@ -350,6 +350,8 @@ static const AVOption avcodec_options[] = { {"unspecified", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, "color_range_type"}, {"mpeg", "MPEG (219*2^(n-8))", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_MPEG }, INT_MIN, INT_MAX, V|E|D, "color_range_type"}, {"jpeg", "JPEG (2^n-1)", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_JPEG }, INT_MIN, INT_MAX, V|E|D, "color_range_type"}, +{"limited", "MPEG (219*2^(n-8))", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_MPEG }, INT_MIN, INT_MAX, V|E|D, "color_range_type"}, +{"full", "JPEG (2^n-1)", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_JPEG }, INT_MIN, INT_MAX, V|E|D, "color_range_type"}, {"chroma_sample_location", "chroma sample location", OFFSET(chroma_sample_location), AV_OPT_TYPE_INT, {.i64 = AVCHROMA_LOC_UNSPECIFIED }, 0, INT_MAX, V|E|D, "chroma_sample_location_type"}, {"unknown", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = AVCHROMA_LOC_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, "chroma_sample_location_type"}, {"left", "Left", 0, AV_OPT_TYPE_CONST, {.i64 = AVCHROMA_LOC_LEFT }, INT_MIN, INT_MAX, V|E|D, "chroma_sample_location_type"}, diff --git a/src/third_party/ffmpeg/libavcodec/opus_silk.c b/src/third_party/ffmpeg/libavcodec/opus_silk.c index cf8b16ac..27671516 100644 --- a/src/third_party/ffmpeg/libavcodec/opus_silk.c +++ b/src/third_party/ffmpeg/libavcodec/opus_silk.c @@ -48,7 +48,7 @@ typedef struct SilkFrame { } SilkFrame; struct SilkContext { - AVCodecContext *avctx; + void *logctx; int output_channels; int midonly; @@ -799,7 +799,7 @@ int ff_silk_decode_superframe(SilkContext *s, OpusRangeCoder *rc, if (bandwidth > OPUS_BANDWIDTH_WIDEBAND || coded_channels > 2 || duration_ms > 60) { - av_log(s->avctx, AV_LOG_ERROR, "Invalid parameters passed " + av_log(s->logctx, AV_LOG_ERROR, "Invalid parameters passed " "to the SILK decoder.\n"); return AVERROR(EINVAL); } @@ -879,12 +879,12 @@ void ff_silk_flush(SilkContext *s) memset(s->prev_stereo_weights, 0, sizeof(s->prev_stereo_weights)); } -int ff_silk_init(AVCodecContext *avctx, SilkContext **ps, int output_channels) +int ff_silk_init(void *logctx, SilkContext **ps, int output_channels) { SilkContext *s; if (output_channels != 1 && output_channels != 2) { - av_log(avctx, AV_LOG_ERROR, "Invalid number of output channels: %d\n", + av_log(logctx, AV_LOG_ERROR, "Invalid number of output channels: %d\n", output_channels); return AVERROR(EINVAL); } @@ -893,7 +893,7 @@ int ff_silk_init(AVCodecContext *avctx, SilkContext **ps, int output_channels) if (!s) return AVERROR(ENOMEM); - s->avctx = avctx; + s->logctx = logctx; s->output_channels = output_channels; ff_silk_flush(s); diff --git a/src/third_party/ffmpeg/libavcodec/opus_silk.h b/src/third_party/ffmpeg/libavcodec/opus_silk.h index 6552c166..4b595da2 100644 --- a/src/third_party/ffmpeg/libavcodec/opus_silk.h +++ b/src/third_party/ffmpeg/libavcodec/opus_silk.h @@ -23,7 +23,6 @@ #ifndef AVCODEC_OPUS_SILK_H #define AVCODEC_OPUS_SILK_H -#include "avcodec.h" #include "opus.h" #include "opus_rc.h" @@ -32,7 +31,7 @@ typedef struct SilkContext SilkContext; -int ff_silk_init(AVCodecContext *avctx, SilkContext **ps, int output_channels); +int ff_silk_init(void *logctx, SilkContext **ps, int output_channels); void ff_silk_free(SilkContext **ps); void ff_silk_flush(SilkContext *s); diff --git a/src/third_party/ffmpeg/libavcodec/osq.c b/src/third_party/ffmpeg/libavcodec/osq.c new file mode 100644 index 00000000..435f3ea7 --- /dev/null +++ b/src/third_party/ffmpeg/libavcodec/osq.c @@ -0,0 +1,481 @@ +/* + * OSQ audio decoder + * Copyright (c) 2023 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/internal.h" +#include "libavutil/intreadwrite.h" +#include "avcodec.h" +#include "codec_internal.h" +#include "decode.h" +#include "internal.h" +#define BITSTREAM_READER_LE +#include "get_bits.h" +#include "unary.h" + +#define OFFSET 5 + +typedef struct OSQChannel { + unsigned prediction; + unsigned coding_mode; + unsigned residue_parameter; + unsigned residue_bits; + unsigned history[3]; + unsigned pos, count; + double sum; + int32_t prev; +} OSQChannel; + +typedef struct OSQContext { + GetBitContext gb; + OSQChannel ch[2]; + + uint8_t *bitstream; + size_t max_framesize; + size_t bitstream_size; + + int factor; + int decorrelate; + int frame_samples; + uint64_t nb_samples; + + int32_t *decode_buffer[2]; + + AVPacket *pkt; + int pkt_offset; +} OSQContext; + +static av_cold int osq_close(AVCodecContext *avctx) +{ + OSQContext *s = avctx->priv_data; + + av_freep(&s->bitstream); + s->bitstream_size = 0; + + for (int ch = 0; ch < FF_ARRAY_ELEMS(s->decode_buffer); ch++) + av_freep(&s->decode_buffer[ch]); + + return 0; +} + +static av_cold int osq_init(AVCodecContext *avctx) +{ + OSQContext *s = avctx->priv_data; + + if (avctx->extradata_size < 48) + return AVERROR(EINVAL); + + if (avctx->extradata[0] != 1) { + av_log(avctx, AV_LOG_ERROR, "Unsupported version.\n"); + return AVERROR_INVALIDDATA; + } + + avctx->sample_rate = AV_RL32(avctx->extradata + 4); + if (avctx->sample_rate < 1) + return AVERROR_INVALIDDATA; + + av_channel_layout_uninit(&avctx->ch_layout); + avctx->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; + avctx->ch_layout.nb_channels = avctx->extradata[3]; + if (avctx->ch_layout.nb_channels < 1) + return AVERROR_INVALIDDATA; + if (avctx->ch_layout.nb_channels > FF_ARRAY_ELEMS(s->decode_buffer)) + return AVERROR_INVALIDDATA; + + s->factor = 1; + switch (avctx->extradata[2]) { + case 8: avctx->sample_fmt = AV_SAMPLE_FMT_U8P; break; + case 16: avctx->sample_fmt = AV_SAMPLE_FMT_S16P; break; + case 20: + case 24: s->factor = 256; + avctx->sample_fmt = AV_SAMPLE_FMT_S32P; break; + default: return AVERROR_INVALIDDATA; + } + + avctx->bits_per_raw_sample = avctx->extradata[2]; + s->nb_samples = AV_RL64(avctx->extradata + 16); + s->frame_samples = AV_RL16(avctx->extradata + 8); + s->max_framesize = (s->frame_samples * 16 + 1024) * avctx->ch_layout.nb_channels; + + s->bitstream = av_calloc(s->max_framesize + AV_INPUT_BUFFER_PADDING_SIZE, sizeof(*s->bitstream)); + if (!s->bitstream) + return AVERROR(ENOMEM); + + for (int ch = 0; ch < avctx->ch_layout.nb_channels; ch++) { + s->decode_buffer[ch] = av_calloc(s->frame_samples + OFFSET, + sizeof(*s->decode_buffer[ch])); + if (!s->decode_buffer[ch]) + return AVERROR(ENOMEM); + } + + s->pkt = avctx->internal->in_pkt; + + return 0; +} + +static void reset_stats(OSQChannel *cb) +{ + memset(cb->history, 0, sizeof(cb->history)); + cb->pos = cb->count = cb->sum = 0; +} + +static void update_stats(OSQChannel *cb, int val) +{ + cb->sum += FFABS(val) - cb->history[cb->pos]; + cb->history[cb->pos] = FFABS(val); + cb->pos++; + cb->count++; + if (cb->pos >= FF_ARRAY_ELEMS(cb->history)) + cb->pos = 0; +} + +static int update_residue_parameter(OSQChannel *cb) +{ + double sum, x; + int rice_k; + + sum = cb->sum; + x = sum / cb->count; + rice_k = av_ceil_log2(x); + if (rice_k >= 30) { + rice_k = floor(sum / 1.4426952 + 0.5); + if (rice_k < 1) + rice_k = 1; + } + + return rice_k; +} + +static uint32_t get_urice(GetBitContext *gb, int k) +{ + uint32_t z, x, b; + + x = get_unary(gb, 1, 512); + b = get_bits_long(gb, k); + z = b | x << k; + + return z; +} + +static int32_t get_srice(GetBitContext *gb, int x) +{ + int32_t y = get_urice(gb, x); + return get_bits1(gb) ? -y : y; +} + +static int osq_channel_parameters(AVCodecContext *avctx, int ch) +{ + OSQContext *s = avctx->priv_data; + OSQChannel *cb = &s->ch[ch]; + GetBitContext *gb = &s->gb; + + cb->prev = 0; + cb->prediction = get_urice(gb, 5); + cb->coding_mode = get_urice(gb, 3); + if (cb->prediction >= 15) + return AVERROR_INVALIDDATA; + if (cb->coding_mode > 0 && cb->coding_mode < 3) { + cb->residue_parameter = get_urice(gb, 4); + if (!cb->residue_parameter || cb->residue_parameter >= 31) + return AVERROR_INVALIDDATA; + } else if (cb->coding_mode == 3) { + cb->residue_bits = get_urice(gb, 4); + if (!cb->residue_bits || cb->residue_bits >= 31) + return AVERROR_INVALIDDATA; + } else if (cb->coding_mode) { + return AVERROR_INVALIDDATA; + } + + if (cb->coding_mode == 2) + reset_stats(cb); + + return 0; +} + +#define A (-1) +#define B (-2) +#define C (-3) +#define D (-4) +#define E (-5) +#define P2 ((dst[A] + dst[A]) - dst[B]) +#define P3 ((dst[A] - dst[B]) * 3 + dst[C]) + +static int do_decode(AVCodecContext *avctx, AVFrame *frame, int decorrelate, int downsample) +{ + OSQContext *s = avctx->priv_data; + const int nb_channels = avctx->ch_layout.nb_channels; + const int nb_samples = frame->nb_samples; + GetBitContext *gb = &s->gb; + + for (int n = 0; n < nb_samples; n++) { + for (int ch = 0; ch < nb_channels; ch++) { + OSQChannel *cb = &s->ch[ch]; + int32_t *dst = s->decode_buffer[ch] + OFFSET; + int32_t p, prev = cb->prev; + + if (nb_channels == 2 && ch == 1 && decorrelate != s->decorrelate) { + if (!decorrelate) { + s->decode_buffer[1][OFFSET+A] += s->decode_buffer[0][OFFSET+B]; + s->decode_buffer[1][OFFSET+B] += s->decode_buffer[0][OFFSET+C]; + s->decode_buffer[1][OFFSET+C] += s->decode_buffer[0][OFFSET+D]; + s->decode_buffer[1][OFFSET+D] += s->decode_buffer[0][OFFSET+E]; + } else { + s->decode_buffer[1][OFFSET+A] -= s->decode_buffer[0][OFFSET+B]; + s->decode_buffer[1][OFFSET+B] -= s->decode_buffer[0][OFFSET+C]; + s->decode_buffer[1][OFFSET+C] -= s->decode_buffer[0][OFFSET+D]; + s->decode_buffer[1][OFFSET+D] -= s->decode_buffer[0][OFFSET+E]; + } + s->decorrelate = decorrelate; + } + + if (!cb->coding_mode) { + dst[n] = 0; + } else if (cb->coding_mode == 3) { + dst[n] = get_sbits_long(gb, cb->residue_bits); + } else { + dst[n] = get_srice(gb, cb->residue_parameter); + } + + if (get_bits_left(gb) < 0) { + av_log(avctx, AV_LOG_ERROR, "overread!\n"); + return AVERROR_INVALIDDATA; + } + + p = prev / 2; + prev = dst[n]; + + switch (cb->prediction) { + case 0: + break; + case 1: + dst[n] += dst[A]; + break; + case 2: + dst[n] += dst[A] + p; + break; + case 3: + dst[n] += P2; + break; + case 4: + dst[n] += P2 + p; + break; + case 5: + dst[n] += P3; + break; + case 6: + dst[n] += P3 + p; + break; + case 7: + dst[n] += (P2 + P3) / 2 + p; + break; + case 8: + dst[n] += (P2 + P3) / 2; + break; + case 9: + dst[n] += (P2 * 2 + P3) / 3 + p; + break; + case 10: + dst[n] += (P2 + P3 * 2) / 3 + p; + break; + case 11: + dst[n] += (dst[A] + dst[B]) / 2; + break; + case 12: + dst[n] += dst[B]; + break; + case 13: + dst[n] += (dst[D] + dst[B]) / 2; + break; + case 14: + dst[n] += (P2 + dst[A]) / 2 + p; + break; + default: + return AVERROR_INVALIDDATA; + } + + cb->prev = prev; + + if (downsample) + dst[n] *= 256; + + dst[E] = dst[D]; + dst[D] = dst[C]; + dst[C] = dst[B]; + dst[B] = dst[A]; + dst[A] = dst[n]; + + if (cb->coding_mode == 2) { + update_stats(cb, dst[n]); + cb->residue_parameter = update_residue_parameter(cb); + } + + if (nb_channels == 2 && ch == 1) { + if (decorrelate) + dst[n] += s->decode_buffer[0][OFFSET+n]; + } + + if (downsample) + dst[A] /= 256; + } + } + + return 0; +} + +static int osq_decode_block(AVCodecContext *avctx, AVFrame *frame) +{ + const int nb_channels = avctx->ch_layout.nb_channels; + const int nb_samples = frame->nb_samples; + OSQContext *s = avctx->priv_data; + const int factor = s->factor; + int ret, decorrelate, downsample; + GetBitContext *gb = &s->gb; + + skip_bits1(gb); + decorrelate = get_bits1(gb); + downsample = get_bits1(gb); + + for (int ch = 0; ch < nb_channels; ch++) { + if ((ret = osq_channel_parameters(avctx, ch)) < 0) { + av_log(avctx, AV_LOG_ERROR, "invalid channel parameters\n"); + return ret; + } + } + + if ((ret = do_decode(avctx, frame, decorrelate, downsample)) < 0) + return ret; + + align_get_bits(gb); + + switch (avctx->sample_fmt) { + case AV_SAMPLE_FMT_U8P: + for (int ch = 0; ch < nb_channels; ch++) { + uint8_t *dst = (uint8_t *)frame->extended_data[ch]; + int32_t *src = s->decode_buffer[ch] + OFFSET; + + for (int n = 0; n < nb_samples; n++) + dst[n] = av_clip_uint8(src[n] + 0x80); + } + break; + case AV_SAMPLE_FMT_S16P: + for (int ch = 0; ch < nb_channels; ch++) { + int16_t *dst = (int16_t *)frame->extended_data[ch]; + int32_t *src = s->decode_buffer[ch] + OFFSET; + + for (int n = 0; n < nb_samples; n++) + dst[n] = (int16_t)src[n]; + } + break; + case AV_SAMPLE_FMT_S32P: + for (int ch = 0; ch < nb_channels; ch++) { + int32_t *dst = (int32_t *)frame->extended_data[ch]; + int32_t *src = s->decode_buffer[ch] + OFFSET; + + for (int n = 0; n < nb_samples; n++) + dst[n] = src[n] * factor; + } + break; + default: + return AVERROR_BUG; + } + + return 0; +} + +static int osq_receive_frame(AVCodecContext *avctx, AVFrame *frame) +{ + OSQContext *s = avctx->priv_data; + GetBitContext *gb = &s->gb; + int ret, n; + + while (s->bitstream_size < s->max_framesize) { + int size; + + if (!s->pkt->data) { + ret = ff_decode_get_packet(avctx, s->pkt); + if (ret == AVERROR_EOF && s->bitstream_size > 0) + break; + if (ret == AVERROR_EOF || ret == AVERROR(EAGAIN)) + return ret; + if (ret < 0) + goto fail; + } + + size = FFMIN(s->pkt->size - s->pkt_offset, s->max_framesize - s->bitstream_size); + memcpy(s->bitstream + s->bitstream_size, s->pkt->data + s->pkt_offset, size); + s->bitstream_size += size; + s->pkt_offset += size; + + if (s->pkt_offset == s->pkt->size) { + av_packet_unref(s->pkt); + s->pkt_offset = 0; + } + } + + frame->nb_samples = FFMIN(s->frame_samples, s->nb_samples); + if (frame->nb_samples <= 0) + return AVERROR_EOF; + + if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) + goto fail; + + if ((ret = init_get_bits8(gb, s->bitstream, s->bitstream_size)) < 0) + goto fail; + + if ((ret = osq_decode_block(avctx, frame)) < 0) + goto fail; + + s->nb_samples -= frame->nb_samples; + + n = get_bits_count(gb) / 8; + if (n > s->bitstream_size) { + ret = AVERROR_INVALIDDATA; + goto fail; + } + + memmove(s->bitstream, &s->bitstream[n], s->bitstream_size - n); + s->bitstream_size -= n; + + return 0; + +fail: + s->bitstream_size = 0; + s->pkt_offset = 0; + av_packet_unref(s->pkt); + + return ret; +} + +const FFCodec ff_osq_decoder = { + .p.name = "osq", + CODEC_LONG_NAME("OSQ (Original Sound Quality)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_OSQ, + .priv_data_size = sizeof(OSQContext), + .init = osq_init, + FF_CODEC_RECEIVE_FRAME_CB(osq_receive_frame), + .close = osq_close, + .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | + AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P, + AV_SAMPLE_FMT_S16P, + AV_SAMPLE_FMT_S32P, + AV_SAMPLE_FMT_NONE }, +}; diff --git a/src/third_party/ffmpeg/libavcodec/parsers.c b/src/third_party/ffmpeg/libavcodec/parsers.c index 285f81a9..5128009c 100644 --- a/src/third_party/ffmpeg/libavcodec/parsers.c +++ b/src/third_party/ffmpeg/libavcodec/parsers.c @@ -55,6 +55,7 @@ extern const AVCodecParser ff_hevc_parser; extern const AVCodecParser ff_hdr_parser; extern const AVCodecParser ff_ipu_parser; extern const AVCodecParser ff_jpeg2000_parser; +extern const AVCodecParser ff_jpegxl_parser; extern const AVCodecParser ff_misc4_parser; extern const AVCodecParser ff_mjpeg_parser; extern const AVCodecParser ff_mlp_parser; @@ -65,8 +66,7 @@ extern const AVCodecParser ff_opus_parser; extern const AVCodecParser ff_png_parser; extern const AVCodecParser ff_pnm_parser; extern const AVCodecParser ff_qoi_parser; -extern const AVCodecParser ff_rv30_parser; -extern const AVCodecParser ff_rv40_parser; +extern const AVCodecParser ff_rv34_parser; extern const AVCodecParser ff_sbc_parser; extern const AVCodecParser ff_sipr_parser; extern const AVCodecParser ff_tak_parser; diff --git a/src/third_party/ffmpeg/libavcodec/pcm.c b/src/third_party/ffmpeg/libavcodec/pcm.c index 23955ba2..4abca7cc 100644 --- a/src/third_party/ffmpeg/libavcodec/pcm.c +++ b/src/third_party/ffmpeg/libavcodec/pcm.c @@ -538,7 +538,6 @@ static int pcm_decode_frame(AVCodecContext *avctx, AVFrame *frame, s->vector_fmul_scalar((float *)frame->extended_data[0], (const float *)frame->extended_data[0], s->scale, FFALIGN(frame->nb_samples * avctx->ch_layout.nb_channels, 4)); - emms_c(); } *got_frame_ptr = 1; @@ -578,7 +577,7 @@ const FFCodec ff_ ## name_ ## _decoder = { \ .priv_data_size = sizeof(PCMDecode), \ .init = pcm_decode_init, \ FF_CODEC_DECODE_CB(pcm_decode_frame), \ - .p.capabilities = AV_CODEC_CAP_DR1, \ + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_PARAM_CHANGE, \ .p.sample_fmts = (const enum AVSampleFormat[]){ sample_fmt_, \ AV_SAMPLE_FMT_NONE }, \ } diff --git a/src/third_party/ffmpeg/libavcodec/pcx.c b/src/third_party/ffmpeg/libavcodec/pcx.c index 4cca4972..8e2aae7b 100644 --- a/src/third_party/ffmpeg/libavcodec/pcx.c +++ b/src/third_party/ffmpeg/libavcodec/pcx.c @@ -75,9 +75,10 @@ static int pcx_decode_frame(AVCodecContext *avctx, AVFrame *p, GetByteContext gb; int compressed, xmin, ymin, xmax, ymax; int ret; - unsigned int w, h, bits_per_pixel, bytes_per_line, nplanes, stride, y, x, + unsigned int w, h, bits_per_pixel, bytes_per_line, nplanes, y, x, bytes_per_scanline; uint8_t *ptr, *scanline; + ptrdiff_t stride; if (avpkt->size < PCX_HEADER_SIZE) { av_log(avctx, AV_LOG_ERROR, "Packet too small\n"); diff --git a/src/third_party/ffmpeg/libavcodec/pdvdec.c b/src/third_party/ffmpeg/libavcodec/pdvdec.c index d50c4e72..e2c03e7e 100644 --- a/src/third_party/ffmpeg/libavcodec/pdvdec.c +++ b/src/third_party/ffmpeg/libavcodec/pdvdec.c @@ -102,8 +102,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, dst += frame->linesize[0]; } - av_frame_unref(s->previous_frame); - if ((ret = av_frame_ref(s->previous_frame, frame)) < 0) + if ((ret = av_frame_replace(s->previous_frame, frame)) < 0) return ret; if (avpkt->flags & AV_PKT_FLAG_KEY) { diff --git a/src/third_party/ffmpeg/libavcodec/photocd.c b/src/third_party/ffmpeg/libavcodec/photocd.c index 3a09b819..07e8d460 100644 --- a/src/third_party/ffmpeg/libavcodec/photocd.c +++ b/src/third_party/ffmpeg/libavcodec/photocd.c @@ -210,8 +210,8 @@ static av_noinline int read_hufftable(AVCodecContext *avctx, VLC *vlc) s->syms[j] = sym; } - ff_free_vlc(vlc); - ret = ff_init_vlc_sparse(vlc, 12, count, + ff_vlc_free(vlc); + ret = ff_vlc_init_sparse(vlc, 12, count, s->bits, sizeof(*s->bits), sizeof(*s->bits), s->codes, sizeof(*s->codes), sizeof(*s->codes), s->syms, sizeof(*s->syms), sizeof(*s->syms), 0); @@ -438,7 +438,7 @@ static av_cold int photocd_decode_close(AVCodecContext *avctx) PhotoCDContext *s = avctx->priv_data; for (int i = 0; i < 3; i++) - ff_free_vlc(&s->vlc[i]); + ff_vlc_free(&s->vlc[i]); return 0; } diff --git a/src/third_party/ffmpeg/libavcodec/pngenc.c b/src/third_party/ffmpeg/libavcodec/pngenc.c index 21b033ea..f0650962 100644 --- a/src/third_party/ffmpeg/libavcodec/pngenc.c +++ b/src/third_party/ffmpeg/libavcodec/pngenc.c @@ -1059,8 +1059,7 @@ static int encode_apng(AVCodecContext *avctx, AVPacket *pkt, } } - av_frame_unref(s->last_frame); - ret = av_frame_ref(s->last_frame, pict); + ret = av_frame_replace(s->last_frame, pict); if (ret < 0) return ret; diff --git a/src/third_party/ffmpeg/libavcodec/pnmdec.c b/src/third_party/ffmpeg/libavcodec/pnmdec.c index 72bc83b2..acd77ea8 100644 --- a/src/third_party/ffmpeg/libavcodec/pnmdec.c +++ b/src/third_party/ffmpeg/libavcodec/pnmdec.c @@ -137,7 +137,7 @@ static int pnm_decode_frame(AVCodecContext *avctx, AVFrame *p, if(s->type < 4 || (is_mono && s->type==7)){ for (i=0; iheight; i++) { PutBitContext pb; - init_put_bits(&pb, ptr, linesize); + init_put_bits(&pb, ptr, FFABS(linesize)); for(j=0; jwidth * components; j++){ unsigned int c=0; unsigned v=0; diff --git a/src/third_party/ffmpeg/libavcodec/ppc/Makefile b/src/third_party/ffmpeg/libavcodec/ppc/Makefile index bc13d8a0..10b9ca60 100644 --- a/src/third_party/ffmpeg/libavcodec/ppc/Makefile +++ b/src/third_party/ffmpeg/libavcodec/ppc/Makefile @@ -1,9 +1,6 @@ # subsystems OBJS-$(CONFIG_AUDIODSP) += ppc/audiodsp.o OBJS-$(CONFIG_BLOCKDSP) += ppc/blockdsp.o -OBJS-$(CONFIG_FFT) += ppc/fft_init.o \ - ppc/fft_altivec.o \ - ppc/fft_vsx.o OBJS-$(CONFIG_FDCTDSP) += ppc/fdctdsp.o OBJS-$(CONFIG_FMTCONVERT) += ppc/fmtconvert_altivec.o OBJS-$(CONFIG_H264CHROMA) += ppc/h264chroma_init.o diff --git a/src/third_party/ffmpeg/libavcodec/ppc/fdctdsp.c b/src/third_party/ffmpeg/libavcodec/ppc/fdctdsp.c index 4ab516c6..ae3c1b18 100644 --- a/src/third_party/ffmpeg/libavcodec/ppc/fdctdsp.c +++ b/src/third_party/ffmpeg/libavcodec/ppc/fdctdsp.c @@ -25,6 +25,7 @@ #include "libavutil/ppc/cpu.h" #include "libavutil/ppc/util_altivec.h" +#include "libavcodec/avcodec.h" #include "libavcodec/fdctdsp.h" #include "fdct.h" diff --git a/src/third_party/ffmpeg/libavcodec/ppc/idctdsp.c b/src/third_party/ffmpeg/libavcodec/ppc/idctdsp.c index 29f625a0..a7acbc5e 100644 --- a/src/third_party/ffmpeg/libavcodec/ppc/idctdsp.c +++ b/src/third_party/ffmpeg/libavcodec/ppc/idctdsp.c @@ -40,6 +40,7 @@ #include "libavutil/ppc/cpu.h" #include "libavutil/ppc/util_altivec.h" +#include "libavcodec/avcodec.h" #include "libavcodec/idctdsp.h" #if HAVE_ALTIVEC diff --git a/src/third_party/ffmpeg/libavcodec/ppc/mpegaudiodsp_altivec.c b/src/third_party/ffmpeg/libavcodec/ppc/mpegaudiodsp_altivec.c index 6794ed09..b065203c 100644 --- a/src/third_party/ffmpeg/libavcodec/ppc/mpegaudiodsp_altivec.c +++ b/src/third_party/ffmpeg/libavcodec/ppc/mpegaudiodsp_altivec.c @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + #include "config.h" #include "libavutil/attributes.h" #include "libavutil/cpu.h" diff --git a/src/third_party/ffmpeg/libavcodec/profiles.c b/src/third_party/ffmpeg/libavcodec/profiles.c index c646a3f5..5bb8f150 100644 --- a/src/third_party/ffmpeg/libavcodec/profiles.c +++ b/src/third_party/ffmpeg/libavcodec/profiles.c @@ -24,180 +24,180 @@ #if !CONFIG_SMALL const AVProfile ff_aac_profiles[] = { - { FF_PROFILE_AAC_LOW, "LC" }, - { 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_AAC_MAIN, "Main" }, - { FF_PROFILE_AAC_SSR, "SSR" }, - { FF_PROFILE_AAC_LTP, "LTP" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_AAC_LOW, "LC" }, + { AV_PROFILE_AAC_HE, "HE-AAC" }, + { AV_PROFILE_AAC_HE_V2, "HE-AACv2" }, + { AV_PROFILE_AAC_LD, "LD" }, + { AV_PROFILE_AAC_ELD, "ELD" }, + { AV_PROFILE_AAC_MAIN, "Main" }, + { AV_PROFILE_AAC_SSR, "SSR" }, + { AV_PROFILE_AAC_LTP, "LTP" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_dca_profiles[] = { - { FF_PROFILE_DTS, "DTS" }, - { FF_PROFILE_DTS_ES, "DTS-ES" }, - { FF_PROFILE_DTS_96_24, "DTS 96/24" }, - { FF_PROFILE_DTS_HD_HRA, "DTS-HD HRA" }, - { FF_PROFILE_DTS_HD_MA, "DTS-HD MA" }, - { FF_PROFILE_DTS_HD_MA_X, "DTS-HD MA + DTS:X" }, - { FF_PROFILE_DTS_HD_MA_X_IMAX, "DTS-HD MA + DTS:X IMAX" }, - { FF_PROFILE_DTS_EXPRESS, "DTS Express" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_DTS, "DTS" }, + { AV_PROFILE_DTS_ES, "DTS-ES" }, + { AV_PROFILE_DTS_96_24, "DTS 96/24" }, + { AV_PROFILE_DTS_HD_HRA, "DTS-HD HRA" }, + { AV_PROFILE_DTS_HD_MA, "DTS-HD MA" }, + { AV_PROFILE_DTS_HD_MA_X, "DTS-HD MA + DTS:X" }, + { AV_PROFILE_DTS_HD_MA_X_IMAX, "DTS-HD MA + DTS:X IMAX" }, + { AV_PROFILE_DTS_EXPRESS, "DTS Express" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_eac3_profiles[] = { - { FF_PROFILE_EAC3_DDP_ATMOS, "Dolby Digital Plus + Dolby Atmos"}, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_EAC3_DDP_ATMOS, "Dolby Digital Plus + Dolby Atmos"}, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_truehd_profiles[] = { - { FF_PROFILE_TRUEHD_ATMOS, "Dolby TrueHD + Dolby Atmos"}, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_TRUEHD_ATMOS, "Dolby TrueHD + Dolby Atmos"}, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_dnxhd_profiles[] = { - { FF_PROFILE_DNXHD, "DNXHD"}, - { FF_PROFILE_DNXHR_LB, "DNXHR LB"}, - { FF_PROFILE_DNXHR_SQ, "DNXHR SQ"}, - { FF_PROFILE_DNXHR_HQ, "DNXHR HQ" }, - { FF_PROFILE_DNXHR_HQX, "DNXHR HQX"}, - { FF_PROFILE_DNXHR_444, "DNXHR 444"}, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_DNXHD, "DNXHD"}, + { AV_PROFILE_DNXHR_LB, "DNXHR LB"}, + { AV_PROFILE_DNXHR_SQ, "DNXHR SQ"}, + { AV_PROFILE_DNXHR_HQ, "DNXHR HQ" }, + { AV_PROFILE_DNXHR_HQX, "DNXHR HQX"}, + { AV_PROFILE_DNXHR_444, "DNXHR 444"}, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_h264_profiles[] = { - { FF_PROFILE_H264_BASELINE, "Baseline" }, - { FF_PROFILE_H264_CONSTRAINED_BASELINE, "Constrained Baseline" }, - { FF_PROFILE_H264_MAIN, "Main" }, - { FF_PROFILE_H264_EXTENDED, "Extended" }, - { FF_PROFILE_H264_HIGH, "High" }, - { FF_PROFILE_H264_HIGH_10, "High 10" }, - { FF_PROFILE_H264_HIGH_10_INTRA, "High 10 Intra" }, - { FF_PROFILE_H264_HIGH_422, "High 4:2:2" }, - { FF_PROFILE_H264_HIGH_422_INTRA, "High 4:2:2 Intra" }, - { FF_PROFILE_H264_HIGH_444, "High 4:4:4" }, - { FF_PROFILE_H264_HIGH_444_PREDICTIVE, "High 4:4:4 Predictive" }, - { FF_PROFILE_H264_HIGH_444_INTRA, "High 4:4:4 Intra" }, - { FF_PROFILE_H264_CAVLC_444, "CAVLC 4:4:4" }, - { FF_PROFILE_H264_MULTIVIEW_HIGH, "Multiview High" }, - { FF_PROFILE_H264_STEREO_HIGH, "Stereo High" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_H264_BASELINE, "Baseline" }, + { AV_PROFILE_H264_CONSTRAINED_BASELINE, "Constrained Baseline" }, + { AV_PROFILE_H264_MAIN, "Main" }, + { AV_PROFILE_H264_EXTENDED, "Extended" }, + { AV_PROFILE_H264_HIGH, "High" }, + { AV_PROFILE_H264_HIGH_10, "High 10" }, + { AV_PROFILE_H264_HIGH_10_INTRA, "High 10 Intra" }, + { AV_PROFILE_H264_HIGH_422, "High 4:2:2" }, + { AV_PROFILE_H264_HIGH_422_INTRA, "High 4:2:2 Intra" }, + { AV_PROFILE_H264_HIGH_444, "High 4:4:4" }, + { AV_PROFILE_H264_HIGH_444_PREDICTIVE, "High 4:4:4 Predictive" }, + { AV_PROFILE_H264_HIGH_444_INTRA, "High 4:4:4 Intra" }, + { AV_PROFILE_H264_CAVLC_444, "CAVLC 4:4:4" }, + { AV_PROFILE_H264_MULTIVIEW_HIGH, "Multiview High" }, + { AV_PROFILE_H264_STEREO_HIGH, "Stereo High" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_vvc_profiles[] = { - { FF_PROFILE_VVC_MAIN_10, "Main 10" }, - { FF_PROFILE_VVC_MAIN_10_444, "Main 10 4:4:4" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_VVC_MAIN_10, "Main 10" }, + { AV_PROFILE_VVC_MAIN_10_444, "Main 10 4:4:4" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_hevc_profiles[] = { - { FF_PROFILE_HEVC_MAIN, "Main" }, - { FF_PROFILE_HEVC_MAIN_10, "Main 10" }, - { FF_PROFILE_HEVC_MAIN_STILL_PICTURE, "Main Still Picture" }, - { FF_PROFILE_HEVC_REXT, "Rext" }, - { FF_PROFILE_HEVC_SCC, "Scc" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_HEVC_MAIN, "Main" }, + { AV_PROFILE_HEVC_MAIN_10, "Main 10" }, + { AV_PROFILE_HEVC_MAIN_STILL_PICTURE, "Main Still Picture" }, + { AV_PROFILE_HEVC_REXT, "Rext" }, + { AV_PROFILE_HEVC_SCC, "Scc" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_jpeg2000_profiles[] = { - { FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0, "JPEG 2000 codestream restriction 0" }, - { FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1, "JPEG 2000 codestream restriction 1" }, - { FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION, "JPEG 2000 no codestream restrictions" }, - { FF_PROFILE_JPEG2000_DCINEMA_2K, "JPEG 2000 digital cinema 2K" }, - { FF_PROFILE_JPEG2000_DCINEMA_4K, "JPEG 2000 digital cinema 4K" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0, "JPEG 2000 codestream restriction 0" }, + { AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1, "JPEG 2000 codestream restriction 1" }, + { AV_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION, "JPEG 2000 no codestream restrictions" }, + { AV_PROFILE_JPEG2000_DCINEMA_2K, "JPEG 2000 digital cinema 2K" }, + { AV_PROFILE_JPEG2000_DCINEMA_4K, "JPEG 2000 digital cinema 4K" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_mpeg2_video_profiles[] = { - { FF_PROFILE_MPEG2_422, "4:2:2" }, - { FF_PROFILE_MPEG2_HIGH, "High" }, - { FF_PROFILE_MPEG2_SS, "Spatially Scalable" }, - { FF_PROFILE_MPEG2_SNR_SCALABLE, "SNR Scalable" }, - { FF_PROFILE_MPEG2_MAIN, "Main" }, - { FF_PROFILE_MPEG2_SIMPLE, "Simple" }, - { FF_PROFILE_RESERVED, "Reserved" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_MPEG2_422, "4:2:2" }, + { AV_PROFILE_MPEG2_HIGH, "High" }, + { AV_PROFILE_MPEG2_SS, "Spatially Scalable" }, + { AV_PROFILE_MPEG2_SNR_SCALABLE, "SNR Scalable" }, + { AV_PROFILE_MPEG2_MAIN, "Main" }, + { AV_PROFILE_MPEG2_SIMPLE, "Simple" }, + { AV_PROFILE_RESERVED, "Reserved" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_mpeg4_video_profiles[] = { - { FF_PROFILE_MPEG4_SIMPLE, "Simple Profile" }, - { FF_PROFILE_MPEG4_SIMPLE_SCALABLE, "Simple Scalable Profile" }, - { FF_PROFILE_MPEG4_CORE, "Core Profile" }, - { FF_PROFILE_MPEG4_MAIN, "Main Profile" }, - { FF_PROFILE_MPEG4_N_BIT, "N-bit Profile" }, - { FF_PROFILE_MPEG4_SCALABLE_TEXTURE, "Scalable Texture Profile" }, - { FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION, "Simple Face Animation Profile" }, - { FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE, "Basic Animated Texture Profile" }, - { FF_PROFILE_MPEG4_HYBRID, "Hybrid Profile" }, - { FF_PROFILE_MPEG4_ADVANCED_REAL_TIME, "Advanced Real Time Simple Profile" }, - { FF_PROFILE_MPEG4_CORE_SCALABLE, "Code Scalable Profile" }, - { FF_PROFILE_MPEG4_ADVANCED_CODING, "Advanced Coding Profile" }, - { FF_PROFILE_MPEG4_ADVANCED_CORE, "Advanced Core Profile" }, - { FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE, "Advanced Scalable Texture Profile" }, - { FF_PROFILE_MPEG4_SIMPLE_STUDIO, "Simple Studio Profile" }, - { FF_PROFILE_MPEG4_ADVANCED_SIMPLE, "Advanced Simple Profile" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_MPEG4_SIMPLE, "Simple Profile" }, + { AV_PROFILE_MPEG4_SIMPLE_SCALABLE, "Simple Scalable Profile" }, + { AV_PROFILE_MPEG4_CORE, "Core Profile" }, + { AV_PROFILE_MPEG4_MAIN, "Main Profile" }, + { AV_PROFILE_MPEG4_N_BIT, "N-bit Profile" }, + { AV_PROFILE_MPEG4_SCALABLE_TEXTURE, "Scalable Texture Profile" }, + { AV_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION, "Simple Face Animation Profile" }, + { AV_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE, "Basic Animated Texture Profile" }, + { AV_PROFILE_MPEG4_HYBRID, "Hybrid Profile" }, + { AV_PROFILE_MPEG4_ADVANCED_REAL_TIME, "Advanced Real Time Simple Profile" }, + { AV_PROFILE_MPEG4_CORE_SCALABLE, "Code Scalable Profile" }, + { AV_PROFILE_MPEG4_ADVANCED_CODING, "Advanced Coding Profile" }, + { AV_PROFILE_MPEG4_ADVANCED_CORE, "Advanced Core Profile" }, + { AV_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE, "Advanced Scalable Texture Profile" }, + { AV_PROFILE_MPEG4_SIMPLE_STUDIO, "Simple Studio Profile" }, + { AV_PROFILE_MPEG4_ADVANCED_SIMPLE, "Advanced Simple Profile" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_vc1_profiles[] = { - { FF_PROFILE_VC1_SIMPLE, "Simple" }, - { FF_PROFILE_VC1_MAIN, "Main" }, - { FF_PROFILE_VC1_COMPLEX, "Complex" }, - { FF_PROFILE_VC1_ADVANCED, "Advanced" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_VC1_SIMPLE, "Simple" }, + { AV_PROFILE_VC1_MAIN, "Main" }, + { AV_PROFILE_VC1_COMPLEX, "Complex" }, + { AV_PROFILE_VC1_ADVANCED, "Advanced" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_vp9_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 }, + { AV_PROFILE_VP9_0, "Profile 0" }, + { AV_PROFILE_VP9_1, "Profile 1" }, + { AV_PROFILE_VP9_2, "Profile 2" }, + { AV_PROFILE_VP9_3, "Profile 3" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_av1_profiles[] = { - { FF_PROFILE_AV1_MAIN, "Main" }, - { FF_PROFILE_AV1_HIGH, "High" }, - { FF_PROFILE_AV1_PROFESSIONAL, "Professional" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_AV1_MAIN, "Main" }, + { AV_PROFILE_AV1_HIGH, "High" }, + { AV_PROFILE_AV1_PROFESSIONAL, "Professional" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_sbc_profiles[] = { - { FF_PROFILE_SBC_MSBC, "mSBC" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_SBC_MSBC, "mSBC" }, + { AV_PROFILE_UNKNOWN }, }; const AVProfile ff_prores_profiles[] = { - { FF_PROFILE_PRORES_PROXY, "Proxy" }, - { FF_PROFILE_PRORES_LT, "LT" }, - { FF_PROFILE_PRORES_STANDARD, "Standard" }, - { FF_PROFILE_PRORES_HQ, "HQ" }, - { FF_PROFILE_PRORES_4444, "4444" }, - { FF_PROFILE_PRORES_XQ, "XQ" }, - { FF_PROFILE_UNKNOWN } + { AV_PROFILE_PRORES_PROXY, "Proxy" }, + { AV_PROFILE_PRORES_LT, "LT" }, + { AV_PROFILE_PRORES_STANDARD, "Standard" }, + { AV_PROFILE_PRORES_HQ, "HQ" }, + { AV_PROFILE_PRORES_4444, "4444" }, + { AV_PROFILE_PRORES_XQ, "XQ" }, + { AV_PROFILE_UNKNOWN } }; const AVProfile ff_mjpeg_profiles[] = { - { FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, "Baseline" }, - { FF_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT, "Sequential" }, - { FF_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT, "Progressive" }, - { FF_PROFILE_MJPEG_HUFFMAN_LOSSLESS, "Lossless" }, - { FF_PROFILE_MJPEG_JPEG_LS, "JPEG LS" }, - { FF_PROFILE_UNKNOWN } + { AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, "Baseline" }, + { AV_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT, "Sequential" }, + { AV_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT, "Progressive" }, + { AV_PROFILE_MJPEG_HUFFMAN_LOSSLESS, "Lossless" }, + { AV_PROFILE_MJPEG_JPEG_LS, "JPEG LS" }, + { AV_PROFILE_UNKNOWN } }; const AVProfile ff_arib_caption_profiles[] = { - { FF_PROFILE_ARIB_PROFILE_A, "Profile A" }, - { FF_PROFILE_ARIB_PROFILE_C, "Profile C" }, - { FF_PROFILE_UNKNOWN } + { AV_PROFILE_ARIB_PROFILE_A, "Profile A" }, + { AV_PROFILE_ARIB_PROFILE_C, "Profile C" }, + { AV_PROFILE_UNKNOWN } }; const AVProfile ff_evc_profiles[] = { - { FF_PROFILE_EVC_BASELINE, "Baseline" }, - { FF_PROFILE_EVC_MAIN, "Main" }, - { FF_PROFILE_UNKNOWN }, + { AV_PROFILE_EVC_BASELINE, "Baseline" }, + { AV_PROFILE_EVC_MAIN, "Main" }, + { AV_PROFILE_UNKNOWN }, }; #endif /* !CONFIG_SMALL */ diff --git a/src/third_party/ffmpeg/libavcodec/profiles.h b/src/third_party/ffmpeg/libavcodec/profiles.h index c0eacae5..270430a4 100644 --- a/src/third_party/ffmpeg/libavcodec/profiles.h +++ b/src/third_party/ffmpeg/libavcodec/profiles.h @@ -26,35 +26,35 @@ {name, description, 0, AV_OPT_TYPE_CONST, {.i64 = value }, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_## type ##_PARAM, "avctx.profile"}, #define FF_AAC_PROFILE_OPTS \ - FF_AVCTX_PROFILE_OPTION("aac_main", NULL, AUDIO, FF_PROFILE_AAC_MAIN)\ - FF_AVCTX_PROFILE_OPTION("aac_low", NULL, AUDIO, FF_PROFILE_AAC_LOW)\ - FF_AVCTX_PROFILE_OPTION("aac_ssr", NULL, AUDIO, FF_PROFILE_AAC_SSR)\ - FF_AVCTX_PROFILE_OPTION("aac_ltp", NULL, AUDIO, FF_PROFILE_AAC_LTP)\ - FF_AVCTX_PROFILE_OPTION("aac_he", NULL, AUDIO, FF_PROFILE_AAC_HE)\ - FF_AVCTX_PROFILE_OPTION("aac_he_v2", NULL, AUDIO, FF_PROFILE_AAC_HE_V2)\ - FF_AVCTX_PROFILE_OPTION("aac_ld", NULL, AUDIO, FF_PROFILE_AAC_LD)\ - FF_AVCTX_PROFILE_OPTION("aac_eld", NULL, AUDIO, FF_PROFILE_AAC_ELD)\ - FF_AVCTX_PROFILE_OPTION("mpeg2_aac_low", NULL, AUDIO, FF_PROFILE_MPEG2_AAC_LOW)\ - FF_AVCTX_PROFILE_OPTION("mpeg2_aac_he", NULL, AUDIO, FF_PROFILE_MPEG2_AAC_HE)\ + FF_AVCTX_PROFILE_OPTION("aac_main", NULL, AUDIO, AV_PROFILE_AAC_MAIN)\ + FF_AVCTX_PROFILE_OPTION("aac_low", NULL, AUDIO, AV_PROFILE_AAC_LOW)\ + FF_AVCTX_PROFILE_OPTION("aac_ssr", NULL, AUDIO, AV_PROFILE_AAC_SSR)\ + FF_AVCTX_PROFILE_OPTION("aac_ltp", NULL, AUDIO, AV_PROFILE_AAC_LTP)\ + FF_AVCTX_PROFILE_OPTION("aac_he", NULL, AUDIO, AV_PROFILE_AAC_HE)\ + FF_AVCTX_PROFILE_OPTION("aac_he_v2", NULL, AUDIO, AV_PROFILE_AAC_HE_V2)\ + FF_AVCTX_PROFILE_OPTION("aac_ld", NULL, AUDIO, AV_PROFILE_AAC_LD)\ + FF_AVCTX_PROFILE_OPTION("aac_eld", NULL, AUDIO, AV_PROFILE_AAC_ELD)\ + FF_AVCTX_PROFILE_OPTION("mpeg2_aac_low", NULL, AUDIO, AV_PROFILE_MPEG2_AAC_LOW)\ + FF_AVCTX_PROFILE_OPTION("mpeg2_aac_he", NULL, AUDIO, AV_PROFILE_MPEG2_AAC_HE)\ #define FF_MPEG4_PROFILE_OPTS \ - FF_AVCTX_PROFILE_OPTION("mpeg4_sp", NULL, VIDEO, FF_PROFILE_MPEG4_SIMPLE)\ - FF_AVCTX_PROFILE_OPTION("mpeg4_core", NULL, VIDEO, FF_PROFILE_MPEG4_CORE)\ - FF_AVCTX_PROFILE_OPTION("mpeg4_main", NULL, VIDEO, FF_PROFILE_MPEG4_MAIN)\ - FF_AVCTX_PROFILE_OPTION("mpeg4_asp", NULL, VIDEO, FF_PROFILE_MPEG4_ADVANCED_SIMPLE)\ + FF_AVCTX_PROFILE_OPTION("mpeg4_sp", NULL, VIDEO, AV_PROFILE_MPEG4_SIMPLE)\ + FF_AVCTX_PROFILE_OPTION("mpeg4_core", NULL, VIDEO, AV_PROFILE_MPEG4_CORE)\ + FF_AVCTX_PROFILE_OPTION("mpeg4_main", NULL, VIDEO, AV_PROFILE_MPEG4_MAIN)\ + FF_AVCTX_PROFILE_OPTION("mpeg4_asp", NULL, VIDEO, AV_PROFILE_MPEG4_ADVANCED_SIMPLE)\ #define FF_MPEG2_PROFILE_OPTS \ - FF_AVCTX_PROFILE_OPTION("422", NULL, VIDEO, FF_PROFILE_MPEG2_422)\ - FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, FF_PROFILE_MPEG2_HIGH)\ - FF_AVCTX_PROFILE_OPTION("ss", NULL, VIDEO, FF_PROFILE_MPEG2_SS)\ - FF_AVCTX_PROFILE_OPTION("snr", NULL, VIDEO, FF_PROFILE_MPEG2_SNR_SCALABLE)\ - FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, FF_PROFILE_MPEG2_MAIN)\ - FF_AVCTX_PROFILE_OPTION("simple", NULL, VIDEO, FF_PROFILE_MPEG2_SIMPLE)\ + FF_AVCTX_PROFILE_OPTION("422", NULL, VIDEO, AV_PROFILE_MPEG2_422)\ + FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, AV_PROFILE_MPEG2_HIGH)\ + FF_AVCTX_PROFILE_OPTION("ss", NULL, VIDEO, AV_PROFILE_MPEG2_SS)\ + FF_AVCTX_PROFILE_OPTION("snr", NULL, VIDEO, AV_PROFILE_MPEG2_SNR_SCALABLE)\ + FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, AV_PROFILE_MPEG2_MAIN)\ + FF_AVCTX_PROFILE_OPTION("simple", NULL, VIDEO, AV_PROFILE_MPEG2_SIMPLE)\ #define FF_AV1_PROFILE_OPTS \ - FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, FF_PROFILE_AV1_MAIN)\ - FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, FF_PROFILE_AV1_HIGH)\ - FF_AVCTX_PROFILE_OPTION("professional", NULL, VIDEO, FF_PROFILE_AV1_PROFESSIONAL)\ + FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, AV_PROFILE_AV1_MAIN)\ + FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, AV_PROFILE_AV1_HIGH)\ + FF_AVCTX_PROFILE_OPTION("professional", NULL, VIDEO, AV_PROFILE_AV1_PROFESSIONAL)\ extern const AVProfile ff_aac_profiles[]; extern const AVProfile ff_dca_profiles[]; diff --git a/src/third_party/ffmpeg/libavcodec/proresdec.h b/src/third_party/ffmpeg/libavcodec/proresdec.h index 1e48752e..230fca41 100644 --- a/src/third_party/ffmpeg/libavcodec/proresdec.h +++ b/src/third_party/ffmpeg/libavcodec/proresdec.h @@ -22,10 +22,15 @@ #ifndef AVCODEC_PRORESDEC_H #define AVCODEC_PRORESDEC_H +#include + #include "get_bits.h" #include "blockdsp.h" #include "proresdsp.h" +#include "libavutil/frame.h" +#include "libavutil/pixfmt.h" + typedef struct { const uint8_t *data; unsigned mb_x; diff --git a/src/third_party/ffmpeg/libavcodec/proresdec2.c b/src/third_party/ffmpeg/libavcodec/proresdec2.c index b86614ad..3a5b7534 100644 --- a/src/third_party/ffmpeg/libavcodec/proresdec2.c +++ b/src/third_party/ffmpeg/libavcodec/proresdec2.c @@ -37,6 +37,7 @@ #include "codec_internal.h" #include "decode.h" #include "get_bits.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "idctdsp.h" #include "profiles.h" @@ -140,27 +141,27 @@ static av_cold int decode_init(AVCodecContext *avctx) switch (avctx->codec_tag) { case MKTAG('a','p','c','o'): - avctx->profile = FF_PROFILE_PRORES_PROXY; + avctx->profile = AV_PROFILE_PRORES_PROXY; break; case MKTAG('a','p','c','s'): - avctx->profile = FF_PROFILE_PRORES_LT; + avctx->profile = AV_PROFILE_PRORES_LT; break; case MKTAG('a','p','c','n'): - avctx->profile = FF_PROFILE_PRORES_STANDARD; + avctx->profile = AV_PROFILE_PRORES_STANDARD; break; case MKTAG('a','p','c','h'): - avctx->profile = FF_PROFILE_PRORES_HQ; + avctx->profile = AV_PROFILE_PRORES_HQ; break; case MKTAG('a','p','4','h'): - avctx->profile = FF_PROFILE_PRORES_4444; + avctx->profile = AV_PROFILE_PRORES_4444; avctx->bits_per_raw_sample = 12; break; case MKTAG('a','p','4','x'): - avctx->profile = FF_PROFILE_PRORES_XQ; + avctx->profile = AV_PROFILE_PRORES_XQ; avctx->bits_per_raw_sample = 12; break; default: - avctx->profile = FF_PROFILE_UNKNOWN; + avctx->profile = AV_PROFILE_UNKNOWN; av_log(avctx, AV_LOG_WARNING, "Unknown prores profile %d\n", avctx->codec_tag); } @@ -171,7 +172,7 @@ static av_cold int decode_init(AVCodecContext *avctx) } ff_blockdsp_init(&ctx->bdsp); - ret = ff_proresdsp_init(&ctx->prodsp, avctx); + ret = ff_proresdsp_init(&ctx->prodsp, avctx->bits_per_raw_sample); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "Fail to init proresdsp for bits per raw sample %d\n", avctx->bits_per_raw_sample); return ret; @@ -277,7 +278,7 @@ static int decode_frame_header(ProresContext *ctx, const uint8_t *buf, *fmtp++ = ctx->pix_fmt; *fmtp = AV_PIX_FMT_NONE; - if ((ret = ff_thread_get_format(avctx, pix_fmts)) < 0) + if ((ret = ff_get_format(avctx, pix_fmts)) < 0) return ret; avctx->pix_fmt = ret; @@ -804,13 +805,14 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, ff_thread_finish_setup(avctx); if (avctx->hwaccel) { - ret = avctx->hwaccel->start_frame(avctx, NULL, 0); + const FFHWAccel *hwaccel = ffhwaccel(avctx->hwaccel); + ret = hwaccel->start_frame(avctx, NULL, 0); if (ret < 0) return ret; - ret = avctx->hwaccel->decode_slice(avctx, avpkt->data, avpkt->size); + ret = hwaccel->decode_slice(avctx, avpkt->data, avpkt->size); if (ret < 0) return ret; - ret = avctx->hwaccel->end_frame(avctx); + ret = hwaccel->end_frame(avctx); if (ret < 0) return ret; goto finish; diff --git a/src/third_party/ffmpeg/libavcodec/proresdsp.c b/src/third_party/ffmpeg/libavcodec/proresdsp.c index 6ed01179..bc253e55 100644 --- a/src/third_party/ffmpeg/libavcodec/proresdsp.c +++ b/src/third_party/ffmpeg/libavcodec/proresdsp.c @@ -76,12 +76,12 @@ static void prores_idct_put_12_c(uint16_t *out, ptrdiff_t linesize, int16_t *blo put_pixels_12(out, linesize >> 1, block); } -av_cold int ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx) +av_cold int ff_proresdsp_init(ProresDSPContext *dsp, int bits_per_raw_sample) { - if (avctx->bits_per_raw_sample == 10) { + if (bits_per_raw_sample == 10) { dsp->idct_put = prores_idct_put_10_c; dsp->idct_permutation_type = FF_IDCT_PERM_NONE; - } else if (avctx->bits_per_raw_sample == 12) { + } else if (bits_per_raw_sample == 12) { dsp->idct_put = prores_idct_put_12_c; dsp->idct_permutation_type = FF_IDCT_PERM_NONE; } else { @@ -89,7 +89,7 @@ av_cold int ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx) } #if ARCH_X86 - ff_proresdsp_init_x86(dsp, avctx); + ff_proresdsp_init_x86(dsp, bits_per_raw_sample); #endif ff_init_scantable_permutation(dsp->idct_permutation, diff --git a/src/third_party/ffmpeg/libavcodec/proresdsp.h b/src/third_party/ffmpeg/libavcodec/proresdsp.h index 37ba76b8..966ba3d7 100644 --- a/src/third_party/ffmpeg/libavcodec/proresdsp.h +++ b/src/third_party/ffmpeg/libavcodec/proresdsp.h @@ -25,7 +25,6 @@ #include #include -#include "avcodec.h" typedef struct ProresDSPContext { int idct_permutation_type; @@ -33,8 +32,8 @@ typedef struct ProresDSPContext { void (*idct_put)(uint16_t *out, ptrdiff_t linesize, int16_t *block, const int16_t *qmat); } ProresDSPContext; -int ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx); +int ff_proresdsp_init(ProresDSPContext *dsp, int bits_per_raw_sample); -void ff_proresdsp_init_x86(ProresDSPContext *dsp, AVCodecContext *avctx); +void ff_proresdsp_init_x86(ProresDSPContext *dsp, int bits_per_raw_sample); #endif /* AVCODEC_PRORESDSP_H */ diff --git a/src/third_party/ffmpeg/libavcodec/proresenc_anatoliy.c b/src/third_party/ffmpeg/libavcodec/proresenc_anatoliy.c index fc48c97d..e7114f16 100644 --- a/src/third_party/ffmpeg/libavcodec/proresenc_anatoliy.c +++ b/src/third_party/ffmpeg/libavcodec/proresenc_anatoliy.c @@ -32,7 +32,6 @@ #include "avcodec.h" #include "codec_internal.h" #include "encode.h" -#include "internal.h" #include "profiles.h" #include "proresdata.h" #include "put_bits.h" @@ -42,13 +41,13 @@ #define DEFAULT_SLICE_MB_WIDTH 8 static const AVProfile profiles[] = { - { FF_PROFILE_PRORES_PROXY, "apco"}, - { FF_PROFILE_PRORES_LT, "apcs"}, - { FF_PROFILE_PRORES_STANDARD, "apcn"}, - { FF_PROFILE_PRORES_HQ, "apch"}, - { FF_PROFILE_PRORES_4444, "ap4h"}, - { FF_PROFILE_PRORES_XQ, "ap4x"}, - { FF_PROFILE_UNKNOWN } + { AV_PROFILE_PRORES_PROXY, "apco"}, + { AV_PROFILE_PRORES_LT, "apcs"}, + { AV_PROFILE_PRORES_STANDARD, "apcn"}, + { AV_PROFILE_PRORES_HQ, "apch"}, + { AV_PROFILE_PRORES_4444, "ap4h"}, + { AV_PROFILE_PRORES_XQ, "ap4x"}, + { AV_PROFILE_UNKNOWN } }; static const int qp_start_table[] = { 8, 3, 2, 1, 1, 1}; @@ -198,6 +197,35 @@ typedef struct { char *vendor; } ProresContext; +/** + * Check if a value is in the list. If not, return the default value + * + * @param ctx Context for the log msg + * @param val_name Name of the checked value, for log msg + * @param array_valid_values Array of valid int, ended with INT_MAX + * @param default_value Value return if checked value is not in the array + * @return Value or default_value. + */ +static int int_from_list_or_default(void *ctx, const char *val_name, int val, + const int *array_valid_values, int default_value) +{ + int i = 0; + + while (1) { + int ref_val = array_valid_values[i]; + if (ref_val == INT_MAX) + break; + if (val == ref_val) + return val; + i++; + } + /* val is not a valid value */ + av_log(ctx, AV_LOG_DEBUG, + "%s %d are not supported. Set to default value : %d\n", + val_name, val, default_value); + return default_value; +} + static void encode_codeword(PutBitContext *pb, int val, int codebook) { unsigned int rice_order, exp_order, switch_bits, first_exp, exp, zeros; @@ -743,7 +771,7 @@ static int prores_encode_frame(AVCodecContext *avctx, AVPacket *pkt, bytestream_put_be16(&buf, avctx->width); bytestream_put_be16(&buf, avctx->height); frame_flags = 0x82; /* 422 not interlaced */ - if (avctx->profile >= FF_PROFILE_PRORES_4444) /* 4444 or 4444 Xq */ + if (avctx->profile >= AV_PROFILE_PRORES_4444) /* 4444 or 4444 Xq */ frame_flags |= 0x40; /* 444 chroma */ if (ctx->is_interlaced) { if ((pict->flags & AV_FRAME_FLAG_TOP_FIELD_FIRST) || !(pict->flags & AV_FRAME_FLAG_INTERLACED)) { @@ -761,10 +789,13 @@ static int prores_encode_frame(AVCodecContext *avctx, AVPacket *pkt, *buf++ = frame_flags; *buf++ = 0; /* reserved */ /* only write color properties, if valid value. set to unspecified otherwise */ - *buf++ = ff_int_from_list_or_default(avctx, "frame color primaries", pict->color_primaries, valid_primaries, 0); - *buf++ = ff_int_from_list_or_default(avctx, "frame color trc", pict->color_trc, valid_trc, 0); - *buf++ = ff_int_from_list_or_default(avctx, "frame colorspace", pict->colorspace, valid_colorspace, 0); - if (avctx->profile >= FF_PROFILE_PRORES_4444) { + *buf++ = int_from_list_or_default(avctx, "frame color primaries", + pict->color_primaries, valid_primaries, 0); + *buf++ = int_from_list_or_default(avctx, "frame color trc", + pict->color_trc, valid_trc, 0); + *buf++ = int_from_list_or_default(avctx, "frame colorspace", + pict->colorspace, valid_colorspace, 0); + if (avctx->profile >= AV_PROFILE_PRORES_4444) { if (avctx->pix_fmt == AV_PIX_FMT_YUV444P10) { *buf++ = 0xA0;/* src b64a and no alpha */ } else { @@ -840,40 +871,40 @@ static av_cold int prores_encode_init(AVCodecContext *avctx) return AVERROR(EINVAL); } - if (avctx->profile == FF_PROFILE_UNKNOWN) { + if (avctx->profile == AV_PROFILE_UNKNOWN) { if (avctx->pix_fmt == AV_PIX_FMT_YUV422P10) { - avctx->profile = FF_PROFILE_PRORES_STANDARD; + avctx->profile = AV_PROFILE_PRORES_STANDARD; av_log(avctx, AV_LOG_INFO, "encoding with ProRes standard (apcn) profile\n"); } else if (avctx->pix_fmt == AV_PIX_FMT_YUV444P10) { - avctx->profile = FF_PROFILE_PRORES_4444; + avctx->profile = AV_PROFILE_PRORES_4444; av_log(avctx, AV_LOG_INFO, "encoding with ProRes 4444 (ap4h) profile\n"); } else if (avctx->pix_fmt == AV_PIX_FMT_YUVA444P10) { - avctx->profile = FF_PROFILE_PRORES_4444; + avctx->profile = AV_PROFILE_PRORES_4444; av_log(avctx, AV_LOG_INFO, "encoding with ProRes 4444+ (ap4h) profile\n"); } - } else if (avctx->profile < FF_PROFILE_PRORES_PROXY - || avctx->profile > FF_PROFILE_PRORES_XQ) { + } else if (avctx->profile < AV_PROFILE_PRORES_PROXY + || avctx->profile > AV_PROFILE_PRORES_XQ) { av_log( avctx, AV_LOG_ERROR, "unknown profile %d, use [0 - apco, 1 - apcs, 2 - apcn (default), 3 - apch, 4 - ap4h, 5 - ap4x]\n", avctx->profile); return AVERROR(EINVAL); - } else if ((avctx->pix_fmt == AV_PIX_FMT_YUV422P10) && (avctx->profile > FF_PROFILE_PRORES_HQ)){ + } else if ((avctx->pix_fmt == AV_PIX_FMT_YUV422P10) && (avctx->profile > AV_PROFILE_PRORES_HQ)){ av_log(avctx, AV_LOG_ERROR, "encoding with ProRes 444/Xq (ap4h/ap4x) profile, need YUV444P10 input\n"); return AVERROR(EINVAL); } else if ((avctx->pix_fmt == AV_PIX_FMT_YUV444P10 || avctx->pix_fmt == AV_PIX_FMT_YUVA444P10) - && (avctx->profile < FF_PROFILE_PRORES_4444)){ + && (avctx->profile < AV_PROFILE_PRORES_4444)){ av_log(avctx, AV_LOG_ERROR, "encoding with ProRes Proxy/LT/422/422 HQ (apco, apcs, apcn, ap4h) profile, need YUV422P10 input\n"); return AVERROR(EINVAL); } - if (avctx->profile < FF_PROFILE_PRORES_4444) { /* 422 versions */ + if (avctx->profile < AV_PROFILE_PRORES_4444) { /* 422 versions */ ctx->is_422 = 1; if ((avctx->height & 0xf) || (avctx->width & 0xf)) { ctx->fill_y = av_malloc(4 * (DEFAULT_SLICE_MB_WIDTH << 8)); diff --git a/src/third_party/ffmpeg/libavcodec/pthread_frame.c b/src/third_party/ffmpeg/libavcodec/pthread_frame.c index bc305f56..13857677 100644 --- a/src/third_party/ffmpeg/libavcodec/pthread_frame.c +++ b/src/third_party/ffmpeg/libavcodec/pthread_frame.c @@ -31,6 +31,7 @@ #include "avcodec_internal.h" #include "codec_internal.h" #include "decode.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "internal.h" #include "pthread_internal.h" @@ -50,21 +51,11 @@ #include "libavutil/thread.h" enum { - ///< Set when the thread is awaiting a packet. + /// Set when the thread is awaiting a packet. STATE_INPUT_READY, - ///< Set before the codec has called ff_thread_finish_setup(). + /// Set before the codec has called ff_thread_finish_setup(). STATE_SETTING_UP, - /** - * Set when the codec calls get_buffer(). - * State is returned to STATE_SETTING_UP afterwards. - */ - STATE_GET_BUFFER, - /** - * Set when the codec calls get_format(). - * State is returned to STATE_SETTING_UP afterwards. - */ - STATE_GET_FORMAT, - ///< Set after the codec has called ff_thread_finish_setup(). + /// Set after the codec has called ff_thread_finish_setup(). STATE_SETUP_FINISHED, }; @@ -150,7 +141,7 @@ typedef struct FrameThreadContext { static int hwaccel_serial(const AVCodecContext *avctx) { - return avctx->hwaccel && !(avctx->hwaccel->caps_internal & HWACCEL_CAP_THREAD_SAFE); + return avctx->hwaccel && !(ffhwaccel(avctx->hwaccel)->caps_internal & HWACCEL_CAP_THREAD_SAFE); } static void async_lock(FrameThreadContext *fctx) @@ -245,7 +236,7 @@ static attribute_align_arg void *frame_worker_thread(void *arg) pthread_mutex_unlock(&p->parent->hwaccel_mutex); } av_assert0(!avctx->hwaccel || - (avctx->hwaccel->caps_internal & HWACCEL_CAP_THREAD_SAFE)); + (ffhwaccel(avctx->hwaccel)->caps_internal & HWACCEL_CAP_THREAD_SAFE)); if (p->async_serializing) { p->async_serializing = 0; @@ -274,7 +265,7 @@ static attribute_align_arg void *frame_worker_thread(void *arg) * @param for_user 0 if the destination is a codec thread, 1 if the destination is the user's thread * @return 0 on success, negative error code on failure */ -static int update_context_from_thread(AVCodecContext *dst, AVCodecContext *src, int for_user) +static int update_context_from_thread(AVCodecContext *dst, const AVCodecContext *src, int for_user) { const FFCodec *const codec = ffcodec(dst->codec); int err = 0; @@ -367,12 +358,13 @@ FF_ENABLE_DEPRECATION_WARNINGS // propagate hwaccel state for threadsafe hwaccels if (p_src->hwaccel_threadsafe) { + const FFHWAccel *hwaccel = ffhwaccel(src->hwaccel); if (!dst->hwaccel) { - if (src->hwaccel->priv_data_size) { - av_assert0(src->hwaccel->update_thread_context); + if (hwaccel->priv_data_size) { + av_assert0(hwaccel->update_thread_context); dst->internal->hwaccel_priv_data = - av_mallocz(src->hwaccel->priv_data_size); + av_mallocz(hwaccel->priv_data_size); if (!dst->internal->hwaccel_priv_data) return AVERROR(ENOMEM); } @@ -380,8 +372,8 @@ FF_ENABLE_DEPRECATION_WARNINGS } av_assert0(dst->hwaccel == src->hwaccel); - if (src->hwaccel->update_thread_context) { - err = src->hwaccel->update_thread_context(dst, src); + if (hwaccel->update_thread_context) { + err = hwaccel->update_thread_context(dst, src); if (err < 0) { av_log(dst, AV_LOG_ERROR, "Error propagating hwaccel state\n"); ff_hwaccel_uninit(dst); @@ -402,7 +394,7 @@ FF_ENABLE_DEPRECATION_WARNINGS * @param src The source context. * @return 0 on success, negative error code on failure */ -static int update_context_from_user(AVCodecContext *dst, AVCodecContext *src) +static int update_context_from_user(AVCodecContext *dst, const AVCodecContext *src) { int err; @@ -432,22 +424,6 @@ FF_ENABLE_DEPRECATION_WARNINGS FF_DISABLE_DEPRECATION_WARNINGS dst->reordered_opaque = src->reordered_opaque; FF_ENABLE_DEPRECATION_WARNINGS -#endif - -#if FF_API_SLICE_OFFSET -FF_DISABLE_DEPRECATION_WARNINGS - if (src->slice_count && src->slice_offset) { - if (dst->slice_count < src->slice_count) { - int err = av_reallocp_array(&dst->slice_offset, src->slice_count, - sizeof(*dst->slice_offset)); - if (err < 0) - return err; - } - memcpy(dst->slice_offset, src->slice_offset, - src->slice_count * sizeof(*dst->slice_offset)); - } - dst->slice_count = src->slice_count; -FF_ENABLE_DEPRECATION_WARNINGS #endif av_packet_unref(dst->internal->last_pkt_props); @@ -652,12 +628,14 @@ void ff_thread_await_progress(const ThreadFrame *f, int n, int field) } void ff_thread_finish_setup(AVCodecContext *avctx) { - PerThreadContext *p = avctx->internal->thread_ctx; + PerThreadContext *p; if (!(avctx->active_thread_type&FF_THREAD_FRAME)) return; + p = avctx->internal->thread_ctx; + p->hwaccel_threadsafe = avctx->hwaccel && - (avctx->hwaccel->caps_internal & HWACCEL_CAP_THREAD_SAFE); + (ffhwaccel(avctx->hwaccel)->caps_internal & HWACCEL_CAP_THREAD_SAFE); if (hwaccel_serial(avctx) && !p->hwaccel_serializing) { pthread_mutex_lock(&p->parent->hwaccel_mutex); @@ -666,7 +644,7 @@ void ff_thread_finish_setup(AVCodecContext *avctx) { /* this assumes that no hwaccel calls happen before ff_thread_finish_setup() */ if (avctx->hwaccel && - !(avctx->hwaccel->caps_internal & HWACCEL_CAP_ASYNC_SAFE)) { + !(ffhwaccel(avctx->hwaccel)->caps_internal & HWACCEL_CAP_ASYNC_SAFE)) { p->async_serializing = 1; async_lock(p->parent); @@ -762,12 +740,6 @@ void ff_frame_thread_free(AVCodecContext *avctx, int thread_count) av_freep(&ctx->priv_data); } -#if FF_API_SLICE_OFFSET -FF_DISABLE_DEPRECATION_WARNINGS - av_freep(&ctx->slice_offset); -FF_ENABLE_DEPRECATION_WARNINGS -#endif - av_buffer_unref(&ctx->internal->pool); av_packet_free(&ctx->internal->last_pkt_props); av_freep(&ctx->internal); @@ -964,11 +936,12 @@ void ff_thread_flush(AVCodecContext *avctx) int ff_thread_can_start_frame(AVCodecContext *avctx) { - PerThreadContext *p = avctx->internal->thread_ctx; - - if ((avctx->active_thread_type&FF_THREAD_FRAME) && atomic_load(&p->state) != STATE_SETTING_UP && + if ((avctx->active_thread_type & FF_THREAD_FRAME) && ffcodec(avctx->codec)->update_thread_context) { - return 0; + PerThreadContext *p = avctx->internal->thread_ctx; + + if (atomic_load(&p->state) != STATE_SETTING_UP) + return 0; } return 1; diff --git a/src/third_party/ffmpeg/libavcodec/qdm2_tablegen.h b/src/third_party/ffmpeg/libavcodec/qdm2_tablegen.h index a68ea859..6e174a78 100644 --- a/src/third_party/ffmpeg/libavcodec/qdm2_tablegen.h +++ b/src/third_party/ffmpeg/libavcodec/qdm2_tablegen.h @@ -116,9 +116,9 @@ static av_cold void build_vlc(VLC *vlc, int nb_bits, int nb_codes, { vlc->table = &qdm2_table[*offset]; vlc->table_allocated = FF_ARRAY_ELEMS(qdm2_table) - *offset; - ff_init_vlc_from_lengths(vlc, nb_bits, nb_codes, + ff_vlc_init_from_lengths(vlc, nb_bits, nb_codes, &tab[0][1], 2, &tab[0][0], 2, 1, - -1, INIT_VLC_STATIC_OVERLONG | INIT_VLC_LE, NULL); + -1, VLC_INIT_STATIC_OVERLONG | VLC_INIT_LE, NULL); *offset += vlc->table_size; } diff --git a/src/third_party/ffmpeg/libavcodec/qdmc.c b/src/third_party/ffmpeg/libavcodec/qdmc.c index 081c4dd4..474e5ef8 100644 --- a/src/third_party/ffmpeg/libavcodec/qdmc.c +++ b/src/third_party/ffmpeg/libavcodec/qdmc.c @@ -172,9 +172,9 @@ static av_cold void qdmc_init_static_data(void) static VLCElem vlc_buffer[13698]; vtable[i].table = &vlc_buffer[offset]; vtable[i].table_allocated = FF_ARRAY_ELEMS(vlc_buffer) - offset; - ff_init_vlc_from_lengths(&vtable[i], huff_bits[i], huff_sizes[i], + ff_vlc_init_from_lengths(&vtable[i], huff_bits[i], huff_sizes[i], &hufftab[0][1], 2, &hufftab[0][0], 2, 1, -1, - INIT_VLC_LE | INIT_VLC_STATIC_OVERLONG, NULL); + VLC_INIT_LE | VLC_INIT_STATIC_OVERLONG, NULL); hufftab += huff_sizes[i]; offset += vtable[i].table_size; } diff --git a/src/third_party/ffmpeg/libavcodec/qpeg.c b/src/third_party/ffmpeg/libavcodec/qpeg.c index 1f76ebc5..9b4ad8e2 100644 --- a/src/third_party/ffmpeg/libavcodec/qpeg.c +++ b/src/third_party/ffmpeg/libavcodec/qpeg.c @@ -307,8 +307,7 @@ FF_ENABLE_DEPRECATION_WARNINGS #endif memcpy(p->data[1], a->pal, AVPALETTE_SIZE); - av_frame_unref(ref); - if ((ret = av_frame_ref(ref, p)) < 0) + if ((ret = av_frame_replace(ref, p)) < 0) return ret; if (intra) diff --git a/src/third_party/ffmpeg/libavcodec/qsvenc.c b/src/third_party/ffmpeg/libavcodec/qsvenc.c index df63c182..a0144b07 100644 --- a/src/third_party/ffmpeg/libavcodec/qsvenc.c +++ b/src/third_party/ffmpeg/libavcodec/qsvenc.c @@ -21,12 +21,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "config_components.h" - #include #include #include +#include "libavutil/avassert.h" #include "libavutil/common.h" #include "libavutil/hwcontext.h" #include "libavutil/hwcontext_qsv.h" @@ -34,9 +33,9 @@ #include "libavutil/log.h" #include "libavutil/time.h" #include "libavutil/imgutils.h" -#include "libavcodec/bytestream.h" #include "avcodec.h" +#include "encode.h" #include "internal.h" #include "packet_internal.h" #include "qsv.h" @@ -1506,7 +1505,7 @@ static int qsv_retrieve_enc_params(AVCodecContext *avctx, QSVEncContext *q) } memset(avctx->extradata + avctx->extradata_size, 0, AV_INPUT_BUFFER_PADDING_SIZE); - cpb_props = ff_add_cpb_side_data(avctx); + cpb_props = ff_encode_add_cpb_side_data(avctx); if (!cpb_props) return AVERROR(ENOMEM); cpb_props->max_bitrate = avctx->rc_max_rate; @@ -1997,8 +1996,7 @@ static int submit_frame(QSVEncContext *q, const AVFrame *frame, return ret; } } else { - av_frame_unref(qf->frame); - ret = av_frame_ref(qf->frame, frame); + ret = av_frame_replace(qf->frame, frame); if (ret < 0) return ret; } @@ -2586,7 +2584,7 @@ int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext *q, pict_type = AV_PICTURE_TYPE_P; else if (qpkt.bs->FrameType & MFX_FRAMETYPE_B || qpkt.bs->FrameType & MFX_FRAMETYPE_xB) pict_type = AV_PICTURE_TYPE_B; - else if (qpkt.bs->FrameType == MFX_FRAMETYPE_UNKNOWN) { + else if (qpkt.bs->FrameType == MFX_FRAMETYPE_UNKNOWN && qpkt.bs->DataLength) { pict_type = AV_PICTURE_TYPE_NONE; av_log(avctx, AV_LOG_WARNING, "Unknown FrameType, set pict_type to AV_PICTURE_TYPE_NONE.\n"); } else { diff --git a/src/third_party/ffmpeg/libavcodec/qsvenc_hevc.c b/src/third_party/ffmpeg/libavcodec/qsvenc_hevc.c index 5e23ca96..c5b7ac7c 100644 --- a/src/third_party/ffmpeg/libavcodec/qsvenc_hevc.c +++ b/src/third_party/ffmpeg/libavcodec/qsvenc_hevc.c @@ -376,7 +376,7 @@ static const AVClass class = { static const FFCodecDefault qsv_enc_defaults[] = { { "b", "1M" }, { "refs", "0" }, - { "g", "-1" }, + { "g", "248" }, { "bf", "-1" }, { "qmin", "-1" }, { "qmax", "-1" }, diff --git a/src/third_party/ffmpeg/libavcodec/qtrleenc.c b/src/third_party/ffmpeg/libavcodec/qtrleenc.c index 38467627..92e6e843 100644 --- a/src/third_party/ffmpeg/libavcodec/qtrleenc.c +++ b/src/third_party/ffmpeg/libavcodec/qtrleenc.c @@ -385,8 +385,7 @@ static int qtrle_encode_frame(AVCodecContext *avctx, AVPacket *pkt, pkt->size = encode_frame(s, pict, pkt->data); /* save the current frame */ - av_frame_unref(s->previous_frame); - ret = av_frame_ref(s->previous_frame, pict); + ret = av_frame_replace(s->previous_frame, pict); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "cannot add reference\n"); return ret; diff --git a/src/third_party/ffmpeg/libavcodec/ralf.c b/src/third_party/ffmpeg/libavcodec/ralf.c index 591598d8..8f7fac79 100644 --- a/src/third_party/ffmpeg/libavcodec/ralf.c +++ b/src/third_party/ffmpeg/libavcodec/ralf.c @@ -99,7 +99,7 @@ static av_cold int init_ralf_vlc(VLC *vlc, const uint8_t *data, int elems) for (i = 0; i < elems; i++) codes[i] = prefixes[lens[i]]++; - return ff_init_vlc_sparse(vlc, FFMIN(max_bits, 9), elems, + return ff_vlc_init_sparse(vlc, FFMIN(max_bits, 9), elems, lens, 1, 1, codes, 2, 2, NULL, 0, 0, 0); } @@ -109,16 +109,16 @@ static av_cold int decode_close(AVCodecContext *avctx) int i, j, k; for (i = 0; i < 3; i++) { - ff_free_vlc(&ctx->sets[i].filter_params); - ff_free_vlc(&ctx->sets[i].bias); - ff_free_vlc(&ctx->sets[i].coding_mode); + ff_vlc_free(&ctx->sets[i].filter_params); + ff_vlc_free(&ctx->sets[i].bias); + ff_vlc_free(&ctx->sets[i].coding_mode); for (j = 0; j < 10; j++) for (k = 0; k < 11; k++) - ff_free_vlc(&ctx->sets[i].filter_coeffs[j][k]); + ff_vlc_free(&ctx->sets[i].filter_coeffs[j][k]); for (j = 0; j < 15; j++) - ff_free_vlc(&ctx->sets[i].short_codes[j]); + ff_vlc_free(&ctx->sets[i].short_codes[j]); for (j = 0; j < 125; j++) - ff_free_vlc(&ctx->sets[i].long_codes[j]); + ff_vlc_free(&ctx->sets[i].long_codes[j]); } return 0; diff --git a/src/third_party/ffmpeg/libavcodec/rasc.c b/src/third_party/ffmpeg/libavcodec/rasc.c index 4d057e80..21c1829f 100644 --- a/src/third_party/ffmpeg/libavcodec/rasc.c +++ b/src/third_party/ffmpeg/libavcodec/rasc.c @@ -379,8 +379,8 @@ static int decode_dlta(AVCodecContext *avctx, if (!s->frame2->data[0] || !s->frame1->data[0]) return AVERROR_INVALIDDATA; - b1 = s->frame1->data[0] + s->frame1->linesize[0] * (y + h - 1) + x * s->bpp; - b2 = s->frame2->data[0] + s->frame2->linesize[0] * (y + h - 1) + x * s->bpp; + b1 = s->frame1->data[0] + s->frame1->linesize[0] * (int)(y + h - 1) + ((int)x) * s->bpp; + b2 = s->frame2->data[0] + s->frame2->linesize[0] * (int)(y + h - 1) + ((int)x) * s->bpp; cx = 0, cy = h; while (bytestream2_get_bytes_left(&dc) > 0) { int type = bytestream2_get_byte(&dc); @@ -620,7 +620,7 @@ static void draw_cursor(AVCodecContext *avctx) if (cr == s->cursor[0] && cg == s->cursor[1] && cb == s->cursor[2]) continue; - dst = s->frame->data[0] + s->frame->linesize[0] * (s->cursor_y + i) + (s->cursor_x + j); + dst = s->frame->data[0] + s->frame->linesize[0] * (int)(s->cursor_y + i) + (int)(s->cursor_x + j); for (int k = 0; k < 256; k++) { int pr = pal[k * 4 + 0]; int pg = pal[k * 4 + 1]; @@ -646,7 +646,7 @@ static void draw_cursor(AVCodecContext *avctx) continue; cr >>= 3; cg >>=3; cb >>= 3; - dst = s->frame->data[0] + s->frame->linesize[0] * (s->cursor_y + i) + 2 * (s->cursor_x + j); + dst = s->frame->data[0] + s->frame->linesize[0] * (int)(s->cursor_y + i) + 2 * (s->cursor_x + j); AV_WL16(dst, cr | cg << 5 | cb << 10); } } @@ -660,7 +660,7 @@ static void draw_cursor(AVCodecContext *avctx) if (cr == s->cursor[0] && cg == s->cursor[1] && cb == s->cursor[2]) continue; - dst = s->frame->data[0] + s->frame->linesize[0] * (s->cursor_y + i) + 4 * (s->cursor_x + j); + dst = s->frame->data[0] + s->frame->linesize[0] * (int)(s->cursor_y + i) + 4 * (s->cursor_x + j); dst[0] = cb; dst[1] = cg; dst[2] = cr; diff --git a/src/third_party/ffmpeg/libavcodec/ratecontrol.c b/src/third_party/ffmpeg/libavcodec/ratecontrol.c index 649f570c..55ce0547 100644 --- a/src/third_party/ffmpeg/libavcodec/ratecontrol.c +++ b/src/third_party/ffmpeg/libavcodec/ratecontrol.c @@ -26,6 +26,7 @@ */ #include "libavutil/attributes.h" +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "avcodec.h" diff --git a/src/third_party/ffmpeg/libavcodec/raw.c b/src/third_party/ffmpeg/libavcodec/raw.c index 1e5b48d1..b73b80e5 100644 --- a/src/third_party/ffmpeg/libavcodec/raw.c +++ b/src/third_party/ffmpeg/libavcodec/raw.c @@ -206,6 +206,8 @@ static const PixelFormatTag raw_pix_fmt_tags[] = { { AV_PIX_FMT_GBRAP10BE, MKTAG(10 , 00 , '4', 'G') }, { AV_PIX_FMT_GBRAP12LE, MKTAG('G', '4', 00 , 12 ) }, { AV_PIX_FMT_GBRAP12BE, MKTAG(12 , 00 , '4', 'G') }, + { AV_PIX_FMT_GBRAP14LE, MKTAG('G', '4', 00 , 14 ) }, + { AV_PIX_FMT_GBRAP14BE, MKTAG(14 , 00 , '4', 'G') }, { AV_PIX_FMT_GBRAP16LE, MKTAG('G', '4', 00 , 16 ) }, { AV_PIX_FMT_GBRAP16BE, MKTAG(16 , 00 , '4', 'G') }, diff --git a/src/third_party/ffmpeg/libavcodec/riscv/Makefile b/src/third_party/ffmpeg/libavcodec/riscv/Makefile index ee17a521..77bba7f7 100644 --- a/src/third_party/ffmpeg/libavcodec/riscv/Makefile +++ b/src/third_party/ffmpeg/libavcodec/riscv/Makefile @@ -10,6 +10,8 @@ OBJS-$(CONFIG_BSWAPDSP) += riscv/bswapdsp_init.o \ RVV-OBJS-$(CONFIG_BSWAPDSP) += riscv/bswapdsp_rvv.o OBJS-$(CONFIG_FMTCONVERT) += riscv/fmtconvert_init.o RVV-OBJS-$(CONFIG_FMTCONVERT) += riscv/fmtconvert_rvv.o +OBJS-$(CONFIG_G722DSP) += riscv/g722dsp_init.o +RVV-OBJS-$(CONFIG_G722DSP) += riscv/g722dsp_rvv.o OBJS-$(CONFIG_H264CHROMA) += riscv/h264_chroma_init_riscv.o RVV-OBJS-$(CONFIG_H264CHROMA) += riscv/h264_mc_chroma.o OBJS-$(CONFIG_IDCTDSP) += riscv/idctdsp_init.o diff --git a/src/third_party/ffmpeg/libavcodec/riscv/aacpsdsp_rvv.S b/src/third_party/ffmpeg/libavcodec/riscv/aacpsdsp_rvv.S index b581383f..fe250cd8 100644 --- a/src/third_party/ffmpeg/libavcodec/riscv/aacpsdsp_rvv.S +++ b/src/third_party/ffmpeg/libavcodec/riscv/aacpsdsp_rvv.S @@ -38,14 +38,14 @@ endfunc func ff_ps_mul_pair_single_rvv, zve32f 1: - vsetvli t0, a3, e32, m1, ta, ma + vsetvli t0, a3, e32, m4, ta, ma vlseg2e32.v v24, (a1) sub a3, a3, t0 vle32.v v16, (a2) sh3add a1, t0, a1 vfmul.vv v24, v24, v16 sh2add a2, t0, a2 - vfmul.vv v25, v25, v16 + vfmul.vv v28, v28, v16 vsseg2e32.v v24, (a0) sh3add a0, t0, a0 bnez a3, 1b @@ -168,10 +168,10 @@ func ff_ps_hybrid_analysis_ileave_rvv, zve32x /* no needs for zve32f here */ mv t4, a4 addi a2, a2, 1 2: - vsetvli t5, t3, e32, m1, ta, ma + vsetvli t5, t3, e32, m4, ta, ma vlse32.v v16, (t1), t6 sub t3, t3, t5 - vlse32.v v17, (t4), t6 + vlse32.v v20, (t4), t6 mul t2, t5, t6 vsseg2e32.v v16, (t0) sh3add t0, t5, t0 @@ -203,12 +203,12 @@ func ff_ps_hybrid_synthesis_deint_rvv, zve32x mv t4, a4 addi a2, a2, 1 2: - vsetvli t5, t3, e32, m1, ta, ma + vsetvli t5, t3, e32, m4, ta, ma vlseg2e32.v v16, (t1) sub t3, t3, t5 vsse32.v v16, (t0), t6 mul t2, t5, t6 - vsse32.v v17, (t4), t6 + vsse32.v v20, (t4), t6 sh3add t1, t5, t1 add t0, t0, t2 add t4, t4, t2 @@ -223,7 +223,7 @@ func ff_ps_hybrid_synthesis_deint_rvv, zve32x endfunc func ff_ps_stereo_interpolate_rvv, zve32f - vsetvli t0, zero, e32, m1, ta, ma + vsetvli t0, zero, e32, m2, ta, ma vid.v v24 flw ft0, (a2) vadd.vi v24, v24, 1 // v24[i] = i + 1 @@ -232,47 +232,43 @@ func ff_ps_stereo_interpolate_rvv, zve32f flw ft2, 8(a2) vfmv.v.f v16, ft0 flw ft3, 12(a2) - vfmv.v.f v17, ft1 + vfmv.v.f v18, ft1 flw ft0, (a3) - vfmv.v.f v18, ft2 + vfmv.v.f v20, ft2 flw ft1, 4(a3) - vfmv.v.f v19, ft3 + vfmv.v.f v22, ft3 flw ft2, 8(a3) - vfmv.v.f v20, ft0 flw ft3, 12(a3) - vfmv.v.f v21, ft1 fcvt.s.wu ft4, t0 // (float)(vlenb / sizeof (float)) - vfmv.v.f v22, ft2 + vfmacc.vf v16, ft0, v24 // h0 += (i + 1) * h0_step fmul.s ft0, ft0, ft4 - vfmv.v.f v23, ft3 + vfmacc.vf v18, ft1, v24 fmul.s ft1, ft1, ft4 - vfmacc.vv v16, v24, v20 // h0 += (i + 1) * h0_step + vfmacc.vf v20, ft2, v24 fmul.s ft2, ft2, ft4 - vfmacc.vv v17, v24, v21 + vfmacc.vf v22, ft3, v24 fmul.s ft3, ft3, ft4 - vfmacc.vv v18, v24, v22 - vfmacc.vv v19, v24, v23 1: - vsetvli t0, a4, e32, m1, ta, ma - vlseg2e32.v v8, (a0) // v8:l_re, v9:l_im + vsetvli t0, a4, e32, m2, ta, ma + vlseg2e32.v v0, (a0) // v0:l_re, v2:l_im sub a4, a4, t0 - vlseg2e32.v v10, (a1) // v10:r_re, v11:r_im - vfmul.vv v12, v8, v16 - vfmul.vv v13, v9, v16 - vfmul.vv v14, v8, v17 - vfmul.vv v15, v9, v17 - vfmacc.vv v12, v10, v18 - vfmacc.vv v13, v11, v18 - vfmacc.vv v14, v10, v19 - vfmacc.vv v15, v11, v19 - vsseg2e32.v v12, (a0) + vlseg2e32.v v4, (a1) // v4:r_re, v6:r_im + vfmul.vv v8, v0, v16 + vfmul.vv v10, v2, v16 + vfmul.vv v12, v0, v18 + vfmul.vv v14, v2, v18 + vfmacc.vv v8, v4, v20 + vfmacc.vv v10, v6, v20 + vfmacc.vv v12, v4, v22 + vfmacc.vv v14, v6, v22 + vsseg2e32.v v8, (a0) sh3add a0, t0, a0 - vsseg2e32.v v14, (a1) + vsseg2e32.v v12, (a1) sh3add a1, t0, a1 vfadd.vf v16, v16, ft0 // h0 += (vlenb / sizeof (float)) * h0_step - vfadd.vf v17, v17, ft1 - vfadd.vf v18, v18, ft2 - vfadd.vf v19, v19, ft3 + vfadd.vf v18, v18, ft1 + vfadd.vf v20, v20, ft2 + vfadd.vf v22, v22, ft3 bnez a4, 1b ret diff --git a/src/third_party/ffmpeg/libavcodec/riscv/audiodsp_rvv.S b/src/third_party/ffmpeg/libavcodec/riscv/audiodsp_rvv.S index f7eba211..f0b23bab 100644 --- a/src/third_party/ffmpeg/libavcodec/riscv/audiodsp_rvv.S +++ b/src/third_party/ffmpeg/libavcodec/riscv/audiodsp_rvv.S @@ -42,7 +42,7 @@ endfunc func ff_vector_clip_int32_rvv, zve32x 1: - vsetvli t0, a4, e32, m1, ta, ma + vsetvli t0, a4, e32, m8, ta, ma vle32.v v8, (a1) sub a4, a4, t0 vmax.vx v8, v8, a2 @@ -59,7 +59,7 @@ func ff_vector_clipf_rvv, zve32f NOHWF fmv.w.x fa0, a3 NOHWF fmv.w.x fa1, a4 1: - vsetvli t0, a2, e32, m1, ta, ma + vsetvli t0, a2, e32, m8, ta, ma vle32.v v8, (a1) sub a2, a2, t0 vfmax.vf v8, v8, fa0 diff --git a/src/third_party/ffmpeg/libavcodec/riscv/bswapdsp_rvb.S b/src/third_party/ffmpeg/libavcodec/riscv/bswapdsp_rvb.S index 91b47bf8..0786bd3f 100644 --- a/src/third_party/ffmpeg/libavcodec/riscv/bswapdsp_rvb.S +++ b/src/third_party/ffmpeg/libavcodec/riscv/bswapdsp_rvb.S @@ -20,49 +20,10 @@ #include "config.h" #include "libavutil/riscv/asm.S" +#include "libavutil/riscv/bswap_rvb.S" #if (__riscv_xlen >= 64) func ff_bswap32_buf_rvb, zbb - andi t0, a1, 4 - beqz t0, 1f - /* Align a1 (input) to 64-bit */ - lwu t0, (a1) - addi a0, a0, 4 - rev8 t0, t0 - addi a2, a2, -1 - srli t0, t0, __riscv_xlen - 32 - addi a1, a1, 4 - sw t0, -4(a0) -1: - andi a3, a2, -2 - sh2add a2, a2, a0 - beqz a3, 3f - sh2add a3, a3, a0 -2: /* 2 elements (64 bits) at a time on a 64-bit boundary */ - ld t0, (a1) - addi a0, a0, 8 - rev8 t0, t0 -#if (__riscv_xlen == 64) - srli t2, t0, 32 - sw t0, -4(a0) -#else - srli t1, t0, __riscv_xlen - 64 - srli t2, t0, __riscv_xlen - 32 - sw t1, -4(a0) -#endif - addi a1, a1, 8 - sw t2, -8(a0) - bne a0, a3, 2b -3: - beq a0, a2, 5f -4: /* Process last element */ - lwu t0, (a1) - addi a0, a0, 4 - rev8 t0, t0 - addi a1, a1, 4 - srli t0, t0, __riscv_xlen - 32 - sw t0, -4(a0) -5: - ret + bswap32_rvb a0, a1, a2 endfunc #endif diff --git a/src/third_party/ffmpeg/libavcodec/riscv/fmtconvert_rvv.S b/src/third_party/ffmpeg/libavcodec/riscv/fmtconvert_rvv.S index 51365753..d0e2f106 100644 --- a/src/third_party/ffmpeg/libavcodec/riscv/fmtconvert_rvv.S +++ b/src/third_party/ffmpeg/libavcodec/riscv/fmtconvert_rvv.S @@ -24,7 +24,7 @@ func ff_int32_to_float_fmul_scalar_rvv, zve32f NOHWF fmv.w.x fa0, a2 NOHWF mv a2, a3 1: - vsetvli t0, a2, e32, m1, ta, ma + vsetvli t0, a2, e32, m8, ta, ma vle32.v v24, (a1) sub a2, a2, t0 vfcvt.f.x.v v24, v24 diff --git a/src/third_party/ffmpeg/libavcodec/riscv/g722dsp_init.c b/src/third_party/ffmpeg/libavcodec/riscv/g722dsp_init.c new file mode 100644 index 00000000..77e29bfb --- /dev/null +++ b/src/third_party/ffmpeg/libavcodec/riscv/g722dsp_init.c @@ -0,0 +1,40 @@ +/* + * Copyright © 2023 Rémi Denis-Courmont. + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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 + +#include "libavutil/attributes.h" +#include "libavutil/cpu.h" +#include "libavutil/riscv/cpu.h" +#include "libavcodec/g722dsp.h" + +extern void ff_g722_apply_qmf_rvv(const int16_t *prev_samples, int xout[2]); + +av_cold void ff_g722dsp_init_riscv(G722DSPContext *dsp) +{ +#if HAVE_RVV + int flags = av_get_cpu_flags(); + + if ((flags & AV_CPU_FLAG_RVV_I32) && ff_get_rv_vlenb() >= 16) + dsp->apply_qmf = ff_g722_apply_qmf_rvv; +#endif +} diff --git a/src/third_party/ffmpeg/libavcodec/riscv/g722dsp_rvv.S b/src/third_party/ffmpeg/libavcodec/riscv/g722dsp_rvv.S new file mode 100644 index 00000000..350be8dc --- /dev/null +++ b/src/third_party/ffmpeg/libavcodec/riscv/g722dsp_rvv.S @@ -0,0 +1,66 @@ +/* + * Copyright © 2023 Rémi Denis-Courmont. + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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/riscv/asm.S" + +func ff_g722_apply_qmf_rvv, zve32x + lla t0, qmf_coeffs + vsetivli zero, 12, e16, m2, ta, ma + vlseg2e16.v v28, (a0) + vlseg2e16.v v24, (t0) + vwmul.vv v16, v28, v24 + vwmul.vv v20, v30, v26 + vsetivli zero, 12, e32, m4, ta, ma + vmv.s.x v10, zero + vredsum.vs v8, v16, v10 + vredsum.vs v9, v20, v10 + vmv.x.s t0, v8 + vmv.x.s t1, v9 + sw t0, 4(a1) + sw t1, 0(a1) + ret +endfunc + +const qmf_coeffs, align=2 + .short 3 + .short -11 + .short -11 + .short 53 + .short 12 + .short -156 + .short 32 + .short 362 + .short -210 + .short -805 + .short 951 + .short 3876 + .short 3876 + .short 951 + .short -805 + .short -210 + .short 362 + .short 32 + .short -156 + .short 12 + .short 53 + .short -11 + .short -11 + .short 3 +endconst diff --git a/src/third_party/ffmpeg/libavcodec/riscv/h264_chroma_init_riscv.c b/src/third_party/ffmpeg/libavcodec/riscv/h264_chroma_init_riscv.c index f3e91282..e6fe5f6e 100644 --- a/src/third_party/ffmpeg/libavcodec/riscv/h264_chroma_init_riscv.c +++ b/src/third_party/ffmpeg/libavcodec/riscv/h264_chroma_init_riscv.c @@ -27,6 +27,10 @@ void h264_put_chroma_mc8_rvv(uint8_t *p_dst, const uint8_t *p_src, ptrdiff_t stride, int h, int x, int y); void h264_avg_chroma_mc8_rvv(uint8_t *p_dst, const uint8_t *p_src, ptrdiff_t stride, int h, int x, int y); +void h264_put_chroma_mc4_rvv(uint8_t *p_dst, const uint8_t *p_src, ptrdiff_t stride, int h, int x, int y); +void h264_avg_chroma_mc4_rvv(uint8_t *p_dst, const uint8_t *p_src, ptrdiff_t stride, int h, int x, int y); +void h264_put_chroma_mc2_rvv(uint8_t *p_dst, const uint8_t *p_src, ptrdiff_t stride, int h, int x, int y); +void h264_avg_chroma_mc2_rvv(uint8_t *p_dst, const uint8_t *p_src, ptrdiff_t stride, int h, int x, int y); av_cold void ff_h264chroma_init_riscv(H264ChromaContext *c, int bit_depth) { @@ -37,6 +41,10 @@ av_cold void ff_h264chroma_init_riscv(H264ChromaContext *c, int bit_depth) (flags & AV_CPU_FLAG_RVB_ADDR) && ff_get_rv_vlenb() >= 16) { c->put_h264_chroma_pixels_tab[0] = h264_put_chroma_mc8_rvv; c->avg_h264_chroma_pixels_tab[0] = h264_avg_chroma_mc8_rvv; + c->put_h264_chroma_pixels_tab[1] = h264_put_chroma_mc4_rvv; + c->avg_h264_chroma_pixels_tab[1] = h264_avg_chroma_mc4_rvv; + c->put_h264_chroma_pixels_tab[2] = h264_put_chroma_mc2_rvv; + c->avg_h264_chroma_pixels_tab[2] = h264_avg_chroma_mc2_rvv; } #endif } diff --git a/src/third_party/ffmpeg/libavcodec/riscv/h264_mc_chroma.S b/src/third_party/ffmpeg/libavcodec/riscv/h264_mc_chroma.S index 364bc315..ce99bda4 100644 --- a/src/third_party/ffmpeg/libavcodec/riscv/h264_mc_chroma.S +++ b/src/third_party/ffmpeg/libavcodec/riscv/h264_mc_chroma.S @@ -19,8 +19,7 @@ */ #include "libavutil/riscv/asm.S" -.macro h264_chroma_mc8 type -func h264_\type\()_chroma_mc8_rvv, zve32x +.macro do_chroma_mc type unroll csrw vxrm, zero slli t2, a5, 3 mul t1, a5, a4 @@ -30,94 +29,100 @@ func h264_\type\()_chroma_mc8_rvv, zve32x sub a7, a4, t1 addi a6, a5, 64 sub t0, t2, t1 - vsetivli t3, 8, e8, m1, ta, mu + vsetvli t3, t6, e8, m1, ta, mu beqz t1, 2f blez a3, 8f li t4, 0 li t2, 0 li t5, 1 addi a5, t3, 1 - slli t3, a2, 2 + slli t3, a2, (1 + \unroll) 1: # if (xy != 0) add a4, a1, t4 vsetvli zero, a5, e8, m1, ta, ma + .ifc \unroll,1 addi t2, t2, 4 + .else + addi t2, t2, 2 + .endif vle8.v v10, (a4) add a4, a4, a2 vslide1down.vx v11, v10, t5 - vsetivli zero, 8, e8, m1, ta, ma + vsetvli zero, t6, e8, m1, ta, ma vwmulu.vx v8, v10, a6 vwmaccu.vx v8, a7, v11 vsetvli zero, a5, e8, m1, ta, ma vle8.v v12, (a4) - vsetivli zero, 8, e8, m1, ta, ma + vsetvli zero, t6, e8, m1, ta, ma add a4, a4, a2 vwmaccu.vx v8, t0, v12 vsetvli zero, a5, e8, m1, ta, ma vslide1down.vx v13, v12, t5 - vsetivli zero, 8, e8, m1, ta, ma + vsetvli zero, t6, e8, m1, ta, ma vwmulu.vx v10, v12, a6 vwmaccu.vx v8, t1, v13 vwmaccu.vx v10, a7, v13 vsetvli zero, a5, e8, m1, ta, ma vle8.v v14, (a4) - vsetivli zero, 8, e8, m1, ta, ma + vsetvli zero, t6, e8, m1, ta, ma add a4, a4, a2 vwmaccu.vx v10, t0, v14 vsetvli zero, a5, e8, m1, ta, ma vslide1down.vx v15, v14, t5 - vsetivli zero, 8, e8, m1, ta, ma + vsetvli zero, t6, e8, m1, ta, ma vwmulu.vx v12, v14, a6 vwmaccu.vx v10, t1, v15 vwmaccu.vx v12, a7, v15 + vnclipu.wi v15, v8, 6 + .ifc \type,avg + vle8.v v9, (a0) + vaaddu.vv v15, v15, v9 + .endif + vse8.v v15, (a0) + add a0, a0, a2 + vnclipu.wi v8, v10, 6 + .ifc \type,avg + vle8.v v9, (a0) + vaaddu.vv v8, v8, v9 + .endif + add t4, t4, t3 + vse8.v v8, (a0) + add a0, a0, a2 + .ifc \unroll,1 vsetvli zero, a5, e8, m1, ta, ma vle8.v v14, (a4) - vsetivli zero, 8, e8, m1, ta, ma + vsetvli zero, t6, e8, m1, ta, ma add a4, a4, a2 vwmaccu.vx v12, t0, v14 vsetvli zero, a5, e8, m1, ta, ma vslide1down.vx v15, v14, t5 - vsetivli zero, 8, e8, m1, ta, ma + vsetvli zero, t6, e8, m1, ta, ma vwmulu.vx v16, v14, a6 vwmaccu.vx v12, t1, v15 vwmaccu.vx v16, a7, v15 vsetvli zero, a5, e8, m1, ta, ma vle8.v v14, (a4) - vsetivli zero, 8, e8, m1, ta, ma - add a4, a0, t4 - add t4, t4, t3 + vsetvli zero, t6, e8, m1, ta, ma vwmaccu.vx v16, t0, v14 vsetvli zero, a5, e8, m1, ta, ma vslide1down.vx v14, v14, t5 - vsetivli zero, 8, e8, m1, ta, ma - vnclipu.wi v15, v8, 6 + vsetvli zero, t6, e8, m1, ta, ma vwmaccu.vx v16, t1, v14 - .ifc \type,avg - vle8.v v9, (a4) - vaaddu.vv v15, v15, v9 - .endif - vse8.v v15, (a4) - add a4, a4, a2 - vnclipu.wi v8, v10, 6 - .ifc \type,avg - vle8.v v9, (a4) - vaaddu.vv v8, v8, v9 - .endif - vse8.v v8, (a4) - add a4, a4, a2 vnclipu.wi v8, v12, 6 .ifc \type,avg - vle8.v v9, (a4) + vle8.v v9, (a0) vaaddu.vv v8, v8, v9 .endif - vse8.v v8, (a4) - add a4, a4, a2 + vse8.v v8, (a0) + add a0, a0, a2 vnclipu.wi v8, v16, 6 .ifc \type,avg - vle8.v v9, (a4) + vle8.v v9, (a0) vaaddu.vv v8, v8, v9 .endif - vse8.v v8, (a4) + vse8.v v8, (a0) + add a0, a0, a2 + .endif blt t2, a3, 1b j 8f 2: @@ -126,11 +131,15 @@ func h264_\type\()_chroma_mc8_rvv, zve32x blez a3, 8f li a4, 0 li t1, 0 - slli a7, a2, 2 + slli a7, a2, (1 + \unroll) 3: # if ((x8 - xy) == 0 && (y8 -xy) != 0) add a5, a1, a4 vsetvli zero, zero, e8, m1, ta, ma + .ifc \unroll,1 addi t1, t1, 4 + .else + addi t1, t1, 2 + .endif vle8.v v8, (a5) add a5, a5, a2 add t2, a5, a2 @@ -141,42 +150,44 @@ func h264_\type\()_chroma_mc8_rvv, zve32x add t2, t2, a2 add a5, t2, a2 vwmaccu.vx v10, t0, v8 - vle8.v v8, (t2) - vle8.v v14, (a5) - add a5, a0, a4 add a4, a4, a7 vwmaccu.vx v12, t0, v9 vnclipu.wi v15, v10, 6 vwmulu.vx v10, v9, a6 + vnclipu.wi v9, v12, 6 .ifc \type,avg - vle8.v v16, (a5) + vle8.v v16, (a0) vaaddu.vv v15, v15, v16 .endif - vse8.v v15, (a5) - add a5, a5, a2 - vnclipu.wi v9, v12, 6 - vwmaccu.vx v10, t0, v8 - vwmulu.vx v12, v8, a6 + vse8.v v15, (a0) + add a0, a0, a2 .ifc \type,avg - vle8.v v16, (a5) + vle8.v v16, (a0) vaaddu.vv v9, v9, v16 .endif - vse8.v v9, (a5) - add a5, a5, a2 + vse8.v v9, (a0) + add a0, a0, a2 + .ifc \unroll,1 + vle8.v v8, (t2) + vle8.v v14, (a5) + vwmaccu.vx v10, t0, v8 + vwmulu.vx v12, v8, a6 vnclipu.wi v8, v10, 6 vwmaccu.vx v12, t0, v14 .ifc \type,avg - vle8.v v16, (a5) + vle8.v v16, (a0) vaaddu.vv v8, v8, v16 .endif - vse8.v v8, (a5) - add a5, a5, a2 + vse8.v v8, (a0) + add a0, a0, a2 vnclipu.wi v8, v12, 6 .ifc \type,avg - vle8.v v16, (a5) + vle8.v v16, (a0) vaaddu.vv v8, v8, v16 .endif - vse8.v v8, (a5) + vse8.v v8, (a0) + add a0, a0, a2 + .endif blt t1, a3, 3b j 8f 4: @@ -186,87 +197,95 @@ func h264_\type\()_chroma_mc8_rvv, zve32x li a4, 0 li t2, 0 addi t0, t3, 1 - slli t1, a2, 2 + slli t1, a2, (1 + \unroll) 5: # if ((x8 - xy) != 0 && (y8 -xy) == 0) add a5, a1, a4 vsetvli zero, t0, e8, m1, ta, ma + .ifc \unroll,1 addi t2, t2, 4 + .else + addi t2, t2, 2 + .endif vle8.v v8, (a5) add a5, a5, a2 vslide1down.vx v9, v8, t5 - vsetivli zero, 8, e8, m1, ta, ma + vsetvli zero, t6, e8, m1, ta, ma vwmulu.vx v10, v8, a6 vwmaccu.vx v10, a7, v9 vsetvli zero, t0, e8, m1, ta, ma vle8.v v8, (a5) add a5, a5, a2 vslide1down.vx v9, v8, t5 - vsetivli zero, 8, e8, m1, ta, ma + vsetvli zero, t6, e8, m1, ta, ma vwmulu.vx v12, v8, a6 vwmaccu.vx v12, a7, v9 + vnclipu.wi v16, v10, 6 + .ifc \type,avg + vle8.v v18, (a0) + vaaddu.vv v16, v16, v18 + .endif + vse8.v v16, (a0) + add a0, a0, a2 + vnclipu.wi v10, v12, 6 + .ifc \type,avg + vle8.v v18, (a0) + vaaddu.vv v10, v10, v18 + .endif + add a4, a4, t1 + vse8.v v10, (a0) + add a0, a0, a2 + .ifc \unroll,1 vsetvli zero, t0, e8, m1, ta, ma vle8.v v8, (a5) add a5, a5, a2 vslide1down.vx v9, v8, t5 - vsetivli zero, 8, e8, m1, ta, ma + vsetvli zero, t6, e8, m1, ta, ma vwmulu.vx v14, v8, a6 vwmaccu.vx v14, a7, v9 vsetvli zero, t0, e8, m1, ta, ma vle8.v v8, (a5) - add a5, a0, a4 - add a4, a4, t1 vslide1down.vx v9, v8, t5 - vsetivli zero, 8, e8, m1, ta, ma - vnclipu.wi v16, v10, 6 - .ifc \type,avg - vle8.v v18, (a5) - vaaddu.vv v16, v16, v18 - .endif - vse8.v v16, (a5) - add a5, a5, a2 - vnclipu.wi v10, v12, 6 + vsetvli zero, t6, e8, m1, ta, ma vwmulu.vx v12, v8, a6 - .ifc \type,avg - vle8.v v18, (a5) - vaaddu.vv v10, v10, v18 - .endif - vse8.v v10, (a5) - add a5, a5, a2 vnclipu.wi v8, v14, 6 vwmaccu.vx v12, a7, v9 .ifc \type,avg - vle8.v v18, (a5) + vle8.v v18, (a0) vaaddu.vv v8, v8, v18 .endif - vse8.v v8, (a5) - add a5, a5, a2 + vse8.v v8, (a0) + add a0, a0, a2 vnclipu.wi v8, v12, 6 .ifc \type,avg - vle8.v v18, (a5) + vle8.v v18, (a0) vaaddu.vv v8, v8, v18 .endif - vse8.v v8, (a5) + vse8.v v8, (a0) + add a0, a0, a2 + .endif blt t2, a3, 5b j 8f 6: blez a3, 8f li a4, 0 li t2, 0 - slli a7, a2, 2 + slli a7, a2, (1 + \unroll) 7: # the final else, none of the above conditions are met add t0, a1, a4 vsetvli zero, zero, e8, m1, ta, ma add a5, a0, a4 add a4, a4, a7 + .ifc \unroll,1 addi t2, t2, 4 + .else + addi t2, t2, 2 + .endif vle8.v v8, (t0) add t0, t0, a2 add t1, t0, a2 vwmulu.vx v10, v8, a6 vle8.v v8, (t0) add t0, t1, a2 - vle8.v v9, (t1) - vle8.v v12, (t0) vnclipu.wi v13, v10, 6 vwmulu.vx v10, v8, a6 .ifc \type,avg @@ -276,13 +295,16 @@ func h264_\type\()_chroma_mc8_rvv, zve32x vse8.v v13, (a5) add a5, a5, a2 vnclipu.wi v8, v10, 6 - vwmulu.vx v10, v9, a6 .ifc \type,avg vle8.v v18, (a5) vaaddu.vv v8, v8, v18 .endif vse8.v v8, (a5) add a5, a5, a2 + .ifc \unroll,1 + vle8.v v9, (t1) + vle8.v v12, (t0) + vwmulu.vx v10, v9, a6 vnclipu.wi v8, v10, 6 vwmulu.vx v10, v12, a6 .ifc \type,avg @@ -297,11 +319,56 @@ func h264_\type\()_chroma_mc8_rvv, zve32x vaaddu.vv v8, v8, v18 .endif vse8.v v8, (a5) + .endif blt t2, a3, 7b 8: ret -endfunc .endm -h264_chroma_mc8 put -h264_chroma_mc8 avg +func h264_put_chroma_mc_rvv, zve32x +11: + li a7, 3 + blt a3, a7, 12f + do_chroma_mc put 1 +12: + do_chroma_mc put 0 +endfunc + +func h264_avg_chroma_mc_rvv, zve32x +21: + li a7, 3 + blt a3, a7, 22f + do_chroma_mc avg 1 +22: + do_chroma_mc avg 0 +endfunc + +func h264_put_chroma_mc8_rvv, zve32x + li t6, 8 + j 11b +endfunc + +func h264_put_chroma_mc4_rvv, zve32x + li t6, 4 + j 11b +endfunc + +func h264_put_chroma_mc2_rvv, zve32x + li t6, 2 + j 11b +endfunc + +func h264_avg_chroma_mc8_rvv, zve32x + li t6, 8 + j 21b +endfunc + +func h264_avg_chroma_mc4_rvv, zve32x + li t6, 4 + j 21b +endfunc + +func h264_avg_chroma_mc2_rvv, zve32x + li t6, 2 + j 21b +endfunc diff --git a/src/third_party/ffmpeg/libavcodec/rka.c b/src/third_party/ffmpeg/libavcodec/rka.c index d56f4fae..724107f3 100644 --- a/src/third_party/ffmpeg/libavcodec/rka.c +++ b/src/third_party/ffmpeg/libavcodec/rka.c @@ -59,8 +59,8 @@ typedef struct AdaptiveModel { } AdaptiveModel; typedef struct ChContext { - int cmode; - int cmode2; + int qfactor; + int vrq; int last_nb_decoded; unsigned srate_pad; unsigned pos_idx; @@ -131,7 +131,7 @@ static void adaptive_model_free(AdaptiveModel *am) static av_cold int rka_decode_init(AVCodecContext *avctx) { RKAContext *s = avctx->priv_data; - int cmode; + int qfactor; if (avctx->extradata_size < 16) return AVERROR_INVALIDDATA; @@ -160,14 +160,18 @@ static av_cold int rka_decode_init(AVCodecContext *avctx) s->last_nb_samples = s->total_nb_samples % s->frame_samples; s->correlated = avctx->extradata[15] & 1; - cmode = avctx->extradata[14] & 0xf; + qfactor = avctx->extradata[14] & 0xf; if ((avctx->extradata[15] & 4) != 0) - cmode = -cmode; + qfactor = -qfactor; - s->ch[0].cmode = s->ch[1].cmode = cmode < 0 ? 2 : cmode; - s->ch[0].cmode2 = cmode < 0 ? FFABS(cmode) : 0; - s->ch[1].cmode2 = cmode < 0 ? FFABS(cmode) : 0; - av_log(avctx, AV_LOG_DEBUG, "cmode: %d\n", cmode); + s->ch[0].qfactor = s->ch[1].qfactor = qfactor < 0 ? 2 : qfactor; + s->ch[0].vrq = qfactor < 0 ? -qfactor : 0; + s->ch[1].vrq = qfactor < 0 ? -qfactor : 0; + if (qfactor < 0) { + s->ch[0].vrq = av_clip(s->ch[0].vrq, 1, 8); + s->ch[1].vrq = av_clip(s->ch[1].vrq, 1, 8); + } + av_log(avctx, AV_LOG_DEBUG, "qfactor: %d\n", qfactor); return 0; } @@ -665,18 +669,16 @@ static int mdl64_decode(ACoder *ac, Model64 *ctx, int *dst) return 0; } -static const uint8_t tab[16] = { - 0, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 -}; +static const uint8_t vrq_qfactors[8] = { 3, 3, 2, 2, 1, 1, 1, 1 }; static int decode_filter(RKAContext *s, ChContext *ctx, ACoder *ac, int off, unsigned size) { FiltCoeffs filt; Model64 *mdl64; - int m = 0, split, val, last_val = 0, ret; - unsigned idx = 3, bits = 0; + int split, val, last_val = 0, ret; + unsigned rsize, idx = 3, bits = 0, m = 0; - if (ctx->cmode == 0) { + if (ctx->qfactor == 0) { if (amdl_decode_int(&ctx->fshift, ac, &bits, 15) < 0) return -1; bits &= 31U; @@ -698,10 +700,12 @@ static int decode_filter(RKAContext *s, ChContext *ctx, ACoder *ac, int off, uns if (amdl_decode_int(&ctx->position, ac, &idx, 10) < 0) return -1; + m = 0; idx = (ctx->pos_idx + idx) % 11; ctx->pos_idx = idx; - for (int y = 0; y < FFMIN(split, size - x); y++, off++) { + rsize = FFMIN(split, size - x); + for (int y = 0; y < rsize; y++, off++) { int midx, shift = idx, *src, sum = 16; if (off >= FF_ARRAY_ELEMS(ctx->buf0)) @@ -728,7 +732,7 @@ static int decode_filter(RKAContext *s, ChContext *ctx, ACoder *ac, int off, uns for (int i = 15; i < filt.size; i++) sum += filt.coeffs[i] * (unsigned)src[-i]; sum = sum >> 6; - if (ctx->cmode == 0) { + if (ctx->qfactor == 0) { if (bits == 0) { ctx->buf1[off] = sum + val; } else { @@ -737,7 +741,7 @@ static int decode_filter(RKAContext *s, ChContext *ctx, ACoder *ac, int off, uns } ctx->buf0[off] = ctx->buf1[off] + (unsigned)ctx->buf0[off + -1]; } else { - val *= 1U << ctx->cmode; + val *= 1U << ctx->qfactor; sum += ctx->buf0[off + -1] + (unsigned)val; switch (s->bps) { case 16: sum = av_clip_int16(sum); break; @@ -745,15 +749,15 @@ static int decode_filter(RKAContext *s, ChContext *ctx, ACoder *ac, int off, uns } ctx->buf1[off] = sum - ctx->buf0[off + -1]; ctx->buf0[off] = sum; - m += FFABS(ctx->buf1[off]); + m += (unsigned)FFABS(ctx->buf1[off]); } } - if (ctx->cmode2 != 0) { + if (ctx->vrq != 0) { int sum = 0; - for (int i = (signed)((unsigned)m << 6) / split; i > 0; i = i >> 1) + for (unsigned i = (m << 6) / rsize; i > 0; i = i >> 1) sum++; - sum = sum - (ctx->cmode2 + 7); - ctx->cmode = FFMAX(sum, tab[ctx->cmode2]); + sum -= (ctx->vrq + 7); + ctx->qfactor = FFMAX(sum, vrq_qfactors[ctx->vrq - 1]); } x += split; @@ -949,6 +953,10 @@ static int rka_decode_frame(AVCodecContext *avctx, AVFrame *frame, } } + if (frame->nb_samples < s->frame_samples && + frame->nb_samples > s->last_nb_samples) + frame->nb_samples = s->last_nb_samples; + *got_frame_ptr = 1; return avpkt->size; diff --git a/src/third_party/ffmpeg/libavcodec/rl.c b/src/third_party/ffmpeg/libavcodec/rl.c index 3f8271d3..a78242d4 100644 --- a/src/third_party/ffmpeg/libavcodec/rl.c +++ b/src/third_party/ffmpeg/libavcodec/rl.c @@ -82,7 +82,9 @@ av_cold void ff_rl_init_vlc(RLTable *rl, unsigned static_size) VLCElem table[1500] = { 0 }; VLC vlc = { .table = table, .table_allocated = static_size }; av_assert0(static_size <= FF_ARRAY_ELEMS(table)); - init_vlc(&vlc, 9, rl->n + 1, &rl->table_vlc[0][1], 4, 2, &rl->table_vlc[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC); + vlc_init(&vlc, 9, rl->n + 1, + &rl->table_vlc[0][1], 4, 2, + &rl->table_vlc[0][0], 4, 2, VLC_INIT_USE_STATIC); for (q = 0; q < 32; q++) { int qmul = q * 2; diff --git a/src/third_party/ffmpeg/libavcodec/rl.h b/src/third_party/ffmpeg/libavcodec/rl.h index 4380fda2..c45d8659 100644 --- a/src/third_party/ffmpeg/libavcodec/rl.h +++ b/src/third_party/ffmpeg/libavcodec/rl.h @@ -80,7 +80,7 @@ void ff_rl_init(RLTable *rl, uint8_t static_store[2][2*MAX_RUN + MAX_LEVEL + 3]) */ void ff_rl_init_vlc(RLTable *rl, unsigned static_size); -#define INIT_VLC_RL(rl, static_size)\ +#define VLC_INIT_RL(rl, static_size)\ {\ static RL_VLC_ELEM rl_vlc_table[32][static_size];\ \ diff --git a/src/third_party/ffmpeg/libavcodec/roqvideo.c b/src/third_party/ffmpeg/libavcodec/roqvideo.c index f9a3c8e0..ca8c8de9 100644 --- a/src/third_party/ffmpeg/libavcodec/roqvideo.c +++ b/src/third_party/ffmpeg/libavcodec/roqvideo.c @@ -111,13 +111,13 @@ static inline void apply_motion_generic(RoqContext *ri, int x, int y, int deltax /* check MV against frame boundaries */ if ((mx < 0) || (mx > ri->width - sz) || (my < 0) || (my > ri->height - sz)) { - av_log(ri->avctx, AV_LOG_ERROR, "motion vector out of bounds: MV = (%d, %d), boundaries = (0, 0, %d, %d)\n", + av_log(ri->logctx, AV_LOG_ERROR, "motion vector out of bounds: MV = (%d, %d), boundaries = (0, 0, %d, %d)\n", mx, my, ri->width, ri->height); return; } if (!ri->last_frame->data[0]) { - av_log(ri->avctx, AV_LOG_ERROR, "Invalid decode type. Invalid header?\n"); + av_log(ri->logctx, AV_LOG_ERROR, "Invalid decode type. Invalid header?\n"); return; } diff --git a/src/third_party/ffmpeg/libavcodec/roqvideo.h b/src/third_party/ffmpeg/libavcodec/roqvideo.h index 8318b6e5..2c2e4288 100644 --- a/src/third_party/ffmpeg/libavcodec/roqvideo.h +++ b/src/third_party/ffmpeg/libavcodec/roqvideo.h @@ -22,7 +22,7 @@ #ifndef AVCODEC_ROQVIDEO_H #define AVCODEC_ROQVIDEO_H -#include "avcodec.h" +#include "libavutil/frame.h" typedef struct roq_cell { unsigned char y[4]; @@ -39,7 +39,7 @@ typedef struct motion_vect { typedef struct RoqContext { const AVClass *class; - AVCodecContext *avctx; + void *logctx; AVFrame *last_frame; AVFrame *current_frame; int width, height; diff --git a/src/third_party/ffmpeg/libavcodec/roqvideodec.c b/src/third_party/ffmpeg/libavcodec/roqvideodec.c index 6f2e48d2..bfc69a65 100644 --- a/src/third_party/ffmpeg/libavcodec/roqvideodec.c +++ b/src/third_party/ffmpeg/libavcodec/roqvideodec.c @@ -72,7 +72,7 @@ static void roqvideo_decode_frame(RoqContext *ri, GetByteContext *gb) xpos = ypos = 0; if (chunk_size > bytestream2_get_bytes_left(gb)) { - av_log(ri->avctx, AV_LOG_ERROR, "Chunk does not fit in input buffer\n"); + av_log(ri->logctx, AV_LOG_ERROR, "Chunk does not fit in input buffer\n"); chunk_size = bytestream2_get_bytes_left(gb); } @@ -80,7 +80,7 @@ static void roqvideo_decode_frame(RoqContext *ri, GetByteContext *gb) for (yp = ypos; yp < ypos + 16; yp += 8) for (xp = xpos; xp < xpos + 16; xp += 8) { if (bytestream2_tell(gb) >= chunk_start + chunk_size) { - av_log(ri->avctx, AV_LOG_VERBOSE, "Chunk is too short\n"); + av_log(ri->logctx, AV_LOG_VERBOSE, "Chunk is too short\n"); return; } if (vqflg_pos < 0) { @@ -114,7 +114,7 @@ static void roqvideo_decode_frame(RoqContext *ri, GetByteContext *gb) if(k & 0x02) y += 4; if (bytestream2_tell(gb) >= chunk_start + chunk_size) { - av_log(ri->avctx, AV_LOG_VERBOSE, "Chunk is too short\n"); + av_log(ri->logctx, AV_LOG_VERBOSE, "Chunk is too short\n"); return; } if (vqflg_pos < 0) { @@ -169,7 +169,7 @@ static av_cold int roq_decode_init(AVCodecContext *avctx) { RoqContext *s = avctx->priv_data; - s->avctx = avctx; + s->logctx = avctx; if (avctx->width % 16 || avctx->height % 16) { avpriv_request_sample(avctx, "Dimensions not being a multiple of 16"); diff --git a/src/third_party/ffmpeg/libavcodec/roqvideoenc.c b/src/third_party/ffmpeg/libavcodec/roqvideoenc.c index c25aa39b..0933abf4 100644 --- a/src/third_party/ffmpeg/libavcodec/roqvideoenc.c +++ b/src/third_party/ffmpeg/libavcodec/roqvideoenc.c @@ -911,10 +911,10 @@ static int roq_encode_video(RoqEncContext *enc) /* Quake 3 can't handle chunks bigger than 65535 bytes */ if (tempData->mainChunkSize/8 > 65535 && enc->quake3_compat) { if (enc->lambda > 100000) { - av_log(roq->avctx, AV_LOG_ERROR, "Cannot encode video in Quake compatible form\n"); + av_log(roq->logctx, AV_LOG_ERROR, "Cannot encode video in Quake compatible form\n"); return AVERROR(EINVAL); } - av_log(roq->avctx, AV_LOG_ERROR, + av_log(roq->logctx, AV_LOG_ERROR, "Warning, generated a frame too big for Quake (%d > 65535), " "now switching to a bigger qscale value.\n", tempData->mainChunkSize/8); @@ -972,7 +972,7 @@ static av_cold int roq_encode_init(AVCodecContext *avctx) av_lfg_init(&enc->randctx, 1); - roq->avctx = avctx; + roq->logctx = avctx; enc->framesSinceKeyframe = 0; if ((avctx->width & 0xf) || (avctx->height & 0xf)) { @@ -1057,8 +1057,6 @@ static int roq_encode_frame(AVCodecContext *avctx, AVPacket *pkt, RoqContext *const roq = &enc->common; int size, ret; - roq->avctx = avctx; - enc->frame_to_enc = frame; if (frame->quality) diff --git a/src/third_party/ffmpeg/libavcodec/rpzaenc.c b/src/third_party/ffmpeg/libavcodec/rpzaenc.c index da9500e4..d84555d6 100644 --- a/src/third_party/ffmpeg/libavcodec/rpzaenc.c +++ b/src/third_party/ffmpeg/libavcodec/rpzaenc.c @@ -30,6 +30,7 @@ #include "avcodec.h" #include "codec_internal.h" #include "encode.h" +#include "mathops.h" #include "put_bits.h" typedef struct RpzaContext { @@ -65,7 +66,7 @@ typedef struct rgb { #define SQR(x) ((x) * (x)) /* 15 bit components */ -#define GET_CHAN(color, chan) (((color) >> ((chan) * 5) & 0x1F) * 8) +#define GET_CHAN(color, chan) (((color) >> ((chan) * 5) & 0x1F)) #define R(color) GET_CHAN(color, RED) #define G(color) GET_CHAN(color, GREEN) #define B(color) GET_CHAN(color, BLUE) @@ -141,9 +142,9 @@ static uint16_t rgb24_to_rgb555(const uint8_t *rgb24) uint16_t rgb555 = 0; uint32_t r, g, b; - r = rgb24[0] >> 3; - g = rgb24[1] >> 3; - b = rgb24[2] >> 3; + r = rgb24[0]; + g = rgb24[1]; + b = rgb24[2]; rgb555 |= (r << 10); rgb555 |= (g << 5); @@ -185,7 +186,7 @@ static int max_component_diff(const uint16_t *colorA, const uint16_t *colorB) if (diff > max) { max = diff; } - return max * 8; + return max; } /* @@ -266,9 +267,9 @@ static int compare_blocks(const uint16_t *block1, const uint16_t *block2, */ static int leastsquares(const uint16_t *block_ptr, const BlockInfo *bi, channel_offset xchannel, channel_offset ychannel, - double *slope, double *y_intercept, double *correlation_coef) + int *slope, int *y_intercept, int *correlation_coef) { - double sumx = 0, sumy = 0, sumx2 = 0, sumy2 = 0, sumxy = 0, + int sumx = 0, sumy = 0, sumx2 = 0, sumy2 = 0, sumxy = 0, sumx_sq = 0, sumy_sq = 0, tmp, tmp2; int i, j, count; uint8_t x, y; @@ -305,10 +306,10 @@ static int leastsquares(const uint16_t *block_ptr, const BlockInfo *bi, tmp2 = count * sumy2 - sumy_sq; if (tmp2 == 0) { - *correlation_coef = 0.0; + *correlation_coef = 0; } else { *correlation_coef = (count * sumxy - sumx * sumy) / - sqrt(tmp * tmp2); + ff_sqrt((unsigned)tmp * tmp2); } return 0; // success @@ -332,18 +333,18 @@ static int calc_lsq_max_fit_error(const uint16_t *block_ptr, const BlockInfo *bi y = GET_CHAN(block_ptr[j], ychannel); /* calculate x_inc as the 4-color index (0..3) */ - x_inc = floor( (x - min) * 3.0 / (max - min) + 0.5); + x_inc = (x - min) * 3 / (max - min) + 1; x_inc = FFMAX(FFMIN(3, x_inc), 0); /* calculate lin_y corresponding to x_inc */ - lin_y = (int)(tmp_min + (tmp_max - tmp_min) * x_inc / 3.0 + 0.5); + lin_y = tmp_min + (tmp_max - tmp_min) * x_inc / 3 + 1; err = FFABS(lin_y - y); if (err > max_err) max_err = err; /* calculate lin_x corresponding to x_inc */ - lin_x = (int)(min + (max - min) * x_inc / 3.0 + 0.5); + lin_x = min + (max - min) * x_inc / 3 + 1; err = FFABS(lin_x - x); if (err > max_err) @@ -577,7 +578,7 @@ static void rpza_encode_stream(RpzaContext *s, const AVFrame *pict) uint8_t avg_color[3]; int pixel_count; uint8_t min_color[3], max_color[3]; - double slope, y_intercept, correlation_coef; + int slope, y_intercept, correlation_coef; const uint16_t *src_pixels = (const uint16_t *)pict->data[0]; uint16_t *prev_pixels = (uint16_t *)s->prev_frame->data[0]; @@ -730,8 +731,8 @@ post_skip : min_color[i] = GET_CHAN(src_pixels[block_offset], i); max_color[i] = GET_CHAN(src_pixels[block_offset], i); } else { - tmp_min = (int)(0.5 + min * slope + y_intercept); - tmp_max = (int)(0.5 + max * slope + y_intercept); + tmp_min = 1 + min * slope + y_intercept; + tmp_max = 1 + max * slope + y_intercept; av_assert0(tmp_min <= tmp_max); // clamp min and max color values @@ -802,7 +803,7 @@ static int rpza_encode_frame(AVCodecContext *avctx, AVPacket *pkt, { RpzaContext *s = avctx->priv_data; uint8_t *buf; - int ret = ff_alloc_packet(avctx, pkt, 4LL + 6LL * avctx->height * avctx->width); + int ret = ff_alloc_packet(avctx, pkt, 4LL + 6LL * FFMAX(avctx->height, 4) * FFMAX(avctx->width, 4)); if (ret < 0) return ret; diff --git a/src/third_party/ffmpeg/libavcodec/rtjpeg.c b/src/third_party/ffmpeg/libavcodec/rtjpeg.c index 8e02bce2..734e3875 100644 --- a/src/third_party/ffmpeg/libavcodec/rtjpeg.c +++ b/src/third_party/ffmpeg/libavcodec/rtjpeg.c @@ -167,7 +167,7 @@ void ff_rtjpeg_decode_init(RTJpegContext *c, int width, int height, c->h = height; } -void ff_rtjpeg_init(RTJpegContext *c, AVCodecContext *avctx) +void ff_rtjpeg_init(RTJpegContext *c, struct AVCodecContext *avctx) { int i; diff --git a/src/third_party/ffmpeg/libavcodec/rtjpeg.h b/src/third_party/ffmpeg/libavcodec/rtjpeg.h index d4dc0744..14befb54 100644 --- a/src/third_party/ffmpeg/libavcodec/rtjpeg.h +++ b/src/third_party/ffmpeg/libavcodec/rtjpeg.h @@ -24,6 +24,7 @@ #include +#include "libavutil/frame.h" #include "libavutil/mem_internal.h" #include "idctdsp.h" @@ -39,7 +40,8 @@ typedef struct RTJpegContext { DECLARE_ALIGNED(16, int16_t, block)[64]; } RTJpegContext; -void ff_rtjpeg_init(RTJpegContext *c, AVCodecContext *avctx); +struct AVCodecContext; +void ff_rtjpeg_init(RTJpegContext *c, struct AVCodecContext *avctx); void ff_rtjpeg_decode_init(RTJpegContext *c, int width, int height, const uint32_t *lquant, const uint32_t *cquant); diff --git a/src/third_party/ffmpeg/libavcodec/rtv1.c b/src/third_party/ffmpeg/libavcodec/rtv1.c index 4b202e6a..06afe9e8 100644 --- a/src/third_party/ffmpeg/libavcodec/rtv1.c +++ b/src/third_party/ffmpeg/libavcodec/rtv1.c @@ -54,7 +54,7 @@ static int decode_rtv1(GetByteContext *gb, uint8_t *dst, ptrdiff_t linesize, int a, b; if (bytestream2_get_bytes_left(gb) < 4) - break; + return AVERROR_INVALIDDATA; a = bytestream2_get_le16u(gb); b = bytestream2_get_le16u(gb); @@ -77,7 +77,7 @@ static int decode_rtv1(GetByteContext *gb, uint8_t *dst, ptrdiff_t linesize, dxt1_block(dst + x, linesize, block); } else { if (bytestream2_get_bytes_left(gb) < 12 * 4) - break; + return AVERROR_INVALIDDATA; for (int by = 0; by < 4; by++) { for (int bx = 0; bx < 4; bx++) @@ -126,7 +126,9 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *p, dst = p->data[0] + p->linesize[0] * (avctx->coded_height - 1); linesize = -p->linesize[0]; - decode_rtv1(&gb, dst, linesize, width, height, flags, dsp->dxt1_block); + ret = decode_rtv1(&gb, dst, linesize, width, height, flags, dsp->dxt1_block); + if (ret < 0) + return ret; p->pict_type = AV_PICTURE_TYPE_I; p->flags |= AV_FRAME_FLAG_KEY; diff --git a/src/third_party/ffmpeg/libavcodec/rv10.c b/src/third_party/ffmpeg/libavcodec/rv10.c index bb1ead50..6abceade 100644 --- a/src/third_party/ffmpeg/libavcodec/rv10.c +++ b/src/third_party/ffmpeg/libavcodec/rv10.c @@ -334,8 +334,8 @@ static av_cold void rv10_build_vlc(VLC *vlc, const uint16_t len_count[15], for (unsigned tmp = nb_lens + len_count[i]; nb_lens < tmp; nb_lens++) lens[nb_lens] = i + 2; av_assert1(nb_lens == nb_syms); - ff_init_vlc_from_lengths(vlc, DC_VLC_BITS, nb_lens, lens, 1, - syms, 2, 2, 0, INIT_VLC_STATIC_OVERLONG, NULL); + ff_vlc_init_from_lengths(vlc, DC_VLC_BITS, nb_lens, lens, 1, + syms, 2, 2, 0, VLC_INIT_STATIC_OVERLONG, NULL); } static av_cold void rv10_init_static(void) @@ -477,7 +477,7 @@ static int rv10_decode_packet(AVCodecContext *avctx, const uint8_t *buf, if ((s->mb_x == 0 && s->mb_y == 0) || !s->current_picture_ptr) { // FIXME write parser so we always have complete frames? if (s->current_picture_ptr) { - ff_er_frame_end(&s->er); + ff_er_frame_end(&s->er, NULL); ff_mpv_frame_end(s); s->mb_x = s->mb_y = s->resync_mb_x = s->resync_mb_y = 0; } @@ -649,7 +649,7 @@ static int rv10_decode_frame(AVCodecContext *avctx, AVFrame *pict, } if (s->current_picture_ptr && s->mb_y >= s->mb_height) { - ff_er_frame_end(&s->er); + ff_er_frame_end(&s->er, NULL); ff_mpv_frame_end(s); if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) { diff --git a/src/third_party/ffmpeg/libavcodec/rv34.c b/src/third_party/ffmpeg/libavcodec/rv34.c index 51f18147..e9660bb4 100644 --- a/src/third_party/ffmpeg/libavcodec/rv34.c +++ b/src/third_party/ffmpeg/libavcodec/rv34.c @@ -113,10 +113,10 @@ static void rv34_gen_vlc(const uint8_t *bits, int size, VLC *vlc, const uint8_t vlc->table = &table_data[*offset]; vlc->table_allocated = FF_ARRAY_ELEMS(table_data) - *offset; - ff_init_vlc_sparse(vlc, FFMIN(maxbits, 9), size, + ff_vlc_init_sparse(vlc, FFMIN(maxbits, 9), size, bits, 1, 1, cw, 2, 2, - syms, !!syms, !!syms, INIT_VLC_STATIC_OVERLONG); + syms, !!syms, !!syms, VLC_INIT_STATIC_OVERLONG); *offset += vlc->table_size; } @@ -1560,7 +1560,7 @@ static int finish_frame(AVCodecContext *avctx, AVFrame *pict) MpegEncContext *s = &r->s; int got_picture = 0, ret; - ff_er_frame_end(&s->er); + ff_er_frame_end(&s->er, NULL); ff_mpv_frame_end(s); s->mb_num_left = 0; @@ -1655,7 +1655,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx, AVFrame *pict, av_log(avctx, AV_LOG_ERROR, "New frame but still %d MB left.\n", s->mb_num_left); if (!s->context_reinit) - ff_er_frame_end(&s->er); + ff_er_frame_end(&s->er, NULL); ff_mpv_frame_end(s); } @@ -1790,7 +1790,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx, AVFrame *pict, av_log(avctx, AV_LOG_INFO, "marking unfished frame as finished\n"); /* always mark the current frame as finished, frame-mt supports * only complete frames */ - ff_er_frame_end(&s->er); + ff_er_frame_end(&s->er, NULL); ff_mpv_frame_end(s); s->mb_num_left = 0; ff_thread_report_progress(&s->current_picture_ptr->tf, INT_MAX, 0); diff --git a/src/third_party/ffmpeg/libavcodec/rv34_parser.c b/src/third_party/ffmpeg/libavcodec/rv34_parser.c index e17bc856..2997a4db 100644 --- a/src/third_party/ffmpeg/libavcodec/rv34_parser.c +++ b/src/third_party/ffmpeg/libavcodec/rv34_parser.c @@ -24,13 +24,10 @@ * RV30/40 parser */ -#include "config_components.h" - -#include "parser.h" +#include "avcodec.h" #include "libavutil/intreadwrite.h" typedef struct RV34ParseContext { - ParseContext pc; int64_t key_dts; int key_pts; } RV34ParseContext; @@ -78,18 +75,8 @@ static int rv34_parse(AVCodecParserContext *s, return buf_size; } -#if CONFIG_RV30_PARSER -const AVCodecParser ff_rv30_parser = { - .codec_ids = { AV_CODEC_ID_RV30 }, +const AVCodecParser ff_rv34_parser = { + .codec_ids = { AV_CODEC_ID_RV30, AV_CODEC_ID_RV40 }, .priv_data_size = sizeof(RV34ParseContext), .parser_parse = rv34_parse, }; -#endif - -#if CONFIG_RV40_PARSER -const AVCodecParser ff_rv40_parser = { - .codec_ids = { AV_CODEC_ID_RV40 }, - .priv_data_size = sizeof(RV34ParseContext), - .parser_parse = rv34_parse, -}; -#endif diff --git a/src/third_party/ffmpeg/libavcodec/rv40.c b/src/third_party/ffmpeg/libavcodec/rv40.c index 75849b17..d2f8ef9f 100644 --- a/src/third_party/ffmpeg/libavcodec/rv40.c +++ b/src/third_party/ffmpeg/libavcodec/rv40.c @@ -53,9 +53,9 @@ static av_cold void rv40_init_table(VLC *vlc, unsigned *offset, int nb_bits, vlc->table_allocated = 1 << nb_bits; *offset += 1 << nb_bits; - ff_init_vlc_from_lengths(vlc, nb_bits, nb_codes, + ff_vlc_init_from_lengths(vlc, nb_bits, nb_codes, &tab[0][1], 2, &tab[0][0], 2, 1, - 0, INIT_VLC_USE_NEW_STATIC, NULL); + 0, VLC_INIT_USE_STATIC, NULL); } /** @@ -87,9 +87,9 @@ static av_cold void rv40_init_tables(void) } aic_mode2_vlc[i].table = &aic_mode2_table[offset]; aic_mode2_vlc[i].table_allocated = FF_ARRAY_ELEMS(aic_mode2_table) - offset; - ff_init_vlc_from_lengths(&aic_mode2_vlc[i], AIC_MODE2_BITS, AIC_MODE2_SIZE, + ff_vlc_init_from_lengths(&aic_mode2_vlc[i], AIC_MODE2_BITS, AIC_MODE2_SIZE, aic_mode2_vlc_bits[i], 1, - syms, 2, 2, 0, INIT_VLC_STATIC_OVERLONG, NULL); + syms, 2, 2, 0, VLC_INIT_STATIC_OVERLONG, NULL); offset += aic_mode2_vlc[i].table_size; } for(i = 0; i < NUM_PTYPE_VLCS; i++){ diff --git a/src/third_party/ffmpeg/libavcodec/sbcenc.c b/src/third_party/ffmpeg/libavcodec/sbcenc.c index fccb0e3e..6e1dd88c 100644 --- a/src/third_party/ffmpeg/libavcodec/sbcenc.c +++ b/src/third_party/ffmpeg/libavcodec/sbcenc.c @@ -31,6 +31,7 @@ */ #include "libavutil/channel_layout.h" +#include "libavutil/emms.h" #include "libavutil/opt.h" #include "avcodec.h" #include "codec_internal.h" @@ -198,7 +199,7 @@ static int sbc_encode_init(AVCodecContext *avctx) SBCEncContext *sbc = avctx->priv_data; struct sbc_frame *frame = &sbc->frame; - if (avctx->profile == FF_PROFILE_SBC_MSBC) + if (avctx->profile == AV_PROFILE_SBC_MSBC) sbc->msbc = 1; if (sbc->msbc) { @@ -332,7 +333,7 @@ static const AVOption options[] = { OFFSET(max_delay), AV_OPT_TYPE_DURATION, {.i64 = 13000}, 1000,13000, AE }, { "msbc", "use mSBC mode (wideband speech mono SBC)", OFFSET(msbc), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AE }, - FF_AVCTX_PROFILE_OPTION("msbc", NULL, AUDIO, FF_PROFILE_SBC_MSBC) + FF_AVCTX_PROFILE_OPTION("msbc", NULL, AUDIO, AV_PROFILE_SBC_MSBC) { NULL }, }; diff --git a/src/third_party/ffmpeg/libavcodec/sbrdsp_template.c b/src/third_party/ffmpeg/libavcodec/sbrdsp_template.c index b3737c0f..89e389d9 100644 --- a/src/third_party/ffmpeg/libavcodec/sbrdsp_template.c +++ b/src/third_party/ffmpeg/libavcodec/sbrdsp_template.c @@ -20,6 +20,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/attributes_internal.h" + static void sbr_sum64x5_c(INTFLOAT *z) { int k; @@ -103,3 +105,268 @@ av_cold void AAC_RENAME(ff_sbrdsp_init)(SBRDSPContext *s) #endif #endif /* !USE_FIXED */ } + +/* First eight entries repeated at end to simplify SIMD implementations. */ +const attribute_visibility_hidden 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 +{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)}, +}; diff --git a/src/third_party/ffmpeg/libavcodec/sga.c b/src/third_party/ffmpeg/libavcodec/sga.c index eae691ad..4ced6e98 100644 --- a/src/third_party/ffmpeg/libavcodec/sga.c +++ b/src/third_party/ffmpeg/libavcodec/sga.c @@ -127,19 +127,18 @@ static int decode_index_palmap(SGAVideoContext *s, AVFrame *frame) static int decode_index_tilemap(SGAVideoContext *s, AVFrame *frame) { - GetByteContext *gb = &s->gb; - GetBitContext pm; + GetByteContext *gb = &s->gb, gb2; bytestream2_seek(gb, s->tilemapdata_offset, SEEK_SET); if (bytestream2_get_bytes_left(gb) < s->tilemapdata_size) return AVERROR_INVALIDDATA; - init_get_bits8(&pm, gb->buffer, s->tilemapdata_size); + gb2 = *gb; for (int y = 0; y < s->tiles_h; y++) { for (int x = 0; x < s->tiles_w; x++) { uint8_t tile[64]; - int tilemap = get_bits(&pm, 16); + int tilemap = bytestream2_get_be16u(&gb2); int flip_x = (tilemap >> 11) & 1; int flip_y = (tilemap >> 12) & 1; int tindex = av_clip((tilemap & 511) - 1, 0, s->nb_tiles - 1); diff --git a/src/third_party/ffmpeg/libavcodec/sheervideo.c b/src/third_party/ffmpeg/libavcodec/sheervideo.c index d9c94ea9..660e2661 100644 --- a/src/third_party/ffmpeg/libavcodec/sheervideo.c +++ b/src/third_party/ffmpeg/libavcodec/sheervideo.c @@ -1796,8 +1796,8 @@ static av_cold int build_vlc(VLC *vlc, const SheerTable *table) lens[count] = len; } - ff_free_vlc(vlc); - return ff_init_vlc_from_lengths(vlc, SHEER_VLC_BITS, count, + ff_vlc_free(vlc); + return ff_vlc_init_from_lengths(vlc, SHEER_VLC_BITS, count, lens, sizeof(*lens), NULL, 0, 0, 0, 0, NULL); } @@ -1992,8 +1992,8 @@ static av_cold int decode_end(AVCodecContext *avctx) { SheerVideoContext *s = avctx->priv_data; - ff_free_vlc(&s->vlc[0]); - ff_free_vlc(&s->vlc[1]); + ff_vlc_free(&s->vlc[0]); + ff_vlc_free(&s->vlc[1]); return 0; } diff --git a/src/third_party/ffmpeg/libavcodec/shorten.c b/src/third_party/ffmpeg/libavcodec/shorten.c index eca0c4e8..0ad95bf9 100644 --- a/src/third_party/ffmpeg/libavcodec/shorten.c +++ b/src/third_party/ffmpeg/libavcodec/shorten.c @@ -280,7 +280,7 @@ static int decode_wave_header(AVCodecContext *avctx, const uint8_t *header, int header_size) { int len, bps; - short wave_format; + uint16_t wave_format; GetByteContext gb; bytestream2_init(&gb, header, header_size); diff --git a/src/third_party/ffmpeg/libavcodec/sipr.c b/src/third_party/ffmpeg/libavcodec/sipr.c index 692b59b3..3ddc579f 100644 --- a/src/third_party/ffmpeg/libavcodec/sipr.c +++ b/src/third_party/ffmpeg/libavcodec/sipr.c @@ -532,7 +532,6 @@ static int sipr_decode_frame(AVCodecContext *avctx, AVFrame *frame, int subframe_size = ctx->mode == MODE_16k ? L_SUBFR_16k : SUBFR_SIZE; int i, ret; - ctx->avctx = avctx; if (avpkt->size < (mode_par->bits_per_frame >> 3)) { av_log(avctx, AV_LOG_ERROR, "Error processing packet: packet size (%d) too small\n", diff --git a/src/third_party/ffmpeg/libavcodec/sipr.h b/src/third_party/ffmpeg/libavcodec/sipr.h index e1ef35d6..e7073987 100644 --- a/src/third_party/ffmpeg/libavcodec/sipr.h +++ b/src/third_party/ffmpeg/libavcodec/sipr.h @@ -24,7 +24,6 @@ #ifndef AVCODEC_SIPR_H #define AVCODEC_SIPR_H -#include "avcodec.h" #include "acelp_pitch_delay.h" #include "libavutil/mem_internal.h" @@ -63,8 +62,6 @@ typedef struct SiprParameters { } SiprParameters; typedef struct SiprContext { - AVCodecContext *avctx; - SiprMode mode; float past_pitch_gain; diff --git a/src/third_party/ffmpeg/libavcodec/smacker.c b/src/third_party/ffmpeg/libavcodec/smacker.c index 7ee9fe85..3f2f83ad 100644 --- a/src/third_party/ffmpeg/libavcodec/smacker.c +++ b/src/third_party/ffmpeg/libavcodec/smacker.c @@ -220,10 +220,10 @@ static int smacker_decode_header_tree(SmackVContext *smk, GetBitContext *gb, int goto error; skip_bits1(gb); if (h.current > 1) { - err = ff_init_vlc_from_lengths(&vlc[i], SMKTREE_BITS, h.current, + err = ff_vlc_init_from_lengths(&vlc[i], SMKTREE_BITS, h.current, &h.entries[0].length, sizeof(*h.entries), &h.entries[0].value, sizeof(*h.entries), 1, - 0, INIT_VLC_OUTPUT_LE, smk->avctx); + 0, VLC_INIT_OUTPUT_LE, smk->avctx); if (err < 0) { av_log(smk->avctx, AV_LOG_ERROR, "Cannot build VLC table\n"); goto error; @@ -264,7 +264,7 @@ static int smacker_decode_header_tree(SmackVContext *smk, GetBitContext *gb, int err = 0; error: for (int i = 0; i < 2; i++) { - ff_free_vlc(&vlc[i]); + ff_vlc_free(&vlc[i]); } return err; @@ -659,10 +659,10 @@ static int smka_decode_frame(AVCodecContext *avctx, AVFrame *frame, goto error; skip_bits1(&gb); if (h.current > 1) { - ret = ff_init_vlc_from_lengths(&vlc[i], SMKTREE_BITS, h.current, + ret = ff_vlc_init_from_lengths(&vlc[i], SMKTREE_BITS, h.current, &h.entries[0].length, sizeof(*h.entries), &h.entries[0].value, sizeof(*h.entries), 1, - 0, INIT_VLC_OUTPUT_LE, avctx); + 0, VLC_INIT_OUTPUT_LE, avctx); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "Cannot build VLC table\n"); goto error; @@ -740,7 +740,7 @@ static int smka_decode_frame(AVCodecContext *avctx, AVFrame *frame, error: for(i = 0; i < 4; i++) { - ff_free_vlc(&vlc[i]); + ff_vlc_free(&vlc[i]); } return ret; diff --git a/src/third_party/ffmpeg/libavcodec/smcenc.c b/src/third_party/ffmpeg/libavcodec/smcenc.c index 40b53c40..789aef4f 100644 --- a/src/third_party/ffmpeg/libavcodec/smcenc.c +++ b/src/third_party/ffmpeg/libavcodec/smcenc.c @@ -566,8 +566,7 @@ static int smc_encode_frame(AVCodecContext *avctx, AVPacket *pkt, // write chunk length AV_WB24(pkt->data + 1, pkt->size); - av_frame_unref(s->prev_frame); - ret = av_frame_ref(s->prev_frame, frame); + ret = av_frame_replace(s->prev_frame, frame); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "cannot add reference\n"); return ret; @@ -583,7 +582,7 @@ static int smc_encode_frame(AVCodecContext *avctx, AVPacket *pkt, static int smc_encode_end(AVCodecContext *avctx) { - SMCContext *s = (SMCContext *)avctx->priv_data; + SMCContext *s = avctx->priv_data; av_frame_free(&s->prev_frame); diff --git a/src/third_party/ffmpeg/libavcodec/snow.c b/src/third_party/ffmpeg/libavcodec/snow.c index 5eb3ee1e..59815d00 100644 --- a/src/third_party/ffmpeg/libavcodec/snow.c +++ b/src/third_party/ffmpeg/libavcodec/snow.c @@ -21,8 +21,6 @@ #include "libavutil/log.h" #include "libavutil/thread.h" #include "avcodec.h" -#include "decode.h" -#include "encode.h" #include "snow_dwt.h" #include "snow.h" #include "snowdata.h" @@ -61,36 +59,6 @@ void ff_snow_inner_add_yblock(const uint8_t *obmc, const int obmc_stride, uint8_ } } -int ff_snow_get_buffer(SnowContext *s, AVFrame *frame) -{ - int ret, i; - int edges_needed = av_codec_is_encoder(s->avctx->codec); - - frame->width = s->avctx->width ; - frame->height = s->avctx->height; - if (edges_needed) { - frame->width += 2 * EDGE_WIDTH; - frame->height += 2 * EDGE_WIDTH; - - ret = ff_encode_alloc_frame(s->avctx, frame); - } else - ret = ff_get_buffer(s->avctx, frame, AV_GET_BUFFER_FLAG_REF); - if (ret < 0) - return ret; - if (edges_needed) { - for (i = 0; frame->data[i]; i++) { - int offset = (EDGE_WIDTH >> (i ? s->chroma_v_shift : 0)) * - frame->linesize[i] + - (EDGE_WIDTH >> (i ? s->chroma_h_shift : 0)); - frame->data[i] += offset; - } - frame->width = s->avctx->width; - frame->height = s->avctx->height; - } - - return 0; -} - void ff_snow_reset_contexts(SnowContext *s){ //FIXME better initial contexts int plane_index, level, orientation; @@ -433,36 +401,10 @@ av_cold int ff_snow_common_init(AVCodecContext *avctx){ s->max_ref_frames=1; //just make sure it's not an invalid value in case of no initial keyframe s->spatial_decomposition_count = 1; - ff_hpeldsp_init(&s->hdsp, avctx->flags); ff_videodsp_init(&s->vdsp, 8); ff_dwt_init(&s->dwt); ff_h264qpel_init(&s->h264qpel, 8); -#define mcf(dx,dy)\ - s->qdsp.put_qpel_pixels_tab [0][dy+dx/4]=\ - s->qdsp.put_no_rnd_qpel_pixels_tab[0][dy+dx/4]=\ - s->h264qpel.put_h264_qpel_pixels_tab[0][dy+dx/4];\ - s->qdsp.put_qpel_pixels_tab [1][dy+dx/4]=\ - s->qdsp.put_no_rnd_qpel_pixels_tab[1][dy+dx/4]=\ - s->h264qpel.put_h264_qpel_pixels_tab[1][dy+dx/4]; - - mcf( 0, 0) - mcf( 4, 0) - mcf( 8, 0) - mcf(12, 0) - mcf( 0, 4) - mcf( 4, 4) - mcf( 8, 4) - mcf(12, 4) - mcf( 0, 8) - mcf( 4, 8) - mcf( 8, 8) - mcf(12, 8) - mcf( 0,12) - mcf( 4,12) - mcf( 8,12) - mcf(12,12) - #define mcfh(dx,dy)\ s->hdsp.put_pixels_tab [0][dy/4+dx/8]=\ s->hdsp.put_no_rnd_pixels_tab[0][dy/4+dx/8]=\ @@ -507,27 +449,15 @@ av_cold int ff_snow_common_init(AVCodecContext *avctx){ int ff_snow_common_init_after_header(AVCodecContext *avctx) { SnowContext *s = avctx->priv_data; int plane_index, level, orientation; - int ret, emu_buf_size; if(!s->scratchbuf) { - if (av_codec_is_decoder(avctx->codec)) { - if ((ret = ff_get_buffer(s->avctx, s->mconly_picture, - AV_GET_BUFFER_FLAG_REF)) < 0) - return ret; - } - + int emu_buf_size; emu_buf_size = FFMAX(s->mconly_picture->linesize[0], 2*avctx->width+256) * (2 * MB_SIZE + HTAPS_MAX - 1); if (!FF_ALLOCZ_TYPED_ARRAY(s->scratchbuf, FFMAX(s->mconly_picture->linesize[0], 2*avctx->width+256) * 7 * MB_SIZE) || !FF_ALLOCZ_TYPED_ARRAY(s->emu_edge_buffer, emu_buf_size)) return AVERROR(ENOMEM); } - if (av_codec_is_decoder(avctx->codec) && - s->mconly_picture->format != avctx->pix_fmt) { - av_log(avctx, AV_LOG_ERROR, "pixel format changed\n"); - return AVERROR_INVALIDDATA; - } - for(plane_index=0; plane_index < s->nb_planes; plane_index++){ int w= s->avctx->width; int h= s->avctx->height; @@ -589,20 +519,21 @@ void ff_snow_release_buffer(AVCodecContext *avctx) } } -int ff_snow_frame_start(SnowContext *s){ +int ff_snow_frames_prepare(SnowContext *s) +{ AVFrame *tmp; - int i, ret; ff_snow_release_buffer(s->avctx); tmp= s->last_picture[s->max_ref_frames-1]; - for(i=s->max_ref_frames-1; i>0; i--) + for (int i = s->max_ref_frames - 1; i > 0; i--) s->last_picture[i] = s->last_picture[i-1]; s->last_picture[0] = s->current_picture; s->current_picture = tmp; if(s->keyframe){ s->ref_frames= 0; + s->current_picture->flags |= AV_FRAME_FLAG_KEY; }else{ int i; for(i=0; imax_ref_frames && s->last_picture[i]->data[0]; i++) @@ -613,14 +544,8 @@ int ff_snow_frame_start(SnowContext *s){ av_log(s->avctx,AV_LOG_ERROR, "No reference frames\n"); return AVERROR_INVALIDDATA; } - } - if ((ret = ff_snow_get_buffer(s, s->current_picture)) < 0) - return ret; - - if (s->keyframe) - s->current_picture->flags |= AV_FRAME_FLAG_KEY; - else s->current_picture->flags &= ~AV_FRAME_FLAG_KEY; + } return 0; } @@ -635,18 +560,11 @@ av_cold void ff_snow_common_end(SnowContext *s) av_freep(&s->temp_idwt_buffer); av_freep(&s->run_buffer); - s->m.me.temp= NULL; - av_freep(&s->m.me.scratchpad); - av_freep(&s->m.me.map); - av_freep(&s->m.sc.obmc_scratchpad); - av_freep(&s->block); av_freep(&s->scratchbuf); av_freep(&s->emu_edge_buffer); for(i=0; iref_mvs[i]); - av_freep(&s->ref_scores[i]); if(s->last_picture[i] && s->last_picture[i]->data[0]) { av_assert0(s->last_picture[i]->data[0] != s->current_picture->data[0]); } diff --git a/src/third_party/ffmpeg/libavcodec/snow.h b/src/third_party/ffmpeg/libavcodec/snow.h index ed0f9abb..a5e2c138 100644 --- a/src/third_party/ffmpeg/libavcodec/snow.h +++ b/src/third_party/ffmpeg/libavcodec/snow.h @@ -24,21 +24,18 @@ #include "libavutil/motion_vector.h" +#include "avcodec.h" #include "hpeldsp.h" -#include "me_cmp.h" -#include "qpeldsp.h" #include "snow_dwt.h" #include "rangecoder.h" #include "mathops.h" -#include "mpegvideo.h" #include "h264qpel.h" +#include "videodsp.h" #define SNOW_MAX_PLANES 4 -#define FF_ME_ITER 3 - #define MID_STATE 128 #define MAX_PLANES 4 @@ -117,12 +114,9 @@ typedef struct SnowContext{ AVClass *class; AVCodecContext *avctx; RangeCoder c; - MECmpContext mecc; HpelDSPContext hdsp; - QpelDSPContext qdsp; VideoDSPContext vdsp; H264QpelContext h264qpel; - MpegvideoEncDSPContext mpvencdsp; SnowDWTContext dwt; AVFrame *input_picture; ///< new_picture with the internal linesizes AVFrame *current_picture; @@ -155,9 +149,6 @@ typedef struct SnowContext{ int spatial_scalability; int qlog; int last_qlog; - int lambda; - int lambda2; - int pass1_rc; int mv_scale; int last_mv_scale; int qbias; @@ -170,18 +161,7 @@ typedef struct SnowContext{ int nb_planes; Plane plane[MAX_PLANES]; BlockNode *block; -#define ME_CACHE_SIZE 1024 - unsigned me_cache[ME_CACHE_SIZE]; - unsigned me_cache_generation; slice_buffer sb; - int memc_only; - int no_bitstream; - int intra_penalty; - int motion_est; - int iterative_dia_size; - int scenechange_threshold; - - 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) uint8_t *scratchbuf; uint8_t *emu_edge_buffer; @@ -189,9 +169,6 @@ typedef struct SnowContext{ AVMotionVector *avmv; unsigned avmv_size; int avmv_index; - uint64_t encoding_error[SNOW_MAX_PLANES]; - - int pred; }SnowContext; /* Tables */ @@ -199,44 +176,6 @@ extern const uint8_t * const ff_obmc_tab[4]; extern const uint8_t ff_qexp[QROOT]; extern int ff_scale_mv_ref[MAX_REF_FRAMES][MAX_REF_FRAMES]; -/* C bits used by mmx/sse2/altivec */ - -static av_always_inline void snow_interleave_line_header(int * i, int width, IDWTELEM * low, IDWTELEM * high){ - (*i) = (width) - 2; - - if (width & 1){ - low[(*i)+1] = low[((*i)+1)>>1]; - (*i)--; - } -} - -static av_always_inline void snow_interleave_line_footer(int * i, IDWTELEM * low, IDWTELEM * high){ - for (; (*i)>=0; (*i)-=2){ - low[(*i)+1] = high[(*i)>>1]; - low[*i] = low[(*i)>>1]; - } -} - -static av_always_inline void snow_horizontal_compose_lift_lead_out(int i, IDWTELEM * dst, IDWTELEM * src, IDWTELEM * ref, int width, int w, int lift_high, int mul, int add, int shift){ - for(; i> shift); - } - - if((width^lift_high)&1){ - dst[w] = src[w] - ((mul * 2 * ref[w] + add) >> shift); - } -} - -static av_always_inline void snow_horizontal_compose_liftS_lead_out(int i, IDWTELEM * dst, IDWTELEM * src, IDWTELEM * ref, int width, int w){ - for(; i> W_BS); - } - - if(width&1){ - dst[w] = src[w] + ((2 * ref[w] + W_BO + 4 * src[w]) >> W_BS); - } -} - /* common code */ int ff_snow_common_init(AVCodecContext *avctx); @@ -245,11 +184,10 @@ void ff_snow_common_end(SnowContext *s); void ff_snow_release_buffer(AVCodecContext *avctx); void ff_snow_reset_contexts(SnowContext *s); int ff_snow_alloc_blocks(SnowContext *s); -int ff_snow_frame_start(SnowContext *s); +int ff_snow_frames_prepare(SnowContext *s); void ff_snow_pred_block(SnowContext *s, uint8_t *dst, uint8_t *tmp, ptrdiff_t stride, int sx, int sy, int b_w, int b_h, const BlockNode *block, int plane_index, int w, int h); -int ff_snow_get_buffer(SnowContext *s, AVFrame *frame); /* common inline functions */ //XXX doublecheck all of them should stay inlined @@ -486,227 +424,8 @@ static inline void set_blocks(SnowContext *s, int level, int x, int y, int l, in } } -static inline void init_ref(MotionEstContext *c, const uint8_t *const src[3], uint8_t *const ref[3], uint8_t *const ref2[3], int x, int y, int ref_index){ - SnowContext *s = c->avctx->priv_data; - const int offset[3]= { - y*c-> stride + x, - ((y*c->uvstride + x)>>s->chroma_h_shift), - ((y*c->uvstride + x)>>s->chroma_h_shift), - }; - int i; - for(i=0; i<3; i++){ - c->src[0][i]= src [i]; - c->ref[0][i]= ref [i] + offset[i]; - } - av_assert2(!ref_index); -} - - -/* bitstream functions */ - extern const int8_t ff_quant3bA[256]; #define QEXPSHIFT (7-FRAC_BITS+8) //FIXME try to change this to 0 -static inline void put_symbol(RangeCoder *c, uint8_t *state, int v, int is_signed){ - int i; - - if(v){ - const int a= FFABS(v); - const int e= av_log2(a); - const int el= FFMIN(e, 10); - put_rac(c, state+0, 0); - - for(i=0; i=el; i--){ - put_rac(c, state+22+9, (a>>i)&1); //22..31 - } - for(; i>=0; i--){ - put_rac(c, state+22+i, (a>>i)&1); //22..31 - } - - if(is_signed) - put_rac(c, state+11 + el, v < 0); //11..21 - }else{ - put_rac(c, state+0, 1); - } -} - -static inline int get_symbol(RangeCoder *c, uint8_t *state, int is_signed){ - if(get_rac(c, state+0)) - return 0; - else{ - int i, e; - unsigned a; - e= 0; - while(get_rac(c, state+1 + FFMIN(e,9))){ //1..10 - e++; - if (e > 31) - return AVERROR_INVALIDDATA; - } - - a= 1; - for(i=e-1; i>=0; i--){ - a += a + get_rac(c, state+22 + FFMIN(i,9)); //22..31 - } - - e= -(is_signed && get_rac(c, state+11 + FFMIN(e,10))); //11..21 - return (a^e)-e; - } -} - -static inline void put_symbol2(RangeCoder *c, uint8_t *state, int v, int log2){ - int i; - int r= log2>=0 ? 1<=0); - av_assert2(log2>=-4); - - while(v >= r){ - put_rac(c, state+4+log2, 1); - v -= r; - log2++; - if(log2>0) r+=r; - } - put_rac(c, state+4+log2, 0); - - for(i=log2-1; i>=0; i--){ - put_rac(c, state+31-i, (v>>i)&1); - } -} - -static inline int get_symbol2(RangeCoder *c, uint8_t *state, int log2){ - int i; - int r= log2>=0 ? 1<=-4); - - while(log2<28 && get_rac(c, state+4+log2)){ - v+= r; - log2++; - if(log2>0) r+=r; - } - - for(i=log2-1; i>=0; i--){ - v+= get_rac(c, state+31-i)<width; - const int h= b->height; - int x,y; - - int run, runs; - x_and_coeff *xc= b->x_coeff; - x_and_coeff *prev_xc= NULL; - x_and_coeff *prev2_xc= xc; - x_and_coeff *parent_xc= parent ? parent->x_coeff : NULL; - x_and_coeff *prev_parent_xc= parent_xc; - - runs= get_symbol2(&s->c, b->state[30], 0); - if(runs-- > 0) run= get_symbol2(&s->c, b->state[1], 3); - else run= INT_MAX; - - for(y=0; yx == 0){ - rt= prev_xc->coeff; - } - for(x=0; xx <= x) - prev_xc++; - if(prev_xc->x == x + 1) - rt= prev_xc->coeff; - else - rt=0; - } - if(parent_xc){ - if(x>>1 > parent_xc->x){ - parent_xc++; - } - if(x>>1 == parent_xc->x){ - p= parent_xc->coeff; - } - } - if(/*ll|*/l|lt|t|rt|p){ - int context= av_log2(/*FFABS(ll) + */3*(l>>1) + (lt>>1) + (t&~1) + (rt>>1) + (p>>1)); - - v=get_rac(&s->c, &b->state[0][context]); - if(v){ - v= 2*(get_symbol2(&s->c, b->state[context + 2], context-4) + 1); - v+=get_rac(&s->c, &b->state[0][16 + 1 + 3 + ff_quant3bA[l&0xFF] + 3*ff_quant3bA[t&0xFF]]); - if ((uint16_t)v != v) { - av_log(s->avctx, AV_LOG_ERROR, "Coefficient damaged\n"); - v = 1; - } - xc->x=x; - (xc++)->coeff= v; - } - }else{ - if(!run){ - if(runs-- > 0) run= get_symbol2(&s->c, b->state[1], 3); - else run= INT_MAX; - v= 2*(get_symbol2(&s->c, b->state[0 + 2], 0-4) + 1); - v+=get_rac(&s->c, &b->state[0][16 + 1 + 3]); - if ((uint16_t)v != v) { - av_log(s->avctx, AV_LOG_ERROR, "Coefficient damaged\n"); - v = 1; - } - - xc->x=x; - (xc++)->coeff= v; - }else{ - int max_run; - run--; - v=0; - av_assert2(run >= 0); - if(y) max_run= FFMIN(run, prev_xc->x - x - 2); - else max_run= FFMIN(run, w-x-1); - if(parent_xc) - max_run= FFMIN(max_run, 2*parent_xc->x - x - 1); - av_assert2(max_run >= 0 && max_run <= run); - - x+= max_run; - run-= max_run; - } - } - } - (xc++)->x= w+1; //end marker - prev_xc= prev2_xc; - prev2_xc= xc; - - if(parent_xc){ - if(y&1){ - while(parent_xc->x != parent->width+1) - parent_xc++; - parent_xc++; - prev_parent_xc= parent_xc; - }else{ - parent_xc= prev_parent_xc; - } - } - } - - (xc++)->x= w+1; //end marker -} - #endif /* AVCODEC_SNOW_H */ diff --git a/src/third_party/ffmpeg/libavcodec/snow_dwt.h b/src/third_party/ffmpeg/libavcodec/snow_dwt.h index 15b8a300..6e7d22c7 100644 --- a/src/third_party/ffmpeg/libavcodec/snow_dwt.h +++ b/src/third_party/ffmpeg/libavcodec/snow_dwt.h @@ -24,6 +24,8 @@ #include #include +#include "libavutil/attributes.h" + struct MpegEncContext; typedef int DWTELEM; @@ -91,6 +93,44 @@ typedef struct SnowDWTContext { : ff_slice_buffer_load_line((slice_buf), \ (line_num))) +/* C bits used by mmx/sse2/altivec */ + +static av_always_inline void snow_interleave_line_header(int *i, int width, IDWTELEM *low, IDWTELEM *high) +{ + *i = width - 2; + + if (width & 1) { + low[*i + 1] = low[(*i + 1)>>1]; + (*i)--; + } +} + +static av_always_inline void snow_interleave_line_footer(int *i, IDWTELEM *low, const IDWTELEM *high) +{ + for (; *i >= 0; *i -= 2) { + low[*i + 1] = high[*i >> 1]; + low[*i] = low[*i >> 1]; + } +} + +static av_always_inline void snow_horizontal_compose_lift_lead_out(int i, IDWTELEM *dst, const IDWTELEM *src, const IDWTELEM *ref, int width, int w, int lift_high, int mul, int add, int shift) +{ + for (; i < w; i++) + dst[i] = src[i] - ((mul * (ref[i] + ref[i + 1]) + add) >> shift); + + if ((width ^ lift_high) & 1) + dst[w] = src[w] - ((mul * 2 * ref[w] + add) >> shift); +} + +static av_always_inline void snow_horizontal_compose_liftS_lead_out(int i, IDWTELEM *dst, const IDWTELEM *src, const IDWTELEM *ref, int width, int w) +{ + for (; i < w; i++) + dst[i] = src[i] + ((ref[i] + ref[(i+1)]+W_BO + 4 * src[i]) >> W_BS); + + if (width & 1) + dst[w] = src[w] + ((2 * ref[w] + W_BO + 4 * src[w]) >> W_BS); +} + int ff_slice_buffer_init(slice_buffer *buf, int line_count, int max_allocated_lines, int line_width, IDWTELEM *base_buffer); diff --git a/src/third_party/ffmpeg/libavcodec/snowdec.c b/src/third_party/ffmpeg/libavcodec/snowdec.c index bed29d33..70fbab9a 100644 --- a/src/third_party/ffmpeg/libavcodec/snowdec.c +++ b/src/third_party/ffmpeg/libavcodec/snowdec.c @@ -18,17 +18,166 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/emms.h" #include "libavutil/intmath.h" #include "libavutil/log.h" #include "libavutil/opt.h" #include "avcodec.h" #include "codec_internal.h" +#include "decode.h" #include "snow_dwt.h" #include "snow.h" #include "rangecoder.h" #include "mathops.h" +static inline int get_symbol(RangeCoder *c, uint8_t *state, int is_signed) +{ + if (get_rac(c, state + 0)) + return 0; + else { + int e; + unsigned a; + e = 0; + while (get_rac(c, state + 1 + FFMIN(e, 9))) { //1..10 + e++; + if (e > 31) + return AVERROR_INVALIDDATA; + } + + a = 1; + for (int i = e - 1; i >= 0; i--) + a += a + get_rac(c, state + 22 + FFMIN(i, 9)); //22..31 + + e = -(is_signed && get_rac(c, state + 11 + FFMIN(e, 10))); //11..21 + return (a ^ e) - e; + } +} + +static inline int get_symbol2(RangeCoder *c, uint8_t *state, int log2) +{ + int r = log2 >= 0 ? 1 << log2 : 1; + int v = 0; + + av_assert2(log2 >= -4); + + while (log2 < 28 && get_rac(c, state + 4 + log2)) { + v += r; + log2++; + if (log2 > 0) r += r; + } + + for (int i = log2 - 1; i >= 0; i--) + v += get_rac(c, state + 31 - i) << i; + + return v; +} + +static void unpack_coeffs(SnowContext *s, SubBand *b, SubBand * parent, int orientation) +{ + const int w = b->width; + const int h = b->height; + + int run, runs; + x_and_coeff *xc = b->x_coeff; + x_and_coeff *prev_xc = NULL; + x_and_coeff *prev2_xc = xc; + x_and_coeff *parent_xc = parent ? parent->x_coeff : NULL; + x_and_coeff *prev_parent_xc = parent_xc; + + runs = get_symbol2(&s->c, b->state[30], 0); + if (runs-- > 0) run = get_symbol2(&s->c, b->state[1], 3); + else run = INT_MAX; + + for (int y = 0; y < h; y++) { + int v = 0; + int lt = 0, t = 0, rt = 0; + + if (y && prev_xc->x == 0) + rt = prev_xc->coeff; + + for (int x = 0; x < w; x++) { + int p = 0; + const int l = v; + + lt= t; t= rt; + + if (y) { + if (prev_xc->x <= x) + prev_xc++; + if (prev_xc->x == x + 1) + rt = prev_xc->coeff; + else + rt = 0; + } + if (parent_xc) { + if (x>>1 > parent_xc->x) + parent_xc++; + if (x>>1 == parent_xc->x) + p = parent_xc->coeff; + } + if (/*ll|*/l|lt|t|rt|p) { + int context = av_log2(/*FFABS(ll) + */3*(l>>1) + (lt>>1) + (t&~1) + (rt>>1) + (p>>1)); + + v = get_rac(&s->c, &b->state[0][context]); + if (v) { + v = 2*(get_symbol2(&s->c, b->state[context + 2], context-4) + 1); + v += get_rac(&s->c, &b->state[0][16 + 1 + 3 + ff_quant3bA[l&0xFF] + 3 * ff_quant3bA[t&0xFF]]); + if ((uint16_t)v != v) { + av_log(s->avctx, AV_LOG_ERROR, "Coefficient damaged\n"); + v = 1; + } + xc->x = x; + (xc++)->coeff = v; + } + } else { + if (!run) { + if (runs-- > 0) run = get_symbol2(&s->c, b->state[1], 3); + else run = INT_MAX; + v = 2 * (get_symbol2(&s->c, b->state[0 + 2], 0-4) + 1); + v += get_rac(&s->c, &b->state[0][16 + 1 + 3]); + if ((uint16_t)v != v) { + av_log(s->avctx, AV_LOG_ERROR, "Coefficient damaged\n"); + v = 1; + } + + xc->x = x; + (xc++)->coeff = v; + } else { + int max_run; + run--; + v = 0; + av_assert2(run >= 0); + if (y) max_run = FFMIN(run, prev_xc->x - x - 2); + else max_run = FFMIN(run, w-x-1); + if (parent_xc) + max_run = FFMIN(max_run, 2*parent_xc->x - x - 1); + av_assert2(max_run >= 0 && max_run <= run); + + x += max_run; + run -= max_run; + } + } + } + (xc++)->x = w+1; //end marker + prev_xc = prev2_xc; + prev2_xc = xc; + + if (parent_xc) { + if (y & 1) { + while (parent_xc->x != parent->width+1) + parent_xc++; + parent_xc++; + prev_parent_xc= parent_xc; + } else { + parent_xc= prev_parent_xc; + } + } + } + + (xc++)->x = w + 1; //end marker +} + static av_always_inline void predict_slice_buffered(SnowContext *s, slice_buffer * sb, IDWTELEM * old_buffer, int plane_index, int add, int mb_y){ Plane *p= &s->plane[plane_index]; const int mb_w= s->b_width << s->block_max_depth; @@ -453,6 +602,17 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture, s->current_picture->pict_type= AV_PICTURE_TYPE_I; //FIXME I vs. P if ((res = decode_header(s)) < 0) return res; + + if (!s->mconly_picture->data[0]) { + res = ff_get_buffer(avctx, s->mconly_picture, AV_GET_BUFFER_FLAG_REF); + if (res < 0) + return res; + } + if (s->mconly_picture->format != avctx->pix_fmt) { + av_log(avctx, AV_LOG_ERROR, "pixel format changed\n"); + return AVERROR_INVALIDDATA; + } + if ((res=ff_snow_common_init_after_header(avctx)) < 0) return res; @@ -474,7 +634,13 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture, ff_snow_alloc_blocks(s); - if((res = ff_snow_frame_start(s)) < 0) + if ((res = ff_snow_frames_prepare(s)) < 0) + return res; + + s->current_picture->width = s->avctx->width; + s->current_picture->height = s->avctx->height; + res = ff_get_buffer(s->avctx, s->current_picture, AV_GET_BUFFER_FLAG_REF); + if (res < 0) return res; s->current_picture->pict_type = s->keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P; diff --git a/src/third_party/ffmpeg/libavcodec/snowenc.c b/src/third_party/ffmpeg/libavcodec/snowenc.c index 1360343a..c2152153 100644 --- a/src/third_party/ffmpeg/libavcodec/snowenc.c +++ b/src/third_party/ffmpeg/libavcodec/snowenc.c @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/emms.h" #include "libavutil/intmath.h" #include "libavutil/libm.h" #include "libavutil/log.h" @@ -29,6 +30,7 @@ #include "internal.h" //For AVCodecInternal.recon_frame #include "me_cmp.h" #include "packet_internal.h" +#include "qpeldsp.h" #include "snow_dwt.h" #include "snow.h" @@ -38,20 +40,136 @@ #include "mpegvideo.h" #include "h263enc.h" +#define FF_ME_ITER 3 + +typedef struct SnowEncContext { + SnowContext com; + QpelDSPContext qdsp; + MpegvideoEncDSPContext mpvencdsp; + + int lambda; + int lambda2; + int pass1_rc; + + int pred; + int memc_only; + int no_bitstream; + int intra_penalty; + int motion_est; + int iterative_dia_size; + int scenechange_threshold; + + MECmpContext mecc; + 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) +#define ME_CACHE_SIZE 1024 + unsigned me_cache[ME_CACHE_SIZE]; + unsigned me_cache_generation; + + uint64_t encoding_error[SNOW_MAX_PLANES]; +} SnowEncContext; + +static void init_ref(MotionEstContext *c, const uint8_t *const src[3], + uint8_t *const ref[3], uint8_t *const ref2[3], + int x, int y, int ref_index) +{ + SnowContext *s = c->avctx->priv_data; + const int offset[3] = { + y*c-> stride + x, + ((y*c->uvstride + x) >> s->chroma_h_shift), + ((y*c->uvstride + x) >> s->chroma_h_shift), + }; + for (int i = 0; i < 3; i++) { + c->src[0][i] = src [i]; + c->ref[0][i] = ref [i] + offset[i]; + } + av_assert2(!ref_index); +} + +static inline void put_symbol(RangeCoder *c, uint8_t *state, int v, int is_signed) +{ + if (v) { + const int a = FFABS(v); + const int e = av_log2(a); + const int el = FFMIN(e, 10); + int i; + + put_rac(c, state + 0, 0); + + for (i = 0; i < el; i++) + put_rac(c, state + 1 + i, 1); //1..10 + for(; i < e; i++) + put_rac(c, state + 1 + 9, 1); //1..10 + put_rac(c, state + 1 + FFMIN(i, 9), 0); + + for (i = e - 1; i >= el; i--) + put_rac(c, state + 22 + 9, (a >> i) & 1); //22..31 + for(; i >= 0; i--) + put_rac(c, state + 22 + i, (a >> i) & 1); //22..31 + + if (is_signed) + put_rac(c, state + 11 + el, v < 0); //11..21 + } else { + put_rac(c, state + 0, 1); + } +} + +static inline void put_symbol2(RangeCoder *c, uint8_t *state, int v, int log2) +{ + int r = log2 >= 0 ? 1<= 0); + av_assert2(log2 >= -4); + + while (v >= r) { + put_rac(c, state + 4 + log2, 1); + v -= r; + log2++; + if (log2 > 0) r += r; + } + put_rac(c, state + 4 + log2, 0); + + for (int i = log2 - 1; i >= 0; i--) + put_rac(c, state + 31 - i, (v >> i) & 1); +} + +static int get_encode_buffer(SnowContext *s, AVFrame *frame) +{ + int ret; + + frame->width = s->avctx->width + 2 * EDGE_WIDTH; + frame->height = s->avctx->height + 2 * EDGE_WIDTH; + + ret = ff_encode_alloc_frame(s->avctx, frame); + if (ret < 0) + return ret; + for (int i = 0; frame->data[i]; i++) { + int offset = (EDGE_WIDTH >> (i ? s->chroma_v_shift : 0)) * + frame->linesize[i] + + (EDGE_WIDTH >> (i ? s->chroma_h_shift : 0)); + frame->data[i] += offset; + } + frame->width = s->avctx->width; + frame->height = s->avctx->height; + + return 0; +} + static av_cold int encode_init(AVCodecContext *avctx) { - SnowContext *s = avctx->priv_data; + SnowEncContext *const enc = avctx->priv_data; + SnowContext *const s = &enc->com; + MpegEncContext *const mpv = &enc->m; int plane_index, ret; int i; - if(s->pred == DWT_97 + if (enc->pred == DWT_97 && (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 AVERROR(EINVAL); } - s->spatial_decomposition_type= s->pred; //FIXME add decorrelator type r transform_type + s->spatial_decomposition_type = enc->pred; //FIXME add decorrelator type r transform_type s->mv_scale = (avctx->flags & AV_CODEC_FLAG_QPEL) ? 2 : 4; s->block_max_depth= (avctx->flags & AV_CODEC_FLAG_4MV ) ? 1 : 0; @@ -65,31 +183,59 @@ static av_cold int encode_init(AVCodecContext *avctx) s->plane[plane_index].fast_mc= 1; } + // Must be before ff_snow_common_init() + ff_hpeldsp_init(&s->hdsp, avctx->flags); if ((ret = ff_snow_common_init(avctx)) < 0) { return ret; } - ff_me_cmp_init(&s->mecc, avctx); - ff_mpegvideoencdsp_init(&s->mpvencdsp, avctx); + +#define mcf(dx,dy)\ + enc->qdsp.put_qpel_pixels_tab [0][dy+dx/4]=\ + enc->qdsp.put_no_rnd_qpel_pixels_tab[0][dy+dx/4]=\ + s->h264qpel.put_h264_qpel_pixels_tab[0][dy+dx/4];\ + enc->qdsp.put_qpel_pixels_tab [1][dy+dx/4]=\ + enc->qdsp.put_no_rnd_qpel_pixels_tab[1][dy+dx/4]=\ + s->h264qpel.put_h264_qpel_pixels_tab[1][dy+dx/4]; + + mcf( 0, 0) + mcf( 4, 0) + mcf( 8, 0) + mcf(12, 0) + mcf( 0, 4) + mcf( 4, 4) + mcf( 8, 4) + mcf(12, 4) + mcf( 0, 8) + mcf( 4, 8) + mcf( 8, 8) + mcf(12, 8) + mcf( 0,12) + mcf( 4,12) + mcf( 8,12) + mcf(12,12) + + ff_me_cmp_init(&enc->mecc, avctx); + ff_mpegvideoencdsp_init(&enc->mpvencdsp, avctx); ff_snow_alloc_blocks(s); s->version=0; - s->m.avctx = avctx; - s->m.bit_rate= avctx->bit_rate; - s->m.lmin = avctx->mb_lmin; - s->m.lmax = avctx->mb_lmax; - s->m.mb_num = (avctx->width * avctx->height + 255) / 256; // For ratecontrol + mpv->avctx = avctx; + mpv->bit_rate= avctx->bit_rate; + mpv->lmin = avctx->mb_lmin; + mpv->lmax = avctx->mb_lmax; + mpv->mb_num = (avctx->width * avctx->height + 255) / 256; // For ratecontrol - s->m.me.temp = - s->m.me.scratchpad = av_calloc(avctx->width + 64, 2*16*2*sizeof(uint8_t)); - s->m.sc.obmc_scratchpad= av_mallocz(MB_SIZE*MB_SIZE*12*sizeof(uint32_t)); - s->m.me.map = av_mallocz(2 * ME_MAP_SIZE * sizeof(*s->m.me.map)); - if (!s->m.me.scratchpad || !s->m.me.map || !s->m.sc.obmc_scratchpad) + mpv->me.temp = + mpv->me.scratchpad = av_calloc(avctx->width + 64, 2*16*2*sizeof(uint8_t)); + mpv->sc.obmc_scratchpad= av_mallocz(MB_SIZE*MB_SIZE*12*sizeof(uint32_t)); + mpv->me.map = av_mallocz(2 * ME_MAP_SIZE * sizeof(*mpv->me.map)); + if (!mpv->me.scratchpad || !mpv->me.map || !mpv->sc.obmc_scratchpad) return AVERROR(ENOMEM); - s->m.me.score_map = s->m.me.map + ME_MAP_SIZE; + mpv->me.score_map = mpv->me.map + ME_MAP_SIZE; - ff_h263_encode_init(&s->m); //mv_penalty + ff_h263_encode_init(mpv); //mv_penalty s->max_ref_frames = av_clip(avctx->refs, 1, MAX_REF_FRAMES); @@ -101,11 +247,11 @@ static av_cold int encode_init(AVCodecContext *avctx) return AVERROR(ENOMEM); } if((avctx->flags&AV_CODEC_FLAG_PASS2) || !(avctx->flags&AV_CODEC_FLAG_QSCALE)){ - ret = ff_rate_control_init(&s->m); + ret = ff_rate_control_init(mpv); if(ret < 0) return ret; } - s->pass1_rc= !(avctx->flags & (AV_CODEC_FLAG_QSCALE|AV_CODEC_FLAG_PASS2)); + enc->pass1_rc = !(avctx->flags & (AV_CODEC_FLAG_QSCALE|AV_CODEC_FLAG_PASS2)); switch(avctx->pix_fmt){ case AV_PIX_FMT_YUV444P: @@ -130,8 +276,8 @@ static av_cold int encode_init(AVCodecContext *avctx) if (ret) return ret; - ret = ff_set_cmp(&s->mecc, s->mecc.me_cmp, s->avctx->me_cmp); - ret |= ff_set_cmp(&s->mecc, s->mecc.me_sub_cmp, s->avctx->me_sub_cmp); + ret = ff_set_cmp(&enc->mecc, enc->mecc.me_cmp, s->avctx->me_cmp); + ret |= ff_set_cmp(&enc->mecc, enc->mecc.me_sub_cmp, s->avctx->me_sub_cmp); if (ret < 0) return AVERROR(EINVAL); @@ -139,10 +285,10 @@ static av_cold int encode_init(AVCodecContext *avctx) if (!s->input_picture) return AVERROR(ENOMEM); - if ((ret = ff_snow_get_buffer(s, s->input_picture)) < 0) + if ((ret = get_encode_buffer(s, s->input_picture)) < 0) return ret; - if(s->motion_est == FF_ME_ITER){ + if (enc->motion_est == FF_ME_ITER) { int size= s->b_width * s->b_height << 2*s->block_max_depth; for(i=0; imax_ref_frames; i++){ s->ref_mvs[i] = av_calloc(size, sizeof(*s->ref_mvs[i])); @@ -220,7 +366,10 @@ static inline int get_penalty_factor(int lambda, int lambda2, int type){ #define P_MV1 P[9] #define FLAG_QPEL 1 //must be 1 -static int encode_q_branch(SnowContext *s, int level, int x, int y){ +static int encode_q_branch(SnowEncContext *enc, int level, int x, int y) +{ + SnowContext *const s = &enc->com; + MotionEstContext *const c = &enc->m.me; uint8_t p_buffer[1024]; uint8_t i_buffer[1024]; uint8_t p_state[sizeof(s->block_state)]; @@ -257,7 +406,6 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){ int16_t last_mv[3][2]; 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); int mx_context= av_log2(2*FFABS(left->mx - top->mx)); int my_context= av_log2(2*FFABS(left->my - top->my)); @@ -286,18 +434,18 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){ last_mv[2][0]= bottom->mx; last_mv[2][1]= bottom->my; - s->m.mb_stride=2; - s->m.mb_x= - s->m.mb_y= 0; + enc->m.mb_stride = 2; + enc->m.mb_x = + enc->m.mb_y = 0; c->skip= 0; av_assert1(c-> stride == stride); av_assert1(c->uvstride == uvstride); - c->penalty_factor = get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_cmp); - c->sub_penalty_factor= get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_sub_cmp); - c->mb_penalty_factor = get_penalty_factor(s->lambda, s->lambda2, c->avctx->mb_cmp); - c->current_mv_penalty= c->mv_penalty[s->m.f_code=1] + MAX_DMV; + c->penalty_factor = get_penalty_factor(enc->lambda, enc->lambda2, c->avctx->me_cmp); + c->sub_penalty_factor= get_penalty_factor(enc->lambda, enc->lambda2, c->avctx->me_sub_cmp); + c->mb_penalty_factor = get_penalty_factor(enc->lambda, enc->lambda2, c->avctx->mb_cmp); + c->current_mv_penalty = c->mv_penalty[enc->m.f_code=1] + MAX_DMV; c->xmin = - x*block_w - 16+3; c->ymin = - y*block_w - 16+3; @@ -328,7 +476,7 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){ for(ref=0; refref_frames; ref++){ init_ref(c, current_data, s->last_picture[ref]->data, NULL, block_w*x, block_w*y, 0); - ref_score= ff_epzs_motion_search(&s->m, &ref_mx, &ref_my, P, 0, /*ref_index*/ 0, last_mv, + ref_score= ff_epzs_motion_search(&enc->m, &ref_mx, &ref_my, P, 0, /*ref_index*/ 0, last_mv, (1<<16)>>shift, level-LOG2_MB_SIZE+4, block_w); av_assert2(ref_mx >= c->xmin); @@ -336,8 +484,8 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){ av_assert2(ref_my >= c->ymin); av_assert2(ref_my <= c->ymax); - ref_score= c->sub_motion_search(&s->m, &ref_mx, &ref_my, ref_score, 0, 0, level-LOG2_MB_SIZE+4, block_w); - ref_score= ff_get_mb_score(&s->m, ref_mx, ref_my, 0, 0, level-LOG2_MB_SIZE+4, block_w, 0); + ref_score= c->sub_motion_search(&enc->m, &ref_mx, &ref_my, ref_score, 0, 0, level-LOG2_MB_SIZE+4, block_w); + ref_score= ff_get_mb_score(&enc->m, ref_mx, ref_my, 0, 0, level-LOG2_MB_SIZE+4, block_w, 0); ref_score+= 2*av_log2(2*ref)*c->penalty_factor; if(s->ref_mvs[ref]){ s->ref_mvs[ref][index][0]= ref_mx; @@ -369,7 +517,7 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){ put_symbol(&pc, &p_state[128 + 32*(mx_context + 16*!!best_ref)], mx - pmx, 1); put_symbol(&pc, &p_state[128 + 32*(my_context + 16*!!best_ref)], my - pmy, 1); p_len= pc.bytestream - pc.bytestream_start; - score += (s->lambda2*(get_rac_count(&pc)-base_bits))>>FF_LAMBDA_SHIFT; + score += (enc->lambda2*(get_rac_count(&pc)-base_bits))>>FF_LAMBDA_SHIFT; block_s= block_w*block_w; sum = pix_sum(current_data[0], stride, block_w, block_w); @@ -400,9 +548,9 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){ put_symbol(&ic, &i_state[96], cr-pcr, 1); } i_len= ic.bytestream - ic.bytestream_start; - iscore += (s->lambda2*(get_rac_count(&ic)-base_bits))>>FF_LAMBDA_SHIFT; + iscore += (enc->lambda2*(get_rac_count(&ic)-base_bits))>>FF_LAMBDA_SHIFT; - av_assert1(iscore < 255*255*256 + s->lambda2*10); + av_assert1(iscore < 255*255*256 + enc->lambda2*10); av_assert1(iscore >= 0); av_assert1(l>=0 && l<=255); av_assert1(pl>=0 && pl<=255); @@ -413,16 +561,16 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){ if (vard <= 64 || vard < varc) c->scene_change_score+= ff_sqrt(vard) - ff_sqrt(varc); else - c->scene_change_score+= s->m.qscale; + c->scene_change_score += enc->m.qscale; } if(level!=s->block_max_depth){ put_rac(&s->c, &s->block_state[4 + s_context], 0); - score2 = encode_q_branch(s, level+1, 2*x+0, 2*y+0); - score2+= encode_q_branch(s, level+1, 2*x+1, 2*y+0); - score2+= encode_q_branch(s, level+1, 2*x+0, 2*y+1); - score2+= encode_q_branch(s, level+1, 2*x+1, 2*y+1); - score2+= s->lambda2>>FF_LAMBDA_SHIFT; //FIXME exact split overhead + score2 = encode_q_branch(enc, level+1, 2*x+0, 2*y+0); + score2+= encode_q_branch(enc, level+1, 2*x+1, 2*y+0); + score2+= encode_q_branch(enc, level+1, 2*x+0, 2*y+1); + score2+= encode_q_branch(enc, level+1, 2*x+1, 2*y+1); + score2+= enc->lambda2>>FF_LAMBDA_SHIFT; //FIXME exact split overhead if(score2 < score && score2 < iscore) return score2; @@ -504,7 +652,9 @@ static void encode_q_branch2(SnowContext *s, int level, int x, int y){ } } -static int get_dc(SnowContext *s, int mb_x, int mb_y, int plane_index){ +static int get_dc(SnowEncContext *enc, int mb_x, int mb_y, int plane_index) +{ + SnowContext *const s = &enc->com; int i, x2, y2; Plane *p= &s->plane[plane_index]; const int block_size = MB_SIZE >> s->block_max_depth; @@ -514,7 +664,7 @@ static int get_dc(SnowContext *s, int mb_x, int mb_y, int plane_index){ const int obmc_stride= plane_index ? (2*block_size)>>s->chroma_h_shift : 2*block_size; const int ref_stride= s->current_picture->linesize[plane_index]; const uint8_t *src = s->input_picture->data[plane_index]; - IDWTELEM *dst= (IDWTELEM*)s->m.sc.obmc_scratchpad + plane_index*block_size*block_size*4; //FIXME change to unsigned + IDWTELEM *dst= (IDWTELEM*)enc->m.sc.obmc_scratchpad + plane_index*block_size*block_size*4; //FIXME change to unsigned const int b_stride = s->b_width << s->block_max_depth; const int w= p->width; const int h= p->height; @@ -600,7 +750,10 @@ static inline int get_block_bits(SnowContext *s, int x, int y, int w){ } } -static int get_block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index, uint8_t (*obmc_edged)[MB_SIZE * 2]){ +static int get_block_rd(SnowEncContext *enc, int mb_x, int mb_y, + int plane_index, uint8_t (*obmc_edged)[MB_SIZE * 2]) +{ + SnowContext *const s = &enc->com; Plane *p= &s->plane[plane_index]; const int block_size = MB_SIZE >> s->block_max_depth; const int block_w = plane_index ? block_size>>s->chroma_h_shift : block_size; @@ -609,7 +762,7 @@ static int get_block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index, uin const int ref_stride= s->current_picture->linesize[plane_index]; uint8_t *dst= s->current_picture->data[plane_index]; const uint8_t *src = s->input_picture->data[plane_index]; - IDWTELEM *pred= (IDWTELEM*)s->m.sc.obmc_scratchpad + plane_index*block_size*block_size*4; + IDWTELEM *pred= (IDWTELEM*)enc->m.sc.obmc_scratchpad + plane_index*block_size*block_size*4; uint8_t *cur = s->scratchbuf; uint8_t *tmp = s->emu_edge_buffer; const int b_stride = s->b_width << s->block_max_depth; @@ -618,7 +771,7 @@ static int get_block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index, uin const int h= p->height; int distortion; int rate= 0; - const int penalty_factor= get_penalty_factor(s->lambda, s->lambda2, s->avctx->me_cmp); + const int penalty_factor = get_penalty_factor(enc->lambda, enc->lambda2, s->avctx->me_cmp); int sx= block_w*mb_x - block_w/2; int sy= block_h*mb_y - block_h/2; int x0= FFMAX(0,-sx); @@ -672,19 +825,19 @@ static int get_block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index, uin * to improve the score of the whole frame, thus iterative motion * estimation does not always converge. */ if(s->avctx->me_cmp == FF_CMP_W97) - distortion = ff_w97_32_c(&s->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, 32); + distortion = ff_w97_32_c(&enc->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, 32); else if(s->avctx->me_cmp == FF_CMP_W53) - distortion = ff_w53_32_c(&s->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, 32); + distortion = ff_w53_32_c(&enc->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, 32); else{ distortion = 0; for(i=0; i<4; i++){ int off = sx+16*(i&1) + (sy+16*(i>>1))*ref_stride; - distortion += s->mecc.me_cmp[0](&s->m, src + off, dst + off, ref_stride, 16); + distortion += enc->mecc.me_cmp[0](&enc->m, src + off, dst + off, ref_stride, 16); } } }else{ av_assert2(block_w==8); - distortion = s->mecc.me_cmp[0](&s->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, block_w*2); + distortion = enc->mecc.me_cmp[0](&enc->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, block_w*2); } if(plane_index==0){ @@ -701,7 +854,9 @@ static int get_block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index, uin return distortion + rate*penalty_factor; } -static int get_4block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index){ +static int get_4block_rd(SnowEncContext *enc, int mb_x, int mb_y, int plane_index) +{ + SnowContext *const s = &enc->com; int i, y2; Plane *p= &s->plane[plane_index]; const int block_size = MB_SIZE >> s->block_max_depth; @@ -720,7 +875,7 @@ static int get_4block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index){ const int h= p->height; int distortion= 0; int rate= 0; - const int penalty_factor= get_penalty_factor(s->lambda, s->lambda2, s->avctx->me_cmp); + const int penalty_factor= get_penalty_factor(enc->lambda, enc->lambda2, s->avctx->me_cmp); av_assert2(s->chroma_h_shift == s->chroma_v_shift); //obmc and square assumtions below @@ -748,7 +903,7 @@ static int get_4block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index){ } av_assert1(block_w== 8 || block_w==16); - distortion += s->mecc.me_cmp[block_w==8](&s->m, src + x + y*ref_stride, dst + x + y*ref_stride, ref_stride, block_h); + distortion += enc->mecc.me_cmp[block_w==8](&enc->m, src + x + y*ref_stride, dst + x + y*ref_stride, ref_stride, block_h); } if(plane_index==0){ @@ -897,9 +1052,10 @@ static int encode_subband(SnowContext *s, SubBand *b, const IDWTELEM *src, const // encode_subband_dzr(s, b, src, parent, stride, orientation); } -static av_always_inline int check_block_intra(SnowContext *s, int mb_x, int mb_y, int p[3], +static av_always_inline int check_block_intra(SnowEncContext *enc, int mb_x, int mb_y, int p[3], uint8_t (*obmc_edged)[MB_SIZE * 2], int *best_rd) { + SnowContext *const s = &enc->com; const int b_stride= s->b_width << s->block_max_depth; BlockNode *block= &s->block[mb_x + mb_y * b_stride]; BlockNode backup= *block; @@ -913,7 +1069,7 @@ static av_always_inline int check_block_intra(SnowContext *s, int mb_x, int mb_y block->color[2] = p[2]; block->type |= BLOCK_INTRA; - rd = get_block_rd(s, mb_x, mb_y, 0, obmc_edged) + s->intra_penalty; + rd = get_block_rd(enc, mb_x, mb_y, 0, obmc_edged) + enc->intra_penalty; //FIXME chroma if(rd < *best_rd){ @@ -927,7 +1083,11 @@ static av_always_inline int check_block_intra(SnowContext *s, int mb_x, int mb_y /* special case for int[2] args we discard afterwards, * fixes compilation problem with gcc 2.95 */ -static av_always_inline int check_block_inter(SnowContext *s, int mb_x, int mb_y, int p0, int p1, uint8_t (*obmc_edged)[MB_SIZE * 2], int *best_rd){ +static av_always_inline int check_block_inter(SnowEncContext *enc, + int mb_x, int mb_y, int p0, int p1, + uint8_t (*obmc_edged)[MB_SIZE * 2], int *best_rd) +{ + SnowContext *const s = &enc->com; const int b_stride = s->b_width << s->block_max_depth; BlockNode *block = &s->block[mb_x + mb_y * b_stride]; BlockNode backup = *block; @@ -938,16 +1098,16 @@ static av_always_inline int check_block_inter(SnowContext *s, int mb_x, int mb_y av_assert2(mb_x < b_stride); index = (p0 + 31 * p1) & (ME_CACHE_SIZE-1); - value = s->me_cache_generation + (p0 >> 10) + p1 * (1 << 6) + (block->ref << 12); - if (s->me_cache[index] == value) + value = enc->me_cache_generation + (p0 >> 10) + p1 * (1 << 6) + (block->ref << 12); + if (enc->me_cache[index] == value) return 0; - s->me_cache[index] = value; + enc->me_cache[index] = value; block->mx = p0; block->my = p1; block->type &= ~BLOCK_INTRA; - rd = get_block_rd(s, mb_x, mb_y, 0, obmc_edged); + rd = get_block_rd(enc, mb_x, mb_y, 0, obmc_edged); //FIXME chroma if (rd < *best_rd) { @@ -959,7 +1119,10 @@ static av_always_inline int check_block_inter(SnowContext *s, int mb_x, int mb_y } } -static av_always_inline int check_4block_inter(SnowContext *s, int mb_x, int mb_y, int p0, int p1, int ref, int *best_rd){ +static av_always_inline int check_4block_inter(SnowEncContext *enc, int mb_x, int mb_y, + int p0, int p1, int ref, int *best_rd) +{ + SnowContext *const s = &enc->com; const int b_stride= s->b_width << s->block_max_depth; BlockNode *block= &s->block[mb_x + mb_y * b_stride]; BlockNode backup[4]; @@ -979,10 +1142,10 @@ static av_always_inline int check_4block_inter(SnowContext *s, int mb_x, int mb_ av_assert2(((mb_x|mb_y)&1) == 0); index= (p0 + 31*p1) & (ME_CACHE_SIZE-1); - value= s->me_cache_generation + (p0>>10) + (p1<<6) + (block->ref<<12); - if(s->me_cache[index] == value) + value = enc->me_cache_generation + (p0>>10) + (p1<<6) + (block->ref<<12); + if (enc->me_cache[index] == value) return 0; - s->me_cache[index]= value; + enc->me_cache[index] = value; block->mx= p0; block->my= p1; @@ -990,7 +1153,7 @@ static av_always_inline int check_4block_inter(SnowContext *s, int mb_x, int mb_ block->type &= ~BLOCK_INTRA; block[1]= block[b_stride]= block[b_stride+1]= *block; - rd= get_4block_rd(s, mb_x, mb_y, 0); + rd = get_4block_rd(enc, mb_x, mb_y, 0); //FIXME chroma if(rd < *best_rd){ @@ -1005,7 +1168,9 @@ static av_always_inline int check_4block_inter(SnowContext *s, int mb_x, int mb_ } } -static void iterative_me(SnowContext *s){ +static void iterative_me(SnowEncContext *enc) +{ + SnowContext *const s = &enc->com; int pass, mb_x, mb_y; const int b_width = s->b_width << s->block_max_depth; const int b_height= s->b_height << s->block_max_depth; @@ -1018,7 +1183,7 @@ static void iterative_me(SnowContext *s){ memcpy(state, s->block_state, sizeof(s->block_state)); for(mb_y= 0; mb_yb_height; mb_y++) for(mb_x= 0; mb_xb_width; mb_x++) - encode_q_branch(s, 0, mb_x, mb_y); + encode_q_branch(enc, 0, mb_x, mb_y); s->c = r; memcpy(s->block_state, state, sizeof(s->block_state)); } @@ -1050,9 +1215,9 @@ static void iterative_me(SnowContext *s){ backup= *block; - if(!s->me_cache_generation) - memset(s->me_cache, 0, sizeof(s->me_cache)); - s->me_cache_generation += 1<<22; + if (!enc->me_cache_generation) + memset(enc->me_cache, 0, sizeof(enc->me_cache)); + enc->me_cache_generation += 1<<22; //FIXME precalculate { @@ -1108,14 +1273,14 @@ static void iterative_me(SnowContext *s){ // intra(black) = neighbors' contribution to the current block for(i=0; i < s->nb_planes; i++) - color[i]= get_dc(s, mb_x, mb_y, i); + color[i]= get_dc(enc, mb_x, mb_y, i); // get previous score (cannot be cached due to OBMC) if(pass > 0 && (block->type&BLOCK_INTRA)){ int color0[3]= {block->color[0], block->color[1], block->color[2]}; - check_block_intra(s, mb_x, mb_y, color0, obmc_edged, &best_rd); + check_block_intra(enc, mb_x, mb_y, color0, obmc_edged, &best_rd); }else - check_block_inter(s, mb_x, mb_y, block->mx, block->my, obmc_edged, &best_rd); + check_block_inter(enc, mb_x, mb_y, block->mx, block->my, obmc_edged, &best_rd); ref_b= *block; ref_rd= best_rd; @@ -1126,30 +1291,30 @@ static void iterative_me(SnowContext *s){ block->ref= ref; best_rd= INT_MAX; - check_block_inter(s, mb_x, mb_y, mvr[0][0], mvr[0][1], obmc_edged, &best_rd); - check_block_inter(s, mb_x, mb_y, 0, 0, obmc_edged, &best_rd); + check_block_inter(enc, mb_x, mb_y, mvr[0][0], mvr[0][1], obmc_edged, &best_rd); + check_block_inter(enc, mb_x, mb_y, 0, 0, obmc_edged, &best_rd); if(tb) - check_block_inter(s, mb_x, mb_y, mvr[-b_stride][0], mvr[-b_stride][1], obmc_edged, &best_rd); + check_block_inter(enc, mb_x, mb_y, mvr[-b_stride][0], mvr[-b_stride][1], obmc_edged, &best_rd); if(lb) - check_block_inter(s, mb_x, mb_y, mvr[-1][0], mvr[-1][1], obmc_edged, &best_rd); + check_block_inter(enc, mb_x, mb_y, mvr[-1][0], mvr[-1][1], obmc_edged, &best_rd); if(rb) - check_block_inter(s, mb_x, mb_y, mvr[1][0], mvr[1][1], obmc_edged, &best_rd); + check_block_inter(enc, mb_x, mb_y, mvr[1][0], mvr[1][1], obmc_edged, &best_rd); if(bb) - check_block_inter(s, mb_x, mb_y, mvr[b_stride][0], mvr[b_stride][1], obmc_edged, &best_rd); + check_block_inter(enc, mb_x, mb_y, mvr[b_stride][0], mvr[b_stride][1], obmc_edged, &best_rd); /* fullpel ME */ //FIXME avoid subpel interpolation / round to nearest integer 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); + int dia_size = enc->iterative_dia_size ? enc->iterative_dia_size : FFMAX(s->avctx->dia_size, 1); dia_change=0; for(i=0; i < dia_size; i++){ for(j=0; jmx+square[i][0], block->my+square[i][1], obmc_edged, &best_rd); + dia_change |= check_block_inter(enc, mb_x, mb_y, block->mx+square[i][0], block->my+square[i][1], obmc_edged, &best_rd); }while(dia_change); //FIXME or try the standard 2 pass qpel or similar @@ -1171,7 +1336,7 @@ static void iterative_me(SnowContext *s){ } best_rd= ref_rd; *block= ref_b; - check_block_intra(s, mb_x, mb_y, color, obmc_edged, &best_rd); + check_block_intra(enc, mb_x, mb_y, color, obmc_edged, &best_rd); //FIXME RD style color selection if(!same_block(block, &backup)){ if(tb ) tb ->type &= ~BLOCK_OPT; @@ -1209,20 +1374,20 @@ static void iterative_me(SnowContext *s){ same_block(b[0], b[3])) continue; - if(!s->me_cache_generation) - memset(s->me_cache, 0, sizeof(s->me_cache)); - s->me_cache_generation += 1<<22; + if (!enc->me_cache_generation) + memset(enc->me_cache, 0, sizeof(enc->me_cache)); + enc->me_cache_generation += 1<<22; - init_rd= best_rd= get_4block_rd(s, mb_x, mb_y, 0); + init_rd = best_rd = get_4block_rd(enc, mb_x, mb_y, 0); //FIXME more multiref search? - check_4block_inter(s, mb_x, mb_y, + check_4block_inter(enc, mb_x, mb_y, (b[0]->mx + b[1]->mx + b[2]->mx + b[3]->mx + 2) >> 2, (b[0]->my + b[1]->my + b[2]->my + b[3]->my + 2) >> 2, 0, &best_rd); for(i=0; i<4; i++) if(!(b[i]->type&BLOCK_INTRA)) - check_4block_inter(s, mb_x, mb_y, b[i]->mx, b[i]->my, b[i]->ref, &best_rd); + check_4block_inter(enc, mb_x, mb_y, b[i]->mx, b[i]->my, b[i]->ref, &best_rd); if(init_rd != best_rd) change++; @@ -1232,13 +1397,15 @@ static void iterative_me(SnowContext *s){ } } -static void encode_blocks(SnowContext *s, int search){ +static void encode_blocks(SnowEncContext *enc, int search) +{ + SnowContext *const s = &enc->com; int x, y; int w= s->b_width; int h= s->b_height; - if(s->motion_est == FF_ME_ITER && !s->keyframe && search) - iterative_me(s); + if (enc->motion_est == FF_ME_ITER && !s->keyframe && search) + iterative_me(enc); for(y=0; yc.bytestream_end - s->c.bytestream < w*MB_SIZE*MB_SIZE*3){ //FIXME nicer limit @@ -1246,10 +1413,10 @@ static void encode_blocks(SnowContext *s, int search){ return; } for(x=0; xmotion_est == FF_ME_ITER || !search) + if (enc->motion_est == FF_ME_ITER || !search) encode_q_branch2(s, 0, x, y); else - encode_q_branch (s, 0, x, y); + encode_q_branch (enc, 0, x, y); } } } @@ -1496,8 +1663,9 @@ static int qscale2qlog(int qscale){ + 61*QROOT/8; ///< 64 > 60 } -static int ratecontrol_1pass(SnowContext *s, AVFrame *pict) +static int ratecontrol_1pass(SnowEncContext *enc, AVFrame *pict) { + SnowContext *const s = &enc->com; /* Estimate the frame's complexity as a sum of weighted dwt coefficients. * FIXME we know exact mv bits at this point, * but ratecontrol isn't set up to include them. */ @@ -1532,17 +1700,17 @@ static int ratecontrol_1pass(SnowContext *s, AVFrame *pict) coef_sum = (uint64_t)coef_sum * coef_sum >> 16; if(pict->pict_type == AV_PICTURE_TYPE_I){ - s->m.mb_var_sum = coef_sum; - s->m.mc_mb_var_sum = 0; + enc->m.mb_var_sum = coef_sum; + enc->m.mc_mb_var_sum = 0; }else{ - s->m.mc_mb_var_sum = coef_sum; - s->m.mb_var_sum = 0; + enc->m.mc_mb_var_sum = coef_sum; + enc->m.mb_var_sum = 0; } - pict->quality= ff_rate_estimate_qscale(&s->m, 1); + pict->quality= ff_rate_estimate_qscale(&enc->m, 1); if (pict->quality < 0) return INT_MIN; - s->lambda= pict->quality * 3/2; + enc->lambda= pict->quality * 3/2; delta_qlog= qscale2qlog(pict->quality) - s->qlog; s->qlog+= delta_qlog; return delta_qlog; @@ -1581,7 +1749,9 @@ static void calculate_visual_weight(SnowContext *s, Plane *p){ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet) { - SnowContext *s = avctx->priv_data; + SnowEncContext *const enc = avctx->priv_data; + SnowContext *const s = &enc->com; + MpegEncContext *const mpv = &enc->m; RangeCoder * const c= &s->c; AVCodecInternal *avci = avctx->internal; AVFrame *pic; @@ -1604,7 +1774,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, memcpy(&s->input_picture->data[i][y * s->input_picture->linesize[i]], &pict->data[i][y * pict->linesize[i]], AV_CEIL_RSHIFT(width, hshift)); - s->mpvencdsp.draw_edges(s->input_picture->data[i], s->input_picture->linesize[i], + enc->mpvencdsp.draw_edges(s->input_picture->data[i], s->input_picture->linesize[i], AV_CEIL_RSHIFT(width, hshift), AV_CEIL_RSHIFT(height, vshift), EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift, EDGE_TOP | EDGE_BOTTOM); @@ -1615,54 +1785,57 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, pic->pict_type = pict->pict_type; pic->quality = pict->quality; - s->m.picture_number= avctx->frame_num; + mpv->picture_number = avctx->frame_num; if(avctx->flags&AV_CODEC_FLAG_PASS2){ - s->m.pict_type = pic->pict_type = s->m.rc_context.entry[avctx->frame_num].new_pict_type; + mpv->pict_type = pic->pict_type = mpv->rc_context.entry[avctx->frame_num].new_pict_type; s->keyframe = pic->pict_type == AV_PICTURE_TYPE_I; if(!(avctx->flags&AV_CODEC_FLAG_QSCALE)) { - pic->quality = ff_rate_estimate_qscale(&s->m, 0); + pic->quality = ff_rate_estimate_qscale(mpv, 0); if (pic->quality < 0) return -1; } }else{ s->keyframe= avctx->gop_size==0 || avctx->frame_num % avctx->gop_size == 0; - s->m.pict_type = pic->pict_type = s->keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P; + mpv->pict_type = pic->pict_type = s->keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P; } - if(s->pass1_rc && avctx->frame_num == 0) + if (enc->pass1_rc && avctx->frame_num == 0) pic->quality = 2*FF_QP2LAMBDA; if (pic->quality) { s->qlog = qscale2qlog(pic->quality); - s->lambda = pic->quality * 3/2; + enc->lambda = pic->quality * 3/2; } if (s->qlog < 0 || (!pic->quality && (avctx->flags & AV_CODEC_FLAG_QSCALE))) { s->qlog= LOSSLESS_QLOG; - s->lambda = 0; + enc->lambda = 0; }//else keep previous frame's qlog until after motion estimation if (s->current_picture->data[0]) { int w = s->avctx->width; int h = s->avctx->height; - s->mpvencdsp.draw_edges(s->current_picture->data[0], - s->current_picture->linesize[0], w , h , - EDGE_WIDTH , EDGE_WIDTH , EDGE_TOP | EDGE_BOTTOM); + enc->mpvencdsp.draw_edges(s->current_picture->data[0], + s->current_picture->linesize[0], w , h , + EDGE_WIDTH , EDGE_WIDTH , EDGE_TOP | EDGE_BOTTOM); if (s->current_picture->data[2]) { - s->mpvencdsp.draw_edges(s->current_picture->data[1], - s->current_picture->linesize[1], w>>s->chroma_h_shift, h>>s->chroma_v_shift, - EDGE_WIDTH>>s->chroma_h_shift, EDGE_WIDTH>>s->chroma_v_shift, EDGE_TOP | EDGE_BOTTOM); - s->mpvencdsp.draw_edges(s->current_picture->data[2], - s->current_picture->linesize[2], w>>s->chroma_h_shift, h>>s->chroma_v_shift, - EDGE_WIDTH>>s->chroma_h_shift, EDGE_WIDTH>>s->chroma_v_shift, EDGE_TOP | EDGE_BOTTOM); + enc->mpvencdsp.draw_edges(s->current_picture->data[1], + s->current_picture->linesize[1], w>>s->chroma_h_shift, h>>s->chroma_v_shift, + EDGE_WIDTH>>s->chroma_h_shift, EDGE_WIDTH>>s->chroma_v_shift, EDGE_TOP | EDGE_BOTTOM); + enc->mpvencdsp.draw_edges(s->current_picture->data[2], + s->current_picture->linesize[2], w>>s->chroma_h_shift, h>>s->chroma_v_shift, + EDGE_WIDTH>>s->chroma_h_shift, EDGE_WIDTH>>s->chroma_v_shift, EDGE_TOP | EDGE_BOTTOM); } emms_c(); } - ff_snow_frame_start(s); + ff_snow_frames_prepare(s); + ret = get_encode_buffer(s, s->current_picture); + if (ret < 0) + return ret; - s->m.current_picture_ptr= &s->m.current_picture; - s->m.current_picture.f = s->current_picture; - s->m.current_picture.f->pts = pict->pts; + mpv->current_picture_ptr = &mpv->current_picture; + mpv->current_picture.f = s->current_picture; + mpv->current_picture.f->pts = pict->pts; if(pic->pict_type == AV_PICTURE_TYPE_P){ int block_width = (width +15)>>4; int block_height= (height+15)>>4; @@ -1671,40 +1844,40 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, av_assert0(s->current_picture->data[0]); av_assert0(s->last_picture[0]->data[0]); - s->m.avctx= s->avctx; - s->m. last_picture.f = s->last_picture[0]; - s->m. new_picture = s->input_picture; - s->m. last_picture_ptr= &s->m. last_picture; - s->m.linesize = stride; - s->m.uvlinesize= s->current_picture->linesize[1]; - s->m.width = width; - s->m.height= height; - s->m.mb_width = block_width; - s->m.mb_height= block_height; - 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 = pic->pict_type; - 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 & AV_CODEC_FLAG_QPEL)!=0; - s->m.out_format= FMT_H263; - s->m.unrestricted_mv= 1; + mpv->avctx = s->avctx; + mpv->last_picture.f = s->last_picture[0]; + mpv-> new_picture = s->input_picture; + mpv->last_picture_ptr = &mpv->last_picture; + mpv->linesize = stride; + mpv->uvlinesize = s->current_picture->linesize[1]; + mpv->width = width; + mpv->height = height; + mpv->mb_width = block_width; + mpv->mb_height = block_height; + mpv->mb_stride = mpv->mb_width + 1; + mpv->b8_stride = 2 * mpv->mb_width + 1; + mpv->f_code = 1; + mpv->pict_type = pic->pict_type; + mpv->motion_est = enc->motion_est; + mpv->me.scene_change_score = 0; + mpv->me.dia_size = avctx->dia_size; + mpv->quarter_sample = (s->avctx->flags & AV_CODEC_FLAG_QPEL)!=0; + mpv->out_format = FMT_H263; + mpv->unrestricted_mv = 1; - s->m.lambda = s->lambda; - s->m.qscale= (s->m.lambda*139 + FF_LAMBDA_SCALE*64) >> (FF_LAMBDA_SHIFT + 7); - s->lambda2= s->m.lambda2= (s->m.lambda*s->m.lambda + FF_LAMBDA_SCALE/2) >> FF_LAMBDA_SHIFT; + mpv->lambda = enc->lambda; + mpv->qscale = (mpv->lambda*139 + FF_LAMBDA_SCALE*64) >> (FF_LAMBDA_SHIFT + 7); + enc->lambda2 = mpv->lambda2 = (mpv->lambda*mpv->lambda + FF_LAMBDA_SCALE/2) >> FF_LAMBDA_SHIFT; - s->m.mecc= s->mecc; //move - s->m.qdsp= s->qdsp; //move - s->m.hdsp = s->hdsp; - ff_init_me(&s->m); - s->hdsp = s->m.hdsp; - s->mecc= s->m.mecc; + mpv->mecc = enc->mecc; //move + mpv->qdsp = enc->qdsp; //move + mpv->hdsp = s->hdsp; + ff_init_me(&enc->m); + s->hdsp = mpv->hdsp; + enc->mecc = mpv->mecc; } - if(s->pass1_rc){ + if (enc->pass1_rc) { memcpy(rc_header_bak, s->header_state, sizeof(s->header_state)); memcpy(rc_block_bak, s->block_state, sizeof(s->block_state)); } @@ -1722,7 +1895,7 @@ redo_frame: return AVERROR(EINVAL); } - s->m.pict_type = pic->pict_type; + mpv->pict_type = pic->pict_type; s->qbias = pic->pict_type == AV_PICTURE_TYPE_P ? 2 : 0; ff_snow_common_init_after_header(avctx); @@ -1734,9 +1907,9 @@ redo_frame: } encode_header(s); - s->m.misc_bits = 8*(s->c.bytestream - s->c.bytestream_start); - encode_blocks(s, 1); - s->m.mv_bits = 8*(s->c.bytestream - s->c.bytestream_start) - s->m.misc_bits; + mpv->misc_bits = 8 * (s->c.bytestream - s->c.bytestream_start); + encode_blocks(enc, 1); + mpv->mv_bits = 8 * (s->c.bytestream - s->c.bytestream_start) - mpv->misc_bits; for(plane_index=0; plane_index < s->nb_planes; plane_index++){ Plane *p= &s->plane[plane_index]; @@ -1745,7 +1918,7 @@ redo_frame: int x, y; // int bits= put_bits_count(&s->c.pb); - if (!s->memc_only) { + if (!enc->memc_only) { //FIXME optimize if(pict->data[plane_index]) //FIXME gray hack for(y=0; ypict_type == AV_PICTURE_TYPE_P && !(avctx->flags&AV_CODEC_FLAG_PASS2) - && s->m.me.scene_change_score > s->scenechange_threshold){ + && mpv->me.scene_change_score > enc->scenechange_threshold) { ff_init_range_encoder(c, pkt->data, pkt->size); ff_build_rac_states(c, (1LL<<32)/20, 256-8); pic->pict_type= AV_PICTURE_TYPE_I; @@ -1783,8 +1956,8 @@ redo_frame: ff_spatial_dwt(s->spatial_dwt_buffer, s->temp_dwt_buffer, w, h, w, s->spatial_decomposition_type, s->spatial_decomposition_count); - if(s->pass1_rc && plane_index==0){ - int delta_qlog = ratecontrol_1pass(s, pic); + if (enc->pass1_rc && plane_index==0) { + int delta_qlog = ratecontrol_1pass(enc, pic); if (delta_qlog <= INT_MIN) return -1; if(delta_qlog){ @@ -1793,7 +1966,7 @@ redo_frame: memcpy(s->header_state, rc_header_bak, sizeof(s->header_state)); memcpy(s->block_state, rc_block_bak, sizeof(s->block_state)); encode_header(s); - encode_blocks(s, 0); + encode_blocks(enc, 0); } } @@ -1804,7 +1977,7 @@ redo_frame: quantize(s, b, b->ibuf, b->buf, b->stride, s->qbias); if(orientation==0) decorrelate(s, b, b->ibuf, b->stride, pic->pict_type == AV_PICTURE_TYPE_P, 0); - if (!s->no_bitstream) + if (!enc->no_bitstream) encode_subband(s, b, b->ibuf, b->parent ? b->parent->ibuf : NULL, b->stride, orientation); av_assert0(b->parent==NULL || b->parent->stride == b->stride*2); if(orientation==0) @@ -1854,7 +2027,7 @@ redo_frame: } } s->avctx->error[plane_index] += error; - s->encoding_error[plane_index] = error; + enc->encoding_error[plane_index] = error; } } @@ -1866,28 +2039,27 @@ redo_frame: s->current_picture->pict_type = pic->pict_type; s->current_picture->quality = pic->quality; - s->m.frame_bits = 8*(s->c.bytestream - s->c.bytestream_start); - s->m.p_tex_bits = s->m.frame_bits - s->m.misc_bits - s->m.mv_bits; - s->m.current_picture.display_picture_number = - s->m.current_picture.coded_picture_number = avctx->frame_num; - s->m.current_picture.f->quality = pic->quality; - s->m.total_bits += 8*(s->c.bytestream - s->c.bytestream_start); - if(s->pass1_rc) - if (ff_rate_estimate_qscale(&s->m, 0) < 0) + mpv->frame_bits = 8 * (s->c.bytestream - s->c.bytestream_start); + mpv->p_tex_bits = mpv->frame_bits - mpv->misc_bits - mpv->mv_bits; + mpv->total_bits += 8*(s->c.bytestream - s->c.bytestream_start); + mpv->current_picture.display_picture_number = + mpv->current_picture.coded_picture_number = avctx->frame_num; + mpv->current_picture.f->quality = pic->quality; + if (enc->pass1_rc) + if (ff_rate_estimate_qscale(mpv, 0) < 0) return -1; if(avctx->flags&AV_CODEC_FLAG_PASS1) - ff_write_pass1_stats(&s->m); - s->m.last_pict_type = s->m.pict_type; + ff_write_pass1_stats(mpv); + mpv->last_pict_type = mpv->pict_type; emms_c(); ff_side_data_set_encoder_stats(pkt, s->current_picture->quality, - s->encoding_error, + enc->encoding_error, (s->avctx->flags&AV_CODEC_FLAG_PSNR) ? SNOW_MAX_PLANES : 0, s->current_picture->pict_type); if (s->avctx->flags & AV_CODEC_FLAG_RECON_FRAME) { - av_frame_unref(avci->recon_frame); - av_frame_ref(avci->recon_frame, s->current_picture); + av_frame_replace(avci->recon_frame, s->current_picture); } pkt->size = ff_rac_terminate(c, 0); @@ -1900,17 +2072,29 @@ redo_frame: static av_cold int encode_end(AVCodecContext *avctx) { - SnowContext *s = avctx->priv_data; + SnowEncContext *const enc = avctx->priv_data; + SnowContext *const s = &enc->com; ff_snow_common_end(s); - ff_rate_control_uninit(&s->m); + ff_rate_control_uninit(&enc->m); av_frame_free(&s->input_picture); + + for (int i = 0; i < MAX_REF_FRAMES; i++) { + av_freep(&s->ref_mvs[i]); + av_freep(&s->ref_scores[i]); + } + + enc->m.me.temp = NULL; + av_freep(&enc->m.me.scratchpad); + av_freep(&enc->m.me.map); + av_freep(&enc->m.sc.obmc_scratchpad); + av_freep(&avctx->stats_out); return 0; } -#define OFFSET(x) offsetof(SnowContext, x) +#define OFFSET(x) offsetof(SnowEncContext, 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_ITER, VE, "motion_est" }, @@ -1949,7 +2133,7 @@ const FFCodec ff_snow_encoder = { .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE | AV_CODEC_CAP_ENCODER_RECON_FRAME, - .priv_data_size = sizeof(SnowContext), + .priv_data_size = sizeof(SnowEncContext), .init = encode_init, FF_CODEC_ENCODE_CB(encode_frame), .close = encode_end, diff --git a/src/third_party/ffmpeg/libavcodec/speedhqdec.c b/src/third_party/ffmpeg/libavcodec/speedhqdec.c index ff106009..f3e84ab3 100644 --- a/src/third_party/ffmpeg/libavcodec/speedhqdec.c +++ b/src/third_party/ffmpeg/libavcodec/speedhqdec.c @@ -506,7 +506,7 @@ static av_cold void compute_alpha_vlcs(void) av_assert0(entry == FF_ARRAY_ELEMS(run_code)); - INIT_LE_VLC_SPARSE_STATIC(&dc_alpha_run_vlc_le, ALPHA_VLC_BITS, + VLC_INIT_LE_SPARSE_STATIC(&dc_alpha_run_vlc_le, ALPHA_VLC_BITS, FF_ARRAY_ELEMS(run_code), run_bits, 1, 1, run_code, 2, 2, @@ -546,7 +546,7 @@ static av_cold void compute_alpha_vlcs(void) av_assert0(entry == FF_ARRAY_ELEMS(level_code)); - INIT_LE_VLC_SPARSE_STATIC(&dc_alpha_level_vlc_le, ALPHA_VLC_BITS, + VLC_INIT_LE_SPARSE_STATIC(&dc_alpha_level_vlc_le, ALPHA_VLC_BITS, FF_ARRAY_ELEMS(level_code), level_bits, 1, 1, level_code, 2, 2, @@ -556,18 +556,18 @@ static av_cold void compute_alpha_vlcs(void) static av_cold void speedhq_static_init(void) { /* Exactly the same as MPEG-2, except for a little-endian reader. */ - INIT_CUSTOM_VLC_STATIC(&dc_lum_vlc_le, DC_VLC_BITS, 12, + VLC_INIT_CUSTOM_STATIC(&dc_lum_vlc_le, DC_VLC_BITS, 12, ff_mpeg12_vlc_dc_lum_bits, 1, 1, ff_mpeg12_vlc_dc_lum_code, 2, 2, - INIT_VLC_OUTPUT_LE, 512); - INIT_CUSTOM_VLC_STATIC(&dc_chroma_vlc_le, DC_VLC_BITS, 12, + VLC_INIT_OUTPUT_LE, 512); + VLC_INIT_CUSTOM_STATIC(&dc_chroma_vlc_le, DC_VLC_BITS, 12, ff_mpeg12_vlc_dc_chroma_bits, 1, 1, ff_mpeg12_vlc_dc_chroma_code, 2, 2, - INIT_VLC_OUTPUT_LE, 514); + VLC_INIT_OUTPUT_LE, 514); ff_init_2d_vlc_rl(ff_speedhq_vlc_table, speedhq_rl_vlc, ff_speedhq_run, ff_speedhq_level, SPEEDHQ_RL_NB_ELEMS, - FF_ARRAY_ELEMS(speedhq_rl_vlc), INIT_VLC_LE); + FF_ARRAY_ELEMS(speedhq_rl_vlc), VLC_INIT_LE); compute_alpha_vlcs(); } diff --git a/src/third_party/ffmpeg/libavcodec/svq1dec.c b/src/third_party/ffmpeg/libavcodec/svq1dec.c index c7269456..8563b291 100644 --- a/src/third_party/ffmpeg/libavcodec/svq1dec.c +++ b/src/third_party/ffmpeg/libavcodec/svq1dec.c @@ -282,7 +282,7 @@ static int svq1_decode_block_non_intra(GetBitContext *bitbuf, uint8_t *pixels, SVQ1_CALC_CODEBOOK_ENTRIES(ff_svq1_inter_codebooks); for (y = 0; y < height; y++) { - for (x = 0; x < width / 4; x++, codebook++) { + for (x = 0; x < width / 4; x++) { n3 = dst[x]; /* add mean value to vector */ n1 = n4 + ((n3 & 0xFF00FF00) >> 8); @@ -290,6 +290,8 @@ static int svq1_decode_block_non_intra(GetBitContext *bitbuf, uint8_t *pixels, SVQ1_ADD_CODEBOOK() /* store result */ dst[x] = n1 << 8 | n2; + if (codebook != NULL) + codebook++; } dst += pitch / 4; } @@ -764,8 +766,7 @@ static int svq1_decode_frame(AVCodecContext *avctx, AVFrame *cur, } if (!s->nonref) { - av_frame_unref(s->prev); - result = av_frame_ref(s->prev, cur); + result = av_frame_replace(s->prev, cur); if (result < 0) return result; } @@ -778,11 +779,11 @@ static int svq1_decode_frame(AVCodecContext *avctx, AVFrame *cur, static av_cold void svq1_static_init(void) { - INIT_VLC_STATIC(&svq1_block_type, SVQ1_BLOCK_TYPE_VLC_BITS, 4, + VLC_INIT_STATIC(&svq1_block_type, SVQ1_BLOCK_TYPE_VLC_BITS, 4, &ff_svq1_block_type_vlc[0][1], 2, 1, &ff_svq1_block_type_vlc[0][0], 2, 1, 8); - INIT_VLC_STATIC(&svq1_motion_component, 7, 33, + VLC_INIT_STATIC(&svq1_motion_component, 7, 33, &ff_mvtab[0][1], 2, 1, &ff_mvtab[0][0], 2, 1, 176); @@ -793,24 +794,24 @@ static av_cold void svq1_static_init(void) svq1_intra_multistage[i].table = &table[offset]; svq1_intra_multistage[i].table_allocated = sizes[0][i]; offset += sizes[0][i]; - init_vlc(&svq1_intra_multistage[i], 3, 8, + vlc_init(&svq1_intra_multistage[i], 3, 8, &ff_svq1_intra_multistage_vlc[i][0][1], 2, 1, &ff_svq1_intra_multistage_vlc[i][0][0], 2, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); svq1_inter_multistage[i].table = &table[offset]; svq1_inter_multistage[i].table_allocated = sizes[1][i]; offset += sizes[1][i]; - init_vlc(&svq1_inter_multistage[i], 3, 8, + vlc_init(&svq1_inter_multistage[i], 3, 8, &ff_svq1_inter_multistage_vlc[i][0][1], 2, 1, &ff_svq1_inter_multistage_vlc[i][0][0], 2, 1, - INIT_VLC_USE_NEW_STATIC); + VLC_INIT_USE_STATIC); } - INIT_VLC_STATIC(&svq1_intra_mean, 8, 256, + VLC_INIT_STATIC(&svq1_intra_mean, 8, 256, &ff_svq1_intra_mean_vlc[0][1], 4, 2, &ff_svq1_intra_mean_vlc[0][0], 4, 2, 632); - INIT_VLC_STATIC(&svq1_inter_mean, 9, 512, + VLC_INIT_STATIC(&svq1_inter_mean, 9, 512, &ff_svq1_inter_mean_vlc[0][1], 4, 2, &ff_svq1_inter_mean_vlc[0][0], 4, 2, 1434); } diff --git a/src/third_party/ffmpeg/libavcodec/svq1enc.c b/src/third_party/ffmpeg/libavcodec/svq1enc.c index 4651e01a..46a484e1 100644 --- a/src/third_party/ffmpeg/libavcodec/svq1enc.c +++ b/src/third_party/ffmpeg/libavcodec/svq1enc.c @@ -26,6 +26,7 @@ * http://www.pcisys.net/~melanson/codecs/ */ +#include "libavutil/emms.h" #include "avcodec.h" #include "codec_internal.h" #include "encode.h" @@ -118,7 +119,7 @@ static void svq1_write_header(SVQ1EncContext *s, PutBitContext *pb, int frame_ty /* output 5 unknown bits (2 + 2 + 1) */ put_bits(pb, 5, 2); /* 2 needed by quicktime decoder */ - i = ff_match_2uint16((void*)ff_svq1_frame_size_table, + i = ff_match_2uint16(ff_svq1_frame_size_table, FF_ARRAY_ELEMS(ff_svq1_frame_size_table), s->frame_width, s->frame_height); put_bits(pb, 3, i); diff --git a/src/third_party/ffmpeg/libavcodec/tak.c b/src/third_party/ffmpeg/libavcodec/tak.c index 99678e98..91feac54 100644 --- a/src/third_party/ffmpeg/libavcodec/tak.c +++ b/src/third_party/ffmpeg/libavcodec/tak.c @@ -144,11 +144,11 @@ int avpriv_tak_parse_streaminfo(TAKStreamInfo *s, const uint8_t *buf, int size) return tak_parse_streaminfo(s, &gb); } -int ff_tak_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, +int ff_tak_decode_frame_header(void *logctx, GetBitContext *gb, TAKStreamInfo *ti, int log_level_offset) { if (get_bits(gb, TAK_FRAME_HEADER_SYNC_ID_BITS) != TAK_FRAME_HEADER_SYNC_ID) { - av_log(avctx, AV_LOG_ERROR + log_level_offset, "missing sync id\n"); + av_log(logctx, AV_LOG_ERROR + log_level_offset, "missing sync id\n"); return AVERROR_INVALIDDATA; } diff --git a/src/third_party/ffmpeg/libavcodec/tak.h b/src/third_party/ffmpeg/libavcodec/tak.h index 5e43598d..1d1ee645 100644 --- a/src/third_party/ffmpeg/libavcodec/tak.h +++ b/src/third_party/ffmpeg/libavcodec/tak.h @@ -29,7 +29,6 @@ #include -#include "avcodec.h" #include "get_bits.h" #define TAK_FORMAT_DATA_TYPE_BITS 3 @@ -151,13 +150,13 @@ int avpriv_tak_parse_streaminfo(TAKStreamInfo *s, const uint8_t *buf, int size); /** * Validate and decode a frame header. - * @param avctx AVCodecContext to use as av_log() context + * @param logctx for use as av_log() context * @param[in] gb GetBitContext from which to read frame header * @param[out] s frame information * @param log_level_offset log level offset, can be used to silence * error messages. * @return non-zero on error, 0 if OK */ -int ff_tak_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, +int ff_tak_decode_frame_header(void *logctx, GetBitContext *gb, TAKStreamInfo *s, int log_level_offset); #endif /* AVCODEC_TAK_H */ diff --git a/src/third_party/ffmpeg/libavcodec/tests/.gitignore b/src/third_party/ffmpeg/libavcodec/tests/.gitignore index 2acfc4e8..0df4ae10 100644 --- a/src/third_party/ffmpeg/libavcodec/tests/.gitignore +++ b/src/third_party/ffmpeg/libavcodec/tests/.gitignore @@ -1,12 +1,12 @@ +/av1_levels /avcodec -/avfft /avpacket +/bitstream_be +/bitstream_le /cabac /celp_math /codec_desc /dct -/fft -/fft-fixed32 /golomb /h264_levels /h265_levels diff --git a/src/third_party/ffmpeg/libavcodec/tests/av1_levels.c b/src/third_party/ffmpeg/libavcodec/tests/av1_levels.c new file mode 100644 index 00000000..e862d197 --- /dev/null +++ b/src/third_party/ffmpeg/libavcodec/tests/av1_levels.c @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2023 Intel Corporation + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include "libavutil/log.h" +#include "libavcodec/av1_levels.h" + +static const struct { + int width; + int height; + float framerate; + int level_idx; +} test_sizes[] = { + { 426, 240, 30.0, 0 }, + { 640, 360, 30.0, 1 }, + { 854, 480, 30.0, 4 }, + { 1280, 720, 30.0, 5 }, + { 1920, 1080, 30.0, 8 }, + { 1920, 1080, 60.0, 9 }, + { 3840, 2160, 30.0, 12 }, + { 3840, 2160, 60.0, 13 }, + { 3840, 2160, 120.0, 14 }, + { 7680, 4320, 30.0, 16 }, + { 7680, 4320, 60.0, 17 }, + { 7680, 4320, 120.0, 18 }, +}; + +static const struct { + int64_t bitrate; + int tier; + int level_idx; +} test_bitrate[] = { + { 1500000, 0, 0 }, + { 3000000, 0, 1 }, + { 6000000, 0, 4 }, + { 10000000, 0, 5 }, + { 12000000, 0, 8 }, + { 30000000, 1, 8 }, + { 20000000, 0, 9 }, + { 50000000, 1, 9 }, + { 30000000, 0, 12 }, + { 100000000, 1, 12 }, + { 40000000, 0, 13 }, + { 160000000, 1, 13 }, + { 60000000, 0, 14 }, + { 240000000, 1, 14 }, + { 100000000, 0, 17 }, + { 480000000, 1, 17 }, + { 160000000, 0, 18 }, + { 800000000, 1, 18 }, +}; + +static const struct { + int tiles; + int tile_cols; + int level_idx; +} test_tiles[] = { + { 8, 4, 0 }, + { 16, 6, 4 }, + { 32, 8, 8 }, + { 64, 8, 12 }, + { 128, 16, 16 }, +}; + +int main(void) +{ + const AV1LevelDescriptor *level; + int i; + +#define CHECK(expected, format, ...) do { \ + if (level ? (level->level_idx != expected) \ + : !level) { \ + av_log(NULL, AV_LOG_ERROR, "Incorrect level for " \ + format ": expected %d, got %d.\n", __VA_ARGS__, \ + expected, level ? level->level_idx : -1); \ + return 1; \ + } \ + } while (0) + + for (i = 0; i < FF_ARRAY_ELEMS(test_sizes); i++) { + level = ff_av1_guess_level(0, 0, + test_sizes[i].width, + test_sizes[i].height, + 0, 0, test_sizes[i].framerate); + CHECK(test_sizes[i].level_idx, "size %dx%d, framerate %f", + test_sizes[i].width, test_sizes[i].height, test_sizes[i].framerate); + } + + for (i = 0; i < FF_ARRAY_ELEMS(test_bitrate); i++) { + level = ff_av1_guess_level(test_bitrate[i].bitrate, + test_bitrate[i].tier, + 0, 0, 0, 0, 0); + CHECK(test_bitrate[i].level_idx, "bitrate %"PRId64" tier %d", + test_bitrate[i].bitrate, test_bitrate[i].tier); + } + + for (i = 0; i < FF_ARRAY_ELEMS(test_tiles); i++) { + level = ff_av1_guess_level(0, 0, 0, 0, + test_tiles[i].tiles, + test_tiles[i].tile_cols, + 0); + CHECK(test_tiles[i].level_idx, "tiles %d, tile cols %d", + test_tiles[i].tiles, + test_tiles[i].tile_cols); + } + + return 0; +} diff --git a/src/third_party/ffmpeg/libavcodec/tests/codec_desc.c b/src/third_party/ffmpeg/libavcodec/tests/codec_desc.c index c9b34973..bceb91a3 100644 --- a/src/third_party/ffmpeg/libavcodec/tests/codec_desc.c +++ b/src/third_party/ffmpeg/libavcodec/tests/codec_desc.c @@ -16,7 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "libavcodec/avcodec.h" +#include "libavcodec/codec_desc.h" int main(int argc, char **argv) { diff --git a/src/third_party/ffmpeg/libavcodec/tests/dct.c b/src/third_party/ffmpeg/libavcodec/tests/dct.c index c847af2f..010d0c1a 100644 --- a/src/third_party/ffmpeg/libavcodec/tests/dct.c +++ b/src/third_party/ffmpeg/libavcodec/tests/dct.c @@ -37,12 +37,14 @@ #include "libavutil/cpu.h" #include "libavutil/common.h" +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "libavutil/lfg.h" #include "libavutil/mem_internal.h" #include "libavutil/time.h" #include "libavcodec/dct.h" +#include "libavcodec/fdctdsp.h" #include "libavcodec/idctdsp.h" #include "libavcodec/simple_idct.h" #include "libavcodec/xvididct.h" diff --git a/src/third_party/ffmpeg/libavcodec/tests/h264_levels.c b/src/third_party/ffmpeg/libavcodec/tests/h264_levels.c index 98febcc4..af3bfe01 100644 --- a/src/third_party/ffmpeg/libavcodec/tests/h264_levels.c +++ b/src/third_party/ffmpeg/libavcodec/tests/h264_levels.c @@ -16,7 +16,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "libavutil/common.h" +#include +#include + +#include "libavutil/log.h" +#include "libavutil/macros.h" #include "libavcodec/h264_levels.h" static const struct { diff --git a/src/third_party/ffmpeg/libavcodec/tests/motion.c b/src/third_party/ffmpeg/libavcodec/tests/motion.c index ef6e1ff3..caa8ecb8 100644 --- a/src/third_party/ffmpeg/libavcodec/tests/motion.c +++ b/src/third_party/ffmpeg/libavcodec/tests/motion.c @@ -30,6 +30,7 @@ #include "config.h" #include "libavcodec/me_cmp.h" #include "libavutil/cpu.h" +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "libavutil/lfg.h" #include "libavutil/mem.h" diff --git a/src/third_party/ffmpeg/libavcodec/thread.h b/src/third_party/ffmpeg/libavcodec/thread.h index 88a14cfe..4edcfc31 100644 --- a/src/third_party/ffmpeg/libavcodec/thread.h +++ b/src/third_party/ffmpeg/libavcodec/thread.h @@ -52,6 +52,8 @@ void ff_thread_flush(AVCodecContext *avctx); int ff_thread_decode_frame(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, AVPacket *avpkt); +int ff_thread_can_start_frame(AVCodecContext *avctx); + /** * If the codec defines update_thread_context(), call this * when they are ready for the next thread to start decoding @@ -62,8 +64,6 @@ int ff_thread_decode_frame(AVCodecContext *avctx, AVFrame *picture, */ void ff_thread_finish_setup(AVCodecContext *avctx); -#define ff_thread_get_format ff_get_format - /** * Wrapper around get_buffer() for frame-multithreaded codecs. * Call this function instead of ff_get_buffer(f). @@ -75,12 +75,7 @@ void ff_thread_finish_setup(AVCodecContext *avctx); int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f, int flags); /** - * Wrapper around release_buffer() frame-for multithreaded codecs. - * Call this function instead of avctx->release_buffer(f). - * The AVFrame will be copied and the actual release_buffer() call - * will be performed later. The contents of data pointed to by the - * AVFrame should not be changed until ff_thread_get_buffer() is called - * on it. + * Wrapper around av_frame_unref() for frame-threaded codecs. * * @param avctx The current context. * @param f The picture being released. diff --git a/src/third_party/ffmpeg/libavcodec/threadframe.h b/src/third_party/ffmpeg/libavcodec/threadframe.h index d581c408..a8403c89 100644 --- a/src/third_party/ffmpeg/libavcodec/threadframe.h +++ b/src/third_party/ffmpeg/libavcodec/threadframe.h @@ -87,6 +87,4 @@ int ff_thread_ref_frame(ThreadFrame *dst, const ThreadFrame *src); int ff_thread_replace_frame(AVCodecContext *avctx, ThreadFrame *dst, const ThreadFrame *src); -int ff_thread_can_start_frame(AVCodecContext *avctx); - #endif diff --git a/src/third_party/ffmpeg/libavcodec/tiff.c b/src/third_party/ffmpeg/libavcodec/tiff.c index 14896459..adb49e45 100644 --- a/src/third_party/ffmpeg/libavcodec/tiff.c +++ b/src/third_party/ffmpeg/libavcodec/tiff.c @@ -337,7 +337,7 @@ static void av_always_inline dng_blit(TiffContext *s, uint8_t *dst, int dst_stri (split vertically in the middle). */ for (line = 0; line < height / 2; line++) { uint16_t *dst_u16 = (uint16_t *)dst; - uint16_t *src_u16 = (uint16_t *)src; + const uint16_t *src_u16 = (const uint16_t *)src; /* Blit first half of input row row to initial row of output */ for (col = 0; col < width; col++) @@ -360,7 +360,7 @@ static void av_always_inline dng_blit(TiffContext *s, uint8_t *dst, int dst_stri if (is_u16) { for (line = 0; line < height; line++) { uint16_t *dst_u16 = (uint16_t *)dst; - uint16_t *src_u16 = (uint16_t *)src; + const uint16_t *src_u16 = (const uint16_t *)src; for (col = 0; col < width; col++) *dst_u16++ = dng_process_color16(*src_u16++, s->dng_lut, @@ -570,7 +570,7 @@ static int tiff_uncompress_lzma(uint8_t *dst, uint64_t *len, const uint8_t *src, lzma_stream stream = LZMA_STREAM_INIT; lzma_ret ret; - stream.next_in = (uint8_t *)src; + stream.next_in = src; stream.avail_in = size; stream.next_out = dst; stream.avail_out = *len; diff --git a/src/third_party/ffmpeg/libavcodec/trace_headers_bsf.c b/src/third_party/ffmpeg/libavcodec/trace_headers_bsf.c index 028b0a1e..8781f5f1 100644 --- a/src/third_party/ffmpeg/libavcodec/trace_headers_bsf.c +++ b/src/third_party/ffmpeg/libavcodec/trace_headers_bsf.c @@ -44,6 +44,8 @@ static int trace_headers_init(AVBSFContext *bsf) ctx->cbc->trace_enable = 1; ctx->cbc->trace_level = AV_LOG_INFO; + ctx->cbc->trace_context = ctx->cbc; + ctx->cbc->trace_read_callback = ff_cbs_trace_read_log; if (bsf->par_in->extradata) { CodedBitstreamFragment *frag = &ctx->fragment; diff --git a/src/third_party/ffmpeg/libavcodec/truemotion2.c b/src/third_party/ffmpeg/libavcodec/truemotion2.c index 73c93359..366d8aef 100644 --- a/src/third_party/ffmpeg/libavcodec/truemotion2.c +++ b/src/third_party/ffmpeg/libavcodec/truemotion2.c @@ -198,7 +198,7 @@ static int tm2_build_huff_table(TM2Context *ctx, TM2Codes *code) /* convert codes to vlc_table */ if (res >= 0) { - res = ff_init_vlc_from_lengths(&code->vlc, huff.max_bits, huff.max_num, + res = ff_vlc_init_from_lengths(&code->vlc, huff.max_bits, huff.max_num, huff.lens, sizeof(huff.lens[0]), NULL, 0, 0, 0, 0, ctx->avctx); if (res < 0) @@ -222,8 +222,7 @@ out: static void tm2_free_codes(TM2Codes *code) { av_free(code->recode); - if (code->vlc.table) - ff_free_vlc(&code->vlc); + ff_vlc_free(&code->vlc); } static inline int tm2_get_token(GetBitContext *gb, TM2Codes *code) diff --git a/src/third_party/ffmpeg/libavcodec/tscc2.c b/src/third_party/ffmpeg/libavcodec/tscc2.c index 6e4fe503..168efe93 100644 --- a/src/third_party/ffmpeg/libavcodec/tscc2.c +++ b/src/third_party/ffmpeg/libavcodec/tscc2.c @@ -61,9 +61,9 @@ static av_cold void tscc2_init_vlc(VLC *vlc, int *offset, int nb_codes, vlc->table = &vlc_buf[*offset]; vlc->table_allocated = FF_ARRAY_ELEMS(vlc_buf) - *offset; - ff_init_vlc_from_lengths(vlc, TSCC2_VLC_BITS, nb_codes, + ff_vlc_init_from_lengths(vlc, TSCC2_VLC_BITS, nb_codes, lens, 1, syms, sym_length, sym_length, 0, - INIT_VLC_STATIC_OVERLONG | INIT_VLC_OUTPUT_LE, NULL); + VLC_INIT_STATIC_OVERLONG | VLC_INIT_OUTPUT_LE, NULL); *offset += vlc->table_size; } diff --git a/src/third_party/ffmpeg/libavcodec/tta.c b/src/third_party/ffmpeg/libavcodec/tta.c index 3e89571f..7763ed7f 100644 --- a/src/third_party/ffmpeg/libavcodec/tta.c +++ b/src/third_party/ffmpeg/libavcodec/tta.c @@ -211,7 +211,7 @@ static av_cold int tta_decode_init(AVCodecContext * avctx) av_log(avctx, AV_LOG_DEBUG, "data_length: %d frame_length: %d last: %d total: %d\n", s->data_length, s->frame_length, s->last_frame_length, total_frames); - if(s->frame_length >= UINT_MAX / (s->channels * sizeof(int32_t))){ + if (s->frame_length >= UINT_MAX / (s->channels * sizeof(int32_t))) { av_log(avctx, AV_LOG_ERROR, "frame_length too large\n"); return AVERROR_INVALIDDATA; } @@ -306,14 +306,14 @@ static int tta_decode_frame(AVCodecContext *avctx, AVFrame *frame, rice->sum1 += value - (rice->sum1 >> 4); if (rice->k1 > 0 && rice->sum1 < ff_tta_shift_16[rice->k1]) rice->k1--; - else if(rice->sum1 > ff_tta_shift_16[rice->k1 + 1]) + else if (rice->sum1 > ff_tta_shift_16[rice->k1 + 1]) rice->k1++; value += ff_tta_shift_1[rice->k0]; default: rice->sum0 += value - (rice->sum0 >> 4); if (rice->k0 > 0 && rice->sum0 < ff_tta_shift_16[rice->k0]) rice->k0--; - else if(rice->sum0 > ff_tta_shift_16[rice->k0 + 1]) + else if (rice->sum0 > ff_tta_shift_16[rice->k0 + 1]) rice->k0++; } @@ -342,7 +342,7 @@ static int tta_decode_frame(AVCodecContext *avctx, AVFrame *frame, if (s->channels > 1) { int32_t *r = p - 1; for (*p += *r / 2; r > (int32_t*)p - s->channels; r--) - *r = *(r + 1) - *r; + *r = *(r + 1) - (unsigned)*r; } cur_chan = 0; i++; @@ -399,7 +399,8 @@ error: return ret; } -static av_cold int tta_decode_close(AVCodecContext *avctx) { +static av_cold int tta_decode_close(AVCodecContext *avctx) +{ TTAContext *s = avctx->priv_data; if (s->bps < 3) diff --git a/src/third_party/ffmpeg/libavcodec/ttadata.c b/src/third_party/ffmpeg/libavcodec/ttadata.c index 297d7094..2137a230 100644 --- a/src/third_party/ffmpeg/libavcodec/ttadata.c +++ b/src/third_party/ffmpeg/libavcodec/ttadata.c @@ -47,7 +47,8 @@ void ff_tta_rice_init(TTARice *c, uint32_t k0, uint32_t k1) c->sum1 = ff_tta_shift_16[k1]; } -void ff_tta_filter_init(TTAFilter *c, int32_t shift) { +void ff_tta_filter_init(TTAFilter *c, int32_t shift) +{ memset(c, 0, sizeof(TTAFilter)); c->shift = shift; c->round = ff_tta_shift_1[shift-1]; diff --git a/src/third_party/ffmpeg/libavcodec/ttadsp.c b/src/third_party/ffmpeg/libavcodec/ttadsp.c index fe9e3c69..5dda1958 100644 --- a/src/third_party/ffmpeg/libavcodec/ttadsp.c +++ b/src/third_party/ffmpeg/libavcodec/ttadsp.c @@ -22,7 +22,8 @@ static void tta_filter_process_c(int32_t *qmi, int32_t *dx, int32_t *dl, int32_t *error, int32_t *in, int32_t shift, - int32_t round) { + int32_t round) +{ uint32_t *qm = qmi; if (*error < 0) { diff --git a/src/third_party/ffmpeg/libavcodec/ttmlenc.c b/src/third_party/ffmpeg/libavcodec/ttmlenc.c index fb05c389..6a2ab23c 100644 --- a/src/third_party/ffmpeg/libavcodec/ttmlenc.c +++ b/src/third_party/ffmpeg/libavcodec/ttmlenc.c @@ -45,7 +45,7 @@ typedef struct { static void ttml_text_cb(void *priv, const char *text, int len) { TTMLContext *s = priv; - AVBPrint cur_line = { 0 }; + AVBPrint cur_line; AVBPrint *buffer = &s->buffer; av_bprint_init(&cur_line, len, AV_BPRINT_SIZE_UNLIMITED); diff --git a/src/third_party/ffmpeg/libavcodec/utils.c b/src/third_party/ffmpeg/libavcodec/utils.c index 672eb15d..8807a8c2 100644 --- a/src/third_party/ffmpeg/libavcodec/utils.c +++ b/src/third_party/ffmpeg/libavcodec/utils.c @@ -35,7 +35,9 @@ #include "libavutil/pixfmt.h" #include "avcodec.h" #include "codec.h" +#include "codec_desc.h" #include "codec_internal.h" +#include "codec_par.h" #include "decode.h" #include "hwconfig.h" #include "thread.h" @@ -406,34 +408,6 @@ int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels, return ret; } -void ff_color_frame(AVFrame *frame, const int c[4]) -{ - const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format); - int p, y; - - av_assert0(desc->flags & AV_PIX_FMT_FLAG_PLANAR); - - for (p = 0; pnb_components; p++) { - uint8_t *dst = frame->data[p]; - int is_chroma = p == 1 || p == 2; - int bytes = is_chroma ? AV_CEIL_RSHIFT(frame->width, desc->log2_chroma_w) : frame->width; - int height = is_chroma ? AV_CEIL_RSHIFT(frame->height, desc->log2_chroma_h) : frame->height; - if (desc->comp[0].depth >= 9) { - ((uint16_t*)dst)[0] = c[p]; - av_memcpy_backptr(dst + 2, 2, bytes - 2); - dst += frame->linesize[p]; - for (y = 1; y < height; y++) { - memcpy(dst, frame->data[p], 2*bytes); - dst += frame->linesize[p]; - } - } else { - for (y = 0; y < height; y++) { - memset(dst, c[p], bytes); - dst += frame->linesize[p]; - } - } - } -} int avpriv_codec_get_cap_skip_frame_fill_param(const AVCodec *codec){ return !!(ffcodec(codec)->caps_internal & FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM); @@ -462,10 +436,10 @@ const char *avcodec_get_name(enum AVCodecID id) const char *av_get_profile_name(const AVCodec *codec, int profile) { const AVProfile *p; - if (profile == FF_PROFILE_UNKNOWN || !codec->profiles) + if (profile == AV_PROFILE_UNKNOWN || !codec->profiles) return NULL; - for (p = codec->profiles; p->profile != FF_PROFILE_UNKNOWN; p++) + for (p = codec->profiles; p->profile != AV_PROFILE_UNKNOWN; p++) if (p->profile == profile) return p->name; @@ -477,10 +451,10 @@ const char *avcodec_profile_name(enum AVCodecID codec_id, int profile) const AVCodecDescriptor *desc = avcodec_descriptor_get(codec_id); const AVProfile *p; - if (profile == FF_PROFILE_UNKNOWN || !desc || !desc->profiles) + if (profile == AV_PROFILE_UNKNOWN || !desc || !desc->profiles) return NULL; - for (p = desc->profiles; p->profile != FF_PROFILE_UNKNOWN; p++) + for (p = desc->profiles; p->profile != AV_PROFILE_UNKNOWN; p++) if (p->profile == profile) return p->name; @@ -1046,37 +1020,6 @@ AVCPBProperties *av_cpb_properties_alloc(size_t *size) return props; } -AVCPBProperties *ff_add_cpb_side_data(AVCodecContext *avctx) -{ - AVPacketSideData *tmp; - AVCPBProperties *props; - size_t size; - int i; - - for (i = 0; i < avctx->nb_coded_side_data; i++) - if (avctx->coded_side_data[i].type == AV_PKT_DATA_CPB_PROPERTIES) - return (AVCPBProperties *)avctx->coded_side_data[i].data; - - props = av_cpb_properties_alloc(&size); - if (!props) - return NULL; - - tmp = av_realloc_array(avctx->coded_side_data, avctx->nb_coded_side_data + 1, sizeof(*tmp)); - if (!tmp) { - av_freep(&props); - return NULL; - } - - avctx->coded_side_data = tmp; - avctx->nb_coded_side_data++; - - avctx->coded_side_data[avctx->nb_coded_side_data - 1].type = AV_PKT_DATA_CPB_PROPERTIES; - avctx->coded_side_data[avctx->nb_coded_side_data - 1].data = (uint8_t*)props; - avctx->coded_side_data[avctx->nb_coded_side_data - 1].size = size; - - return props; -} - static unsigned bcd2uint(uint8_t bcd) { unsigned low = bcd & 0xf; @@ -1170,22 +1113,3 @@ int64_t ff_guess_coded_bitrate(AVCodecContext *avctx) return bitrate; } - -int ff_int_from_list_or_default(void *ctx, const char * val_name, int val, - const int * array_valid_values, int default_value) -{ - int i = 0, ref_val; - - while (1) { - ref_val = array_valid_values[i]; - if (ref_val == INT_MAX) - break; - if (val == ref_val) - return val; - i++; - } - /* val is not a valid value */ - av_log(ctx, AV_LOG_DEBUG, - "%s %d are not supported. Set to default value : %d\n", val_name, val, default_value); - return default_value; -} diff --git a/src/third_party/ffmpeg/libavcodec/utvideo.h b/src/third_party/ffmpeg/libavcodec/utvideo.h index 9da9329f..b081b50a 100644 --- a/src/third_party/ffmpeg/libavcodec/utvideo.h +++ b/src/third_party/ffmpeg/libavcodec/utvideo.h @@ -27,12 +27,7 @@ * Common Ut Video header */ -#include "libavutil/common.h" -#include "avcodec.h" -#include "bswapdsp.h" -#include "utvideodsp.h" -#include "lossless_videodsp.h" -#include "lossless_videoencdsp.h" +#include "libavutil/macros.h" enum { PRED_NONE = 0, @@ -61,31 +56,4 @@ enum { UTVIDEO_444 = MKTAG('Y', 'V', '2', '4'), }; -typedef struct UtvideoContext { - const AVClass *class; - AVCodecContext *avctx; - UTVideoDSPContext utdsp; - BswapDSPContext bdsp; - LLVidDSPContext llviddsp; - LLVidEncDSPContext llvidencdsp; - - uint32_t frame_info_size, flags, frame_info, offset; - int planes; - int slices; - int compression; - int interlaced; - int frame_pred; - int pro; - int pack; - - ptrdiff_t slice_stride; - uint8_t *slice_bits, *slice_buffer[4]; - int slice_bits_size; - - const uint8_t *packed_stream[4][256]; - size_t packed_stream_size[4][256]; - const uint8_t *control_stream[4][256]; - size_t control_stream_size[4][256]; -} UtvideoContext; - #endif /* AVCODEC_UTVIDEO_H */ diff --git a/src/third_party/ffmpeg/libavcodec/utvideodec.c b/src/third_party/ffmpeg/libavcodec/utvideodec.c index 66c84352..8a815f55 100644 --- a/src/third_party/ffmpeg/libavcodec/utvideodec.c +++ b/src/third_party/ffmpeg/libavcodec/utvideodec.c @@ -37,8 +37,35 @@ #include "bytestream.h" #include "codec_internal.h" #include "get_bits.h" +#include "lossless_videodsp.h" #include "thread.h" #include "utvideo.h" +#include "utvideodsp.h" + +typedef struct UtvideoContext { + AVCodecContext *avctx; + UTVideoDSPContext utdsp; + BswapDSPContext bdsp; + LLVidDSPContext llviddsp; + + uint32_t frame_info_size, flags, frame_info, offset; + int planes; + int slices; + int compression; + int interlaced; + int frame_pred; + int pro; + int pack; + + uint8_t *slice_bits; + int slice_bits_size; + void *buffer; + + const uint8_t *packed_stream[4][256]; + size_t packed_stream_size[4][256]; + const uint8_t *control_stream[4][256]; + size_t control_stream_size[4][256]; +} UtvideoContext; typedef struct HuffEntry { uint8_t len; @@ -46,7 +73,7 @@ typedef struct HuffEntry { } HuffEntry; static int build_huff(UtvideoContext *c, const uint8_t *src, VLC *vlc, - int *fsym, unsigned nb_elems) + VLC_MULTI *multi, int *fsym, unsigned nb_elems) { int i; HuffEntry he[1024]; @@ -82,11 +109,35 @@ static int build_huff(UtvideoContext *c, const uint8_t *src, VLC *vlc, he[--codes_count[bits[i]]] = (HuffEntry) { bits[i], i }; #define VLC_BITS 11 - return ff_init_vlc_from_lengths(vlc, VLC_BITS, codes_count[0], + return ff_vlc_init_multi_from_lengths(vlc, multi, VLC_BITS, nb_elems, codes_count[0], &he[0].len, sizeof(*he), &he[0].sym, sizeof(*he), 2, 0, 0, c->avctx); } +#define READ_PLANE(b, end) \ +{ \ + buf = !use_pred ? dest : c->buffer; \ + i = 0; \ + for (; CACHED_BITSTREAM_READER && i < width-end && get_bits_left(&gb) > 0;) {\ + ret = get_vlc_multi(&gb, (uint8_t *)buf + i * b, multi.table, \ + vlc.table, VLC_BITS, 3); \ + if (ret > 0) \ + i += ret; \ + if (ret <= 0) \ + goto fail; \ + } \ + for (; i < width && get_bits_left(&gb) > 0; i++) \ + buf[i] = get_vlc2(&gb, vlc.table, VLC_BITS, 3); \ + if (use_pred) { \ + if (b == 2) \ + c->llviddsp.add_left_pred_int16((uint16_t *)dest, (const uint16_t *)buf, 0x3ff, width, prev); \ + else \ + c->llviddsp.add_left_pred((uint8_t *)dest, (const uint8_t *)buf, width, prev); \ + } \ + prev = dest[width-1]; \ + dest += stride; \ +} + static int decode_plane10(UtvideoContext *c, int plane_no, uint16_t *dst, ptrdiff_t stride, int width, int height, @@ -95,11 +146,12 @@ static int decode_plane10(UtvideoContext *c, int plane_no, { int i, j, slice, pix, ret; int sstart, send; + VLC_MULTI multi; VLC vlc; GetBitContext gb; int prev, fsym; - if ((ret = build_huff(c, huff, &vlc, &fsym, 1024)) < 0) { + if ((ret = build_huff(c, huff, &vlc, &multi, &fsym, 1024)) < 0) { av_log(c->avctx, AV_LOG_ERROR, "Cannot build Huffman codes\n"); return ret; } @@ -131,7 +183,7 @@ static int decode_plane10(UtvideoContext *c, int plane_no, send = 0; for (slice = 0; slice < c->slices; slice++) { - uint16_t *dest; + uint16_t *dest, *buf; int slice_data_start, slice_data_end, slice_size; sstart = send; @@ -156,37 +208,20 @@ static int decode_plane10(UtvideoContext *c, int plane_no, init_get_bits(&gb, c->slice_bits, slice_size * 8); prev = 0x200; - for (j = sstart; j < send; j++) { - for (i = 0; i < width; i++) { - pix = get_vlc2(&gb, vlc.table, VLC_BITS, 3); - if (pix < 0) { - av_log(c->avctx, AV_LOG_ERROR, "Decoding error\n"); - goto fail; - } - if (use_pred) { - prev += pix; - prev &= 0x3FF; - pix = prev; - } - dest[i] = pix; - } - dest += stride; - if (get_bits_left(&gb) < 0) { - av_log(c->avctx, AV_LOG_ERROR, - "Slice decoding ran out of bits\n"); - goto fail; - } - } + for (j = sstart; j < send; j++) + READ_PLANE(2, 3) if (get_bits_left(&gb) > 32) av_log(c->avctx, AV_LOG_WARNING, "%d bits left after decoding slice\n", get_bits_left(&gb)); } - ff_free_vlc(&vlc); + ff_vlc_free(&vlc); + ff_vlc_free_multi(&multi); return 0; fail: - ff_free_vlc(&vlc); + ff_vlc_free(&vlc); + ff_vlc_free_multi(&multi); return AVERROR_INVALIDDATA; } @@ -207,6 +242,7 @@ static int decode_plane(UtvideoContext *c, int plane_no, { int i, j, slice, pix; int sstart, send; + VLC_MULTI multi; VLC vlc; GetBitContext gb; int ret, prev, fsym; @@ -259,7 +295,7 @@ static int decode_plane(UtvideoContext *c, int plane_no, return 0; } - if (build_huff(c, src, &vlc, &fsym, 256)) { + if (build_huff(c, src, &vlc, &multi, &fsym, 256)) { av_log(c->avctx, AV_LOG_ERROR, "Cannot build Huffman codes\n"); return AVERROR_INVALIDDATA; } @@ -292,7 +328,7 @@ static int decode_plane(UtvideoContext *c, int plane_no, send = 0; for (slice = 0; slice < c->slices; slice++) { - uint8_t *dest; + uint8_t *dest, *buf; int slice_data_start, slice_data_end, slice_size; sstart = send; @@ -317,36 +353,20 @@ static int decode_plane(UtvideoContext *c, int plane_no, init_get_bits(&gb, c->slice_bits, slice_size * 8); prev = 0x80; - for (j = sstart; j < send; j++) { - for (i = 0; i < width; i++) { - pix = get_vlc2(&gb, vlc.table, VLC_BITS, 3); - if (pix < 0) { - av_log(c->avctx, AV_LOG_ERROR, "Decoding error\n"); - goto fail; - } - if (use_pred) { - prev += pix; - pix = prev; - } - dest[i] = pix; - } - if (get_bits_left(&gb) < 0) { - av_log(c->avctx, AV_LOG_ERROR, - "Slice decoding ran out of bits\n"); - goto fail; - } - dest += stride; - } + for (j = sstart; j < send; j++) + READ_PLANE(1, 5) if (get_bits_left(&gb) > 32) av_log(c->avctx, AV_LOG_WARNING, "%d bits left after decoding slice\n", get_bits_left(&gb)); } - ff_free_vlc(&vlc); + ff_vlc_free(&vlc); + ff_vlc_free_multi(&multi); return 0; fail: - ff_free_vlc(&vlc); + ff_vlc_free(&vlc); + ff_vlc_free_multi(&multi); return AVERROR_INVALIDDATA; } @@ -1039,6 +1059,10 @@ static av_cold int decode_init(AVCodecContext *avctx) return AVERROR_INVALIDDATA; } + c->buffer = av_calloc(avctx->width + 8, c->pro?2:1); + if (!c->buffer) + return AVERROR(ENOMEM); + return 0; } @@ -1047,6 +1071,7 @@ static av_cold int decode_end(AVCodecContext *avctx) UtvideoContext * const c = avctx->priv_data; av_freep(&c->slice_bits); + av_freep(&c->buffer); return 0; } diff --git a/src/third_party/ffmpeg/libavcodec/utvideoenc.c b/src/third_party/ffmpeg/libavcodec/utvideoenc.c index 6e87bbc2..1fcb6854 100644 --- a/src/third_party/ffmpeg/libavcodec/utvideoenc.c +++ b/src/third_party/ffmpeg/libavcodec/utvideoenc.c @@ -33,11 +33,28 @@ #include "encode.h" #include "bswapdsp.h" #include "bytestream.h" +#include "lossless_videoencdsp.h" #include "put_bits.h" #include "mathops.h" #include "utvideo.h" #include "huffman.h" +typedef struct UtvideoContext { + const AVClass *class; + BswapDSPContext bdsp; + LLVidEncDSPContext llvidencdsp; + + uint32_t frame_info_size, flags; + int planes; + int slices; + int compression; + int frame_pred; + + ptrdiff_t slice_stride; + uint8_t *slice_bits, *slice_buffer[4]; + int slice_bits_size; +} UtvideoContext; + typedef struct HuffEntry { uint16_t sym; uint8_t len; @@ -76,7 +93,6 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx) int i, subsampled_height; uint32_t original_format; - c->avctx = avctx; c->frame_info_size = 4; c->slice_stride = FFALIGN(avctx->width, 32); diff --git a/src/third_party/ffmpeg/libavcodec/v210dec.c b/src/third_party/ffmpeg/libavcodec/v210dec.c index 814d65bb..d80fb4e7 100644 --- a/src/third_party/ffmpeg/libavcodec/v210dec.c +++ b/src/third_party/ffmpeg/libavcodec/v210dec.c @@ -33,7 +33,7 @@ typedef struct ThreadData { AVFrame *frame; - uint8_t *buf; + const uint8_t *buf; int stride; } ThreadData; @@ -111,7 +111,7 @@ static int v210_decode_slice(AVCodecContext *avctx, void *arg, int jobnr, int th int stride = td->stride; int slice_start = (avctx->height * jobnr) / s->thread_count; int slice_end = (avctx->height * (jobnr+1)) / s->thread_count; - uint8_t *psrc = td->buf + stride * slice_start; + const uint8_t *psrc = td->buf + stride * slice_start; int16_t *py = (uint16_t*)frame->data[0] + slice_start * frame->linesize[0] / 2; int16_t *pu = (uint16_t*)frame->data[1] + slice_start * frame->linesize[1] / 2; int16_t *pv = (uint16_t*)frame->data[2] + slice_start * frame->linesize[2] / 2; @@ -191,7 +191,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *pic, if (stride) { td.stride = stride; - td.buf = (uint8_t*)psrc; + td.buf = psrc; td.frame = pic; avctx->execute2(avctx, v210_decode_slice, &td, NULL, s->thread_count); } else { @@ -201,7 +201,8 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *pic, if (ret < 0) return ret; decode_row((const uint32_t *)psrc, (uint16_t *)pointers[0], (uint16_t *)pointers[1], (uint16_t *)pointers[2], avctx->width * avctx->height, s->unpack_frame); - av_image_copy(pic->data, pic->linesize, (const uint8_t **)pointers, linesizes, avctx->pix_fmt, avctx->width, avctx->height); + av_image_copy2(pic->data, pic->linesize, pointers, linesizes, + avctx->pix_fmt, avctx->width, avctx->height); av_freep(&pointers[0]); } diff --git a/src/third_party/ffmpeg/libavcodec/v4l2_context.c b/src/third_party/ffmpeg/libavcodec/v4l2_context.c index a40be946..f20f713e 100644 --- a/src/third_party/ffmpeg/libavcodec/v4l2_context.c +++ b/src/third_party/ffmpeg/libavcodec/v4l2_context.c @@ -325,9 +325,13 @@ start: /* 0. handle errors */ if (pfd.revents & POLLERR) { - /* if we are trying to get free buffers but none have been queued yet - no need to raise a warning */ + /* if we are trying to get free buffers but none have been queued yet, + * or if no buffers have been allocated yet, no need to raise a warning + */ if (timeout == 0) { + if (!ctx->buffers) + return NULL; + for (i = 0; i < ctx->num_buffers; i++) { if (ctx->buffers[i].status != V4L2BUF_AVAILABLE) av_log(logger(ctx), AV_LOG_WARNING, "%s POLLERR\n", ctx->name); diff --git a/src/third_party/ffmpeg/libavcodec/v4l2_m2m_enc.c b/src/third_party/ffmpeg/libavcodec/v4l2_m2m_enc.c index 9a0837ec..e08db5d5 100644 --- a/src/third_party/ffmpeg/libavcodec/v4l2_m2m_enc.c +++ b/src/third_party/ffmpeg/libavcodec/v4l2_m2m_enc.c @@ -103,17 +103,17 @@ static inline unsigned int v4l2_h264_profile_from_ff(int p) unsigned int ffmpeg_val; unsigned int v4l2_val; } profile[] = { - { FF_PROFILE_H264_CONSTRAINED_BASELINE, MPEG_VIDEO(H264_PROFILE_CONSTRAINED_BASELINE) }, - { FF_PROFILE_H264_HIGH_444_PREDICTIVE, MPEG_VIDEO(H264_PROFILE_HIGH_444_PREDICTIVE) }, - { FF_PROFILE_H264_HIGH_422_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_422_INTRA) }, - { FF_PROFILE_H264_HIGH_444_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_444_INTRA) }, - { FF_PROFILE_H264_HIGH_10_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_10_INTRA) }, - { FF_PROFILE_H264_HIGH_422, MPEG_VIDEO(H264_PROFILE_HIGH_422) }, - { FF_PROFILE_H264_BASELINE, MPEG_VIDEO(H264_PROFILE_BASELINE) }, - { FF_PROFILE_H264_EXTENDED, MPEG_VIDEO(H264_PROFILE_EXTENDED) }, - { FF_PROFILE_H264_HIGH_10, MPEG_VIDEO(H264_PROFILE_HIGH_10) }, - { FF_PROFILE_H264_MAIN, MPEG_VIDEO(H264_PROFILE_MAIN) }, - { FF_PROFILE_H264_HIGH, MPEG_VIDEO(H264_PROFILE_HIGH) }, + { AV_PROFILE_H264_CONSTRAINED_BASELINE, MPEG_VIDEO(H264_PROFILE_CONSTRAINED_BASELINE) }, + { AV_PROFILE_H264_HIGH_444_PREDICTIVE, MPEG_VIDEO(H264_PROFILE_HIGH_444_PREDICTIVE) }, + { AV_PROFILE_H264_HIGH_422_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_422_INTRA) }, + { AV_PROFILE_H264_HIGH_444_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_444_INTRA) }, + { AV_PROFILE_H264_HIGH_10_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_10_INTRA) }, + { AV_PROFILE_H264_HIGH_422, MPEG_VIDEO(H264_PROFILE_HIGH_422) }, + { AV_PROFILE_H264_BASELINE, MPEG_VIDEO(H264_PROFILE_BASELINE) }, + { AV_PROFILE_H264_EXTENDED, MPEG_VIDEO(H264_PROFILE_EXTENDED) }, + { AV_PROFILE_H264_HIGH_10, MPEG_VIDEO(H264_PROFILE_HIGH_10) }, + { AV_PROFILE_H264_MAIN, MPEG_VIDEO(H264_PROFILE_MAIN) }, + { AV_PROFILE_H264_HIGH, MPEG_VIDEO(H264_PROFILE_HIGH) }, }; int i; @@ -130,11 +130,11 @@ static inline int v4l2_mpeg4_profile_from_ff(int p) unsigned int ffmpeg_val; unsigned int v4l2_val; } profile[] = { - { FF_PROFILE_MPEG4_ADVANCED_CODING, MPEG_VIDEO(MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY) }, - { FF_PROFILE_MPEG4_ADVANCED_SIMPLE, MPEG_VIDEO(MPEG4_PROFILE_ADVANCED_SIMPLE) }, - { FF_PROFILE_MPEG4_SIMPLE_SCALABLE, MPEG_VIDEO(MPEG4_PROFILE_SIMPLE_SCALABLE) }, - { FF_PROFILE_MPEG4_SIMPLE, MPEG_VIDEO(MPEG4_PROFILE_SIMPLE) }, - { FF_PROFILE_MPEG4_CORE, MPEG_VIDEO(MPEG4_PROFILE_CORE) }, + { AV_PROFILE_MPEG4_ADVANCED_CODING, MPEG_VIDEO(MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY) }, + { AV_PROFILE_MPEG4_ADVANCED_SIMPLE, MPEG_VIDEO(MPEG4_PROFILE_ADVANCED_SIMPLE) }, + { AV_PROFILE_MPEG4_SIMPLE_SCALABLE, MPEG_VIDEO(MPEG4_PROFILE_SIMPLE_SCALABLE) }, + { AV_PROFILE_MPEG4_SIMPLE, MPEG_VIDEO(MPEG4_PROFILE_SIMPLE) }, + { AV_PROFILE_MPEG4_CORE, MPEG_VIDEO(MPEG4_PROFILE_CORE) }, }; int i; @@ -206,7 +206,7 @@ static int v4l2_prepare_encoder(V4L2m2mContext *s) switch (avctx->codec_id) { case AV_CODEC_ID_H264: - if (avctx->profile != FF_PROFILE_UNKNOWN) { + if (avctx->profile != AV_PROFILE_UNKNOWN) { val = v4l2_h264_profile_from_ff(avctx->profile); if (val < 0) av_log(avctx, AV_LOG_WARNING, "h264 profile not found\n"); @@ -219,7 +219,7 @@ static int v4l2_prepare_encoder(V4L2m2mContext *s) qmax = 51; break; case AV_CODEC_ID_MPEG4: - if (avctx->profile != FF_PROFILE_UNKNOWN) { + if (avctx->profile != AV_PROFILE_UNKNOWN) { val = v4l2_mpeg4_profile_from_ff(avctx->profile); if (val < 0) av_log(avctx, AV_LOG_WARNING, "mpeg4 profile not found\n"); diff --git a/src/third_party/ffmpeg/libavcodec/vaapi_av1.c b/src/third_party/ffmpeg/libavcodec/vaapi_av1.c index d0339b27..85b50843 100644 --- a/src/third_party/ffmpeg/libavcodec/vaapi_av1.c +++ b/src/third_party/ffmpeg/libavcodec/vaapi_av1.c @@ -19,8 +19,7 @@ */ #include "libavutil/frame.h" -#include "libavutil/pixdesc.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "vaapi_decode.h" #include "internal.h" #include "av1dec.h" @@ -434,11 +433,11 @@ static int vaapi_av1_decode_slice(AVCodecContext *avctx, return 0; } -const AVHWAccel ff_av1_vaapi_hwaccel = { - .name = "av1_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AV1, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_av1_vaapi_hwaccel = { + .p.name = "av1_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = vaapi_av1_start_frame, .end_frame = vaapi_av1_end_frame, .decode_slice = vaapi_av1_decode_slice, diff --git a/src/third_party/ffmpeg/libavcodec/vaapi_decode.c b/src/third_party/ffmpeg/libavcodec/vaapi_decode.c index dd55cbd6..ceac769c 100644 --- a/src/third_party/ffmpeg/libavcodec/vaapi_decode.c +++ b/src/third_party/ffmpeg/libavcodec/vaapi_decode.c @@ -23,6 +23,7 @@ #include "libavutil/pixdesc.h" #include "avcodec.h" +#include "codec_desc.h" #include "decode.h" #include "internal.h" #include "vaapi_decode.h" @@ -390,7 +391,7 @@ static const struct { VAProfile va_profile; VAProfile (*profile_parser)(AVCodecContext *avctx); } vaapi_profile_map[] = { -#define MAP(c, p, v, ...) { AV_CODEC_ID_ ## c, FF_PROFILE_ ## p, VAProfile ## v, __VA_ARGS__ } +#define MAP(c, p, v, ...) { AV_CODEC_ID_ ## c, AV_PROFILE_ ## p, VAProfile ## v, __VA_ARGS__ } MAP(MPEG2VIDEO, MPEG2_SIMPLE, MPEG2Simple ), MAP(MPEG2VIDEO, MPEG2_MAIN, MPEG2Main ), MAP(H263, UNKNOWN, H263Baseline), @@ -497,7 +498,7 @@ static int vaapi_decode_make_config(AVCodecContext *avctx, if (avctx->codec_id != vaapi_profile_map[i].codec_id) continue; if (avctx->profile == vaapi_profile_map[i].codec_profile || - vaapi_profile_map[i].codec_profile == FF_PROFILE_UNKNOWN) + vaapi_profile_map[i].codec_profile == AV_PROFILE_UNKNOWN) profile_match = 1; va_profile = vaapi_profile_map[i].profile_parser ? diff --git a/src/third_party/ffmpeg/libavcodec/vaapi_encode.c b/src/third_party/ffmpeg/libavcodec/vaapi_encode.c index bfca315a..e3820956 100644 --- a/src/third_party/ffmpeg/libavcodec/vaapi_encode.c +++ b/src/third_party/ffmpeg/libavcodec/vaapi_encode.c @@ -276,21 +276,34 @@ static int vaapi_encode_issue(AVCodecContext *avctx, av_log(avctx, AV_LOG_DEBUG, "Issuing encode for pic %"PRId64"/%"PRId64" " "as type %s.\n", pic->display_order, pic->encode_order, picture_type_name[pic->type]); - if (pic->nb_refs == 0) { + if (pic->nb_refs[0] == 0 && pic->nb_refs[1] == 0) { av_log(avctx, AV_LOG_DEBUG, "No reference pictures.\n"); } else { - av_log(avctx, AV_LOG_DEBUG, "Refers to:"); - for (i = 0; i < pic->nb_refs; i++) { + av_log(avctx, AV_LOG_DEBUG, "L0 refers to"); + for (i = 0; i < pic->nb_refs[0]; i++) { av_log(avctx, AV_LOG_DEBUG, " %"PRId64"/%"PRId64, - pic->refs[i]->display_order, pic->refs[i]->encode_order); + pic->refs[0][i]->display_order, pic->refs[0][i]->encode_order); } av_log(avctx, AV_LOG_DEBUG, ".\n"); + + if (pic->nb_refs[1]) { + av_log(avctx, AV_LOG_DEBUG, "L1 refers to"); + for (i = 0; i < pic->nb_refs[1]; i++) { + av_log(avctx, AV_LOG_DEBUG, " %"PRId64"/%"PRId64, + pic->refs[1][i]->display_order, pic->refs[1][i]->encode_order); + } + av_log(avctx, AV_LOG_DEBUG, ".\n"); + } } av_assert0(!pic->encode_issued); - for (i = 0; i < pic->nb_refs; i++) { - av_assert0(pic->refs[i]); - av_assert0(pic->refs[i]->encode_issued); + for (i = 0; i < pic->nb_refs[0]; i++) { + av_assert0(pic->refs[0][i]); + av_assert0(pic->refs[0][i]->encode_issued); + } + for (i = 0; i < pic->nb_refs[1]; i++) { + av_assert0(pic->refs[1][i]); + av_assert0(pic->refs[1][i]->encode_issued); } av_log(avctx, AV_LOG_DEBUG, "Input surface is %#x.\n", pic->input_surface); @@ -650,46 +663,11 @@ fail_at_end: return err; } -static int vaapi_encode_output(AVCodecContext *avctx, - VAAPIEncodePicture *pic, AVPacket *pkt) +static int vaapi_encode_set_output_property(AVCodecContext *avctx, + VAAPIEncodePicture *pic, + AVPacket *pkt) { VAAPIEncodeContext *ctx = avctx->priv_data; - VACodedBufferSegment *buf_list, *buf; - VAStatus vas; - int total_size = 0; - uint8_t *ptr; - int err; - - err = vaapi_encode_wait(avctx, pic); - if (err < 0) - return err; - - buf_list = NULL; - vas = vaMapBuffer(ctx->hwctx->display, pic->output_buffer, - (void**)&buf_list); - if (vas != VA_STATUS_SUCCESS) { - av_log(avctx, AV_LOG_ERROR, "Failed to map output buffers: " - "%d (%s).\n", vas, vaErrorStr(vas)); - err = AVERROR(EIO); - goto fail; - } - - for (buf = buf_list; buf; buf = buf->next) - total_size += buf->size; - - err = ff_get_encode_buffer(avctx, pkt, total_size, 0); - ptr = pkt->data; - - if (err < 0) - goto fail_mapped; - - for (buf = buf_list; buf; buf = buf->next) { - av_log(avctx, AV_LOG_DEBUG, "Output buffer: %u bytes " - "(status %08x).\n", buf->size, buf->status); - - memcpy(ptr, buf->buf, buf->size); - ptr += buf->size; - } if (pic->type == PICTURE_TYPE_IDR) pkt->flags |= AV_PKT_FLAG_KEY; @@ -697,14 +675,6 @@ static int vaapi_encode_output(AVCodecContext *avctx, pkt->pts = pic->pts; pkt->duration = pic->duration; - vas = vaUnmapBuffer(ctx->hwctx->display, pic->output_buffer); - if (vas != VA_STATUS_SUCCESS) { - av_log(avctx, AV_LOG_ERROR, "Failed to unmap output buffers: " - "%d (%s).\n", vas, vaErrorStr(vas)); - err = AVERROR(EIO); - goto fail; - } - // for no-delay encoders this is handled in generic codec if (avctx->codec->capabilities & AV_CODEC_CAP_DELAY && avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { @@ -713,16 +683,180 @@ static int vaapi_encode_output(AVCodecContext *avctx, pic->opaque_ref = NULL; } + if (ctx->codec->flags & FLAG_TIMESTAMP_NO_DELAY) { + pkt->dts = pkt->pts; + return 0; + } + + if (ctx->output_delay == 0) { + pkt->dts = pkt->pts; + } else if (pic->encode_order < ctx->decode_delay) { + if (ctx->ts_ring[pic->encode_order] < INT64_MIN + ctx->dts_pts_diff) + pkt->dts = INT64_MIN; + else + pkt->dts = ctx->ts_ring[pic->encode_order] - ctx->dts_pts_diff; + } else { + pkt->dts = ctx->ts_ring[(pic->encode_order - ctx->decode_delay) % + (3 * ctx->output_delay + ctx->async_depth)]; + } + + return 0; +} + +static int vaapi_encode_get_coded_buffer_size(AVCodecContext *avctx, VABufferID buf_id) +{ + VAAPIEncodeContext *ctx = avctx->priv_data; + VACodedBufferSegment *buf_list, *buf; + int size = 0; + VAStatus vas; + int err; + + vas = vaMapBuffer(ctx->hwctx->display, buf_id, + (void**)&buf_list); + if (vas != VA_STATUS_SUCCESS) { + av_log(avctx, AV_LOG_ERROR, "Failed to map output buffers: " + "%d (%s).\n", vas, vaErrorStr(vas)); + err = AVERROR(EIO); + return err; + } + + for (buf = buf_list; buf; buf = buf->next) + size += buf->size; + + vas = vaUnmapBuffer(ctx->hwctx->display, buf_id); + if (vas != VA_STATUS_SUCCESS) { + av_log(avctx, AV_LOG_ERROR, "Failed to unmap output buffers: " + "%d (%s).\n", vas, vaErrorStr(vas)); + err = AVERROR(EIO); + return err; + } + + return size; +} + +static int vaapi_encode_get_coded_buffer_data(AVCodecContext *avctx, + VABufferID buf_id, uint8_t **dst) +{ + VAAPIEncodeContext *ctx = avctx->priv_data; + VACodedBufferSegment *buf_list, *buf; + VAStatus vas; + int err; + + vas = vaMapBuffer(ctx->hwctx->display, buf_id, + (void**)&buf_list); + if (vas != VA_STATUS_SUCCESS) { + av_log(avctx, AV_LOG_ERROR, "Failed to map output buffers: " + "%d (%s).\n", vas, vaErrorStr(vas)); + err = AVERROR(EIO); + return err; + } + + for (buf = buf_list; buf; buf = buf->next) { + av_log(avctx, AV_LOG_DEBUG, "Output buffer: %u bytes " + "(status %08x).\n", buf->size, buf->status); + + memcpy(*dst, buf->buf, buf->size); + *dst += buf->size; + } + + vas = vaUnmapBuffer(ctx->hwctx->display, buf_id); + if (vas != VA_STATUS_SUCCESS) { + av_log(avctx, AV_LOG_ERROR, "Failed to unmap output buffers: " + "%d (%s).\n", vas, vaErrorStr(vas)); + err = AVERROR(EIO); + return err; + } + + return 0; +} + +static int vaapi_encode_get_coded_data(AVCodecContext *avctx, + VAAPIEncodePicture *pic, AVPacket *pkt) +{ + VAAPIEncodeContext *ctx = avctx->priv_data; + VABufferID output_buffer_prev; + int total_size = 0; + uint8_t *ptr; + int ret; + + if (ctx->coded_buffer_ref) { + output_buffer_prev = (VABufferID)(uintptr_t)ctx->coded_buffer_ref->data; + ret = vaapi_encode_get_coded_buffer_size(avctx, output_buffer_prev); + if (ret < 0) + goto end; + total_size += ret; + } + + ret = vaapi_encode_get_coded_buffer_size(avctx, pic->output_buffer); + if (ret < 0) + goto end; + total_size += ret; + + ret = ff_get_encode_buffer(avctx, pkt, total_size, 0); + if (ret < 0) + goto end; + ptr = pkt->data; + + if (ctx->coded_buffer_ref) { + ret = vaapi_encode_get_coded_buffer_data(avctx, output_buffer_prev, &ptr); + if (ret < 0) + goto end; + } + + ret = vaapi_encode_get_coded_buffer_data(avctx, pic->output_buffer, &ptr); + if (ret < 0) + goto end; + +end: + if (ctx->coded_buffer_ref) { + av_buffer_unref(&ctx->coded_buffer_ref); + } av_buffer_unref(&pic->output_buffer_ref); pic->output_buffer = VA_INVALID_ID; + return ret; +} + +static int vaapi_encode_output(AVCodecContext *avctx, + VAAPIEncodePicture *pic, AVPacket *pkt) +{ + VAAPIEncodeContext *ctx = avctx->priv_data; + AVPacket *pkt_ptr = pkt; + int err; + + err = vaapi_encode_wait(avctx, pic); + if (err < 0) + return err; + + if (pic->non_independent_frame) { + av_assert0(!ctx->coded_buffer_ref); + ctx->coded_buffer_ref = av_buffer_ref(pic->output_buffer_ref); + + if (pic->tail_size) { + if (ctx->tail_pkt->size) { + err = AVERROR(AVERROR_BUG); + goto end; + } + + err = ff_get_encode_buffer(avctx, ctx->tail_pkt, pic->tail_size, 0); + if (err < 0) + goto end; + + memcpy(ctx->tail_pkt->data, pic->tail_data, pic->tail_size); + pkt_ptr = ctx->tail_pkt; + } + } else { + err = vaapi_encode_get_coded_data(avctx, pic, pkt); + if (err < 0) + goto end; + } + av_log(avctx, AV_LOG_DEBUG, "Output read for pic %"PRId64"/%"PRId64".\n", pic->display_order, pic->encode_order); - return 0; -fail_mapped: - vaUnmapBuffer(ctx->hwctx->display, pic->output_buffer); -fail: + vaapi_encode_set_output_property(avctx, pic, pkt_ptr); + +end: av_buffer_unref(&pic->output_buffer_ref); pic->output_buffer = VA_INVALID_ID; return err; @@ -811,8 +945,12 @@ static void vaapi_encode_add_ref(AVCodecContext *avctx, if (is_ref) { av_assert0(pic != target); - av_assert0(pic->nb_refs < MAX_PICTURE_REFERENCES); - pic->refs[pic->nb_refs++] = target; + av_assert0(pic->nb_refs[0] < MAX_PICTURE_REFERENCES && + pic->nb_refs[1] < MAX_PICTURE_REFERENCES); + if (target->display_order < pic->display_order) + pic->refs[0][pic->nb_refs[0]++] = target; + else + pic->refs[1][pic->nb_refs[1]++] = target; ++refs; } @@ -841,10 +979,16 @@ static void vaapi_encode_remove_refs(AVCodecContext *avctx, if (pic->ref_removed[level]) return; - for (i = 0; i < pic->nb_refs; i++) { - av_assert0(pic->refs[i]); - --pic->refs[i]->ref_count[level]; - av_assert0(pic->refs[i]->ref_count[level] >= 0); + for (i = 0; i < pic->nb_refs[0]; i++) { + av_assert0(pic->refs[0][i]); + --pic->refs[0][i]->ref_count[level]; + av_assert0(pic->refs[0][i]->ref_count[level] >= 0); + } + + for (i = 0; i < pic->nb_refs[1]; i++) { + av_assert0(pic->refs[1][i]); + --pic->refs[1][i]->ref_count[level]; + av_assert0(pic->refs[1][i]->ref_count[level] >= 0); } for (i = 0; i < pic->nb_dpb_pics; i++) { @@ -889,7 +1033,7 @@ static void vaapi_encode_set_b_pictures(AVCodecContext *avctx, vaapi_encode_add_ref(avctx, pic, end, 1, 1, 0); vaapi_encode_add_ref(avctx, pic, prev, 0, 0, 1); - for (ref = end->refs[1]; ref; ref = ref->refs[1]) + for (ref = end->refs[1][0]; ref; ref = ref->refs[1][0]) vaapi_encode_add_ref(avctx, pic, ref, 0, 1, 0); } *last = prev; @@ -912,7 +1056,7 @@ static void vaapi_encode_set_b_pictures(AVCodecContext *avctx, vaapi_encode_add_ref(avctx, pic, end, 1, 1, 0); vaapi_encode_add_ref(avctx, pic, prev, 0, 0, 1); - for (ref = end->refs[1]; ref; ref = ref->refs[1]) + for (ref = end->refs[1][0]; ref; ref = ref->refs[1][0]) vaapi_encode_add_ref(avctx, pic, ref, 0, 1, 0); if (i > 1) @@ -926,11 +1070,44 @@ static void vaapi_encode_set_b_pictures(AVCodecContext *avctx, } } +static void vaapi_encode_add_next_prev(AVCodecContext *avctx, + VAAPIEncodePicture *pic) +{ + VAAPIEncodeContext *ctx = avctx->priv_data; + int i; + + if (!pic) + return; + + if (pic->type == PICTURE_TYPE_IDR) { + for (i = 0; i < ctx->nb_next_prev; i++) { + --ctx->next_prev[i]->ref_count[0]; + ctx->next_prev[i] = NULL; + } + ctx->next_prev[0] = pic; + ++pic->ref_count[0]; + ctx->nb_next_prev = 1; + + return; + } + + if (ctx->nb_next_prev < MAX_PICTURE_REFERENCES) { + ctx->next_prev[ctx->nb_next_prev++] = pic; + ++pic->ref_count[0]; + } else { + --ctx->next_prev[0]->ref_count[0]; + for (i = 0; i < MAX_PICTURE_REFERENCES - 1; i++) + ctx->next_prev[i] = ctx->next_prev[i + 1]; + ctx->next_prev[i] = pic; + ++pic->ref_count[0]; + } +} + static int vaapi_encode_pick_next(AVCodecContext *avctx, VAAPIEncodePicture **pic_out) { VAAPIEncodeContext *ctx = avctx->priv_data; - VAAPIEncodePicture *pic = NULL, *next, *start; + VAAPIEncodePicture *pic = NULL, *prev = NULL, *next, *start; int i, b_counter, closed_gop_end; // If there are any B-frames already queued, the next one to encode @@ -941,11 +1118,18 @@ static int vaapi_encode_pick_next(AVCodecContext *avctx, continue; if (pic->type != PICTURE_TYPE_B) continue; - for (i = 0; i < pic->nb_refs; i++) { - if (!pic->refs[i]->encode_issued) + for (i = 0; i < pic->nb_refs[0]; i++) { + if (!pic->refs[0][i]->encode_issued) break; } - if (i == pic->nb_refs) + if (i != pic->nb_refs[0]) + continue; + + for (i = 0; i < pic->nb_refs[1]; i++) { + if (!pic->refs[1][i]->encode_issued) + break; + } + if (i == pic->nb_refs[1]) break; } @@ -1044,21 +1228,30 @@ static int vaapi_encode_pick_next(AVCodecContext *avctx, vaapi_encode_add_ref(avctx, pic, pic, 0, 1, 0); if (pic->type != PICTURE_TYPE_IDR) { - vaapi_encode_add_ref(avctx, pic, start, - pic->type == PICTURE_TYPE_P, - b_counter > 0, 0); - vaapi_encode_add_ref(avctx, pic, ctx->next_prev, 0, 0, 1); + // TODO: apply both previous and forward multi reference for all vaapi encoders. + // And L0/L1 reference frame number can be set dynamically through query + // VAConfigAttribEncMaxRefFrames attribute. + if (avctx->codec_id == AV_CODEC_ID_AV1) { + for (i = 0; i < ctx->nb_next_prev; i++) + vaapi_encode_add_ref(avctx, pic, ctx->next_prev[i], + pic->type == PICTURE_TYPE_P, + b_counter > 0, 0); + } else + vaapi_encode_add_ref(avctx, pic, start, + pic->type == PICTURE_TYPE_P, + b_counter > 0, 0); + + vaapi_encode_add_ref(avctx, pic, ctx->next_prev[ctx->nb_next_prev - 1], 0, 0, 1); } - if (ctx->next_prev) - --ctx->next_prev->ref_count[0]; if (b_counter > 0) { vaapi_encode_set_b_pictures(avctx, start, pic, pic, 1, - &ctx->next_prev); + &prev); } else { - ctx->next_prev = pic; + prev = pic; } - ++ctx->next_prev->ref_count[0]; + vaapi_encode_add_next_prev(avctx, prev); + return 0; } @@ -1205,10 +1398,23 @@ fail: int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt) { VAAPIEncodeContext *ctx = avctx->priv_data; - VAAPIEncodePicture *pic; + VAAPIEncodePicture *pic = NULL; AVFrame *frame = ctx->frame; int err; +start: + /** if no B frame before repeat P frame, sent repeat P frame out. */ + if (ctx->tail_pkt->size) { + for (VAAPIEncodePicture *tmp = ctx->pic_start; tmp; tmp = tmp->next) { + if (tmp->type == PICTURE_TYPE_B && tmp->pts < ctx->tail_pkt->pts) + break; + else if (!tmp->next) { + av_packet_move_ref(pkt, ctx->tail_pkt); + goto end; + } + } + } + err = ff_encode_get_frame(avctx, frame); if (err < 0 && err != AVERROR_EOF) return err; @@ -1228,8 +1434,6 @@ int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt) } if (ctx->has_sync_buffer_func) { - pic = NULL; - if (av_fifo_can_write(ctx->encode_fifo)) { err = vaapi_encode_pick_next(avctx, &pic); if (!err) { @@ -1255,7 +1459,6 @@ int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt) av_fifo_read(ctx->encode_fifo, &pic, 1); ctx->encode_order = pic->encode_order + 1; } else { - pic = NULL; err = vaapi_encode_pick_next(avctx, &pic); if (err < 0) return err; @@ -1276,27 +1479,21 @@ int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt) return err; } - if (ctx->output_delay == 0) { - pkt->dts = pkt->pts; - } else if (pic->encode_order < ctx->decode_delay) { - if (ctx->ts_ring[pic->encode_order] < INT64_MIN + ctx->dts_pts_diff) - pkt->dts = INT64_MIN; - else - pkt->dts = ctx->ts_ring[pic->encode_order] - ctx->dts_pts_diff; - } else { - pkt->dts = ctx->ts_ring[(pic->encode_order - ctx->decode_delay) % - (3 * ctx->output_delay + ctx->async_depth)]; - } - av_log(avctx, AV_LOG_DEBUG, "Output packet: pts %"PRId64" dts %"PRId64".\n", - pkt->pts, pkt->dts); - ctx->output_order = pic->encode_order; vaapi_encode_clear_old(avctx); + /** loop to get an available pkt in encoder flushing. */ + if (ctx->end_of_stream && !pkt->size) + goto start; + +end: + if (pkt->size) + av_log(avctx, AV_LOG_DEBUG, "Output packet: pts %"PRId64", dts %"PRId64", " + "size %d bytes.\n", pkt->pts, pkt->dts, pkt->size); + return 0; } - static av_cold void vaapi_encode_add_global_param(AVCodecContext *avctx, int type, void *buffer, size_t size) { @@ -1414,7 +1611,7 @@ static av_cold int vaapi_encode_profile_entrypoint(AVCodecContext *avctx) av_assert0(ctx->codec->profiles); for (i = 0; (ctx->codec->profiles[i].av_profile != - FF_PROFILE_UNKNOWN); i++) { + AV_PROFILE_UNKNOWN); i++) { profile = &ctx->codec->profiles[i]; if (depth != profile->depth || desc->nb_components != profile->nb_components) @@ -1424,7 +1621,7 @@ static av_cold int vaapi_encode_profile_entrypoint(AVCodecContext *avctx) desc->log2_chroma_h != profile->log2_chroma_h)) continue; if (avctx->profile != profile->av_profile && - avctx->profile != FF_PROFILE_UNKNOWN) + avctx->profile != AV_PROFILE_UNKNOWN) continue; #if VA_CHECK_VERSION(1, 0, 0) @@ -2597,6 +2794,12 @@ av_cold int ff_vaapi_encode_init(AVCodecContext *avctx) ctx->device = (AVHWDeviceContext*)ctx->device_ref->data; ctx->hwctx = ctx->device->hwctx; + ctx->tail_pkt = av_packet_alloc(); + if (!ctx->tail_pkt) { + err = AVERROR(ENOMEM); + goto fail; + } + err = vaapi_encode_profile_entrypoint(avctx); if (err < 0) goto fail; @@ -2789,6 +2992,7 @@ av_cold int ff_vaapi_encode_close(AVCodecContext *avctx) } av_frame_free(&ctx->frame); + av_packet_free(&ctx->tail_pkt); av_freep(&ctx->codec_sequence_params); av_freep(&ctx->codec_picture_params); diff --git a/src/third_party/ffmpeg/libavcodec/vaapi_encode.h b/src/third_party/ffmpeg/libavcodec/vaapi_encode.h index a1e639f5..d0d6cc2a 100644 --- a/src/third_party/ffmpeg/libavcodec/vaapi_encode.h +++ b/src/third_party/ffmpeg/libavcodec/vaapi_encode.h @@ -49,6 +49,7 @@ enum { // A.4.1: table A.6 allows at most 20 tile columns for any level. MAX_TILE_COLS = 20, MAX_ASYNC_DEPTH = 64, + MAX_REFERENCE_LIST_NUM = 2, }; extern const AVCodecHWConfigInternal *const ff_vaapi_encode_hw_configs[]; @@ -116,10 +117,11 @@ typedef struct VAAPIEncodePicture { // but not if it isn't. int nb_dpb_pics; struct VAAPIEncodePicture *dpb[MAX_DPB_SIZE]; - // The reference pictures used in decoding this picture. If they are - // used by later pictures they will also appear in the DPB. - int nb_refs; - struct VAAPIEncodePicture *refs[MAX_PICTURE_REFERENCES]; + // The reference pictures used in decoding this picture. If they are + // used by later pictures they will also appear in the DPB. ref[0][] for + // previous reference frames. ref[1][] for future reference frames. + int nb_refs[MAX_REFERENCE_LIST_NUM]; + struct VAAPIEncodePicture *refs[MAX_REFERENCE_LIST_NUM][MAX_PICTURE_REFERENCES]; // The previous reference picture in encode order. Must be in at least // one of the reference list and DPB list. struct VAAPIEncodePicture *prev; @@ -131,10 +133,21 @@ typedef struct VAAPIEncodePicture { int nb_slices; VAAPIEncodeSlice *slices; + + /** + * indicate if current frame is an independent frame that the coded data + * can be pushed to downstream directly. Coded of non-independent frame + * data will be concatenated into next independent frame. + */ + int non_independent_frame; + /** Tail data of current pic, used only for repeat header of AV1. */ + char tail_data[MAX_PARAM_BUFFER_SIZE]; + /** Byte length of tail_data. */ + size_t tail_size; } VAAPIEncodePicture; typedef struct VAAPIEncodeProfile { - // lavc profile value (FF_PROFILE_*). + // lavc profile value (AV_PROFILE_*). int av_profile; // Supported bit depth. int depth; @@ -290,8 +303,9 @@ typedef struct VAAPIEncodeContext { // Current encoding window, in display (input) order. VAAPIEncodePicture *pic_start, *pic_end; // The next picture to use as the previous reference picture in - // encoding order. - VAAPIEncodePicture *next_prev; + // encoding order. Order from small to large in encoding order. + VAAPIEncodePicture *next_prev[MAX_PICTURE_REFERENCES]; + int nb_next_prev; // Next input order index (display order). int64_t input_order; @@ -364,6 +378,16 @@ typedef struct VAAPIEncodeContext { AVFifo *encode_fifo; // Max number of frame buffered in encoder. int async_depth; + + /** Head data for current output pkt, used only for AV1. */ + //void *header_data; + //size_t header_data_size; + + /** Buffered coded data of a pic if it is an non-independent frame. */ + AVBufferRef *coded_buffer_ref; + + /** Tail data of a pic, now only used for av1 repeat frame header. */ + AVPacket *tail_pkt; } VAAPIEncodeContext; enum { @@ -380,11 +404,14 @@ enum { // Codec supports non-IDR key pictures (that is, key pictures do // not necessarily empty the DPB). FLAG_NON_IDR_KEY_PICTURES = 1 << 5, + // Codec output packet without timestamp delay, which means the + // output packet has same PTS and DTS. + FLAG_TIMESTAMP_NO_DELAY = 1 << 6, }; typedef struct VAAPIEncodeType { // List of supported profiles and corresponding VAAPI profiles. - // (Must end with FF_PROFILE_UNKNOWN.) + // (Must end with AV_PROFILE_UNKNOWN.) const VAAPIEncodeProfile *profiles; // Codec feature flags. diff --git a/src/third_party/ffmpeg/libavcodec/vaapi_encode_av1.c b/src/third_party/ffmpeg/libavcodec/vaapi_encode_av1.c new file mode 100644 index 00000000..5a9ff0f7 --- /dev/null +++ b/src/third_party/ffmpeg/libavcodec/vaapi_encode_av1.c @@ -0,0 +1,951 @@ +/* + * Copyright (c) 2023 Intel Corporation + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include + +#include "libavutil/pixdesc.h" +#include "libavutil/opt.h" + +#include "cbs_av1.h" +#include "put_bits.h" +#include "codec_internal.h" +#include "av1_levels.h" +#include "vaapi_encode.h" + +#define AV1_MAX_QUANT 255 + +typedef struct VAAPIEncodeAV1Picture { + int64_t last_idr_frame; + int slot; +} VAAPIEncodeAV1Picture; + +typedef struct VAAPIEncodeAV1Context { + VAAPIEncodeContext common; + AV1RawOBU sh; /**< sequence header.*/ + AV1RawOBU fh; /**< frame header.*/ + CodedBitstreamContext *cbc; + CodedBitstreamFragment current_obu; + VAConfigAttribValEncAV1 attr; + VAConfigAttribValEncAV1Ext1 attr_ext1; + VAConfigAttribValEncAV1Ext2 attr_ext2; + + char sh_data[MAX_PARAM_BUFFER_SIZE]; /**< coded sequence header data. */ + size_t sh_data_len; /**< bit length of sh_data. */ + char fh_data[MAX_PARAM_BUFFER_SIZE]; /**< coded frame header data. */ + size_t fh_data_len; /**< bit length of fh_data. */ + + uint8_t uniform_tile; + uint8_t use_128x128_superblock; + int sb_cols; + int sb_rows; + int tile_cols_log2; + int tile_rows_log2; + int max_tile_width_sb; + int max_tile_height_sb; + uint8_t width_in_sbs_minus_1[AV1_MAX_TILE_COLS]; + uint8_t height_in_sbs_minus_1[AV1_MAX_TILE_ROWS]; + + int min_log2_tile_cols; + int max_log2_tile_cols; + int min_log2_tile_rows; + int max_log2_tile_rows; + + int q_idx_idr; + int q_idx_p; + int q_idx_b; + + /** bit positions in current frame header */ + int qindex_offset; + int loopfilter_offset; + int cdef_start_offset; + int cdef_param_size; + + /** user options */ + int profile; + int level; + int tier; + int tile_cols, tile_rows; + int tile_groups; +} VAAPIEncodeAV1Context; + +static void vaapi_encode_av1_trace_write_log(void *ctx, + PutBitContext *pbc, int length, + const char *str, const int *subscripts, + int64_t value) +{ + VAAPIEncodeAV1Context *priv = ctx; + int position; + + position = put_bits_count(pbc); + av_assert0(position >= length); + + if (!strcmp(str, "base_q_idx")) + priv->qindex_offset = position - length; + else if (!strcmp(str, "loop_filter_level[0]")) + priv->loopfilter_offset = position - length; + else if (!strcmp(str, "cdef_damping_minus_3")) + priv->cdef_start_offset = position - length; + else if (!strcmp(str, "cdef_uv_sec_strength[i]")) + priv->cdef_param_size = position - priv->cdef_start_offset; +} + +static av_cold int vaapi_encode_av1_get_encoder_caps(AVCodecContext *avctx) +{ + VAAPIEncodeContext *ctx = avctx->priv_data; + VAAPIEncodeAV1Context *priv = avctx->priv_data; + + // Surfaces must be aligned to superblock boundaries. + ctx->surface_width = FFALIGN(avctx->width, priv->use_128x128_superblock ? 128 : 64); + ctx->surface_height = FFALIGN(avctx->height, priv->use_128x128_superblock ? 128 : 64); + + return 0; +} + +static av_cold int vaapi_encode_av1_configure(AVCodecContext *avctx) +{ + VAAPIEncodeContext *ctx = avctx->priv_data; + VAAPIEncodeAV1Context *priv = avctx->priv_data; + int ret; + + ret = ff_cbs_init(&priv->cbc, AV_CODEC_ID_AV1, avctx); + if (ret < 0) + return ret; + priv->cbc->trace_enable = 1; + priv->cbc->trace_level = AV_LOG_DEBUG; + priv->cbc->trace_context = ctx; + priv->cbc->trace_write_callback = vaapi_encode_av1_trace_write_log; + + if (ctx->rc_mode->quality) { + priv->q_idx_p = av_clip(ctx->rc_quality, 0, AV1_MAX_QUANT); + if (fabs(avctx->i_quant_factor) > 0.0) + priv->q_idx_idr = + av_clip((fabs(avctx->i_quant_factor) * priv->q_idx_p + + avctx->i_quant_offset) + 0.5, + 0, AV1_MAX_QUANT); + else + priv->q_idx_idr = priv->q_idx_p; + + if (fabs(avctx->b_quant_factor) > 0.0) + priv->q_idx_b = + av_clip((fabs(avctx->b_quant_factor) * priv->q_idx_p + + avctx->b_quant_offset) + 0.5, + 0, AV1_MAX_QUANT); + else + priv->q_idx_b = priv->q_idx_p; + } else { + /** Arbitrary value */ + priv->q_idx_idr = priv->q_idx_p = priv->q_idx_b = 128; + } + + return 0; +} + +static int vaapi_encode_av1_add_obu(AVCodecContext *avctx, + CodedBitstreamFragment *au, + uint8_t type, + void *obu_unit) +{ + int ret; + + ret = ff_cbs_insert_unit_content(au, -1, + type, obu_unit, NULL); + if (ret < 0) { + av_log(avctx, AV_LOG_ERROR, "Failed to add OBU unit: " + "type = %d.\n", type); + return ret; + } + + return 0; +} + +static int vaapi_encode_av1_write_obu(AVCodecContext *avctx, + char *data, size_t *data_len, + CodedBitstreamFragment *bs) +{ + VAAPIEncodeAV1Context *priv = avctx->priv_data; + int ret; + + ret = ff_cbs_write_fragment_data(priv->cbc, bs); + if (ret < 0) { + av_log(avctx, AV_LOG_ERROR, "Failed to write packed header.\n"); + return ret; + } + + if ((size_t)8 * MAX_PARAM_BUFFER_SIZE < 8 * bs->data_size - bs->data_bit_padding) { + av_log(avctx, AV_LOG_ERROR, "Access unit too large: " + "%zu < %zu.\n", (size_t)8 * MAX_PARAM_BUFFER_SIZE, + 8 * bs->data_size - bs->data_bit_padding); + return AVERROR(ENOSPC); + } + + memcpy(data, bs->data, bs->data_size); + *data_len = 8 * bs->data_size - bs->data_bit_padding; + + return 0; +} + +static int tile_log2(int blkSize, int target) { + int k; + for (k = 0; (blkSize << k) < target; k++); + return k; +} + +static int vaapi_encode_av1_set_tile(AVCodecContext *avctx) +{ + VAAPIEncodeAV1Context *priv = avctx->priv_data; + int mi_cols, mi_rows, sb_shift, sb_size; + int max_tile_area_sb, max_tile_area_sb_varied; + int tile_width_sb, tile_height_sb, widest_tile_sb; + int tile_cols, tile_rows; + int min_log2_tiles; + int i; + + if (priv->tile_cols > AV1_MAX_TILE_COLS || + priv->tile_rows > AV1_MAX_TILE_ROWS) { + av_log(avctx, AV_LOG_ERROR, "Invalid tile number %dx%d, should less than %dx%d.\n", + priv->tile_cols, priv->tile_rows, AV1_MAX_TILE_COLS, AV1_MAX_TILE_ROWS); + return AVERROR(EINVAL); + } + + mi_cols = 2 * ((avctx->width + 7) >> 3); + mi_rows = 2 * ((avctx->height + 7) >> 3); + priv->sb_cols = priv->use_128x128_superblock ? + ((mi_cols + 31) >> 5) : ((mi_cols + 15) >> 4); + priv->sb_rows = priv->use_128x128_superblock ? + ((mi_rows + 31) >> 5) : ((mi_rows + 15) >> 4); + sb_shift = priv->use_128x128_superblock ? 5 : 4; + sb_size = sb_shift + 2; + priv->max_tile_width_sb = AV1_MAX_TILE_WIDTH >> sb_size; + max_tile_area_sb = AV1_MAX_TILE_AREA >> (2 * sb_size); + + priv->min_log2_tile_cols = tile_log2(priv->max_tile_width_sb, priv->sb_cols); + priv->max_log2_tile_cols = tile_log2(1, FFMIN(priv->sb_cols, AV1_MAX_TILE_COLS)); + priv->max_log2_tile_rows = tile_log2(1, FFMIN(priv->sb_rows, AV1_MAX_TILE_ROWS)); + min_log2_tiles = FFMAX(priv->min_log2_tile_cols, + tile_log2(max_tile_area_sb, priv->sb_rows * priv->sb_cols)); + + tile_cols = av_clip(priv->tile_cols, (priv->sb_cols + priv->max_tile_width_sb - 1) / priv->max_tile_width_sb, priv->sb_cols); + + if (!priv->tile_cols) + priv->tile_cols = tile_cols; + else if (priv->tile_cols != tile_cols){ + av_log(avctx, AV_LOG_ERROR, "Invalid tile cols %d, should be in range of %d~%d\n", + priv->tile_cols, + (priv->sb_cols + priv->max_tile_width_sb - 1) / priv->max_tile_width_sb, + priv->sb_cols); + return AVERROR(EINVAL); + } + + priv->tile_cols_log2 = tile_log2(1, priv->tile_cols); + tile_width_sb = (priv->sb_cols + (1 << priv->tile_cols_log2) - 1) >> + priv->tile_cols_log2; + + if (priv->tile_rows > priv->sb_rows) { + av_log(avctx, AV_LOG_ERROR, "Invalid tile rows %d, should be less than %d.\n", + priv->tile_rows, priv->sb_rows); + return AVERROR(EINVAL); + } + + /** Try user setting tile rows number first. */ + tile_rows = priv->tile_rows ? priv->tile_rows : 1; + for (; tile_rows <= priv->sb_rows && tile_rows <= AV1_MAX_TILE_ROWS; tile_rows++) { + /** try uniformed tile. */ + priv->tile_rows_log2 = tile_log2(1, tile_rows); + if ((priv->sb_cols + tile_width_sb - 1) / tile_width_sb == priv->tile_cols) { + for (i = 0; i < priv->tile_cols - 1; i++) + priv->width_in_sbs_minus_1[i] = tile_width_sb - 1; + priv->width_in_sbs_minus_1[i] = priv->sb_cols - (priv->tile_cols - 1) * tile_width_sb - 1; + + tile_height_sb = (priv->sb_rows + (1 << priv->tile_rows_log2) - 1) >> + priv->tile_rows_log2; + + if ((priv->sb_rows + tile_height_sb - 1) / tile_height_sb == tile_rows && + tile_height_sb <= max_tile_area_sb / tile_width_sb) { + for (i = 0; i < tile_rows - 1; i++) + priv->height_in_sbs_minus_1[i] = tile_height_sb - 1; + priv->height_in_sbs_minus_1[i] = priv->sb_rows - (tile_rows - 1) * tile_height_sb - 1; + + priv->uniform_tile = 1; + priv->min_log2_tile_rows = FFMAX(min_log2_tiles - priv->tile_cols_log2, 0); + + break; + } + } + + /** try non-uniformed tile. */ + widest_tile_sb = 0; + for (i = 0; i < priv->tile_cols; i++) { + priv->width_in_sbs_minus_1[i] = (i + 1) * priv->sb_cols / priv->tile_cols - i * priv->sb_cols / priv->tile_cols - 1; + widest_tile_sb = FFMAX(widest_tile_sb, priv->width_in_sbs_minus_1[i] + 1); + } + + if (min_log2_tiles) + max_tile_area_sb_varied = (priv->sb_rows * priv->sb_cols) >> (min_log2_tiles + 1); + else + max_tile_area_sb_varied = priv->sb_rows * priv->sb_cols; + priv->max_tile_height_sb = FFMAX(1, max_tile_area_sb_varied / widest_tile_sb); + + if (tile_rows == av_clip(tile_rows, (priv->sb_rows + priv->max_tile_height_sb - 1) / priv->max_tile_height_sb, priv->sb_rows)) { + for (i = 0; i < tile_rows; i++) + priv->height_in_sbs_minus_1[i] = (i + 1) * priv->sb_rows / tile_rows - i * priv->sb_rows / tile_rows - 1; + + break; + } + + /** Return invalid parameter if explicit tile rows is set. */ + if (priv->tile_rows) { + av_log(avctx, AV_LOG_ERROR, "Invalid tile rows %d.\n", priv->tile_rows); + return AVERROR(EINVAL); + } + } + + priv->tile_rows = tile_rows; + av_log(avctx, AV_LOG_DEBUG, "Setting tile cols/rows to %d/%d.\n", + priv->tile_cols, priv->tile_rows); + + /** check if tile cols/rows is supported by driver. */ + if (priv->attr_ext2.bits.max_tile_num_minus1) { + if ((priv->tile_cols * priv->tile_rows - 1) > priv->attr_ext2.bits.max_tile_num_minus1) { + av_log(avctx, AV_LOG_ERROR, "Unsupported tile num %d * %d = %d by driver, " + "should be at most %d.\n", priv->tile_cols, priv->tile_rows, + priv->tile_cols * priv->tile_rows, + priv->attr_ext2.bits.max_tile_num_minus1 + 1); + return AVERROR(EINVAL); + } + } + + /** check if tile group numbers is valid. */ + if (priv->tile_groups > priv->tile_cols * priv->tile_rows) { + av_log(avctx, AV_LOG_WARNING, "Invalid tile groups number %d, " + "correct to %d.\n", priv->tile_groups, priv->tile_cols * priv->tile_rows); + priv->tile_groups = priv->tile_cols * priv->tile_rows; + } + + return 0; +} + +static int vaapi_encode_av1_write_sequence_header(AVCodecContext *avctx, + char *data, size_t *data_len) +{ + VAAPIEncodeAV1Context *priv = avctx->priv_data; + + memcpy(data, &priv->sh_data, MAX_PARAM_BUFFER_SIZE * sizeof(char)); + *data_len = priv->sh_data_len; + + return 0; +} + +static int vaapi_encode_av1_init_sequence_params(AVCodecContext *avctx) +{ + VAAPIEncodeContext *ctx = avctx->priv_data; + VAAPIEncodeAV1Context *priv = avctx->priv_data; + AV1RawOBU *sh_obu = &priv->sh; + AV1RawSequenceHeader *sh = &sh_obu->obu.sequence_header; + VAEncSequenceParameterBufferAV1 *vseq = ctx->codec_sequence_params; + CodedBitstreamFragment *obu = &priv->current_obu; + const AVPixFmtDescriptor *desc; + int ret; + + memset(sh_obu, 0, sizeof(*sh_obu)); + sh_obu->header.obu_type = AV1_OBU_SEQUENCE_HEADER; + + desc = av_pix_fmt_desc_get(priv->common.input_frames->sw_format); + av_assert0(desc); + + sh->seq_profile = avctx->profile; + if (!sh->seq_force_screen_content_tools) + sh->seq_force_integer_mv = AV1_SELECT_INTEGER_MV; + sh->frame_width_bits_minus_1 = av_log2(avctx->width); + sh->frame_height_bits_minus_1 = av_log2(avctx->height); + sh->max_frame_width_minus_1 = avctx->width - 1; + sh->max_frame_height_minus_1 = avctx->height - 1; + sh->seq_tier[0] = priv->tier; + /** enable order hint and reserve maximum 8 bits for it by default. */ + sh->enable_order_hint = 1; + sh->order_hint_bits_minus_1 = 7; + + sh->color_config = (AV1RawColorConfig) { + .high_bitdepth = desc->comp[0].depth == 8 ? 0 : 1, + .color_primaries = avctx->color_primaries, + .transfer_characteristics = avctx->color_trc, + .matrix_coefficients = avctx->colorspace, + .color_description_present_flag = (avctx->color_primaries != AVCOL_PRI_UNSPECIFIED || + avctx->color_trc != AVCOL_TRC_UNSPECIFIED || + avctx->colorspace != AVCOL_SPC_UNSPECIFIED), + .color_range = avctx->color_range == AVCOL_RANGE_JPEG, + .subsampling_x = desc->log2_chroma_w, + .subsampling_y = desc->log2_chroma_h, + }; + + switch (avctx->chroma_sample_location) { + case AVCHROMA_LOC_LEFT: + sh->color_config.chroma_sample_position = AV1_CSP_VERTICAL; + break; + case AVCHROMA_LOC_TOPLEFT: + sh->color_config.chroma_sample_position = AV1_CSP_COLOCATED; + break; + default: + sh->color_config.chroma_sample_position = AV1_CSP_UNKNOWN; + break; + } + + if (avctx->level != AV_LEVEL_UNKNOWN) { + sh->seq_level_idx[0] = avctx->level; + } else { + const AV1LevelDescriptor *level; + float framerate; + + if (avctx->framerate.num > 0 && avctx->framerate.den > 0) + framerate = avctx->framerate.num / avctx->framerate.den; + else + framerate = 0; + + level = ff_av1_guess_level(avctx->bit_rate, priv->tier, + ctx->surface_width, ctx->surface_height, + priv->tile_rows * priv->tile_cols, + priv->tile_cols, framerate); + if (level) { + av_log(avctx, AV_LOG_VERBOSE, "Using level %s.\n", level->name); + sh->seq_level_idx[0] = level->level_idx; + } else { + av_log(avctx, AV_LOG_VERBOSE, "Stream will not conform to " + "any normal level, using maximum parameters level by default.\n"); + sh->seq_level_idx[0] = 31; + sh->seq_tier[0] = 1; + } + } + vseq->seq_profile = sh->seq_profile; + vseq->seq_level_idx = sh->seq_level_idx[0]; + vseq->seq_tier = sh->seq_tier[0]; + vseq->order_hint_bits_minus_1 = sh->order_hint_bits_minus_1; + vseq->intra_period = ctx->gop_size; + vseq->ip_period = ctx->b_per_p + 1; + + vseq->seq_fields.bits.enable_order_hint = sh->enable_order_hint; + + if (!(ctx->va_rc_mode & VA_RC_CQP)) { + vseq->bits_per_second = ctx->va_bit_rate; + vseq->seq_fields.bits.enable_cdef = sh->enable_cdef = 1; + } + + ret = vaapi_encode_av1_add_obu(avctx, obu, AV1_OBU_SEQUENCE_HEADER, &priv->sh); + if (ret < 0) + goto end; + + ret = vaapi_encode_av1_write_obu(avctx, priv->sh_data, &priv->sh_data_len, obu); + if (ret < 0) + goto end; + +end: + ff_cbs_fragment_reset(obu); + return ret; +} + +static int vaapi_encode_av1_init_picture_params(AVCodecContext *avctx, + VAAPIEncodePicture *pic) +{ + VAAPIEncodeContext *ctx = avctx->priv_data; + VAAPIEncodeAV1Context *priv = avctx->priv_data; + VAAPIEncodeAV1Picture *hpic = pic->priv_data; + AV1RawOBU *fh_obu = &priv->fh; + AV1RawFrameHeader *fh = &fh_obu->obu.frame.header; + VAEncPictureParameterBufferAV1 *vpic = pic->codec_picture_params; + CodedBitstreamFragment *obu = &priv->current_obu; + VAAPIEncodePicture *ref; + VAAPIEncodeAV1Picture *href; + int slot, i; + int ret; + static const int8_t default_loop_filter_ref_deltas[AV1_TOTAL_REFS_PER_FRAME] = + { 1, 0, 0, 0, -1, 0, -1, -1 }; + + memset(fh_obu, 0, sizeof(*fh_obu)); + pic->nb_slices = priv->tile_groups; + pic->non_independent_frame = pic->encode_order < pic->display_order; + fh_obu->header.obu_type = AV1_OBU_FRAME_HEADER; + fh_obu->header.obu_has_size_field = 1; + + switch (pic->type) { + case PICTURE_TYPE_IDR: + av_assert0(pic->nb_refs[0] == 0 || pic->nb_refs[1]); + fh->frame_type = AV1_FRAME_KEY; + fh->refresh_frame_flags = 0xFF; + fh->base_q_idx = priv->q_idx_idr; + hpic->slot = 0; + hpic->last_idr_frame = pic->display_order; + break; + case PICTURE_TYPE_P: + av_assert0(pic->nb_refs[0]); + fh->frame_type = AV1_FRAME_INTER; + fh->base_q_idx = priv->q_idx_p; + ref = pic->refs[0][pic->nb_refs[0] - 1]; + href = ref->priv_data; + hpic->slot = !href->slot; + hpic->last_idr_frame = href->last_idr_frame; + fh->refresh_frame_flags = 1 << hpic->slot; + + /** set the nearest frame in L0 as all reference frame. */ + for (i = 0; i < AV1_REFS_PER_FRAME; i++) { + fh->ref_frame_idx[i] = href->slot; + } + fh->primary_ref_frame = href->slot; + fh->ref_order_hint[href->slot] = ref->display_order - href->last_idr_frame; + vpic->ref_frame_ctrl_l0.fields.search_idx0 = AV1_REF_FRAME_LAST; + + /** set the 2nd nearest frame in L0 as Golden frame. */ + if (pic->nb_refs[0] > 1) { + ref = pic->refs[0][pic->nb_refs[0] - 2]; + href = ref->priv_data; + fh->ref_frame_idx[3] = href->slot; + fh->ref_order_hint[href->slot] = ref->display_order - href->last_idr_frame; + vpic->ref_frame_ctrl_l0.fields.search_idx1 = AV1_REF_FRAME_GOLDEN; + } + break; + case PICTURE_TYPE_B: + av_assert0(pic->nb_refs[0] && pic->nb_refs[1]); + fh->frame_type = AV1_FRAME_INTER; + fh->base_q_idx = priv->q_idx_b; + fh->refresh_frame_flags = 0x0; + fh->reference_select = 1; + + /** B frame will not be referenced, disable its recon frame. */ + vpic->picture_flags.bits.disable_frame_recon = 1; + + /** Use LAST_FRAME and BWDREF_FRAME for reference. */ + vpic->ref_frame_ctrl_l0.fields.search_idx0 = AV1_REF_FRAME_LAST; + vpic->ref_frame_ctrl_l1.fields.search_idx0 = AV1_REF_FRAME_BWDREF; + + ref = pic->refs[0][pic->nb_refs[0] - 1]; + href = ref->priv_data; + hpic->last_idr_frame = href->last_idr_frame; + fh->primary_ref_frame = href->slot; + fh->ref_order_hint[href->slot] = ref->display_order - href->last_idr_frame; + for (i = 0; i < AV1_REF_FRAME_GOLDEN; i++) { + fh->ref_frame_idx[i] = href->slot; + } + + ref = pic->refs[1][pic->nb_refs[1] - 1]; + href = ref->priv_data; + fh->ref_order_hint[href->slot] = ref->display_order - href->last_idr_frame; + for (i = AV1_REF_FRAME_GOLDEN; i < AV1_REFS_PER_FRAME; i++) { + fh->ref_frame_idx[i] = href->slot; + } + break; + default: + av_assert0(0 && "invalid picture type"); + } + + fh->show_frame = pic->display_order <= pic->encode_order; + fh->showable_frame = fh->frame_type != AV1_FRAME_KEY; + fh->frame_width_minus_1 = avctx->width - 1; + fh->frame_height_minus_1 = avctx->height - 1; + fh->render_width_minus_1 = fh->frame_width_minus_1; + fh->render_height_minus_1 = fh->frame_height_minus_1; + fh->order_hint = pic->display_order - hpic->last_idr_frame; + fh->tile_cols = priv->tile_cols; + fh->tile_rows = priv->tile_rows; + fh->tile_cols_log2 = priv->tile_cols_log2; + fh->tile_rows_log2 = priv->tile_rows_log2; + fh->uniform_tile_spacing_flag = priv->uniform_tile; + fh->tile_size_bytes_minus1 = priv->attr_ext2.bits.tile_size_bytes_minus1; + + /** ignore ONLY_4x4 mode for codedlossless is not fully implemented. */ + if (priv->attr_ext2.bits.tx_mode_support & 0x04) + fh->tx_mode = AV1_TX_MODE_SELECT; + else if (priv->attr_ext2.bits.tx_mode_support & 0x02) + fh->tx_mode = AV1_TX_MODE_LARGEST; + else { + av_log(avctx, AV_LOG_ERROR, "No available tx mode found.\n"); + return AVERROR(EINVAL); + } + + for (i = 0; i < fh->tile_cols; i++) + fh->width_in_sbs_minus_1[i] = vpic->width_in_sbs_minus_1[i] = priv->width_in_sbs_minus_1[i]; + + for (i = 0; i < fh->tile_rows; i++) + fh->height_in_sbs_minus_1[i] = vpic->height_in_sbs_minus_1[i] = priv->height_in_sbs_minus_1[i]; + + memcpy(fh->loop_filter_ref_deltas, default_loop_filter_ref_deltas, + AV1_TOTAL_REFS_PER_FRAME * sizeof(int8_t)); + + if (fh->frame_type == AV1_FRAME_KEY && fh->show_frame) { + fh->error_resilient_mode = 1; + } + + if (fh->frame_type == AV1_FRAME_KEY || fh->error_resilient_mode) + fh->primary_ref_frame = AV1_PRIMARY_REF_NONE; + + vpic->base_qindex = fh->base_q_idx; + vpic->frame_width_minus_1 = fh->frame_width_minus_1; + vpic->frame_height_minus_1 = fh->frame_height_minus_1; + vpic->primary_ref_frame = fh->primary_ref_frame; + vpic->reconstructed_frame = pic->recon_surface; + vpic->coded_buf = pic->output_buffer; + vpic->tile_cols = fh->tile_cols; + vpic->tile_rows = fh->tile_rows; + vpic->order_hint = fh->order_hint; +#if VA_CHECK_VERSION(1, 15, 0) + vpic->refresh_frame_flags = fh->refresh_frame_flags; +#endif + + vpic->picture_flags.bits.enable_frame_obu = 0; + vpic->picture_flags.bits.frame_type = fh->frame_type; + vpic->picture_flags.bits.reduced_tx_set = fh->reduced_tx_set; + vpic->picture_flags.bits.error_resilient_mode = fh->error_resilient_mode; + + /** let driver decide to use single or compound reference prediction mode. */ + vpic->mode_control_flags.bits.reference_mode = fh->reference_select ? 2 : 0; + vpic->mode_control_flags.bits.tx_mode = fh->tx_mode; + + vpic->tile_group_obu_hdr_info.bits.obu_has_size_field = 1; + + /** set reference. */ + for (i = 0; i < AV1_REFS_PER_FRAME; i++) + vpic->ref_frame_idx[i] = fh->ref_frame_idx[i]; + + for (i = 0; i < FF_ARRAY_ELEMS(vpic->reference_frames); i++) + vpic->reference_frames[i] = VA_INVALID_SURFACE; + + for (i = 0; i < MAX_REFERENCE_LIST_NUM; i++) { + for (int j = 0; j < pic->nb_refs[i]; j++) { + VAAPIEncodePicture *ref_pic = pic->refs[i][j]; + + slot = ((VAAPIEncodeAV1Picture*)ref_pic->priv_data)->slot; + av_assert0(vpic->reference_frames[slot] == VA_INVALID_SURFACE); + + vpic->reference_frames[slot] = ref_pic->recon_surface; + } + } + + ret = vaapi_encode_av1_add_obu(avctx, obu, AV1_OBU_FRAME_HEADER, &priv->fh); + if (ret < 0) + goto end; + + ret = vaapi_encode_av1_write_obu(avctx, priv->fh_data, &priv->fh_data_len, obu); + if (ret < 0) + goto end; + + if (!(ctx->va_rc_mode & VA_RC_CQP)) { + vpic->min_base_qindex = av_clip(avctx->qmin, 1, AV1_MAX_QUANT); + vpic->max_base_qindex = av_clip(avctx->qmax, 1, AV1_MAX_QUANT); + + vpic->bit_offset_qindex = priv->qindex_offset; + vpic->bit_offset_loopfilter_params = priv->loopfilter_offset; + vpic->bit_offset_cdef_params = priv->cdef_start_offset; + vpic->size_in_bits_cdef_params = priv->cdef_param_size; + vpic->size_in_bits_frame_hdr_obu = priv->fh_data_len; + vpic->byte_offset_frame_hdr_obu_size = (((pic->type == PICTURE_TYPE_IDR) ? + priv->sh_data_len / 8 : 0) + + (fh_obu->header.obu_extension_flag ? + 2 : 1)); + } + +end: + ff_cbs_fragment_reset(obu); + return ret; +} + +static int vaapi_encode_av1_init_slice_params(AVCodecContext *avctx, + VAAPIEncodePicture *pic, + VAAPIEncodeSlice *slice) +{ + VAAPIEncodeAV1Context *priv = avctx->priv_data; + VAEncTileGroupBufferAV1 *vslice = slice->codec_slice_params; + CodedBitstreamAV1Context *cbctx = priv->cbc->priv_data; + int div; + + /** Set tile group info. */ + div = priv->tile_cols * priv->tile_rows / priv->tile_groups; + vslice->tg_start = slice->index * div; + if (slice->index == (priv->tile_groups - 1)) { + vslice->tg_end = priv->tile_cols * priv->tile_rows - 1; + cbctx->seen_frame_header = 0; + } else { + vslice->tg_end = (slice->index + 1) * div - 1; + } + + return 0; +} + +static int vaapi_encode_av1_write_picture_header(AVCodecContext *avctx, + VAAPIEncodePicture *pic, + char *data, size_t *data_len) +{ + VAAPIEncodeAV1Context *priv = avctx->priv_data; + CodedBitstreamFragment *obu = &priv->current_obu; + CodedBitstreamAV1Context *cbctx = priv->cbc->priv_data; + AV1RawOBU *fh_obu = &priv->fh; + AV1RawFrameHeader *rep_fh = &fh_obu->obu.frame_header; + VAAPIEncodeAV1Picture *href; + int ret = 0; + + pic->tail_size = 0; + /** Pack repeat frame header. */ + if (pic->display_order > pic->encode_order) { + memset(fh_obu, 0, sizeof(*fh_obu)); + href = pic->refs[0][pic->nb_refs[0] - 1]->priv_data; + fh_obu->header.obu_type = AV1_OBU_FRAME_HEADER; + fh_obu->header.obu_has_size_field = 1; + + rep_fh->show_existing_frame = 1; + rep_fh->frame_to_show_map_idx = href->slot == 0; + rep_fh->frame_type = AV1_FRAME_INTER; + rep_fh->frame_width_minus_1 = avctx->width - 1; + rep_fh->frame_height_minus_1 = avctx->height - 1; + rep_fh->render_width_minus_1 = rep_fh->frame_width_minus_1; + rep_fh->render_height_minus_1 = rep_fh->frame_height_minus_1; + + cbctx->seen_frame_header = 0; + + ret = vaapi_encode_av1_add_obu(avctx, obu, AV1_OBU_FRAME_HEADER, &priv->fh); + if (ret < 0) + goto end; + + ret = vaapi_encode_av1_write_obu(avctx, pic->tail_data, &pic->tail_size, obu); + if (ret < 0) + goto end; + + pic->tail_size /= 8; + } + + memcpy(data, &priv->fh_data, MAX_PARAM_BUFFER_SIZE * sizeof(char)); + *data_len = priv->fh_data_len; + +end: + ff_cbs_fragment_reset(obu); + return ret; +} + +static const VAAPIEncodeProfile vaapi_encode_av1_profiles[] = { + { AV_PROFILE_AV1_MAIN, 8, 3, 1, 1, VAProfileAV1Profile0 }, + { AV_PROFILE_AV1_MAIN, 10, 3, 1, 1, VAProfileAV1Profile0 }, + { AV_PROFILE_UNKNOWN } +}; + +static const VAAPIEncodeType vaapi_encode_type_av1 = { + .profiles = vaapi_encode_av1_profiles, + .flags = FLAG_B_PICTURES | FLAG_TIMESTAMP_NO_DELAY, + .default_quality = 25, + + .get_encoder_caps = &vaapi_encode_av1_get_encoder_caps, + .configure = &vaapi_encode_av1_configure, + + .sequence_header_type = VAEncPackedHeaderSequence, + .sequence_params_size = sizeof(VAEncSequenceParameterBufferAV1), + .init_sequence_params = &vaapi_encode_av1_init_sequence_params, + .write_sequence_header = &vaapi_encode_av1_write_sequence_header, + + .picture_priv_data_size = sizeof(VAAPIEncodeAV1Picture), + .picture_header_type = VAEncPackedHeaderPicture, + .picture_params_size = sizeof(VAEncPictureParameterBufferAV1), + .init_picture_params = &vaapi_encode_av1_init_picture_params, + .write_picture_header = &vaapi_encode_av1_write_picture_header, + + .slice_params_size = sizeof(VAEncTileGroupBufferAV1), + .init_slice_params = &vaapi_encode_av1_init_slice_params, +}; + +static av_cold int vaapi_encode_av1_init(AVCodecContext *avctx) +{ + VAAPIEncodeContext *ctx = avctx->priv_data; + VAAPIEncodeAV1Context *priv = avctx->priv_data; + VAConfigAttrib attr; + VAStatus vas; + int ret; + + ctx->codec = &vaapi_encode_type_av1; + + ctx->desired_packed_headers = + VA_ENC_PACKED_HEADER_SEQUENCE | + VA_ENC_PACKED_HEADER_PICTURE; + + if (avctx->profile == AV_PROFILE_UNKNOWN) + avctx->profile = priv->profile; + if (avctx->level == AV_LEVEL_UNKNOWN) + avctx->level = priv->level; + + if (avctx->level != AV_LEVEL_UNKNOWN && avctx->level & ~0x1f) { + av_log(avctx, AV_LOG_ERROR, "Invalid level %d\n", avctx->level); + return AVERROR(EINVAL); + } + + ret = ff_vaapi_encode_init(avctx); + if (ret < 0) + return ret; + + attr.type = VAConfigAttribEncAV1; + vas = vaGetConfigAttributes(ctx->hwctx->display, + ctx->va_profile, + ctx->va_entrypoint, + &attr, 1); + if (vas != VA_STATUS_SUCCESS) { + av_log(avctx, AV_LOG_ERROR, "Failed to query " + "config attribute: %d (%s).\n", vas, vaErrorStr(vas)); + return AVERROR_EXTERNAL; + } else if (attr.value == VA_ATTRIB_NOT_SUPPORTED) { + priv->attr.value = 0; + av_log(avctx, AV_LOG_WARNING, "Attribute type:%d is not " + "supported.\n", attr.type); + } else { + priv->attr.value = attr.value; + } + + attr.type = VAConfigAttribEncAV1Ext1; + vas = vaGetConfigAttributes(ctx->hwctx->display, + ctx->va_profile, + ctx->va_entrypoint, + &attr, 1); + if (vas != VA_STATUS_SUCCESS) { + av_log(avctx, AV_LOG_ERROR, "Failed to query " + "config attribute: %d (%s).\n", vas, vaErrorStr(vas)); + return AVERROR_EXTERNAL; + } else if (attr.value == VA_ATTRIB_NOT_SUPPORTED) { + priv->attr_ext1.value = 0; + av_log(avctx, AV_LOG_WARNING, "Attribute type:%d is not " + "supported.\n", attr.type); + } else { + priv->attr_ext1.value = attr.value; + } + + /** This attr provides essential indicators, return error if not support. */ + attr.type = VAConfigAttribEncAV1Ext2; + vas = vaGetConfigAttributes(ctx->hwctx->display, + ctx->va_profile, + ctx->va_entrypoint, + &attr, 1); + if (vas != VA_STATUS_SUCCESS || attr.value == VA_ATTRIB_NOT_SUPPORTED) { + av_log(avctx, AV_LOG_ERROR, "Failed to query " + "config attribute: %d (%s).\n", vas, vaErrorStr(vas)); + return AVERROR_EXTERNAL; + } else { + priv->attr_ext2.value = attr.value; + } + + av_opt_set_int(priv->cbc->priv_data, "fixed_obu_size_length", + priv->attr_ext2.bits.obu_size_bytes_minus1 + 1, 0); + + ret = vaapi_encode_av1_set_tile(avctx); + if (ret < 0) + return ret; + + return 0; +} + +static av_cold int vaapi_encode_av1_close(AVCodecContext *avctx) +{ + VAAPIEncodeAV1Context *priv = avctx->priv_data; + + ff_cbs_fragment_free(&priv->current_obu); + ff_cbs_close(&priv->cbc); + + return ff_vaapi_encode_close(avctx); +} + +#define OFFSET(x) offsetof(VAAPIEncodeAV1Context, x) +#define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM) + +static const AVOption vaapi_encode_av1_options[] = { + VAAPI_ENCODE_COMMON_OPTIONS, + VAAPI_ENCODE_RC_OPTIONS, + { "profile", "Set profile (seq_profile)", + OFFSET(profile), AV_OPT_TYPE_INT, + { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, 0xff, FLAGS, "profile" }, + +#define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \ + { .i64 = value }, 0, 0, FLAGS, "profile" + { PROFILE("main", AV_PROFILE_AV1_MAIN) }, + { PROFILE("high", AV_PROFILE_AV1_HIGH) }, + { PROFILE("professional", AV_PROFILE_AV1_PROFESSIONAL) }, +#undef PROFILE + + { "tier", "Set tier (seq_tier)", + OFFSET(tier), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS, "tier" }, + { "main", NULL, 0, AV_OPT_TYPE_CONST, + { .i64 = 0 }, 0, 0, FLAGS, "tier" }, + { "high", NULL, 0, AV_OPT_TYPE_CONST, + { .i64 = 1 }, 0, 0, FLAGS, "tier" }, + { "level", "Set level (seq_level_idx)", + OFFSET(level), AV_OPT_TYPE_INT, + { .i64 = AV_LEVEL_UNKNOWN }, AV_LEVEL_UNKNOWN, 0x1f, FLAGS, "level" }, + +#define LEVEL(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \ + { .i64 = value }, 0, 0, FLAGS, "level" + { LEVEL("2.0", 0) }, + { LEVEL("2.1", 1) }, + { LEVEL("3.0", 4) }, + { LEVEL("3.1", 5) }, + { LEVEL("4.0", 8) }, + { LEVEL("4.1", 9) }, + { LEVEL("5.0", 12) }, + { LEVEL("5.1", 13) }, + { LEVEL("5.2", 14) }, + { LEVEL("5.3", 15) }, + { LEVEL("6.0", 16) }, + { LEVEL("6.1", 17) }, + { LEVEL("6.2", 18) }, + { LEVEL("6.3", 19) }, +#undef LEVEL + + { "tiles", "Tile columns x rows (Use minimal tile column/row number automatically by default)", + OFFSET(tile_cols), AV_OPT_TYPE_IMAGE_SIZE, { .str = NULL }, 0, 0, FLAGS }, + { "tile_groups", "Number of tile groups for encoding", + OFFSET(tile_groups), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, AV1_MAX_TILE_ROWS * AV1_MAX_TILE_COLS, FLAGS }, + + { NULL }, +}; + +static const FFCodecDefault vaapi_encode_av1_defaults[] = { + { "b", "0" }, + { "bf", "2" }, + { "g", "120" }, + { "qmin", "1" }, + { "qmax", "255" }, + { NULL }, +}; + +static const AVClass vaapi_encode_av1_class = { + .class_name = "av1_vaapi", + .item_name = av_default_item_name, + .option = vaapi_encode_av1_options, + .version = LIBAVUTIL_VERSION_INT, +}; + +const FFCodec ff_av1_vaapi_encoder = { + .p.name = "av1_vaapi", + CODEC_LONG_NAME("AV1 (VAAPI)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, + .priv_data_size = sizeof(VAAPIEncodeAV1Context), + .init = &vaapi_encode_av1_init, + FF_CODEC_RECEIVE_PACKET_CB(&ff_vaapi_encode_receive_packet), + .close = &vaapi_encode_av1_close, + .p.priv_class = &vaapi_encode_av1_class, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | + AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | + FF_CODEC_CAP_INIT_CLEANUP, + .defaults = vaapi_encode_av1_defaults, + .p.pix_fmts = (const enum AVPixelFormat[]) { + AV_PIX_FMT_VAAPI, + AV_PIX_FMT_NONE, + }, + .hw_configs = ff_vaapi_encode_hw_configs, + .p.wrapper_name = "vaapi", +}; diff --git a/src/third_party/ffmpeg/libavcodec/vaapi_encode_h264.c b/src/third_party/ffmpeg/libavcodec/vaapi_encode_h264.c index 9ad017d5..57b5ea2b 100644 --- a/src/third_party/ffmpeg/libavcodec/vaapi_encode_h264.c +++ b/src/third_party/ffmpeg/libavcodec/vaapi_encode_h264.c @@ -322,15 +322,15 @@ static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx) sps->profile_idc = avctx->profile & 0xff; - if (avctx->profile == FF_PROFILE_H264_CONSTRAINED_BASELINE || - avctx->profile == FF_PROFILE_H264_MAIN) + if (avctx->profile == AV_PROFILE_H264_CONSTRAINED_BASELINE || + avctx->profile == AV_PROFILE_H264_MAIN) sps->constraint_set1_flag = 1; - if (avctx->profile == FF_PROFILE_H264_HIGH || avctx->profile == FF_PROFILE_H264_HIGH_10) + if (avctx->profile == AV_PROFILE_H264_HIGH || avctx->profile == AV_PROFILE_H264_HIGH_10) sps->constraint_set3_flag = ctx->gop_size == 1; - if (avctx->profile == FF_PROFILE_H264_MAIN || - avctx->profile == FF_PROFILE_H264_HIGH || avctx->profile == FF_PROFILE_H264_HIGH_10) { + if (avctx->profile == AV_PROFILE_H264_MAIN || + avctx->profile == AV_PROFILE_H264_HIGH || avctx->profile == AV_PROFILE_H264_HIGH_10) { sps->constraint_set4_flag = 1; sps->constraint_set5_flag = ctx->b_per_p == 0; } @@ -340,7 +340,7 @@ static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx) else priv->dpb_frames = 1 + ctx->max_b_depth; - if (avctx->level != FF_LEVEL_UNKNOWN) { + if (avctx->level != AV_LEVEL_UNKNOWN) { sps->level_idc = avctx->level; } else { const H264LevelDescriptor *level; @@ -512,9 +512,9 @@ static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx) pps->seq_parameter_set_id = 0; pps->entropy_coding_mode_flag = - !(sps->profile_idc == FF_PROFILE_H264_BASELINE || - sps->profile_idc == FF_PROFILE_H264_EXTENDED || - sps->profile_idc == FF_PROFILE_H264_CAVLC_444); + !(sps->profile_idc == AV_PROFILE_H264_BASELINE || + sps->profile_idc == AV_PROFILE_H264_EXTENDED || + sps->profile_idc == AV_PROFILE_H264_CAVLC_444); if (!priv->coder && pps->entropy_coding_mode_flag) pps->entropy_coding_mode_flag = 0; @@ -523,9 +523,9 @@ static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx) pps->pic_init_qp_minus26 = priv->fixed_qp_idr - 26; - if (sps->profile_idc == FF_PROFILE_H264_BASELINE || - sps->profile_idc == FF_PROFILE_H264_EXTENDED || - sps->profile_idc == FF_PROFILE_H264_MAIN) { + if (sps->profile_idc == AV_PROFILE_H264_BASELINE || + sps->profile_idc == AV_PROFILE_H264_EXTENDED || + sps->profile_idc == AV_PROFILE_H264_MAIN) { pps->more_rbsp_data = 0; } else { pps->more_rbsp_data = 1; @@ -628,7 +628,7 @@ static int vaapi_encode_h264_init_picture_params(AVCodecContext *avctx, VAAPIEncodePicture *prev = pic->prev; VAAPIEncodeH264Picture *hprev = prev ? prev->priv_data : NULL; VAEncPictureParameterBufferH264 *vpic = pic->codec_picture_params; - int i; + int i, j = 0; if (pic->type == PICTURE_TYPE_IDR) { av_assert0(pic->display_order == pic->encode_order); @@ -729,24 +729,26 @@ static int vaapi_encode_h264_init_picture_params(AVCodecContext *avctx, .TopFieldOrderCnt = hpic->pic_order_cnt, .BottomFieldOrderCnt = hpic->pic_order_cnt, }; + for (int k = 0; k < MAX_REFERENCE_LIST_NUM; k++) { + for (i = 0; i < pic->nb_refs[k]; i++) { + VAAPIEncodePicture *ref = pic->refs[k][i]; + VAAPIEncodeH264Picture *href; - for (i = 0; i < pic->nb_refs; i++) { - VAAPIEncodePicture *ref = pic->refs[i]; - VAAPIEncodeH264Picture *href; + av_assert0(ref && ref->encode_order < pic->encode_order); + href = ref->priv_data; - av_assert0(ref && ref->encode_order < pic->encode_order); - href = ref->priv_data; - - vpic->ReferenceFrames[i] = (VAPictureH264) { - .picture_id = ref->recon_surface, - .frame_idx = href->frame_num, - .flags = VA_PICTURE_H264_SHORT_TERM_REFERENCE, - .TopFieldOrderCnt = href->pic_order_cnt, - .BottomFieldOrderCnt = href->pic_order_cnt, - }; + vpic->ReferenceFrames[j++] = (VAPictureH264) { + .picture_id = ref->recon_surface, + .frame_idx = href->frame_num, + .flags = VA_PICTURE_H264_SHORT_TERM_REFERENCE, + .TopFieldOrderCnt = href->pic_order_cnt, + .BottomFieldOrderCnt = href->pic_order_cnt, + }; + } } - for (; i < FF_ARRAY_ELEMS(vpic->ReferenceFrames); i++) { - vpic->ReferenceFrames[i] = (VAPictureH264) { + + for (; j < FF_ARRAY_ELEMS(vpic->ReferenceFrames); j++) { + vpic->ReferenceFrames[j] = (VAPictureH264) { .picture_id = VA_INVALID_ID, .flags = VA_PICTURE_H264_INVALID, }; @@ -948,17 +950,17 @@ static int vaapi_encode_h264_init_slice_params(AVCodecContext *avctx, if (pic->type == PICTURE_TYPE_P) { int need_rplm = 0; - for (i = 0; i < pic->nb_refs; i++) { - av_assert0(pic->refs[i]); - if (pic->refs[i] != def_l0[i]) + for (i = 0; i < pic->nb_refs[0]; i++) { + av_assert0(pic->refs[0][i]); + if (pic->refs[0][i] != def_l0[i]) need_rplm = 1; } sh->ref_pic_list_modification_flag_l0 = need_rplm; if (need_rplm) { int pic_num = hpic->frame_num; - for (i = 0; i < pic->nb_refs; i++) { - href = pic->refs[i]->priv_data; + for (i = 0; i < pic->nb_refs[0]; i++) { + href = pic->refs[0][i]->priv_data; av_assert0(href->frame_num != pic_num); if (href->frame_num < pic_num) { sh->rplm_l0[i].modification_of_pic_nums_idc = 0; @@ -977,28 +979,29 @@ static int vaapi_encode_h264_init_slice_params(AVCodecContext *avctx, } else { int need_rplm_l0 = 0, need_rplm_l1 = 0; int n0 = 0, n1 = 0; - for (i = 0; i < pic->nb_refs; i++) { - av_assert0(pic->refs[i]); - href = pic->refs[i]->priv_data; - av_assert0(href->pic_order_cnt != hpic->pic_order_cnt); - if (href->pic_order_cnt < hpic->pic_order_cnt) { - if (pic->refs[i] != def_l0[n0]) - need_rplm_l0 = 1; - ++n0; - } else { - if (pic->refs[i] != def_l1[n1]) - need_rplm_l1 = 1; - ++n1; - } + for (i = 0; i < pic->nb_refs[0]; i++) { + av_assert0(pic->refs[0][i]); + href = pic->refs[0][i]->priv_data; + av_assert0(href->pic_order_cnt < hpic->pic_order_cnt); + if (pic->refs[0][i] != def_l0[n0]) + need_rplm_l0 = 1; + ++n0; + } + + for (i = 0; i < pic->nb_refs[1]; i++) { + av_assert0(pic->refs[1][i]); + href = pic->refs[1][i]->priv_data; + av_assert0(href->pic_order_cnt > hpic->pic_order_cnt); + if (pic->refs[1][i] != def_l1[n1]) + need_rplm_l1 = 1; + ++n1; } sh->ref_pic_list_modification_flag_l0 = need_rplm_l0; if (need_rplm_l0) { int pic_num = hpic->frame_num; - for (i = j = 0; i < pic->nb_refs; i++) { - href = pic->refs[i]->priv_data; - if (href->pic_order_cnt > hpic->pic_order_cnt) - continue; + for (i = j = 0; i < pic->nb_refs[0]; i++) { + href = pic->refs[0][i]->priv_data; av_assert0(href->frame_num != pic_num); if (href->frame_num < pic_num) { sh->rplm_l0[j].modification_of_pic_nums_idc = 0; @@ -1019,10 +1022,8 @@ static int vaapi_encode_h264_init_slice_params(AVCodecContext *avctx, sh->ref_pic_list_modification_flag_l1 = need_rplm_l1; if (need_rplm_l1) { int pic_num = hpic->frame_num; - for (i = j = 0; i < pic->nb_refs; i++) { - href = pic->refs[i]->priv_data; - if (href->pic_order_cnt < hpic->pic_order_cnt) - continue; + for (i = j = 0; i < pic->nb_refs[1]; i++) { + href = pic->refs[1][i]->priv_data; av_assert0(href->frame_num != pic_num); if (href->frame_num < pic_num) { sh->rplm_l1[j].modification_of_pic_nums_idc = 0; @@ -1062,14 +1063,13 @@ static int vaapi_encode_h264_init_slice_params(AVCodecContext *avctx, vslice->RefPicList1[i].flags = VA_PICTURE_H264_INVALID; } - av_assert0(pic->nb_refs <= 2); - if (pic->nb_refs >= 1) { + if (pic->nb_refs[0]) { // Backward reference for P- or B-frame. av_assert0(pic->type == PICTURE_TYPE_P || pic->type == PICTURE_TYPE_B); vslice->RefPicList0[0] = vpic->ReferenceFrames[0]; } - if (pic->nb_refs >= 2) { + if (pic->nb_refs[1]) { // Forward reference for B-frame. av_assert0(pic->type == PICTURE_TYPE_B); vslice->RefPicList1[0] = vpic->ReferenceFrames[1]; @@ -1159,13 +1159,13 @@ static av_cold int vaapi_encode_h264_configure(AVCodecContext *avctx) static const VAAPIEncodeProfile vaapi_encode_h264_profiles[] = { #if VA_CHECK_VERSION(1, 18, 0) - { FF_PROFILE_H264_HIGH_10, 10, 3, 1, 1, VAProfileH264High10 }, + { AV_PROFILE_H264_HIGH_10, 10, 3, 1, 1, VAProfileH264High10 }, #endif - { FF_PROFILE_H264_HIGH, 8, 3, 1, 1, VAProfileH264High }, - { FF_PROFILE_H264_MAIN, 8, 3, 1, 1, VAProfileH264Main }, - { FF_PROFILE_H264_CONSTRAINED_BASELINE, + { AV_PROFILE_H264_HIGH, 8, 3, 1, 1, VAProfileH264High }, + { AV_PROFILE_H264_MAIN, 8, 3, 1, 1, VAProfileH264Main }, + { AV_PROFILE_H264_CONSTRAINED_BASELINE, 8, 3, 1, 1, VAProfileH264ConstrainedBaseline }, - { FF_PROFILE_UNKNOWN } + { AV_PROFILE_UNKNOWN } }; static const VAAPIEncodeType vaapi_encode_type_h264 = { @@ -1207,40 +1207,40 @@ static av_cold int vaapi_encode_h264_init(AVCodecContext *avctx) ctx->codec = &vaapi_encode_type_h264; - if (avctx->profile == FF_PROFILE_UNKNOWN) + if (avctx->profile == AV_PROFILE_UNKNOWN) avctx->profile = priv->profile; - if (avctx->level == FF_LEVEL_UNKNOWN) + if (avctx->level == AV_LEVEL_UNKNOWN) avctx->level = priv->level; if (avctx->compression_level == FF_COMPRESSION_DEFAULT) avctx->compression_level = priv->quality; // Reject unsupported profiles. switch (avctx->profile) { - case FF_PROFILE_H264_BASELINE: + case AV_PROFILE_H264_BASELINE: av_log(avctx, AV_LOG_WARNING, "H.264 baseline profile is not " "supported, using constrained baseline profile instead.\n"); - avctx->profile = FF_PROFILE_H264_CONSTRAINED_BASELINE; + avctx->profile = AV_PROFILE_H264_CONSTRAINED_BASELINE; break; - case FF_PROFILE_H264_EXTENDED: + case AV_PROFILE_H264_EXTENDED: av_log(avctx, AV_LOG_ERROR, "H.264 extended profile " "is not supported.\n"); return AVERROR_PATCHWELCOME; - case FF_PROFILE_H264_HIGH_10_INTRA: + case AV_PROFILE_H264_HIGH_10_INTRA: av_log(avctx, AV_LOG_ERROR, "H.264 high 10 intra profile " "is not supported.\n"); return AVERROR_PATCHWELCOME; - case FF_PROFILE_H264_HIGH_422: - case FF_PROFILE_H264_HIGH_422_INTRA: - case FF_PROFILE_H264_HIGH_444: - case FF_PROFILE_H264_HIGH_444_PREDICTIVE: - case FF_PROFILE_H264_HIGH_444_INTRA: - case FF_PROFILE_H264_CAVLC_444: + case AV_PROFILE_H264_HIGH_422: + case AV_PROFILE_H264_HIGH_422_INTRA: + case AV_PROFILE_H264_HIGH_444: + case AV_PROFILE_H264_HIGH_444_PREDICTIVE: + case AV_PROFILE_H264_HIGH_444_INTRA: + case AV_PROFILE_H264_CAVLC_444: av_log(avctx, AV_LOG_ERROR, "H.264 non-4:2:0 profiles " "are not supported.\n"); return AVERROR_PATCHWELCOME; } - if (avctx->level != FF_LEVEL_UNKNOWN && avctx->level & ~0xff) { + if (avctx->level != AV_LEVEL_UNKNOWN && avctx->level & ~0xff) { av_log(avctx, AV_LOG_ERROR, "Invalid level %d: must fit " "in 8-bit unsigned integer.\n", avctx->level); return AVERROR(EINVAL); @@ -1313,19 +1313,19 @@ static const AVOption vaapi_encode_h264_options[] = { { "profile", "Set profile (profile_idc and constraint_set*_flag)", OFFSET(profile), AV_OPT_TYPE_INT, - { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, 0xffff, FLAGS, "profile" }, + { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, 0xffff, FLAGS, "profile" }, #define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \ { .i64 = value }, 0, 0, FLAGS, "profile" - { PROFILE("constrained_baseline", FF_PROFILE_H264_CONSTRAINED_BASELINE) }, - { PROFILE("main", FF_PROFILE_H264_MAIN) }, - { PROFILE("high", FF_PROFILE_H264_HIGH) }, - { PROFILE("high10", FF_PROFILE_H264_HIGH_10) }, + { PROFILE("constrained_baseline", AV_PROFILE_H264_CONSTRAINED_BASELINE) }, + { PROFILE("main", AV_PROFILE_H264_MAIN) }, + { PROFILE("high", AV_PROFILE_H264_HIGH) }, + { PROFILE("high10", AV_PROFILE_H264_HIGH_10) }, #undef PROFILE { "level", "Set level (level_idc)", OFFSET(level), AV_OPT_TYPE_INT, - { .i64 = FF_LEVEL_UNKNOWN }, FF_LEVEL_UNKNOWN, 0xff, FLAGS, "level" }, + { .i64 = AV_LEVEL_UNKNOWN }, AV_LEVEL_UNKNOWN, 0xff, FLAGS, "level" }, #define LEVEL(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \ { .i64 = value }, 0, 0, FLAGS, "level" diff --git a/src/third_party/ffmpeg/libavcodec/vaapi_encode_h265.c b/src/third_party/ffmpeg/libavcodec/vaapi_encode_h265.c index aa7e532f..239ef235 100644 --- a/src/third_party/ffmpeg/libavcodec/vaapi_encode_h265.c +++ b/src/third_party/ffmpeg/libavcodec/vaapi_encode_h265.c @@ -346,7 +346,7 @@ static int vaapi_encode_h265_init_sequence_params(AVCodecContext *avctx) ptl->general_lower_bit_rate_constraint_flag = 1; - if (avctx->level != FF_LEVEL_UNKNOWN) { + if (avctx->level != AV_LEVEL_UNKNOWN) { ptl->general_level_idc = avctx->level; } else { const H265LevelDescriptor *level; @@ -764,7 +764,7 @@ static int vaapi_encode_h265_init_picture_params(AVCodecContext *avctx, VAAPIEncodePicture *prev = pic->prev; VAAPIEncodeH265Picture *hprev = prev ? prev->priv_data : NULL; VAEncPictureParameterBufferHEVC *vpic = pic->codec_picture_params; - int i; + int i, j = 0; if (pic->type == PICTURE_TYPE_IDR) { av_assert0(pic->display_order == pic->encode_order); @@ -789,8 +789,8 @@ static int vaapi_encode_h265_init_picture_params(AVCodecContext *avctx, hpic->pic_type = 1; } else { VAAPIEncodePicture *irap_ref; - av_assert0(pic->refs[0] && pic->refs[1]); - for (irap_ref = pic; irap_ref; irap_ref = irap_ref->refs[1]) { + av_assert0(pic->refs[0][0] && pic->refs[1][0]); + for (irap_ref = pic; irap_ref; irap_ref = irap_ref->refs[1][0]) { if (irap_ref->type == PICTURE_TYPE_I) break; } @@ -915,24 +915,27 @@ static int vaapi_encode_h265_init_picture_params(AVCodecContext *avctx, .flags = 0, }; - for (i = 0; i < pic->nb_refs; i++) { - VAAPIEncodePicture *ref = pic->refs[i]; - VAAPIEncodeH265Picture *href; + for (int k = 0; k < MAX_REFERENCE_LIST_NUM; k++) { + for (i = 0; i < pic->nb_refs[k]; i++) { + VAAPIEncodePicture *ref = pic->refs[k][i]; + VAAPIEncodeH265Picture *href; - av_assert0(ref && ref->encode_order < pic->encode_order); - href = ref->priv_data; + av_assert0(ref && ref->encode_order < pic->encode_order); + href = ref->priv_data; - vpic->reference_frames[i] = (VAPictureHEVC) { - .picture_id = ref->recon_surface, - .pic_order_cnt = href->pic_order_cnt, - .flags = (ref->display_order < pic->display_order ? - VA_PICTURE_HEVC_RPS_ST_CURR_BEFORE : 0) | - (ref->display_order > pic->display_order ? - VA_PICTURE_HEVC_RPS_ST_CURR_AFTER : 0), - }; + vpic->reference_frames[j++] = (VAPictureHEVC) { + .picture_id = ref->recon_surface, + .pic_order_cnt = href->pic_order_cnt, + .flags = (ref->display_order < pic->display_order ? + VA_PICTURE_HEVC_RPS_ST_CURR_BEFORE : 0) | + (ref->display_order > pic->display_order ? + VA_PICTURE_HEVC_RPS_ST_CURR_AFTER : 0), + }; + } } - for (; i < FF_ARRAY_ELEMS(vpic->reference_frames); i++) { - vpic->reference_frames[i] = (VAPictureHEVC) { + + for (; j < FF_ARRAY_ELEMS(vpic->reference_frames); j++) { + vpic->reference_frames[j] = (VAPictureHEVC) { .picture_id = VA_INVALID_ID, .flags = VA_PICTURE_HEVC_INVALID, }; @@ -1016,21 +1019,33 @@ static int vaapi_encode_h265_init_slice_params(AVCodecContext *avctx, memset(rps, 0, sizeof(*rps)); rps_pics = 0; - for (i = 0; i < pic->nb_refs; i++) { - strp = pic->refs[i]->priv_data; - rps_poc[rps_pics] = strp->pic_order_cnt; - rps_used[rps_pics] = 1; - ++rps_pics; + for (i = 0; i < MAX_REFERENCE_LIST_NUM; i++) { + for (j = 0; j < pic->nb_refs[i]; j++) { + strp = pic->refs[i][j]->priv_data; + rps_poc[rps_pics] = strp->pic_order_cnt; + rps_used[rps_pics] = 1; + ++rps_pics; + } } + for (i = 0; i < pic->nb_dpb_pics; i++) { if (pic->dpb[i] == pic) continue; - for (j = 0; j < pic->nb_refs; j++) { - if (pic->dpb[i] == pic->refs[j]) + + for (j = 0; j < pic->nb_refs[0]; j++) { + if (pic->dpb[i] == pic->refs[0][j]) break; } - if (j < pic->nb_refs) + if (j < pic->nb_refs[0]) continue; + + for (j = 0; j < pic->nb_refs[1]; j++) { + if (pic->dpb[i] == pic->refs[1][j]) + break; + } + if (j < pic->nb_refs[1]) + continue; + strp = pic->dpb[i]->priv_data; rps_poc[rps_pics] = strp->pic_order_cnt; rps_used[rps_pics] = 0; @@ -1155,8 +1170,7 @@ static int vaapi_encode_h265_init_slice_params(AVCodecContext *avctx, vslice->ref_pic_list1[i].flags = VA_PICTURE_HEVC_INVALID; } - av_assert0(pic->nb_refs <= 2); - if (pic->nb_refs >= 1) { + if (pic->nb_refs[0]) { // Backward reference for P- or B-frame. av_assert0(pic->type == PICTURE_TYPE_P || pic->type == PICTURE_TYPE_B); @@ -1165,7 +1179,7 @@ static int vaapi_encode_h265_init_slice_params(AVCodecContext *avctx, // Reference for GPB B-frame, L0 == L1 vslice->ref_pic_list1[0] = vpic->reference_frames[0]; } - if (pic->nb_refs >= 2) { + if (pic->nb_refs[1]) { // Forward reference for B-frame. av_assert0(pic->type == PICTURE_TYPE_B); vslice->ref_pic_list1[0] = vpic->reference_frames[1]; @@ -1290,22 +1304,22 @@ static av_cold int vaapi_encode_h265_configure(AVCodecContext *avctx) } static const VAAPIEncodeProfile vaapi_encode_h265_profiles[] = { - { FF_PROFILE_HEVC_MAIN, 8, 3, 1, 1, VAProfileHEVCMain }, - { FF_PROFILE_HEVC_REXT, 8, 3, 1, 1, VAProfileHEVCMain }, + { AV_PROFILE_HEVC_MAIN, 8, 3, 1, 1, VAProfileHEVCMain }, + { AV_PROFILE_HEVC_REXT, 8, 3, 1, 1, VAProfileHEVCMain }, #if VA_CHECK_VERSION(0, 37, 0) - { FF_PROFILE_HEVC_MAIN_10, 10, 3, 1, 1, VAProfileHEVCMain10 }, - { FF_PROFILE_HEVC_REXT, 10, 3, 1, 1, VAProfileHEVCMain10 }, + { AV_PROFILE_HEVC_MAIN_10, 10, 3, 1, 1, VAProfileHEVCMain10 }, + { AV_PROFILE_HEVC_REXT, 10, 3, 1, 1, VAProfileHEVCMain10 }, #endif #if VA_CHECK_VERSION(1, 2, 0) - { FF_PROFILE_HEVC_REXT, 12, 3, 1, 1, VAProfileHEVCMain12 }, - { FF_PROFILE_HEVC_REXT, 8, 3, 1, 0, VAProfileHEVCMain422_10 }, - { FF_PROFILE_HEVC_REXT, 10, 3, 1, 0, VAProfileHEVCMain422_10 }, - { FF_PROFILE_HEVC_REXT, 12, 3, 1, 0, VAProfileHEVCMain422_12 }, - { FF_PROFILE_HEVC_REXT, 8, 3, 0, 0, VAProfileHEVCMain444 }, - { FF_PROFILE_HEVC_REXT, 10, 3, 0, 0, VAProfileHEVCMain444_10 }, - { FF_PROFILE_HEVC_REXT, 12, 3, 0, 0, VAProfileHEVCMain444_12 }, + { AV_PROFILE_HEVC_REXT, 12, 3, 1, 1, VAProfileHEVCMain12 }, + { AV_PROFILE_HEVC_REXT, 8, 3, 1, 0, VAProfileHEVCMain422_10 }, + { AV_PROFILE_HEVC_REXT, 10, 3, 1, 0, VAProfileHEVCMain422_10 }, + { AV_PROFILE_HEVC_REXT, 12, 3, 1, 0, VAProfileHEVCMain422_12 }, + { AV_PROFILE_HEVC_REXT, 8, 3, 0, 0, VAProfileHEVCMain444 }, + { AV_PROFILE_HEVC_REXT, 10, 3, 0, 0, VAProfileHEVCMain444_10 }, + { AV_PROFILE_HEVC_REXT, 12, 3, 0, 0, VAProfileHEVCMain444_12 }, #endif - { FF_PROFILE_UNKNOWN } + { AV_PROFILE_UNKNOWN } }; static const VAAPIEncodeType vaapi_encode_type_h265 = { @@ -1348,12 +1362,12 @@ static av_cold int vaapi_encode_h265_init(AVCodecContext *avctx) ctx->codec = &vaapi_encode_type_h265; - if (avctx->profile == FF_PROFILE_UNKNOWN) + if (avctx->profile == AV_PROFILE_UNKNOWN) avctx->profile = priv->profile; - if (avctx->level == FF_LEVEL_UNKNOWN) + if (avctx->level == AV_LEVEL_UNKNOWN) avctx->level = priv->level; - if (avctx->level != FF_LEVEL_UNKNOWN && avctx->level & ~0xff) { + if (avctx->level != AV_LEVEL_UNKNOWN && avctx->level & ~0xff) { av_log(avctx, AV_LOG_ERROR, "Invalid level %d: must fit " "in 8-bit unsigned integer.\n", avctx->level); return AVERROR(EINVAL); @@ -1395,13 +1409,13 @@ static const AVOption vaapi_encode_h265_options[] = { { "profile", "Set profile (general_profile_idc)", OFFSET(profile), AV_OPT_TYPE_INT, - { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, 0xff, FLAGS, "profile" }, + { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, 0xff, FLAGS, "profile" }, #define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \ { .i64 = value }, 0, 0, FLAGS, "profile" - { PROFILE("main", FF_PROFILE_HEVC_MAIN) }, - { PROFILE("main10", FF_PROFILE_HEVC_MAIN_10) }, - { PROFILE("rext", FF_PROFILE_HEVC_REXT) }, + { PROFILE("main", AV_PROFILE_HEVC_MAIN) }, + { PROFILE("main10", AV_PROFILE_HEVC_MAIN_10) }, + { PROFILE("rext", AV_PROFILE_HEVC_REXT) }, #undef PROFILE { "tier", "Set tier (general_tier_flag)", @@ -1414,7 +1428,7 @@ static const AVOption vaapi_encode_h265_options[] = { { "level", "Set level (general_level_idc)", OFFSET(level), AV_OPT_TYPE_INT, - { .i64 = FF_LEVEL_UNKNOWN }, FF_LEVEL_UNKNOWN, 0xff, FLAGS, "level" }, + { .i64 = AV_LEVEL_UNKNOWN }, AV_LEVEL_UNKNOWN, 0xff, FLAGS, "level" }, #define LEVEL(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \ { .i64 = value }, 0, 0, FLAGS, "level" diff --git a/src/third_party/ffmpeg/libavcodec/vaapi_encode_mjpeg.c b/src/third_party/ffmpeg/libavcodec/vaapi_encode_mjpeg.c index cb7588b9..c17747e3 100644 --- a/src/third_party/ffmpeg/libavcodec/vaapi_encode_mjpeg.c +++ b/src/third_party/ffmpeg/libavcodec/vaapi_encode_mjpeg.c @@ -480,15 +480,15 @@ static av_cold int vaapi_encode_mjpeg_configure(AVCodecContext *avctx) } static const VAAPIEncodeProfile vaapi_encode_mjpeg_profiles[] = { - { FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, + { AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, 8, 1, 0, 0, VAProfileJPEGBaseline }, - { FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, + { AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, 8, 3, 1, 1, VAProfileJPEGBaseline }, - { FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, + { AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, 8, 3, 1, 0, VAProfileJPEGBaseline }, - { FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, + { AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, 8, 3, 0, 0, VAProfileJPEGBaseline }, - { FF_PROFILE_UNKNOWN } + { AV_PROFILE_UNKNOWN } }; static const VAAPIEncodeType vaapi_encode_type_mjpeg = { diff --git a/src/third_party/ffmpeg/libavcodec/vaapi_encode_mpeg2.c b/src/third_party/ffmpeg/libavcodec/vaapi_encode_mpeg2.c index 9261d19a..d1904bf4 100644 --- a/src/third_party/ffmpeg/libavcodec/vaapi_encode_mpeg2.c +++ b/src/third_party/ffmpeg/libavcodec/vaapi_encode_mpeg2.c @@ -458,12 +458,12 @@ static int vaapi_encode_mpeg2_init_picture_params(AVCodecContext *avctx, break; case PICTURE_TYPE_P: vpic->picture_type = VAEncPictureTypePredictive; - vpic->forward_reference_picture = pic->refs[0]->recon_surface; + vpic->forward_reference_picture = pic->refs[0][0]->recon_surface; break; case PICTURE_TYPE_B: vpic->picture_type = VAEncPictureTypeBidirectional; - vpic->forward_reference_picture = pic->refs[0]->recon_surface; - vpic->backward_reference_picture = pic->refs[1]->recon_surface; + vpic->forward_reference_picture = pic->refs[0][0]->recon_surface; + vpic->backward_reference_picture = pic->refs[1][0]->recon_surface; break; default: av_assert0(0 && "invalid picture type"); @@ -558,9 +558,9 @@ static av_cold int vaapi_encode_mpeg2_configure(AVCodecContext *avctx) } static const VAAPIEncodeProfile vaapi_encode_mpeg2_profiles[] = { - { FF_PROFILE_MPEG2_MAIN, 8, 3, 1, 1, VAProfileMPEG2Main }, - { FF_PROFILE_MPEG2_SIMPLE, 8, 3, 1, 1, VAProfileMPEG2Simple }, - { FF_PROFILE_UNKNOWN } + { AV_PROFILE_MPEG2_MAIN, 8, 3, 1, 1, VAProfileMPEG2Main }, + { AV_PROFILE_MPEG2_SIMPLE, 8, 3, 1, 1, VAProfileMPEG2Simple }, + { AV_PROFILE_UNKNOWN } }; static const VAAPIEncodeType vaapi_encode_type_mpeg2 = { @@ -595,9 +595,9 @@ static av_cold int vaapi_encode_mpeg2_init(AVCodecContext *avctx) ctx->codec = &vaapi_encode_type_mpeg2; - if (avctx->profile == FF_PROFILE_UNKNOWN) + if (avctx->profile == AV_PROFILE_UNKNOWN) avctx->profile = priv->profile; - if (avctx->level == FF_LEVEL_UNKNOWN) + if (avctx->level == AV_LEVEL_UNKNOWN) avctx->level = priv->level; // Reject unknown levels (these are required to set f_code for @@ -644,12 +644,12 @@ static const AVOption vaapi_encode_mpeg2_options[] = { { "profile", "Set profile (in profile_and_level_indication)", OFFSET(profile), AV_OPT_TYPE_INT, - { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, 7, FLAGS, "profile" }, + { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, 7, FLAGS, "profile" }, #define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \ { .i64 = value }, 0, 0, FLAGS, "profile" - { PROFILE("simple", FF_PROFILE_MPEG2_SIMPLE) }, - { PROFILE("main", FF_PROFILE_MPEG2_MAIN) }, + { PROFILE("simple", AV_PROFILE_MPEG2_SIMPLE) }, + { PROFILE("main", AV_PROFILE_MPEG2_MAIN) }, #undef PROFILE { "level", "Set level (in profile_and_level_indication)", diff --git a/src/third_party/ffmpeg/libavcodec/vaapi_encode_vp8.c b/src/third_party/ffmpeg/libavcodec/vaapi_encode_vp8.c index ae6a8d31..8a557b96 100644 --- a/src/third_party/ffmpeg/libavcodec/vaapi_encode_vp8.c +++ b/src/third_party/ffmpeg/libavcodec/vaapi_encode_vp8.c @@ -86,7 +86,7 @@ static int vaapi_encode_vp8_init_picture_params(AVCodecContext *avctx, switch (pic->type) { case PICTURE_TYPE_IDR: case PICTURE_TYPE_I: - av_assert0(pic->nb_refs == 0); + av_assert0(pic->nb_refs[0] == 0 && pic->nb_refs[1] == 0); vpic->ref_flags.bits.force_kf = 1; vpic->ref_last_frame = vpic->ref_gf_frame = @@ -94,14 +94,14 @@ static int vaapi_encode_vp8_init_picture_params(AVCodecContext *avctx, VA_INVALID_SURFACE; break; case PICTURE_TYPE_P: - av_assert0(pic->nb_refs == 1); + av_assert0(!pic->nb_refs[1]); vpic->ref_flags.bits.no_ref_last = 0; vpic->ref_flags.bits.no_ref_gf = 1; vpic->ref_flags.bits.no_ref_arf = 1; vpic->ref_last_frame = vpic->ref_gf_frame = vpic->ref_arf_frame = - pic->refs[0]->recon_surface; + pic->refs[0][0]->recon_surface; break; default: av_assert0(0 && "invalid picture type"); @@ -180,7 +180,7 @@ static av_cold int vaapi_encode_vp8_configure(AVCodecContext *avctx) static const VAAPIEncodeProfile vaapi_encode_vp8_profiles[] = { { 0 /* VP8 has no profiles */, 8, 3, 1, 1, VAProfileVP8Version0_3 }, - { FF_PROFILE_UNKNOWN } + { AV_PROFILE_UNKNOWN } }; static const VAAPIEncodeType vaapi_encode_type_vp8 = { diff --git a/src/third_party/ffmpeg/libavcodec/vaapi_encode_vp9.c b/src/third_party/ffmpeg/libavcodec/vaapi_encode_vp9.c index af1353ce..c2a8dec7 100644 --- a/src/third_party/ffmpeg/libavcodec/vaapi_encode_vp9.c +++ b/src/third_party/ffmpeg/libavcodec/vaapi_encode_vp9.c @@ -96,15 +96,15 @@ static int vaapi_encode_vp9_init_picture_params(AVCodecContext *avctx, switch (pic->type) { case PICTURE_TYPE_IDR: - av_assert0(pic->nb_refs == 0); + av_assert0(pic->nb_refs[0] == 0 && pic->nb_refs[1] == 0); vpic->ref_flags.bits.force_kf = 1; vpic->refresh_frame_flags = 0xff; hpic->slot = 0; break; case PICTURE_TYPE_P: - av_assert0(pic->nb_refs == 1); + av_assert0(!pic->nb_refs[1]); { - VAAPIEncodeVP9Picture *href = pic->refs[0]->priv_data; + VAAPIEncodeVP9Picture *href = pic->refs[0][0]->priv_data; av_assert0(href->slot == 0 || href->slot == 1); if (ctx->max_b_depth > 0) { @@ -120,10 +120,10 @@ static int vaapi_encode_vp9_init_picture_params(AVCodecContext *avctx, } break; case PICTURE_TYPE_B: - av_assert0(pic->nb_refs == 2); + av_assert0(pic->nb_refs[0] && pic->nb_refs[1]); { - VAAPIEncodeVP9Picture *href0 = pic->refs[0]->priv_data, - *href1 = pic->refs[1]->priv_data; + VAAPIEncodeVP9Picture *href0 = pic->refs[0][0]->priv_data, + *href1 = pic->refs[1][0]->priv_data; av_assert0(href0->slot < pic->b_depth + 1 && href1->slot < pic->b_depth + 1); @@ -157,12 +157,14 @@ static int vaapi_encode_vp9_init_picture_params(AVCodecContext *avctx, for (i = 0; i < FF_ARRAY_ELEMS(vpic->reference_frames); i++) vpic->reference_frames[i] = VA_INVALID_SURFACE; - for (i = 0; i < pic->nb_refs; i++) { - VAAPIEncodePicture *ref_pic = pic->refs[i]; - int slot; - slot = ((VAAPIEncodeVP9Picture*)ref_pic->priv_data)->slot; - av_assert0(vpic->reference_frames[slot] == VA_INVALID_SURFACE); - vpic->reference_frames[slot] = ref_pic->recon_surface; + for (i = 0; i < MAX_REFERENCE_LIST_NUM; i++) { + for (int j = 0; j < pic->nb_refs[i]; j++) { + VAAPIEncodePicture *ref_pic = pic->refs[i][j]; + int slot; + slot = ((VAAPIEncodeVP9Picture*)ref_pic->priv_data)->slot; + av_assert0(vpic->reference_frames[slot] == VA_INVALID_SURFACE); + vpic->reference_frames[slot] = ref_pic->recon_surface; + } } vpic->pic_flags.bits.frame_type = (pic->type != PICTURE_TYPE_IDR); @@ -227,11 +229,11 @@ static av_cold int vaapi_encode_vp9_configure(AVCodecContext *avctx) } static const VAAPIEncodeProfile vaapi_encode_vp9_profiles[] = { - { FF_PROFILE_VP9_0, 8, 3, 1, 1, VAProfileVP9Profile0 }, - { FF_PROFILE_VP9_1, 8, 3, 0, 0, VAProfileVP9Profile1 }, - { FF_PROFILE_VP9_2, 10, 3, 1, 1, VAProfileVP9Profile2 }, - { FF_PROFILE_VP9_3, 10, 3, 0, 0, VAProfileVP9Profile3 }, - { FF_PROFILE_UNKNOWN } + { AV_PROFILE_VP9_0, 8, 3, 1, 1, VAProfileVP9Profile0 }, + { AV_PROFILE_VP9_1, 8, 3, 0, 0, VAProfileVP9Profile1 }, + { AV_PROFILE_VP9_2, 10, 3, 1, 1, VAProfileVP9Profile2 }, + { AV_PROFILE_VP9_3, 10, 3, 0, 0, VAProfileVP9Profile3 }, + { AV_PROFILE_UNKNOWN } }; static const VAAPIEncodeType vaapi_encode_type_vp9 = { diff --git a/src/third_party/ffmpeg/libavcodec/vaapi_h264.c b/src/third_party/ffmpeg/libavcodec/vaapi_h264.c index 9332aa6f..55cf5a05 100644 --- a/src/third_party/ffmpeg/libavcodec/vaapi_h264.c +++ b/src/third_party/ffmpeg/libavcodec/vaapi_h264.c @@ -22,7 +22,7 @@ #include "h264dec.h" #include "h264_ps.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "vaapi_decode.h" /** @@ -385,11 +385,11 @@ static int vaapi_h264_decode_slice(AVCodecContext *avctx, return 0; } -const AVHWAccel ff_h264_vaapi_hwaccel = { - .name = "h264_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_h264_vaapi_hwaccel = { + .p.name = "h264_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = &vaapi_h264_start_frame, .end_frame = &vaapi_h264_end_frame, .decode_slice = &vaapi_h264_decode_slice, diff --git a/src/third_party/ffmpeg/libavcodec/vaapi_hevc.c b/src/third_party/ffmpeg/libavcodec/vaapi_hevc.c index 8b12484f..3bdd2dd1 100644 --- a/src/third_party/ffmpeg/libavcodec/vaapi_hevc.c +++ b/src/third_party/ffmpeg/libavcodec/vaapi_hevc.c @@ -25,7 +25,7 @@ #include "avcodec.h" #include "hevcdec.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "vaapi_decode.h" #include "vaapi_hevc.h" #include "h265_profile_level.h" @@ -227,8 +227,8 @@ static int vaapi_hevc_start_frame(AVCodecContext *avctx, } #if VA_CHECK_VERSION(1, 2, 0) - if (avctx->profile == FF_PROFILE_HEVC_REXT || - avctx->profile == FF_PROFILE_HEVC_SCC) { + if (avctx->profile == AV_PROFILE_HEVC_REXT || + avctx->profile == AV_PROFILE_HEVC_SCC) { pic->pic_param.rext = (VAPictureParameterBufferHEVCRext) { .range_extension_pic_fields.bits = { .transform_skip_rotation_enabled_flag = sps->transform_skip_rotation_enabled_flag, @@ -262,7 +262,7 @@ static int vaapi_hevc_start_frame(AVCodecContext *avctx, sps->sps_num_palette_predictor_initializers : 0); - if (avctx->profile == FF_PROFILE_HEVC_SCC) { + if (avctx->profile == AV_PROFILE_HEVC_SCC) { pic->pic_param.scc = (VAPictureParameterBufferHEVCScc) { .screen_content_pic_fields.bits = { .pps_curr_pic_ref_enabled_flag = pps->pps_curr_pic_ref_enabled_flag, @@ -294,7 +294,7 @@ static int vaapi_hevc_start_frame(AVCodecContext *avctx, } #endif - pic_param_size = avctx->profile >= FF_PROFILE_HEVC_REXT ? + pic_param_size = avctx->profile >= AV_PROFILE_HEVC_REXT ? sizeof(pic->pic_param) : sizeof(VAPictureParameterBufferHEVC); err = ff_vaapi_decode_make_param_buffer(avctx, &pic->pic, @@ -347,7 +347,7 @@ static int vaapi_hevc_end_frame(AVCodecContext *avctx) VASliceParameterBufferHEVC *last_slice_param = (VASliceParameterBufferHEVC *)&pic->last_slice_param; int ret; - int slice_param_size = avctx->profile >= FF_PROFILE_HEVC_REXT ? + int slice_param_size = avctx->profile >= AV_PROFILE_HEVC_REXT ? sizeof(pic->last_slice_param) : sizeof(VASliceParameterBufferHEVC); if (pic->last_size) { @@ -377,10 +377,10 @@ static void fill_pred_weight_table(AVCodecContext *avctx, { int i; #if VA_CHECK_VERSION(1, 2, 0) - int is_rext = avctx->profile >= FF_PROFILE_HEVC_REXT; + int is_rext = avctx->profile >= AV_PROFILE_HEVC_REXT; #else int is_rext = 0; - if (avctx->profile >= FF_PROFILE_HEVC_REXT) + if (avctx->profile >= AV_PROFILE_HEVC_REXT) av_log(avctx, AV_LOG_WARNING, "Please consider to update to VAAPI 1.2.0 " "or above, which can support REXT related setting correctly.\n"); #endif @@ -461,7 +461,7 @@ static int vaapi_hevc_decode_slice(AVCodecContext *avctx, VAAPIDecodePictureHEVC *pic = h->ref->hwaccel_picture_private; VASliceParameterBufferHEVC *last_slice_param = (VASliceParameterBufferHEVC *)&pic->last_slice_param; - int slice_param_size = avctx->profile >= FF_PROFILE_HEVC_REXT ? + int slice_param_size = avctx->profile >= AV_PROFILE_HEVC_REXT ? sizeof(pic->last_slice_param) : sizeof(VASliceParameterBufferHEVC); int nb_list = (sh->slice_type == HEVC_SLICE_B) ? @@ -526,7 +526,7 @@ static int vaapi_hevc_decode_slice(AVCodecContext *avctx, fill_pred_weight_table(avctx, h, sh, last_slice_param); #if VA_CHECK_VERSION(1, 2, 0) - if (avctx->profile >= FF_PROFILE_HEVC_REXT) { + if (avctx->profile >= AV_PROFILE_HEVC_REXT) { pic->last_slice_param.rext = (VASliceParameterBufferHEVCRext) { .slice_ext_flags.bits = { .cu_chroma_qp_offset_enabled_flag = sh->cu_chroma_qp_offset_enabled_flag, @@ -654,11 +654,11 @@ end: return VAProfileNone; } -const AVHWAccel ff_hevc_vaapi_hwaccel = { - .name = "hevc_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_hevc_vaapi_hwaccel = { + .p.name = "hevc_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = vaapi_hevc_start_frame, .end_frame = vaapi_hevc_end_frame, .decode_slice = vaapi_hevc_decode_slice, diff --git a/src/third_party/ffmpeg/libavcodec/vaapi_mjpeg.c b/src/third_party/ffmpeg/libavcodec/vaapi_mjpeg.c index 81582114..5b8d47bb 100644 --- a/src/third_party/ffmpeg/libavcodec/vaapi_mjpeg.c +++ b/src/third_party/ffmpeg/libavcodec/vaapi_mjpeg.c @@ -19,7 +19,7 @@ #include #include -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "vaapi_decode.h" #include "mjpegdec.h" @@ -142,11 +142,11 @@ fail: return err; } -const AVHWAccel ff_mjpeg_vaapi_hwaccel = { - .name = "mjpeg_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MJPEG, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_mjpeg_vaapi_hwaccel = { + .p.name = "mjpeg_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MJPEG, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = &vaapi_mjpeg_start_frame, .end_frame = &vaapi_mjpeg_end_frame, .decode_slice = &vaapi_mjpeg_decode_slice, diff --git a/src/third_party/ffmpeg/libavcodec/vaapi_mpeg2.c b/src/third_party/ffmpeg/libavcodec/vaapi_mpeg2.c index 5e2b8891..eeb4e873 100644 --- a/src/third_party/ffmpeg/libavcodec/vaapi_mpeg2.c +++ b/src/third_party/ffmpeg/libavcodec/vaapi_mpeg2.c @@ -20,7 +20,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "mpegutils.h" #include "mpegvideo.h" #include "mpegvideodec.h" @@ -172,11 +172,11 @@ static int vaapi_mpeg2_decode_slice(AVCodecContext *avctx, const uint8_t *buffer return 0; } -const AVHWAccel ff_mpeg2_vaapi_hwaccel = { - .name = "mpeg2_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG2VIDEO, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_mpeg2_vaapi_hwaccel = { + .p.name = "mpeg2_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG2VIDEO, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = &vaapi_mpeg2_start_frame, .end_frame = &vaapi_mpeg2_end_frame, .decode_slice = &vaapi_mpeg2_decode_slice, diff --git a/src/third_party/ffmpeg/libavcodec/vaapi_mpeg4.c b/src/third_party/ffmpeg/libavcodec/vaapi_mpeg4.c index 4e74e038..363b686e 100644 --- a/src/third_party/ffmpeg/libavcodec/vaapi_mpeg4.c +++ b/src/third_party/ffmpeg/libavcodec/vaapi_mpeg4.c @@ -23,7 +23,7 @@ #include "config_components.h" #include "h263.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "mpeg4videodec.h" #include "mpegvideo.h" #include "mpegvideodec.h" @@ -180,11 +180,11 @@ static int vaapi_mpeg4_decode_slice(AVCodecContext *avctx, const uint8_t *buffer } #if CONFIG_MPEG4_VAAPI_HWACCEL -const AVHWAccel ff_mpeg4_vaapi_hwaccel = { - .name = "mpeg4_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG4, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_mpeg4_vaapi_hwaccel = { + .p.name = "mpeg4_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG4, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = &vaapi_mpeg4_start_frame, .end_frame = &vaapi_mpeg4_end_frame, .decode_slice = &vaapi_mpeg4_decode_slice, @@ -198,11 +198,11 @@ const AVHWAccel ff_mpeg4_vaapi_hwaccel = { #endif #if CONFIG_H263_VAAPI_HWACCEL -const AVHWAccel ff_h263_vaapi_hwaccel = { - .name = "h263_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H263, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_h263_vaapi_hwaccel = { + .p.name = "h263_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H263, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = &vaapi_mpeg4_start_frame, .end_frame = &vaapi_mpeg4_end_frame, .decode_slice = &vaapi_mpeg4_decode_slice, diff --git a/src/third_party/ffmpeg/libavcodec/vaapi_vc1.c b/src/third_party/ffmpeg/libavcodec/vaapi_vc1.c index fb2132e8..09a5c852 100644 --- a/src/third_party/ffmpeg/libavcodec/vaapi_vc1.c +++ b/src/third_party/ffmpeg/libavcodec/vaapi_vc1.c @@ -22,11 +22,10 @@ #include "config_components.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "mpegvideodec.h" #include "vaapi_decode.h" #include "vc1.h" -#include "vc1data.h" /** Translate FFmpeg MV modes to VA API */ static int get_VAMvModeVC1(enum MVModes mv_mode) @@ -501,11 +500,11 @@ static int vaapi_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, } #if CONFIG_WMV3_VAAPI_HWACCEL -const AVHWAccel ff_wmv3_vaapi_hwaccel = { - .name = "wmv3_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WMV3, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_wmv3_vaapi_hwaccel = { + .p.name = "wmv3_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WMV3, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = &vaapi_vc1_start_frame, .end_frame = &vaapi_vc1_end_frame, .decode_slice = &vaapi_vc1_decode_slice, @@ -518,11 +517,11 @@ const AVHWAccel ff_wmv3_vaapi_hwaccel = { }; #endif -const AVHWAccel ff_vc1_vaapi_hwaccel = { - .name = "vc1_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VC1, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_vc1_vaapi_hwaccel = { + .p.name = "vc1_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VC1, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = &vaapi_vc1_start_frame, .end_frame = &vaapi_vc1_end_frame, .decode_slice = &vaapi_vc1_decode_slice, diff --git a/src/third_party/ffmpeg/libavcodec/vaapi_vp8.c b/src/third_party/ffmpeg/libavcodec/vaapi_vp8.c index 5b18bf8f..31137a45 100644 --- a/src/third_party/ffmpeg/libavcodec/vaapi_vp8.c +++ b/src/third_party/ffmpeg/libavcodec/vaapi_vp8.c @@ -19,7 +19,7 @@ #include #include -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "vaapi_decode.h" #include "vp8.h" @@ -220,11 +220,11 @@ fail: return err; } -const AVHWAccel ff_vp8_vaapi_hwaccel = { - .name = "vp8_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP8, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_vp8_vaapi_hwaccel = { + .p.name = "vp8_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP8, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = &vaapi_vp8_start_frame, .end_frame = &vaapi_vp8_end_frame, .decode_slice = &vaapi_vp8_decode_slice, diff --git a/src/third_party/ffmpeg/libavcodec/vaapi_vp9.c b/src/third_party/ffmpeg/libavcodec/vaapi_vp9.c index 776382f6..9dc7d5e7 100644 --- a/src/third_party/ffmpeg/libavcodec/vaapi_vp9.c +++ b/src/third_party/ffmpeg/libavcodec/vaapi_vp9.c @@ -22,7 +22,7 @@ #include "libavutil/pixdesc.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "vaapi_decode.h" #include "vp9shared.h" @@ -168,11 +168,11 @@ static int vaapi_vp9_decode_slice(AVCodecContext *avctx, return 0; } -const AVHWAccel ff_vp9_vaapi_hwaccel = { - .name = "vp9_vaapi", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP9, - .pix_fmt = AV_PIX_FMT_VAAPI, +const FFHWAccel ff_vp9_vaapi_hwaccel = { + .p.name = "vp9_vaapi", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP9, + .p.pix_fmt = AV_PIX_FMT_VAAPI, .start_frame = vaapi_vp9_start_frame, .end_frame = vaapi_vp9_end_frame, .decode_slice = vaapi_vp9_decode_slice, diff --git a/src/third_party/ffmpeg/libavcodec/vc1dec.c b/src/third_party/ffmpeg/libavcodec/vc1dec.c index 9e343d00..449d2fea 100644 --- a/src/third_party/ffmpeg/libavcodec/vc1dec.c +++ b/src/third_party/ffmpeg/libavcodec/vc1dec.c @@ -34,6 +34,7 @@ #include "decode.h" #include "get_bits.h" #include "h263dec.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "mpeg_er.h" #include "mpegvideo.h" @@ -483,108 +484,108 @@ static av_cold void vc1_init_static(void) { static VLCElem vlc_table[32372]; - INIT_VLC_STATIC(&ff_vc1_norm2_vlc, VC1_NORM2_VLC_BITS, 4, + VLC_INIT_STATIC(&ff_vc1_norm2_vlc, VC1_NORM2_VLC_BITS, 4, vc1_norm2_bits, 1, 1, vc1_norm2_codes, 1, 1, 1 << VC1_NORM2_VLC_BITS); - INIT_VLC_STATIC(&ff_vc1_norm6_vlc, VC1_NORM6_VLC_BITS, 64, + VLC_INIT_STATIC(&ff_vc1_norm6_vlc, VC1_NORM6_VLC_BITS, 64, vc1_norm6_bits, 1, 1, vc1_norm6_codes, 2, 2, 556); - INIT_VLC_STATIC(&ff_vc1_imode_vlc, VC1_IMODE_VLC_BITS, 7, + VLC_INIT_STATIC(&ff_vc1_imode_vlc, VC1_IMODE_VLC_BITS, 7, vc1_imode_bits, 1, 1, vc1_imode_codes, 1, 1, 1 << VC1_IMODE_VLC_BITS); for (int i = 0; i < 3; i++) { ff_vc1_ttmb_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 0]]; ff_vc1_ttmb_vlc[i].table_allocated = vlc_offs[i * 3 + 1] - vlc_offs[i * 3 + 0]; - init_vlc(&ff_vc1_ttmb_vlc[i], VC1_TTMB_VLC_BITS, 16, + vlc_init(&ff_vc1_ttmb_vlc[i], VC1_TTMB_VLC_BITS, 16, vc1_ttmb_bits[i], 1, 1, - vc1_ttmb_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC); + vc1_ttmb_codes[i], 2, 2, VLC_INIT_USE_STATIC); ff_vc1_ttblk_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 1]]; ff_vc1_ttblk_vlc[i].table_allocated = vlc_offs[i * 3 + 2] - vlc_offs[i * 3 + 1]; - init_vlc(&ff_vc1_ttblk_vlc[i], VC1_TTBLK_VLC_BITS, 8, + vlc_init(&ff_vc1_ttblk_vlc[i], VC1_TTBLK_VLC_BITS, 8, vc1_ttblk_bits[i], 1, 1, - vc1_ttblk_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + vc1_ttblk_codes[i], 1, 1, VLC_INIT_USE_STATIC); ff_vc1_subblkpat_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 2]]; ff_vc1_subblkpat_vlc[i].table_allocated = vlc_offs[i * 3 + 3] - vlc_offs[i * 3 + 2]; - init_vlc(&ff_vc1_subblkpat_vlc[i], VC1_SUBBLKPAT_VLC_BITS, 15, + vlc_init(&ff_vc1_subblkpat_vlc[i], VC1_SUBBLKPAT_VLC_BITS, 15, vc1_subblkpat_bits[i], 1, 1, - vc1_subblkpat_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + vc1_subblkpat_codes[i], 1, 1, VLC_INIT_USE_STATIC); } for (int i = 0; i < 4; i++) { ff_vc1_4mv_block_pattern_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 9]]; ff_vc1_4mv_block_pattern_vlc[i].table_allocated = vlc_offs[i * 3 + 10] - vlc_offs[i * 3 + 9]; - init_vlc(&ff_vc1_4mv_block_pattern_vlc[i], VC1_4MV_BLOCK_PATTERN_VLC_BITS, 16, + vlc_init(&ff_vc1_4mv_block_pattern_vlc[i], VC1_4MV_BLOCK_PATTERN_VLC_BITS, 16, vc1_4mv_block_pattern_bits[i], 1, 1, - vc1_4mv_block_pattern_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + vc1_4mv_block_pattern_codes[i], 1, 1, VLC_INIT_USE_STATIC); ff_vc1_cbpcy_p_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 10]]; ff_vc1_cbpcy_p_vlc[i].table_allocated = vlc_offs[i * 3 + 11] - vlc_offs[i * 3 + 10]; - init_vlc(&ff_vc1_cbpcy_p_vlc[i], VC1_CBPCY_P_VLC_BITS, 64, + vlc_init(&ff_vc1_cbpcy_p_vlc[i], VC1_CBPCY_P_VLC_BITS, 64, vc1_cbpcy_p_bits[i], 1, 1, - vc1_cbpcy_p_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC); + vc1_cbpcy_p_codes[i], 2, 2, VLC_INIT_USE_STATIC); ff_vc1_mv_diff_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 11]]; ff_vc1_mv_diff_vlc[i].table_allocated = vlc_offs[i * 3 + 12] - vlc_offs[i * 3 + 11]; - init_vlc(&ff_vc1_mv_diff_vlc[i], VC1_MV_DIFF_VLC_BITS, 73, + vlc_init(&ff_vc1_mv_diff_vlc[i], VC1_MV_DIFF_VLC_BITS, 73, vc1_mv_diff_bits[i], 1, 1, - vc1_mv_diff_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC); + vc1_mv_diff_codes[i], 2, 2, VLC_INIT_USE_STATIC); } for (int i = 0; i < 8; i++) { ff_vc1_ac_coeff_table[i].table = &vlc_table[vlc_offs[i * 2 + 21]]; ff_vc1_ac_coeff_table[i].table_allocated = vlc_offs[i * 2 + 22] - vlc_offs[i * 2 + 21]; - init_vlc(&ff_vc1_ac_coeff_table[i], AC_VLC_BITS, ff_vc1_ac_sizes[i], + vlc_init(&ff_vc1_ac_coeff_table[i], AC_VLC_BITS, ff_vc1_ac_sizes[i], &vc1_ac_tables[i][0][1], 8, 4, - &vc1_ac_tables[i][0][0], 8, 4, INIT_VLC_USE_NEW_STATIC); + &vc1_ac_tables[i][0][0], 8, 4, VLC_INIT_USE_STATIC); /* initialize interlaced MVDATA tables (2-Ref) */ ff_vc1_2ref_mvdata_vlc[i].table = &vlc_table[vlc_offs[i * 2 + 22]]; ff_vc1_2ref_mvdata_vlc[i].table_allocated = vlc_offs[i * 2 + 23] - vlc_offs[i * 2 + 22]; - init_vlc(&ff_vc1_2ref_mvdata_vlc[i], VC1_2REF_MVDATA_VLC_BITS, 126, + vlc_init(&ff_vc1_2ref_mvdata_vlc[i], VC1_2REF_MVDATA_VLC_BITS, 126, vc1_2ref_mvdata_bits[i], 1, 1, - vc1_2ref_mvdata_codes[i], 4, 4, INIT_VLC_USE_NEW_STATIC); + vc1_2ref_mvdata_codes[i], 4, 4, VLC_INIT_USE_STATIC); } for (int i = 0; i < 4; i++) { /* initialize 4MV MBMODE VLC tables for interlaced frame P picture */ ff_vc1_intfr_4mv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 37]]; ff_vc1_intfr_4mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 38] - vlc_offs[i * 3 + 37]; - init_vlc(&ff_vc1_intfr_4mv_mbmode_vlc[i], VC1_INTFR_4MV_MBMODE_VLC_BITS, 15, + vlc_init(&ff_vc1_intfr_4mv_mbmode_vlc[i], VC1_INTFR_4MV_MBMODE_VLC_BITS, 15, vc1_intfr_4mv_mbmode_bits[i], 1, 1, - vc1_intfr_4mv_mbmode_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC); + vc1_intfr_4mv_mbmode_codes[i], 2, 2, VLC_INIT_USE_STATIC); /* initialize NON-4MV MBMODE VLC tables for the same */ ff_vc1_intfr_non4mv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 38]]; ff_vc1_intfr_non4mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 39] - vlc_offs[i * 3 + 38]; - init_vlc(&ff_vc1_intfr_non4mv_mbmode_vlc[i], VC1_INTFR_NON4MV_MBMODE_VLC_BITS, 9, + vlc_init(&ff_vc1_intfr_non4mv_mbmode_vlc[i], VC1_INTFR_NON4MV_MBMODE_VLC_BITS, 9, vc1_intfr_non4mv_mbmode_bits[i], 1, 1, - vc1_intfr_non4mv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + vc1_intfr_non4mv_mbmode_codes[i], 1, 1, VLC_INIT_USE_STATIC); /* initialize interlaced MVDATA tables (1-Ref) */ ff_vc1_1ref_mvdata_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 39]]; ff_vc1_1ref_mvdata_vlc[i].table_allocated = vlc_offs[i * 3 + 40] - vlc_offs[i * 3 + 39]; - init_vlc(&ff_vc1_1ref_mvdata_vlc[i], VC1_1REF_MVDATA_VLC_BITS, 72, + vlc_init(&ff_vc1_1ref_mvdata_vlc[i], VC1_1REF_MVDATA_VLC_BITS, 72, vc1_1ref_mvdata_bits[i], 1, 1, - vc1_1ref_mvdata_codes[i], 4, 4, INIT_VLC_USE_NEW_STATIC); + vc1_1ref_mvdata_codes[i], 4, 4, VLC_INIT_USE_STATIC); } for (int i = 0; i < 4; i++) { /* Initialize 2MV Block pattern VLC tables */ ff_vc1_2mv_block_pattern_vlc[i].table = &vlc_table[vlc_offs[i + 49]]; ff_vc1_2mv_block_pattern_vlc[i].table_allocated = vlc_offs[i + 50] - vlc_offs[i + 49]; - init_vlc(&ff_vc1_2mv_block_pattern_vlc[i], VC1_2MV_BLOCK_PATTERN_VLC_BITS, 4, + vlc_init(&ff_vc1_2mv_block_pattern_vlc[i], VC1_2MV_BLOCK_PATTERN_VLC_BITS, 4, vc1_2mv_block_pattern_bits[i], 1, 1, - vc1_2mv_block_pattern_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + vc1_2mv_block_pattern_codes[i], 1, 1, VLC_INIT_USE_STATIC); } for (int i = 0; i < 8; i++) { /* Initialize interlaced CBPCY VLC tables (Table 124 - Table 131) */ ff_vc1_icbpcy_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 53]]; ff_vc1_icbpcy_vlc[i].table_allocated = vlc_offs[i * 3 + 54] - vlc_offs[i * 3 + 53]; - init_vlc(&ff_vc1_icbpcy_vlc[i], VC1_ICBPCY_VLC_BITS, 63, + vlc_init(&ff_vc1_icbpcy_vlc[i], VC1_ICBPCY_VLC_BITS, 63, vc1_icbpcy_p_bits[i], 1, 1, - vc1_icbpcy_p_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC); + vc1_icbpcy_p_codes[i], 2, 2, VLC_INIT_USE_STATIC); /* Initialize interlaced field picture MBMODE VLC tables */ ff_vc1_if_mmv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 54]]; ff_vc1_if_mmv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 55] - vlc_offs[i * 3 + 54]; - init_vlc(&ff_vc1_if_mmv_mbmode_vlc[i], VC1_IF_MMV_MBMODE_VLC_BITS, 8, + vlc_init(&ff_vc1_if_mmv_mbmode_vlc[i], VC1_IF_MMV_MBMODE_VLC_BITS, 8, vc1_if_mmv_mbmode_bits[i], 1, 1, - vc1_if_mmv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + vc1_if_mmv_mbmode_codes[i], 1, 1, VLC_INIT_USE_STATIC); ff_vc1_if_1mv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 55]]; ff_vc1_if_1mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 56] - vlc_offs[i * 3 + 55]; - init_vlc(&ff_vc1_if_1mv_mbmode_vlc[i], VC1_IF_1MV_MBMODE_VLC_BITS, 6, + vlc_init(&ff_vc1_if_1mv_mbmode_vlc[i], VC1_IF_1MV_MBMODE_VLC_BITS, 6, vc1_if_1mv_mbmode_bits[i], 1, 1, - vc1_if_1mv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC); + vc1_if_1mv_mbmode_codes[i], 1, 1, VLC_INIT_USE_STATIC); } ff_msmp4_vc1_vlcs_init_once(); } @@ -1096,19 +1097,26 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, } if (avctx->hwaccel) { + const FFHWAccel *hwaccel = ffhwaccel(avctx->hwaccel); s->mb_y = 0; if (v->field_mode && buf_start_second_field) { // decode first field s->picture_structure = PICT_BOTTOM_FIELD - v->tff; - if ((ret = avctx->hwaccel->start_frame(avctx, buf_start, buf_start_second_field - buf_start)) < 0) + ret = hwaccel->start_frame(avctx, buf_start, + buf_start_second_field - buf_start); + if (ret < 0) goto err; if (n_slices1 == -1) { // no slices, decode the field as-is - if ((ret = avctx->hwaccel->decode_slice(avctx, buf_start, buf_start_second_field - buf_start)) < 0) + ret = hwaccel->decode_slice(avctx, buf_start, + buf_start_second_field - buf_start); + if (ret < 0) goto err; } else { - if ((ret = avctx->hwaccel->decode_slice(avctx, buf_start, slices[0].rawbuf - buf_start)) < 0) + ret = hwaccel->decode_slice(avctx, buf_start, + slices[0].rawbuf - buf_start); + if (ret < 0) goto err; for (i = 0 ; i < n_slices1 + 1; i++) { @@ -1126,12 +1134,14 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, } } - if ((ret = avctx->hwaccel->decode_slice(avctx, slices[i].rawbuf, slices[i].raw_size)) < 0) + ret = hwaccel->decode_slice(avctx, slices[i].rawbuf, + slices[i].raw_size); + if (ret < 0) goto err; } } - if ((ret = avctx->hwaccel->end_frame(avctx)) < 0) + if ((ret = hwaccel->end_frame(avctx)) < 0) goto err; // decode second field @@ -1147,15 +1157,21 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, } v->s.current_picture_ptr->f->pict_type = v->s.pict_type; - if ((ret = avctx->hwaccel->start_frame(avctx, buf_start_second_field, (buf + buf_size) - buf_start_second_field)) < 0) + ret = hwaccel->start_frame(avctx, buf_start_second_field, + (buf + buf_size) - buf_start_second_field); + if (ret < 0) goto err; if (n_slices - n_slices1 == 2) { // no slices, decode the field as-is - if ((ret = avctx->hwaccel->decode_slice(avctx, buf_start_second_field, (buf + buf_size) - buf_start_second_field)) < 0) + ret = hwaccel->decode_slice(avctx, buf_start_second_field, + (buf + buf_size) - buf_start_second_field); + if (ret < 0) goto err; } else { - if ((ret = avctx->hwaccel->decode_slice(avctx, buf_start_second_field, slices[n_slices1 + 2].rawbuf - buf_start_second_field)) < 0) + ret = hwaccel->decode_slice(avctx, buf_start_second_field, + slices[n_slices1 + 2].rawbuf - buf_start_second_field); + if (ret < 0) goto err; for (i = n_slices1 + 2; i < n_slices; i++) { @@ -1173,25 +1189,33 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, } } - if ((ret = avctx->hwaccel->decode_slice(avctx, slices[i].rawbuf, slices[i].raw_size)) < 0) + ret = hwaccel->decode_slice(avctx, slices[i].rawbuf, + slices[i].raw_size); + if (ret < 0) goto err; } } - if ((ret = avctx->hwaccel->end_frame(avctx)) < 0) + if ((ret = hwaccel->end_frame(avctx)) < 0) goto err; } else { s->picture_structure = PICT_FRAME; - if ((ret = avctx->hwaccel->start_frame(avctx, buf_start, (buf + buf_size) - buf_start)) < 0) + ret = hwaccel->start_frame(avctx, buf_start, + (buf + buf_size) - buf_start); + if (ret < 0) goto err; if (n_slices == 0) { // no slices, decode the frame as-is - if ((ret = avctx->hwaccel->decode_slice(avctx, buf_start, (buf + buf_size) - buf_start)) < 0) + ret = hwaccel->decode_slice(avctx, buf_start, + (buf + buf_size) - buf_start); + if (ret < 0) goto err; } else { // decode the frame part as the first slice - if ((ret = avctx->hwaccel->decode_slice(avctx, buf_start, slices[0].rawbuf - buf_start)) < 0) + ret = hwaccel->decode_slice(avctx, buf_start, + slices[0].rawbuf - buf_start); + if (ret < 0) goto err; // and process the slices as additional slices afterwards @@ -1210,11 +1234,13 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, } } - if ((ret = avctx->hwaccel->decode_slice(avctx, slices[i].rawbuf, slices[i].raw_size)) < 0) + ret = hwaccel->decode_slice(avctx, slices[i].rawbuf, + slices[i].raw_size); + if (ret < 0) goto err; } } - if ((ret = avctx->hwaccel->end_frame(avctx)) < 0) + if ((ret = hwaccel->end_frame(avctx)) < 0) goto err; } } else { @@ -1322,7 +1348,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict, if ( !v->field_mode && avctx->codec_id != AV_CODEC_ID_WMV3IMAGE && avctx->codec_id != AV_CODEC_ID_VC1IMAGE) - ff_er_frame_end(&s->er); + ff_er_frame_end(&s->er, NULL); } ff_mpv_frame_end(s); diff --git a/src/third_party/ffmpeg/libavcodec/vdpau.c b/src/third_party/ffmpeg/libavcodec/vdpau.c index 0bb793c0..2b9b78d8 100644 --- a/src/third_party/ffmpeg/libavcodec/vdpau.c +++ b/src/third_party/ffmpeg/libavcodec/vdpau.c @@ -27,6 +27,7 @@ #include "avcodec.h" #include "decode.h" +#include "hwaccel_internal.h" #include "internal.h" #include "mpegvideodec.h" #include "vc1.h" @@ -324,8 +325,8 @@ static int ff_vdpau_common_reinit(AVCodecContext *avctx) avctx->coded_height == vdctx->height && (!hwctx || !hwctx->reset)) return 0; - avctx->hwaccel->uninit(avctx); - return avctx->hwaccel->init(avctx); + FF_HW_SIMPLE_CALL(avctx, uninit); + return FF_HW_SIMPLE_CALL(avctx, init); } int ff_vdpau_common_start_frame(struct vdpau_picture_context *pic_ctx, diff --git a/src/third_party/ffmpeg/libavcodec/vdpau_av1.c b/src/third_party/ffmpeg/libavcodec/vdpau_av1.c index 3c3c8e61..80923092 100644 --- a/src/third_party/ffmpeg/libavcodec/vdpau_av1.c +++ b/src/third_party/ffmpeg/libavcodec/vdpau_av1.c @@ -25,7 +25,7 @@ #include "avcodec.h" #include "internal.h" #include "av1dec.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "vdpau.h" #include "vdpau_internal.h" @@ -337,13 +337,13 @@ static int vdpau_av1_init(AVCodecContext *avctx) uint32_t level = avctx->level; switch (avctx->profile) { - case FF_PROFILE_AV1_MAIN: + case AV_PROFILE_AV1_MAIN: profile = VDP_DECODER_PROFILE_AV1_MAIN; break; - case FF_PROFILE_AV1_HIGH: + case AV_PROFILE_AV1_HIGH: profile = VDP_DECODER_PROFILE_AV1_HIGH; break; - case FF_PROFILE_AV1_PROFESSIONAL: + case AV_PROFILE_AV1_PROFESSIONAL: profile = VDP_DECODER_PROFILE_AV1_PROFESSIONAL; break; default: @@ -353,11 +353,11 @@ static int vdpau_av1_init(AVCodecContext *avctx) return ff_vdpau_common_init(avctx, profile, level); } -const AVHWAccel ff_av1_vdpau_hwaccel = { - .name = "av1_vdpau", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AV1, - .pix_fmt = AV_PIX_FMT_VDPAU, +const FFHWAccel ff_av1_vdpau_hwaccel = { + .p.name = "av1_vdpau", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, + .p.pix_fmt = AV_PIX_FMT_VDPAU, .start_frame = vdpau_av1_start_frame, .end_frame = vdpau_av1_end_frame, .decode_slice = vdpau_av1_decode_slice, diff --git a/src/third_party/ffmpeg/libavcodec/vdpau_h264.c b/src/third_party/ffmpeg/libavcodec/vdpau_h264.c index 525e2084..9c08e404 100644 --- a/src/third_party/ffmpeg/libavcodec/vdpau_h264.c +++ b/src/third_party/ffmpeg/libavcodec/vdpau_h264.c @@ -26,7 +26,7 @@ #include "avcodec.h" #include "h264dec.h" #include "h264_ps.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "mpegutils.h" #include "vdpau.h" #include "vdpau_internal.h" @@ -219,35 +219,35 @@ static int vdpau_h264_init(AVCodecContext *avctx) VdpDecoderProfile profile; uint32_t level = avctx->level; - switch (avctx->profile & ~FF_PROFILE_H264_INTRA) { - case FF_PROFILE_H264_BASELINE: + switch (avctx->profile & ~AV_PROFILE_H264_INTRA) { + case AV_PROFILE_H264_BASELINE: profile = VDP_DECODER_PROFILE_H264_BASELINE; break; - case FF_PROFILE_H264_CONSTRAINED_BASELINE: + case AV_PROFILE_H264_CONSTRAINED_BASELINE: #ifdef VDP_DECODER_PROFILE_H264_CONSTRAINED_BASELINE profile = VDP_DECODER_PROFILE_H264_CONSTRAINED_BASELINE; break; #endif - case FF_PROFILE_H264_MAIN: + case AV_PROFILE_H264_MAIN: profile = VDP_DECODER_PROFILE_H264_MAIN; break; - case FF_PROFILE_H264_HIGH: + case AV_PROFILE_H264_HIGH: profile = VDP_DECODER_PROFILE_H264_HIGH; break; #ifdef VDP_DECODER_PROFILE_H264_EXTENDED - case FF_PROFILE_H264_EXTENDED: + case AV_PROFILE_H264_EXTENDED: profile = VDP_DECODER_PROFILE_H264_EXTENDED; break; #endif - case FF_PROFILE_H264_HIGH_10: + case AV_PROFILE_H264_HIGH_10: /* XXX: High 10 can be treated as High so long as only 8 bits per * format are supported. */ profile = VDP_DECODER_PROFILE_H264_HIGH; break; #ifdef VDP_DECODER_PROFILE_H264_HIGH_444_PREDICTIVE - case FF_PROFILE_H264_HIGH_422: - case FF_PROFILE_H264_HIGH_444_PREDICTIVE: - case FF_PROFILE_H264_CAVLC_444: + case AV_PROFILE_H264_HIGH_422: + case AV_PROFILE_H264_HIGH_444_PREDICTIVE: + case AV_PROFILE_H264_CAVLC_444: profile = VDP_DECODER_PROFILE_H264_HIGH_444_PREDICTIVE; break; #endif @@ -255,17 +255,17 @@ static int vdpau_h264_init(AVCodecContext *avctx) return AVERROR(ENOTSUP); } - if ((avctx->profile & FF_PROFILE_H264_INTRA) && avctx->level == 11) + if ((avctx->profile & AV_PROFILE_H264_INTRA) && avctx->level == 11) level = VDP_DECODER_LEVEL_H264_1b; return ff_vdpau_common_init(avctx, profile, level); } -const AVHWAccel ff_h264_vdpau_hwaccel = { - .name = "h264_vdpau", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, - .pix_fmt = AV_PIX_FMT_VDPAU, +const FFHWAccel ff_h264_vdpau_hwaccel = { + .p.name = "h264_vdpau", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, + .p.pix_fmt = AV_PIX_FMT_VDPAU, .start_frame = vdpau_h264_start_frame, .end_frame = vdpau_h264_end_frame, .decode_slice = vdpau_h264_decode_slice, diff --git a/src/third_party/ffmpeg/libavcodec/vdpau_hevc.c b/src/third_party/ffmpeg/libavcodec/vdpau_hevc.c index 2669040f..4cd7ce56 100644 --- a/src/third_party/ffmpeg/libavcodec/vdpau_hevc.c +++ b/src/third_party/ffmpeg/libavcodec/vdpau_hevc.c @@ -25,7 +25,7 @@ #include "avcodec.h" #include "hevc_data.h" #include "hevcdec.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "vdpau.h" #include "vdpau_internal.h" #include "h265_profile_level.h" @@ -519,16 +519,16 @@ static int vdpau_hevc_init(AVCodecContext *avctx) int ret; switch (avctx->profile) { - case FF_PROFILE_HEVC_MAIN: + case AV_PROFILE_HEVC_MAIN: profile = VDP_DECODER_PROFILE_HEVC_MAIN; break; - case FF_PROFILE_HEVC_MAIN_10: + case AV_PROFILE_HEVC_MAIN_10: profile = VDP_DECODER_PROFILE_HEVC_MAIN_10; break; - case FF_PROFILE_HEVC_MAIN_STILL_PICTURE: + case AV_PROFILE_HEVC_MAIN_STILL_PICTURE: profile = VDP_DECODER_PROFILE_HEVC_MAIN_STILL; break; - case FF_PROFILE_HEVC_REXT: + case AV_PROFILE_HEVC_REXT: ret = vdpau_hevc_parse_rext_profile(avctx, &profile); if (ret) return AVERROR(ENOTSUP); @@ -540,11 +540,11 @@ static int vdpau_hevc_init(AVCodecContext *avctx) return ff_vdpau_common_init(avctx, profile, level); } -const AVHWAccel ff_hevc_vdpau_hwaccel = { - .name = "hevc_vdpau", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, - .pix_fmt = AV_PIX_FMT_VDPAU, +const FFHWAccel ff_hevc_vdpau_hwaccel = { + .p.name = "hevc_vdpau", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, + .p.pix_fmt = AV_PIX_FMT_VDPAU, .start_frame = vdpau_hevc_start_frame, .end_frame = vdpau_hevc_end_frame, .decode_slice = vdpau_hevc_decode_slice, diff --git a/src/third_party/ffmpeg/libavcodec/vdpau_mpeg12.c b/src/third_party/ffmpeg/libavcodec/vdpau_mpeg12.c index 79007aa1..bbf76eb4 100644 --- a/src/third_party/ffmpeg/libavcodec/vdpau_mpeg12.c +++ b/src/third_party/ffmpeg/libavcodec/vdpau_mpeg12.c @@ -26,7 +26,7 @@ #include #include "avcodec.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "mpegvideo.h" #include "vdpau.h" #include "vdpau_internal.h" @@ -106,11 +106,11 @@ static int vdpau_mpeg1_init(AVCodecContext *avctx) VDP_DECODER_LEVEL_MPEG1_NA); } -const AVHWAccel ff_mpeg1_vdpau_hwaccel = { - .name = "mpeg1_vdpau", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG1VIDEO, - .pix_fmt = AV_PIX_FMT_VDPAU, +const FFHWAccel ff_mpeg1_vdpau_hwaccel = { + .p.name = "mpeg1_vdpau", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG1VIDEO, + .p.pix_fmt = AV_PIX_FMT_VDPAU, .start_frame = vdpau_mpeg_start_frame, .end_frame = ff_vdpau_mpeg_end_frame, .decode_slice = vdpau_mpeg_decode_slice, @@ -128,10 +128,10 @@ static int vdpau_mpeg2_init(AVCodecContext *avctx) VdpDecoderProfile profile; switch (avctx->profile) { - case FF_PROFILE_MPEG2_MAIN: + case AV_PROFILE_MPEG2_MAIN: profile = VDP_DECODER_PROFILE_MPEG2_MAIN; break; - case FF_PROFILE_MPEG2_SIMPLE: + case AV_PROFILE_MPEG2_SIMPLE: profile = VDP_DECODER_PROFILE_MPEG2_SIMPLE; break; default: @@ -141,11 +141,11 @@ static int vdpau_mpeg2_init(AVCodecContext *avctx) return ff_vdpau_common_init(avctx, profile, VDP_DECODER_LEVEL_MPEG2_HL); } -const AVHWAccel ff_mpeg2_vdpau_hwaccel = { - .name = "mpeg2_vdpau", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG2VIDEO, - .pix_fmt = AV_PIX_FMT_VDPAU, +const FFHWAccel ff_mpeg2_vdpau_hwaccel = { + .p.name = "mpeg2_vdpau", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG2VIDEO, + .p.pix_fmt = AV_PIX_FMT_VDPAU, .start_frame = vdpau_mpeg_start_frame, .end_frame = ff_vdpau_mpeg_end_frame, .decode_slice = vdpau_mpeg_decode_slice, diff --git a/src/third_party/ffmpeg/libavcodec/vdpau_mpeg4.c b/src/third_party/ffmpeg/libavcodec/vdpau_mpeg4.c index 1211b1df..055426b9 100644 --- a/src/third_party/ffmpeg/libavcodec/vdpau_mpeg4.c +++ b/src/third_party/ffmpeg/libavcodec/vdpau_mpeg4.c @@ -24,7 +24,7 @@ #include #include "avcodec.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "mpeg4videodec.h" #include "vdpau.h" #include "vdpau_internal.h" @@ -95,13 +95,13 @@ static int vdpau_mpeg4_init(AVCodecContext *avctx) VdpDecoderProfile profile; switch (avctx->profile) { - case FF_PROFILE_MPEG4_SIMPLE: + case AV_PROFILE_MPEG4_SIMPLE: profile = VDP_DECODER_PROFILE_MPEG4_PART2_SP; break; // As any ASP decoder must be able to decode SP, this // should be a safe fallback if profile is unknown/unspecified. - case FF_PROFILE_UNKNOWN: - case FF_PROFILE_MPEG4_ADVANCED_SIMPLE: + case AV_PROFILE_UNKNOWN: + case AV_PROFILE_MPEG4_ADVANCED_SIMPLE: profile = VDP_DECODER_PROFILE_MPEG4_PART2_ASP; break; default: @@ -111,11 +111,11 @@ static int vdpau_mpeg4_init(AVCodecContext *avctx) return ff_vdpau_common_init(avctx, profile, avctx->level); } -const AVHWAccel ff_mpeg4_vdpau_hwaccel = { - .name = "mpeg4_vdpau", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG4, - .pix_fmt = AV_PIX_FMT_VDPAU, +const FFHWAccel ff_mpeg4_vdpau_hwaccel = { + .p.name = "mpeg4_vdpau", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG4, + .p.pix_fmt = AV_PIX_FMT_VDPAU, .start_frame = vdpau_mpeg4_start_frame, .end_frame = ff_vdpau_mpeg_end_frame, .decode_slice = vdpau_mpeg4_decode_slice, diff --git a/src/third_party/ffmpeg/libavcodec/vdpau_vc1.c b/src/third_party/ffmpeg/libavcodec/vdpau_vc1.c index 00b33f42..4e5ee144 100644 --- a/src/third_party/ffmpeg/libavcodec/vdpau_vc1.c +++ b/src/third_party/ffmpeg/libavcodec/vdpau_vc1.c @@ -26,7 +26,7 @@ #include #include "avcodec.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "vc1.h" #include "vdpau.h" #include "vdpau_internal.h" @@ -121,13 +121,13 @@ static int vdpau_vc1_init(AVCodecContext *avctx) VdpDecoderProfile profile; switch (avctx->profile) { - case FF_PROFILE_VC1_SIMPLE: + case AV_PROFILE_VC1_SIMPLE: profile = VDP_DECODER_PROFILE_VC1_SIMPLE; break; - case FF_PROFILE_VC1_MAIN: + case AV_PROFILE_VC1_MAIN: profile = VDP_DECODER_PROFILE_VC1_MAIN; break; - case FF_PROFILE_VC1_ADVANCED: + case AV_PROFILE_VC1_ADVANCED: profile = VDP_DECODER_PROFILE_VC1_ADVANCED; break; default: @@ -138,11 +138,11 @@ static int vdpau_vc1_init(AVCodecContext *avctx) } #if CONFIG_WMV3_VDPAU_HWACCEL -const AVHWAccel ff_wmv3_vdpau_hwaccel = { - .name = "wm3_vdpau", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WMV3, - .pix_fmt = AV_PIX_FMT_VDPAU, +const FFHWAccel ff_wmv3_vdpau_hwaccel = { + .p.name = "wm3_vdpau", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WMV3, + .p.pix_fmt = AV_PIX_FMT_VDPAU, .start_frame = vdpau_vc1_start_frame, .end_frame = ff_vdpau_mpeg_end_frame, .decode_slice = vdpau_vc1_decode_slice, @@ -155,11 +155,11 @@ const AVHWAccel ff_wmv3_vdpau_hwaccel = { }; #endif -const AVHWAccel ff_vc1_vdpau_hwaccel = { - .name = "vc1_vdpau", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VC1, - .pix_fmt = AV_PIX_FMT_VDPAU, +const FFHWAccel ff_vc1_vdpau_hwaccel = { + .p.name = "vc1_vdpau", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VC1, + .p.pix_fmt = AV_PIX_FMT_VDPAU, .start_frame = vdpau_vc1_start_frame, .end_frame = ff_vdpau_mpeg_end_frame, .decode_slice = vdpau_vc1_decode_slice, diff --git a/src/third_party/ffmpeg/libavcodec/vdpau_vp9.c b/src/third_party/ffmpeg/libavcodec/vdpau_vp9.c index 49fe1818..424e2e60 100644 --- a/src/third_party/ffmpeg/libavcodec/vdpau_vp9.c +++ b/src/third_party/ffmpeg/libavcodec/vdpau_vp9.c @@ -23,9 +23,8 @@ #include #include "libavutil/pixdesc.h" #include "avcodec.h" -#include "vp9data.h" +#include "hwaccel_internal.h" #include "vp9dec.h" -#include "hwconfig.h" #include "vdpau.h" #include "vdpau_internal.h" @@ -204,16 +203,16 @@ static int vdpau_vp9_init(AVCodecContext *avctx) uint32_t level = avctx->level; switch (avctx->profile) { - case FF_PROFILE_VP9_0: + case AV_PROFILE_VP9_0: profile = VDP_DECODER_PROFILE_VP9_PROFILE_0; break; - case FF_PROFILE_VP9_1: + case AV_PROFILE_VP9_1: profile = VDP_DECODER_PROFILE_VP9_PROFILE_1; break; - case FF_PROFILE_VP9_2: + case AV_PROFILE_VP9_2: profile = VDP_DECODER_PROFILE_VP9_PROFILE_2; break; - case FF_PROFILE_VP9_3: + case AV_PROFILE_VP9_3: profile = VDP_DECODER_PROFILE_VP9_PROFILE_3; break; default: @@ -223,11 +222,11 @@ static int vdpau_vp9_init(AVCodecContext *avctx) return ff_vdpau_common_init(avctx, profile, level); } -const AVHWAccel ff_vp9_vdpau_hwaccel = { - .name = "vp9_vdpau", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP9, - .pix_fmt = AV_PIX_FMT_VDPAU, +const FFHWAccel ff_vp9_vdpau_hwaccel = { + .p.name = "vp9_vdpau", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP9, + .p.pix_fmt = AV_PIX_FMT_VDPAU, .start_frame = vdpau_vp9_start_frame, .end_frame = vdpau_vp9_end_frame, .decode_slice = vdpau_vp9_decode_slice, diff --git a/src/third_party/ffmpeg/libavcodec/version.h b/src/third_party/ffmpeg/libavcodec/version.h index 9411511e..87b7284a 100644 --- a/src/third_party/ffmpeg/libavcodec/version.h +++ b/src/third_party/ffmpeg/libavcodec/version.h @@ -29,7 +29,7 @@ #include "version_major.h" -#define LIBAVCODEC_VERSION_MINOR 22 +#define LIBAVCODEC_VERSION_MINOR 28 #define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ diff --git a/src/third_party/ffmpeg/libavcodec/version_major.h b/src/third_party/ffmpeg/libavcodec/version_major.h index 95c5aec0..b9164fe5 100644 --- a/src/third_party/ffmpeg/libavcodec/version_major.h +++ b/src/third_party/ffmpeg/libavcodec/version_major.h @@ -50,6 +50,9 @@ #define FF_API_TICKS_PER_FRAME (LIBAVCODEC_VERSION_MAJOR < 61) #define FF_API_DROPCHANGED (LIBAVCODEC_VERSION_MAJOR < 61) +#define FF_API_AVFFT (LIBAVCODEC_VERSION_MAJOR < 62) +#define FF_API_FF_PROFILE_LEVEL (LIBAVCODEC_VERSION_MAJOR < 62) + // reminder to remove CrystalHD decoders on next major bump #define FF_CODEC_CRYSTAL_HD (LIBAVCODEC_VERSION_MAJOR < 61) diff --git a/src/third_party/ffmpeg/libavcodec/videotoolbox.c b/src/third_party/ffmpeg/libavcodec/videotoolbox.c index 64443255..963379d4 100644 --- a/src/third_party/ffmpeg/libavcodec/videotoolbox.c +++ b/src/third_party/ffmpeg/libavcodec/videotoolbox.c @@ -33,6 +33,7 @@ #include "internal.h" #include "h264dec.h" #include "hevcdec.h" +#include "hwaccel_internal.h" #include "mpegvideo.h" #include "proresdec.h" #include @@ -1284,11 +1285,11 @@ int ff_videotoolbox_frame_params(AVCodecContext *avctx, return 0; } -const AVHWAccel ff_h263_videotoolbox_hwaccel = { - .name = "h263_videotoolbox", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H263, - .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, +const FFHWAccel ff_h263_videotoolbox_hwaccel = { + .p.name = "h263_videotoolbox", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H263, + .p.pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, .alloc_frame = ff_videotoolbox_alloc_frame, .start_frame = videotoolbox_mpeg_start_frame, .decode_slice = videotoolbox_mpeg_decode_slice, @@ -1299,11 +1300,11 @@ const AVHWAccel ff_h263_videotoolbox_hwaccel = { .priv_data_size = sizeof(VTContext), }; -const AVHWAccel ff_hevc_videotoolbox_hwaccel = { - .name = "hevc_videotoolbox", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, - .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, +const FFHWAccel ff_hevc_videotoolbox_hwaccel = { + .p.name = "hevc_videotoolbox", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, + .p.pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, .alloc_frame = ff_videotoolbox_alloc_frame, .start_frame = videotoolbox_hevc_start_frame, .decode_slice = videotoolbox_hevc_decode_slice, @@ -1315,11 +1316,11 @@ const AVHWAccel ff_hevc_videotoolbox_hwaccel = { .priv_data_size = sizeof(VTContext), }; -const AVHWAccel ff_h264_videotoolbox_hwaccel = { - .name = "h264_videotoolbox", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, - .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, +const FFHWAccel ff_h264_videotoolbox_hwaccel = { + .p.name = "h264_videotoolbox", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, + .p.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, @@ -1331,11 +1332,11 @@ const AVHWAccel ff_h264_videotoolbox_hwaccel = { .priv_data_size = sizeof(VTContext), }; -const AVHWAccel ff_mpeg1_videotoolbox_hwaccel = { - .name = "mpeg1_videotoolbox", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG1VIDEO, - .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, +const FFHWAccel ff_mpeg1_videotoolbox_hwaccel = { + .p.name = "mpeg1_videotoolbox", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG1VIDEO, + .p.pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, .alloc_frame = ff_videotoolbox_alloc_frame, .start_frame = videotoolbox_mpeg_start_frame, .decode_slice = videotoolbox_mpeg_decode_slice, @@ -1346,11 +1347,11 @@ const AVHWAccel ff_mpeg1_videotoolbox_hwaccel = { .priv_data_size = sizeof(VTContext), }; -const AVHWAccel ff_mpeg2_videotoolbox_hwaccel = { - .name = "mpeg2_videotoolbox", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG2VIDEO, - .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, +const FFHWAccel ff_mpeg2_videotoolbox_hwaccel = { + .p.name = "mpeg2_videotoolbox", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG2VIDEO, + .p.pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, .alloc_frame = ff_videotoolbox_alloc_frame, .start_frame = videotoolbox_mpeg_start_frame, .decode_slice = videotoolbox_mpeg_decode_slice, @@ -1361,11 +1362,11 @@ const AVHWAccel ff_mpeg2_videotoolbox_hwaccel = { .priv_data_size = sizeof(VTContext), }; -const AVHWAccel ff_mpeg4_videotoolbox_hwaccel = { - .name = "mpeg4_videotoolbox", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG4, - .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, +const FFHWAccel ff_mpeg4_videotoolbox_hwaccel = { + .p.name = "mpeg4_videotoolbox", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG4, + .p.pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, .alloc_frame = ff_videotoolbox_alloc_frame, .start_frame = videotoolbox_mpeg_start_frame, .decode_slice = videotoolbox_mpeg_decode_slice, @@ -1376,11 +1377,11 @@ const AVHWAccel ff_mpeg4_videotoolbox_hwaccel = { .priv_data_size = sizeof(VTContext), }; -const AVHWAccel ff_prores_videotoolbox_hwaccel = { - .name = "prores_videotoolbox", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PRORES, - .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, +const FFHWAccel ff_prores_videotoolbox_hwaccel = { + .p.name = "prores_videotoolbox", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PRORES, + .p.pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, .alloc_frame = ff_videotoolbox_alloc_frame, .start_frame = videotoolbox_prores_start_frame, .decode_slice = videotoolbox_prores_decode_slice, diff --git a/src/third_party/ffmpeg/libavcodec/videotoolbox_vp9.c b/src/third_party/ffmpeg/libavcodec/videotoolbox_vp9.c index a998f36d..f5489854 100644 --- a/src/third_party/ffmpeg/libavcodec/videotoolbox_vp9.c +++ b/src/third_party/ffmpeg/libavcodec/videotoolbox_vp9.c @@ -31,6 +31,7 @@ #include "libavutil/intreadwrite.h" #include "libavutil/pixdesc.h" #include "decode.h" +#include "hwaccel_internal.h" #include "internal.h" #include "vp9shared.h" @@ -125,11 +126,11 @@ static int videotoolbox_vp9_end_frame(AVCodecContext *avctx) return ff_videotoolbox_common_end_frame(avctx, frame); } -const AVHWAccel ff_vp9_videotoolbox_hwaccel = { - .name = "vp9_videotoolbox", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP9, - .pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, +const FFHWAccel ff_vp9_videotoolbox_hwaccel = { + .p.name = "vp9_videotoolbox", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP9, + .p.pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX, .alloc_frame = ff_videotoolbox_alloc_frame, .start_frame = videotoolbox_vp9_start_frame, .decode_slice = videotoolbox_vp9_decode_slice, diff --git a/src/third_party/ffmpeg/libavcodec/videotoolboxenc.c b/src/third_party/ffmpeg/libavcodec/videotoolboxenc.c index 61143513..1d159532 100644 --- a/src/third_party/ffmpeg/libavcodec/videotoolboxenc.c +++ b/src/third_party/ffmpeg/libavcodec/videotoolboxenc.c @@ -206,7 +206,7 @@ static void loadVTEncSymbols(void){ GET_SYM(kVTCompressionPropertyKey_MinAllowedFrameQP, "MinAllowedFrameQP"); } -#define H264_PROFILE_CONSTRAINED_HIGH (FF_PROFILE_H264_HIGH | FF_PROFILE_H264_CONSTRAINED) +#define H264_PROFILE_CONSTRAINED_HIGH (AV_PROFILE_H264_HIGH | AV_PROFILE_H264_CONSTRAINED) typedef enum VTH264Entropy{ VT_ENTROPY_NOT_SET, @@ -232,6 +232,7 @@ typedef struct VTEncContext { AVClass *class; enum AVCodecID codec_id; VTCompressionSessionRef session; + CFDictionaryRef supported_props; CFStringRef ycbcr_matrix; CFStringRef color_primaries; CFStringRef transfer_function; @@ -321,6 +322,34 @@ static void clear_frame_queue(VTEncContext *vtctx) set_async_error(vtctx, 0); } +static void vtenc_reset(VTEncContext *vtctx) +{ + if (vtctx->session) { + CFRelease(vtctx->session); + vtctx->session = NULL; + } + + if (vtctx->supported_props) { + CFRelease(vtctx->supported_props); + vtctx->supported_props = NULL; + } + + if (vtctx->color_primaries) { + CFRelease(vtctx->color_primaries); + vtctx->color_primaries = NULL; + } + + if (vtctx->transfer_function) { + CFRelease(vtctx->transfer_function); + vtctx->transfer_function = NULL; + } + + if (vtctx->ycbcr_matrix) { + CFRelease(vtctx->ycbcr_matrix); + vtctx->ycbcr_matrix = NULL; + } +} + static int vtenc_q_pop(VTEncContext *vtctx, bool wait, CMSampleBufferRef *buf, ExtraSEI **sei) { BufNode *info; @@ -455,22 +484,22 @@ static CMVideoCodecType get_cm_codec_type(AVCodecContext *avctx, return kCMVideoCodecType_HEVC; case AV_CODEC_ID_PRORES: switch (profile) { - case FF_PROFILE_PRORES_PROXY: + case AV_PROFILE_PRORES_PROXY: return MKBETAG('a','p','c','o'); // kCMVideoCodecType_AppleProRes422Proxy - case FF_PROFILE_PRORES_LT: + case AV_PROFILE_PRORES_LT: return MKBETAG('a','p','c','s'); // kCMVideoCodecType_AppleProRes422LT - case FF_PROFILE_PRORES_STANDARD: + case AV_PROFILE_PRORES_STANDARD: return MKBETAG('a','p','c','n'); // kCMVideoCodecType_AppleProRes422 - case FF_PROFILE_PRORES_HQ: + case AV_PROFILE_PRORES_HQ: return MKBETAG('a','p','c','h'); // kCMVideoCodecType_AppleProRes422HQ - case FF_PROFILE_PRORES_4444: + case AV_PROFILE_PRORES_4444: return MKBETAG('a','p','4','h'); // kCMVideoCodecType_AppleProRes4444 - case FF_PROFILE_PRORES_XQ: + case AV_PROFILE_PRORES_XQ: return MKBETAG('a','p','4','x'); // kCMVideoCodecType_AppleProRes4444XQ default: av_log(avctx, AV_LOG_ERROR, "Unknown profile ID: %d, using auto\n", profile); - case FF_PROFILE_UNKNOWN: + case AV_PROFILE_UNKNOWN: if (desc && ((desc->flags & AV_PIX_FMT_FLAG_ALPHA) || desc->log2_chroma_w == 0)) @@ -736,18 +765,18 @@ static bool get_vt_h264_profile_level(AVCodecContext *avctx, VTEncContext *vtctx = avctx->priv_data; int profile = vtctx->profile; - if (profile == FF_PROFILE_UNKNOWN && vtctx->level) { + if (profile == AV_PROFILE_UNKNOWN && vtctx->level) { //Need to pick a profile if level is not auto-selected. - profile = vtctx->has_b_frames ? FF_PROFILE_H264_MAIN : FF_PROFILE_H264_BASELINE; + profile = vtctx->has_b_frames ? AV_PROFILE_H264_MAIN : AV_PROFILE_H264_BASELINE; } *profile_level_val = NULL; switch (profile) { - case FF_PROFILE_UNKNOWN: + case AV_PROFILE_UNKNOWN: return true; - case FF_PROFILE_H264_BASELINE: + case AV_PROFILE_H264_BASELINE: switch (vtctx->level) { case 0: *profile_level_val = compat_keys.kVTProfileLevel_H264_Baseline_AutoLevel; break; @@ -769,7 +798,7 @@ static bool get_vt_h264_profile_level(AVCodecContext *avctx, } break; - case FF_PROFILE_H264_CONSTRAINED_BASELINE: + case AV_PROFILE_H264_CONSTRAINED_BASELINE: *profile_level_val = compat_keys.kVTProfileLevel_H264_ConstrainedBaseline_AutoLevel; if (vtctx->level != 0) { @@ -781,7 +810,7 @@ static bool get_vt_h264_profile_level(AVCodecContext *avctx, } break; - case FF_PROFILE_H264_MAIN: + case AV_PROFILE_H264_MAIN: switch (vtctx->level) { case 0: *profile_level_val = compat_keys.kVTProfileLevel_H264_Main_AutoLevel; break; @@ -812,7 +841,7 @@ static bool get_vt_h264_profile_level(AVCodecContext *avctx, } break; - case FF_PROFILE_H264_HIGH: + case AV_PROFILE_H264_HIGH: switch (vtctx->level) { case 0: *profile_level_val = compat_keys.kVTProfileLevel_H264_High_AutoLevel; break; @@ -835,7 +864,7 @@ static bool get_vt_h264_profile_level(AVCodecContext *avctx, compat_keys.kVTProfileLevel_H264_High_5_2; break; } break; - case FF_PROFILE_H264_EXTENDED: + case AV_PROFILE_H264_EXTENDED: switch (vtctx->level) { case 0: *profile_level_val = compat_keys.kVTProfileLevel_H264_Extended_AutoLevel; break; @@ -868,13 +897,13 @@ static bool get_vt_hevc_profile_level(AVCodecContext *avctx, *profile_level_val = NULL; switch (profile) { - case FF_PROFILE_UNKNOWN: + case AV_PROFILE_UNKNOWN: return true; - case FF_PROFILE_HEVC_MAIN: + case AV_PROFILE_HEVC_MAIN: *profile_level_val = compat_keys.kVTProfileLevel_HEVC_Main_AutoLevel; break; - case FF_PROFILE_HEVC_MAIN_10: + case AV_PROFILE_HEVC_MAIN_10: *profile_level_val = compat_keys.kVTProfileLevel_HEVC_Main10_AutoLevel; break; @@ -1001,132 +1030,20 @@ pbinfo_nomem: return AVERROR(ENOMEM); } -static int get_cv_color_primaries(AVCodecContext *avctx, - CFStringRef *primaries) -{ - enum AVColorPrimaries pri = avctx->color_primaries; - switch (pri) { - case AVCOL_PRI_UNSPECIFIED: - *primaries = NULL; - break; - - case AVCOL_PRI_BT470BG: - *primaries = kCVImageBufferColorPrimaries_EBU_3213; - break; - - case AVCOL_PRI_SMPTE170M: - *primaries = kCVImageBufferColorPrimaries_SMPTE_C; - break; - - case AVCOL_PRI_BT709: - *primaries = kCVImageBufferColorPrimaries_ITU_R_709_2; - break; - - case AVCOL_PRI_BT2020: - *primaries = compat_keys.kCVImageBufferColorPrimaries_ITU_R_2020; - break; - - default: - av_log(avctx, AV_LOG_ERROR, "Color primaries %s is not supported.\n", av_color_primaries_name(pri)); - *primaries = NULL; - return -1; - } - - return 0; -} - -static int get_cv_transfer_function(AVCodecContext *avctx, - CFStringRef *transfer_fnc, - CFNumberRef *gamma_level) +static int get_cv_gamma(AVCodecContext *avctx, + CFNumberRef *gamma_level) { enum AVColorTransferCharacteristic trc = avctx->color_trc; - Float32 gamma; + Float32 gamma = 0; *gamma_level = NULL; - switch (trc) { - case AVCOL_TRC_UNSPECIFIED: - *transfer_fnc = NULL; - break; - - case AVCOL_TRC_BT709: - *transfer_fnc = kCVImageBufferTransferFunction_ITU_R_709_2; - break; - - case AVCOL_TRC_SMPTE240M: - *transfer_fnc = kCVImageBufferTransferFunction_SMPTE_240M_1995; - break; - -#if HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_SMPTE_ST_2084_PQ - case AVCOL_TRC_SMPTE2084: - *transfer_fnc = kCVImageBufferTransferFunction_SMPTE_ST_2084_PQ; - break; -#endif -#if HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_LINEAR - case AVCOL_TRC_LINEAR: - *transfer_fnc = kCVImageBufferTransferFunction_Linear; - break; -#endif -#if HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_ITU_R_2100_HLG - case AVCOL_TRC_ARIB_STD_B67: - *transfer_fnc = kCVImageBufferTransferFunction_ITU_R_2100_HLG; - break; -#endif - - case AVCOL_TRC_GAMMA22: - gamma = 2.2; - *transfer_fnc = kCVImageBufferTransferFunction_UseGamma; - *gamma_level = CFNumberCreate(NULL, kCFNumberFloat32Type, &gamma); - break; - - case AVCOL_TRC_GAMMA28: - gamma = 2.8; - *transfer_fnc = kCVImageBufferTransferFunction_UseGamma; - *gamma_level = CFNumberCreate(NULL, kCFNumberFloat32Type, &gamma); - break; - - case AVCOL_TRC_BT2020_10: - case AVCOL_TRC_BT2020_12: - *transfer_fnc = compat_keys.kCVImageBufferTransferFunction_ITU_R_2020; - break; - - default: - *transfer_fnc = NULL; - av_log(avctx, AV_LOG_ERROR, "Transfer function %s is not supported.\n", av_color_transfer_name(trc)); - return -1; - } - - return 0; -} - -static int get_cv_ycbcr_matrix(AVCodecContext *avctx, CFStringRef *matrix) { - switch(avctx->colorspace) { - case AVCOL_SPC_BT709: - *matrix = kCVImageBufferYCbCrMatrix_ITU_R_709_2; - break; - - case AVCOL_SPC_UNSPECIFIED: - case AVCOL_SPC_RGB: - *matrix = NULL; - break; - - case AVCOL_SPC_BT470BG: - case AVCOL_SPC_SMPTE170M: - *matrix = kCVImageBufferYCbCrMatrix_ITU_R_601_4; - break; - - case AVCOL_SPC_SMPTE240M: - *matrix = kCVImageBufferYCbCrMatrix_SMPTE_240M_1995; - break; - - case AVCOL_SPC_BT2020_NCL: - *matrix = compat_keys.kCVImageBufferYCbCrMatrix_ITU_R_2020; - break; - - default: - av_log(avctx, AV_LOG_ERROR, "Color space %s is not supported.\n", av_color_space_name(avctx->colorspace)); - return -1; - } + if (trc == AVCOL_TRC_GAMMA22) + gamma = 2.2; + else if (trc == AVCOL_TRC_GAMMA28) + gamma = 2.8; + if (gamma != 0) + *gamma_level = CFNumberCreate(NULL, kCFNumberFloat32Type, &gamma); return 0; } @@ -1222,6 +1139,50 @@ static int vtenc_create_encoder(AVCodecContext *avctx, return AVERROR_EXTERNAL; } +#if defined (MAC_OS_X_VERSION_10_13) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_13) + if (__builtin_available(macOS 10.13, *)) { + status = VTCopySupportedPropertyDictionaryForEncoder(avctx->width, + avctx->height, + codec_type, + enc_info, + NULL, + &vtctx->supported_props); + + if (status != noErr) { + av_log(avctx, AV_LOG_ERROR,"Error retrieving the supported property dictionary err=%"PRId64"\n", (int64_t)status); + return AVERROR_EXTERNAL; + } + } +#endif + + // Dump the init encoder + { + CFStringRef encoderID = NULL; + status = VTSessionCopyProperty(vtctx->session, + kVTCompressionPropertyKey_EncoderID, + kCFAllocatorDefault, + &encoderID); + if (status == noErr) { + CFIndex length = CFStringGetLength(encoderID); + CFIndex max_size = CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8); + char *name = av_malloc(max_size); + if (!name) { + CFRelease(encoderID); + return AVERROR(ENOMEM); + } + + CFStringGetCString(encoderID, + name, + max_size, + kCFStringEncodingUTF8); + av_log(avctx, AV_LOG_DEBUG, "Init the encoder: %s\n", name); + + av_freep(&name); + } + if (encoderID != NULL) + CFRelease(encoderID); + } + if (avctx->flags & AV_CODEC_FLAG_QSCALE && !vtenc_qscale_enabled()) { av_log(avctx, AV_LOG_ERROR, "Error: -q:v qscale not available for encoder. Use -b:v bitrate instead.\n"); return AVERROR_EXTERNAL; @@ -1633,12 +1594,12 @@ static int vtenc_configure_encoder(AVCodecContext *avctx) vtctx->get_param_set_func = CMVideoFormatDescriptionGetH264ParameterSetAtIndex; vtctx->has_b_frames = avctx->max_b_frames > 0; - if(vtctx->has_b_frames && (0xFF & vtctx->profile) == FF_PROFILE_H264_BASELINE){ + if(vtctx->has_b_frames && (0xFF & vtctx->profile) == AV_PROFILE_H264_BASELINE){ av_log(avctx, AV_LOG_WARNING, "Cannot use B-frames with baseline profile. Output will not contain B-frames.\n"); vtctx->has_b_frames = 0; } - if (vtctx->entropy == VT_CABAC && (0xFF & vtctx->profile) == FF_PROFILE_H264_BASELINE) { + if (vtctx->entropy == VT_CABAC && (0xFF & vtctx->profile) == AV_PROFILE_H264_BASELINE) { av_log(avctx, AV_LOG_WARNING, "CABAC entropy requires 'main' or 'high' profile, but baseline was requested. Encode will not use CABAC entropy.\n"); vtctx->entropy = VT_ENTROPY_NOT_SET; } @@ -1694,9 +1655,10 @@ static int vtenc_configure_encoder(AVCodecContext *avctx) vtctx->dts_delta = vtctx->has_b_frames ? -1 : 0; - get_cv_transfer_function(avctx, &vtctx->transfer_function, &gamma_level); - get_cv_ycbcr_matrix(avctx, &vtctx->ycbcr_matrix); - get_cv_color_primaries(avctx, &vtctx->color_primaries); + get_cv_gamma(avctx, &gamma_level); + vtctx->transfer_function = av_map_videotoolbox_color_trc_from_av(avctx->color_trc); + vtctx->ycbcr_matrix = av_map_videotoolbox_color_matrix_from_av(avctx->colorspace); + vtctx->color_primaries = av_map_videotoolbox_color_primaries_from_av(avctx->color_primaries); if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) { @@ -1743,9 +1705,8 @@ static av_cold int vtenc_init(AVCodecContext *avctx) pthread_cond_init(&vtctx->cv_sample_sent, NULL); // It can happen when user set avctx->profile directly. - if (vtctx->profile == FF_PROFILE_UNKNOWN) + if (vtctx->profile == AV_PROFILE_UNKNOWN) vtctx->profile = avctx->profile; - vtctx->session = NULL; status = vtenc_configure_encoder(avctx); if (status) return status; @@ -2514,8 +2475,8 @@ static int create_cv_pixel_buffer(AVCodecContext *avctx, vtstatus = VTCompressionSessionPrepareToEncodeFrames(vtctx->session); if (vtstatus == kVTInvalidSessionErr) { - CFRelease(vtctx->session); - vtctx->session = NULL; + vtenc_reset(vtctx); + status = vtenc_configure_encoder(avctx); if (status == 0) pix_buf_pool = VTCompressionSessionGetPixelBufferPool(vtctx->session); @@ -2771,10 +2732,7 @@ static int vtenc_populate_extradata(AVCodecContext *avctx, pe_cleanup: CVPixelBufferRelease(pix_buf); - if(vtctx->session) - CFRelease(vtctx->session); - - vtctx->session = NULL; + vtenc_reset(vtctx); vtctx->frame_ct_out = 0; av_assert0(status != 0 || (avctx->extradata && avctx->extradata_size > 0)); @@ -2797,23 +2755,8 @@ static av_cold int vtenc_close(AVCodecContext *avctx) clear_frame_queue(vtctx); pthread_cond_destroy(&vtctx->cv_sample_sent); pthread_mutex_destroy(&vtctx->lock); - CFRelease(vtctx->session); - vtctx->session = NULL; - if (vtctx->color_primaries) { - CFRelease(vtctx->color_primaries); - vtctx->color_primaries = NULL; - } - - if (vtctx->transfer_function) { - CFRelease(vtctx->transfer_function); - vtctx->transfer_function = NULL; - } - - if (vtctx->ycbcr_matrix) { - CFRelease(vtctx->ycbcr_matrix); - vtctx->ycbcr_matrix = NULL; - } + vtenc_reset(vtctx); return 0; } @@ -2889,13 +2832,13 @@ static const enum AVPixelFormat prores_pix_fmts[] = { #define OFFSET(x) offsetof(VTEncContext, x) static const AVOption h264_options[] = { - { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, INT_MAX, VE, "profile" }, - { "baseline", "Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_BASELINE }, INT_MIN, INT_MAX, VE, "profile" }, - { "constrained_baseline", "Constrained Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_CONSTRAINED_BASELINE }, INT_MIN, INT_MAX, VE, "profile" }, - { "main", "Main Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_MAIN }, INT_MIN, INT_MAX, VE, "profile" }, - { "high", "High Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_HIGH }, INT_MIN, INT_MAX, VE, "profile" }, + { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, INT_MAX, VE, "profile" }, + { "baseline", "Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_BASELINE }, INT_MIN, INT_MAX, VE, "profile" }, + { "constrained_baseline", "Constrained Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_CONSTRAINED_BASELINE }, INT_MIN, INT_MAX, VE, "profile" }, + { "main", "Main Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_MAIN }, INT_MIN, INT_MAX, VE, "profile" }, + { "high", "High Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_HIGH }, INT_MIN, INT_MAX, VE, "profile" }, { "constrained_high", "Constrained High Profile", 0, AV_OPT_TYPE_CONST, { .i64 = H264_PROFILE_CONSTRAINED_HIGH }, INT_MIN, INT_MAX, VE, "profile" }, - { "extended", "Extend Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_EXTENDED }, INT_MIN, INT_MAX, VE, "profile" }, + { "extended", "Extend Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_EXTENDED }, INT_MIN, INT_MAX, VE, "profile" }, { "level", "Level", OFFSET(level), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 52, VE, "level" }, { "1.3", "Level 1.3, only available with Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = 13 }, INT_MIN, INT_MAX, VE, "level" }, @@ -2946,9 +2889,9 @@ const FFCodec ff_h264_videotoolbox_encoder = { }; static const AVOption hevc_options[] = { - { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, INT_MAX, VE, "profile" }, - { "main", "Main Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_HEVC_MAIN }, INT_MIN, INT_MAX, VE, "profile" }, - { "main10", "Main10 Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_HEVC_MAIN_10 }, INT_MIN, INT_MAX, VE, "profile" }, + { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, INT_MAX, VE, "profile" }, + { "main", "Main Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_HEVC_MAIN }, INT_MIN, INT_MAX, VE, "profile" }, + { "main10", "Main10 Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_HEVC_MAIN_10 }, INT_MIN, INT_MAX, VE, "profile" }, { "alpha_quality", "Compression quality for the alpha channel", OFFSET(alpha_quality), AV_OPT_TYPE_DOUBLE, { .dbl = 0.0 }, 0.0, 1.0, VE }, @@ -2983,14 +2926,14 @@ const FFCodec ff_hevc_videotoolbox_encoder = { }; static const AVOption prores_options[] = { - { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, FF_PROFILE_PRORES_XQ, VE, "profile" }, - { "auto", "Automatically determine based on input format", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, VE, "profile" }, - { "proxy", "ProRes 422 Proxy", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_PROXY }, INT_MIN, INT_MAX, VE, "profile" }, - { "lt", "ProRes 422 LT", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_LT }, INT_MIN, INT_MAX, VE, "profile" }, - { "standard", "ProRes 422", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_STANDARD }, INT_MIN, INT_MAX, VE, "profile" }, - { "hq", "ProRes 422 HQ", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_HQ }, INT_MIN, INT_MAX, VE, "profile" }, - { "4444", "ProRes 4444", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_4444 }, INT_MIN, INT_MAX, VE, "profile" }, - { "xq", "ProRes 4444 XQ", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_XQ }, INT_MIN, INT_MAX, VE, "profile" }, + { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, AV_PROFILE_PRORES_XQ, VE, "profile" }, + { "auto", "Automatically determine based on input format", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, VE, "profile" }, + { "proxy", "ProRes 422 Proxy", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_PROXY }, INT_MIN, INT_MAX, VE, "profile" }, + { "lt", "ProRes 422 LT", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_LT }, INT_MIN, INT_MAX, VE, "profile" }, + { "standard", "ProRes 422", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_STANDARD }, INT_MIN, INT_MAX, VE, "profile" }, + { "hq", "ProRes 422 HQ", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_HQ }, INT_MIN, INT_MAX, VE, "profile" }, + { "4444", "ProRes 4444", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_4444 }, INT_MIN, INT_MAX, VE, "profile" }, + { "xq", "ProRes 4444 XQ", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_XQ }, INT_MIN, INT_MAX, VE, "profile" }, COMMON_OPTIONS { NULL }, diff --git a/src/third_party/ffmpeg/libavcodec/vlc.c b/src/third_party/ffmpeg/libavcodec/vlc.c index 96f2b28c..e4bbf294 100644 --- a/src/third_party/ffmpeg/libavcodec/vlc.c +++ b/src/third_party/ffmpeg/libavcodec/vlc.c @@ -30,6 +30,7 @@ #include "libavutil/avassert.h" #include "libavutil/error.h" #include "libavutil/internal.h" +#include "libavutil/intreadwrite.h" #include "libavutil/log.h" #include "libavutil/macros.h" #include "libavutil/mem.h" @@ -63,7 +64,7 @@ static int alloc_table(VLC *vlc, int size, int use_static) vlc->table_size += size; if (vlc->table_size > vlc->table_allocated) { if (use_static) - abort(); // cannot do anything, init_vlc() is used with too little memory + abort(); // cannot do anything, vlc_init() is used with too little memory vlc->table_allocated += (1 << vlc->bits); vlc->table = av_realloc_f(vlc->table, vlc->table_allocated, sizeof(*vlc->table)); if (!vlc->table) { @@ -99,7 +100,7 @@ static int vlc_common_init(VLC *vlc, int nb_bits, int nb_codes, { vlc->bits = nb_bits; vlc->table_size = 0; - if (flags & INIT_VLC_USE_NEW_STATIC) { + if (flags & VLC_INIT_USE_STATIC) { av_assert0(nb_codes <= LOCALBUF_ELEMS); } else { vlc->table = NULL; @@ -143,7 +144,7 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes, if (table_nb_bits > 30) return AVERROR(EINVAL); table_size = 1 << table_nb_bits; - table_index = alloc_table(vlc, table_size, flags & INIT_VLC_USE_NEW_STATIC); + table_index = alloc_table(vlc, table_size, flags & VLC_INIT_USE_STATIC); ff_dlog(NULL, "new table index=%d size=%d\n", table_index, table_size); if (table_index < 0) return table_index; @@ -161,7 +162,7 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes, int nb = 1 << (table_nb_bits - n); int inc = 1; - if (flags & INIT_VLC_OUTPUT_LE) { + if (flags & VLC_INIT_OUTPUT_LE) { j = bitswap_32(code); inc = 1 << n; } @@ -199,7 +200,7 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes, subtable_bits = FFMAX(subtable_bits, n); } subtable_bits = FFMIN(subtable_bits, table_nb_bits); - j = (flags & INIT_VLC_OUTPUT_LE) ? bitswap_32(code_prefix) >> (32 - table_nb_bits) : code_prefix; + j = (flags & VLC_INIT_OUTPUT_LE) ? bitswap_32(code_prefix) >> (32 - table_nb_bits) : code_prefix; table[j].len = -subtable_bits; ff_dlog(NULL, "%4x: n=%d (subtable)\n", j, codes[i].bits + table_nb_bits); @@ -230,9 +231,9 @@ static int vlc_common_end(VLC *vlc, int nb_bits, int nb_codes, VLCcode *codes, { int ret = build_table(vlc, nb_bits, nb_codes, codes, flags); - if (flags & INIT_VLC_USE_NEW_STATIC) { + if (flags & VLC_INIT_USE_STATIC) { if (vlc->table_size != vlc->table_allocated && - !(flags & (INIT_VLC_STATIC_OVERLONG & ~INIT_VLC_USE_NEW_STATIC))) + !(flags & (VLC_INIT_STATIC_OVERLONG & ~VLC_INIT_USE_STATIC))) av_log(NULL, AV_LOG_ERROR, "needed %d had %d\n", vlc->table_size, vlc->table_allocated); av_assert0(ret >= 0); } else { @@ -246,30 +247,7 @@ static int vlc_common_end(VLC *vlc, int nb_bits, int nb_codes, VLCcode *codes, return 0; } -/* Build VLC decoding tables suitable for use with get_vlc(). - - 'nb_bits' sets the decoding table size (2^nb_bits) entries. The - bigger it is, the faster is the decoding. But it should not be too - big to save memory and L1 cache. '9' is a good compromise. - - 'nb_codes' : number of vlcs codes - - 'bits' : table which gives the size (in bits) of each vlc code. - - 'codes' : table which gives the bit pattern of of each vlc code. - - 'symbols' : table which gives the values to be returned from get_vlc(). - - 'xxx_wrap' : give the number of bytes between each entry of the - 'bits' or 'codes' tables. - - 'xxx_size' : gives the number of bytes of each entry of the 'bits' - or 'codes' tables. Currently 1,2 and 4 are supported. - - 'wrap' and 'size' make it possible to use any memory configuration and types - (byte/word/long) to store the 'bits', 'codes', and 'symbols' tables. -*/ -int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, +int ff_vlc_init_sparse(VLC *vlc, int nb_bits, int nb_codes, const void *bits, int bits_wrap, int bits_size, const void *codes, int codes_wrap, int codes_size, const void *symbols, int symbols_wrap, int symbols_size, @@ -291,7 +269,7 @@ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, if (!(condition)) \ continue; \ if (len > 3*nb_bits || len > 32) { \ - av_log(NULL, AV_LOG_ERROR, "Too long VLC (%u) in init_vlc\n", len);\ + av_log(NULL, AV_LOG_ERROR, "Too long VLC (%u) in vlc_init\n", len);\ if (buf != localbuf) \ av_free(buf); \ return AVERROR(EINVAL); \ @@ -300,12 +278,12 @@ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, GET_DATA(buf[j].code, codes, i, codes_wrap, codes_size); \ if (buf[j].code >= (1LL< nb_bits); - // qsort is the slowest part of init_vlc, and could probably be improved or avoided + // qsort is the slowest part of vlc_init, and could probably be improved or avoided AV_QSORT(buf, j, struct VLCcode, compare_vlcspec); COPY(len && len <= nb_bits); nb_codes = j; @@ -325,7 +303,7 @@ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, flags, localbuf); } -int ff_init_vlc_from_lengths(VLC *vlc, int nb_bits, int nb_codes, +int ff_vlc_init_from_lengths(VLC *vlc, int nb_bits, int nb_codes, const int8_t *lens, int lens_wrap, const void *symbols, int symbols_wrap, int symbols_size, int offset, int flags, void *logctx) @@ -372,7 +350,153 @@ fail: return AVERROR_INVALIDDATA; } -void ff_free_vlc(VLC *vlc) +static void add_level(VLC_MULTI_ELEM *table, const int nb_elems, + const int num, const int numbits, + const VLCcode *buf, + uint32_t curcode, int curlen, + int curlimit, int curlevel, + const int minlen, const int max, + unsigned* levelcnt, VLC_MULTI_ELEM *info) +{ + if (nb_elems > 256 && curlevel > 2) + return; // No room + for (int i = num-1; i > max; i--) { + for (int j = 0; j < 2; j++) { + int newlimit, sym; + int t = j ? i-1 : i; + int l = buf[t].bits; + uint32_t code; + + sym = buf[t].symbol; + if (l >= curlimit) + return; + code = curcode + (buf[t].code >> curlen); + newlimit = curlimit - l; + l += curlen; + if (nb_elems>256) AV_WN16(info->val+2*curlevel, sym); + else info->val[curlevel] = sym&0xFF; + + if (curlevel) { // let's not add single entries + uint32_t val = code >> (32 - numbits); + uint32_t nb = val + (1U << (numbits - l)); + info->len = l; + info->num = curlevel+1; + for (; val < nb; val++) + AV_COPY64(table+val, info); + levelcnt[curlevel-1]++; + } + + if (curlevel+1 < VLC_MULTI_MAX_SYMBOLS && newlimit >= minlen) { + add_level(table, nb_elems, num, numbits, buf, + code, l, newlimit, curlevel+1, + minlen, max, levelcnt, info); + } + } + } +} + +static int vlc_multi_gen(VLC_MULTI_ELEM *table, const VLC *single, + const int nb_elems, const int nb_codes, const int numbits, + VLCcode *buf, void *logctx) +{ + int minbits, maxbits, max = nb_codes-1; + unsigned count[VLC_MULTI_MAX_SYMBOLS-1] = { 0, }; + VLC_MULTI_ELEM info = { { 0, }, 0, 0, }; + + minbits = buf[0].bits; + maxbits = buf[0].bits; + + for (int n = 1; n < nb_codes; n++) { + minbits = FFMIN(minbits, buf[n].bits); + maxbits = FFMAX(maxbits, buf[n].bits); + } + maxbits = FFMIN(maxbits, numbits); + + while (max >= nb_codes/2) { + if (buf[max].bits+minbits > maxbits) + break; + max--; + } + + for (int j = 0; j < 1<table[j].len; + table[j].num = single->table[j].len > 0 ? 1 : 0; + AV_WN16(table[j].val, single->table[j].sym); + } + + add_level(table, nb_elems, nb_codes, numbits, buf, + 0, 0, FFMIN(maxbits, numbits), 0, minbits, max, count, &info); + + av_log(logctx, AV_LOG_DEBUG, "Joint: %d/%d/%d/%d/%d codes min=%ubits max=%u\n", + count[0], count[1], count[2], count[3], count[4], minbits, max); + + return 0; +} + +int ff_vlc_init_multi_from_lengths(VLC *vlc, VLC_MULTI *multi, int nb_bits, int nb_elems, + int nb_codes, const int8_t *lens, int lens_wrap, + const void *symbols, int symbols_wrap, int symbols_size, + int offset, int flags, void *logctx) +{ + VLCcode localbuf[LOCALBUF_ELEMS], *buf = localbuf; + uint64_t code; + int ret, j, len_max = FFMIN(32, 3 * nb_bits); + + ret = vlc_common_init(vlc, nb_bits, nb_codes, &buf, flags); + if (ret < 0) + return ret; + + multi->table = av_malloc(sizeof(*multi->table) << nb_bits); + if (!multi->table) + return AVERROR(ENOMEM); + + j = code = 0; + for (int i = 0; i < nb_codes; i++, lens += lens_wrap) { + int len = *lens; + if (len > 0) { + unsigned sym; + + buf[j].bits = len; + if (symbols) + GET_DATA(sym, symbols, i, symbols_wrap, symbols_size) + else + sym = i; + buf[j].symbol = sym + offset; + buf[j++].code = code; + } else if (len < 0) { + len = -len; + } else + continue; + if (len > len_max || code & ((1U << (32 - len)) - 1)) { + av_log(logctx, AV_LOG_ERROR, "Invalid VLC (length %u)\n", len); + goto fail; + } + code += 1U << (32 - len); + if (code > UINT32_MAX + 1ULL) { + av_log(logctx, AV_LOG_ERROR, "Overdetermined VLC tree\n"); + goto fail; + } + } + ret = vlc_common_end(vlc, nb_bits, j, buf, flags, buf); + if (ret < 0) + goto fail; + ret = vlc_multi_gen(multi->table, vlc, nb_elems, j, nb_bits, buf, logctx); + if (buf != localbuf) + av_free(buf); + return ret; +fail: + if (buf != localbuf) + av_free(buf); + ff_vlc_free_multi(multi); + return AVERROR_INVALIDDATA; +} + +void ff_vlc_free_multi(VLC_MULTI *vlc) +{ + av_freep(&vlc->table); +} + +void ff_vlc_free(VLC *vlc) { av_freep(&vlc->table); } diff --git a/src/third_party/ffmpeg/libavcodec/vlc.h b/src/third_party/ffmpeg/libavcodec/vlc.h index e63c4847..3f7c033a 100644 --- a/src/third_party/ffmpeg/libavcodec/vlc.h +++ b/src/third_party/ffmpeg/libavcodec/vlc.h @@ -21,6 +21,8 @@ #include +#define VLC_MULTI_MAX_SYMBOLS 6 + // When changing this, be sure to also update tableprint_vlc.h accordingly. typedef int16_t VLCBaseType; @@ -34,22 +36,62 @@ typedef struct VLC { int table_size, table_allocated; } VLC; +typedef struct VLC_MULTI_ELEM { + uint8_t val[VLC_MULTI_MAX_SYMBOLS]; + int8_t len; // -31,32 + uint8_t num; +} VLC_MULTI_ELEM; + +typedef struct VLC_MULTI { + VLC_MULTI_ELEM *table; + int table_size, table_allocated; +} VLC_MULTI; + typedef struct RL_VLC_ELEM { int16_t level; int8_t len; uint8_t run; } RL_VLC_ELEM; -#define init_vlc(vlc, nb_bits, nb_codes, \ +#define vlc_init(vlc, nb_bits, nb_codes, \ bits, bits_wrap, bits_size, \ codes, codes_wrap, codes_size, \ flags) \ - ff_init_vlc_sparse(vlc, nb_bits, nb_codes, \ + ff_vlc_init_sparse(vlc, nb_bits, nb_codes, \ bits, bits_wrap, bits_size, \ codes, codes_wrap, codes_size, \ NULL, 0, 0, flags) -int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, +/** + * Build VLC decoding tables suitable for use with get_vlc2(). + * + * @param[in,out] vlc The VLC to be initialized; table and table_allocated + * must have been set when initializing a static VLC, + * otherwise this will be treated as uninitialized. + * @param[in] nb_bits The number of bits to use for the VLC table; + * higher values take up more memory and cache, but + * allow to read codes with fewer reads. + * Corresponds to the `bits` parameter of get_vlc2(). + * @param[in] nb_codes The number of provided bits, codes and (if supplied) + * symbol entries. + * @param[in] bits The lengths (in bits) of the codes. Entries > 0 + * correspond to valid codes; entries == 0 will be skipped. + * @param[in] bits_wrap Stride (in bytes) of the bits table. + * @param[in] codes_size Size of the bits. 1, 2 and 4 are supported. + * @param[in] codes Table which gives the bit pattern of of each vlc code. + * @param[in] codes_wrap Stride (in bytes) of the codes table. + * @param[in] codes_size Size of the codes. 1, 2 and 4 are supported. + * @param[in] symbols The symbols, i.e. what is returned from get_vlc2() + * when the corresponding code is encountered. + * May be NULL, then 0, 1, 2, 3, 4,... will be used. + * @param[in] symbols_wrap Stride (in bytes) of the symbols table. + * @param[in] symbols_size Size of the symbols. 1 and 2 are supported. + * @param[in] flags A combination of the VLC_INIT_* flags. + * + * 'wrap' and 'size' make it possible to use any memory configuration and types + * (byte/word/int) to store the 'bits', 'codes', and 'symbols' tables. + */ +int ff_vlc_init_sparse(VLC *vlc, int nb_bits, int nb_codes, const void *bits, int bits_wrap, int bits_size, const void *codes, int codes_wrap, int codes_size, const void *symbols, int symbols_wrap, int symbols_size, @@ -81,63 +123,103 @@ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, * @param[in] symbols_wrap Stride (in bytes) of the symbols. * @param[in] symbols_size Size of the symbols. 1 and 2 are supported. * @param[in] offset An offset to apply to all the valid symbols. - * @param[in] flags A combination of the INIT_VLC_* flags; notice that - * INIT_VLC_INPUT_LE is pointless and ignored. + * @param[in] flags A combination of the VLC_INIT_* flags; notice that + * VLC_INIT_INPUT_LE is pointless and ignored. */ -int ff_init_vlc_from_lengths(VLC *vlc, int nb_bits, int nb_codes, +int ff_vlc_init_from_lengths(VLC *vlc, int nb_bits, int nb_codes, const int8_t *lens, int lens_wrap, const void *symbols, int symbols_wrap, int symbols_size, int offset, int flags, void *logctx); -void ff_free_vlc(VLC *vlc); +/** + * Build VLC decoding tables suitable for use with get_vlc_multi() + * + * This function takes lengths and symbols and calculates the codes from them. + * For this the input lengths and symbols have to be sorted according to "left + * nodes in the corresponding tree first". + * + * @param[in,out] vlc The VLC to be initialized; table and table_allocated + * must have been set when initializing a static VLC, + * otherwise this will be treated as uninitialized. + * @param[in,out] multi The VLC_MULTI to be initialized; table and table_allocated + * must have been set when initializing a static VLC, + * otherwise this will be treated as uninitialized. + * @param[in] nb_bits The number of bits to use for the VLC table; + * higher values take up more memory and cache, but + * allow to read codes with fewer reads. + * @param[in] nb_elems The max possible number of elements. + * @param[in] nb_codes The number of provided length and (if supplied) symbol + * entries. + * @param[in] lens The lengths of the codes. Entries > 0 correspond to + * valid codes; entries == 0 will be skipped and entries + * with len < 0 indicate that the tree is incomplete and + * has an open end of length -len at this position. + * @param[in] lens_wrap Stride (in bytes) of the lengths. + * @param[in] symbols The symbols, i.e. what is returned from get_vlc2() + * when the corresponding code is encountered. + * May be NULL, then 0, 1, 2, 3, 4,... will be used. + * @param[in] symbols_wrap Stride (in bytes) of the symbols. + * @param[in] symbols_size Size of the symbols. 1 and 2 are supported. + * @param[in] offset An offset to apply to all the valid symbols. + * @param[in] flags A combination of the VLC_INIT_* flags; notice that + * VLC_INIT_INPUT_LE is pointless and ignored. + */ +int ff_vlc_init_multi_from_lengths(VLC *vlc, VLC_MULTI *multi, int nb_bits, int nb_elems, + int nb_codes, const int8_t *lens, int lens_wrap, + const void *symbols, int symbols_wrap, int symbols_size, + int offset, int flags, void *logctx); -/* If INIT_VLC_INPUT_LE is set, the LSB bit of the codes used to + +void ff_vlc_free_multi(VLC_MULTI *vlc); +void ff_vlc_free(VLC *vlc); + +#define VLC_INIT_USE_STATIC 1 +#define VLC_INIT_STATIC_OVERLONG (2 | VLC_INIT_USE_STATIC) +/* If VLC_INIT_INPUT_LE is set, the LSB bit of the codes used to * initialize the VLC table is the first bit to be read. */ -#define INIT_VLC_INPUT_LE 2 +#define VLC_INIT_INPUT_LE 4 /* If set the VLC is intended for a little endian bitstream reader. */ -#define INIT_VLC_OUTPUT_LE 8 -#define INIT_VLC_LE (INIT_VLC_INPUT_LE | INIT_VLC_OUTPUT_LE) -#define INIT_VLC_USE_NEW_STATIC 4 -#define INIT_VLC_STATIC_OVERLONG (1 | INIT_VLC_USE_NEW_STATIC) +#define VLC_INIT_OUTPUT_LE 8 +#define VLC_INIT_LE (VLC_INIT_INPUT_LE | VLC_INIT_OUTPUT_LE) -#define INIT_CUSTOM_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \ +#define VLC_INIT_CUSTOM_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \ h, i, j, flags, static_size) \ do { \ static VLCElem table[static_size]; \ (vlc)->table = table; \ (vlc)->table_allocated = static_size; \ - ff_init_vlc_sparse(vlc, bits, a, b, c, d, e, f, g, h, i, j, \ - flags | INIT_VLC_USE_NEW_STATIC); \ + ff_vlc_init_sparse(vlc, bits, a, b, c, d, e, f, g, h, i, j, \ + flags | VLC_INIT_USE_STATIC); \ } while (0) -#define INIT_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, h, i, j, static_size) \ - INIT_CUSTOM_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \ +#define VLC_INIT_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, h, i, j, static_size) \ + VLC_INIT_CUSTOM_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \ h, i, j, 0, static_size) -#define INIT_LE_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, h, i, j, static_size) \ - INIT_CUSTOM_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \ - h, i, j, INIT_VLC_LE, static_size) +#define VLC_INIT_LE_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, h, i, j, static_size) \ + VLC_INIT_CUSTOM_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \ + h, i, j, VLC_INIT_LE, static_size) -#define INIT_CUSTOM_VLC_STATIC(vlc, bits, a, b, c, d, e, f, g, flags, static_size) \ - INIT_CUSTOM_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \ +#define VLC_INIT_CUSTOM_STATIC(vlc, bits, a, b, c, d, e, f, g, flags, static_size) \ + VLC_INIT_CUSTOM_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \ NULL, 0, 0, flags, static_size) -#define INIT_VLC_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size) \ - INIT_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, NULL, 0, 0, static_size) +#define VLC_INIT_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size) \ + VLC_INIT_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, NULL, 0, 0, static_size) -#define INIT_LE_VLC_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size) \ - INIT_LE_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, NULL, 0, 0, static_size) +#define VLC_INIT_LE_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size) \ + VLC_INIT_LE_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, NULL, 0, 0, static_size) -#define INIT_VLC_STATIC_FROM_LENGTHS(vlc, bits, nb_codes, lens, len_wrap, \ +#define VLC_INIT_STATIC_FROM_LENGTHS(vlc, bits, nb_codes, lens, len_wrap, \ symbols, symbols_wrap, symbols_size, \ offset, flags, static_size) \ do { \ static VLCElem table[static_size]; \ (vlc)->table = table; \ (vlc)->table_allocated = static_size; \ - ff_init_vlc_from_lengths(vlc, bits, nb_codes, lens, len_wrap, \ + ff_vlc_init_from_lengths(vlc, bits, nb_codes, lens, len_wrap, \ symbols, symbols_wrap, symbols_size, \ - offset, flags | INIT_VLC_USE_NEW_STATIC, \ + offset, flags | VLC_INIT_USE_STATIC, \ NULL); \ } while (0) diff --git a/src/third_party/ffmpeg/libavcodec/vmdvideo.c b/src/third_party/ffmpeg/libavcodec/vmdvideo.c index 226ae0d3..2da8af31 100644 --- a/src/third_party/ffmpeg/libavcodec/vmdvideo.c +++ b/src/third_party/ffmpeg/libavcodec/vmdvideo.c @@ -454,8 +454,7 @@ static int vmdvideo_decode_frame(AVCodecContext *avctx, AVFrame *frame, memcpy(frame->data[1], s->palette, PALETTE_COUNT * 4); /* shuffle frames */ - av_frame_unref(s->prev_frame); - if ((ret = av_frame_ref(s->prev_frame, frame)) < 0) + if ((ret = av_frame_replace(s->prev_frame, frame)) < 0) return ret; *got_frame = 1; diff --git a/src/third_party/ffmpeg/libavcodec/vmixdec.c b/src/third_party/ffmpeg/libavcodec/vmixdec.c index d0f2219a..d6b6e355 100644 --- a/src/third_party/ffmpeg/libavcodec/vmixdec.c +++ b/src/third_party/ffmpeg/libavcodec/vmixdec.c @@ -23,7 +23,6 @@ #include #include -#include "libavutil/avassert.h" #include "libavutil/intreadwrite.h" #include "libavutil/mem_internal.h" @@ -45,18 +44,28 @@ typedef struct SliceContext { typedef struct VMIXContext { int nb_slices; + int lshift; int16_t factors[64]; uint8_t scan[64]; - SliceContext slices[255]; + SliceContext *slices; + unsigned int slices_size; IDCTDSPContext idsp; } VMIXContext; -static const uint8_t quality[25] = { - 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, - 18, 20, 22, 24, 28, 32, 36, 40, 44, 48, 52, 56, 64, +static const uint8_t quality[] = { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1,64,63,62,61, + 60,59,58,57,56,55,54,53,52,51, + 50,49,48,47,46,45,44,43,42,41, + 40,39,38,37,36,35,34,33,32,31, + 30,29,28,27,26,25,24,23,22,21, + 20,19,18,17,16,15,14,13,12,11, + 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, }; static const uint8_t quant[64] = { @@ -107,6 +116,7 @@ static int decode_dcac(AVCodecContext *avctx, const uint8_t *scan = s->scan; const int add = plane ? 0 : 1024; int i, dc_v = 0, ac_v = 0, dc = 0; + const int lshift = s->lshift; for (int y = 0; y < 2; y++) { for (int x = 0; x < width; x += 8) { @@ -115,8 +125,10 @@ static int decode_dcac(AVCodecContext *avctx, if (dc_run > 0) { dc_run--; } else { + if (get_bits_left(dc_gb) < 1) + return AVERROR_INVALIDDATA; dc_v = get_se_golomb_vmix(dc_gb); - dc += dc_v; + dc += (unsigned)dc_v; if (!dc_v) dc_run = get_ue_golomb_long(dc_gb); } @@ -127,14 +139,16 @@ static int decode_dcac(AVCodecContext *avctx, continue; } + if (get_bits_left(ac_gb) < 1) + return AVERROR_INVALIDDATA; ac_v = get_se_golomb_vmix(ac_gb); i = scan[n]; - block[i] = (ac_v * factors[i]) >> 4; + block[i] = ((unsigned)ac_v * factors[i]) >> 4; if (!ac_v) ac_run = get_ue_golomb_long(ac_gb); } - block[0] = ((dc + add) * 16) >> 4; + block[0] = ((unsigned)dc << lshift) + (unsigned)add; s->idsp.idct_put(dst + x, linesize, block); } @@ -208,22 +222,27 @@ static int decode_frame(AVCodecContext *avctx, AVPacket *avpkt) { VMIXContext *s = avctx->priv_data; - unsigned offset = 3, q; + unsigned offset, q; int ret; if (avpkt->size <= 7) return AVERROR_INVALIDDATA; - if (avpkt->data[0] != 0x01) + s->lshift = 0; + offset = 2 + avpkt->data[0]; + if (offset == 5) + s->lshift = avpkt->data[1]; + else if (offset != 3) return AVERROR_INVALIDDATA; - q = av_clip(99 - av_clip(avpkt->data[1], 0, 99), 0, FF_ARRAY_ELEMS(quality) - 1); + q = quality[FFMIN(avpkt->data[offset - 2], FF_ARRAY_ELEMS(quality)-1)]; for (int n = 0; n < 64; n++) - s->factors[n] = quant[n] * quality[q]; + s->factors[n] = quant[n] * q; - s->nb_slices = avpkt->data[2]; - if (!s->nb_slices || s->nb_slices > (avctx->height + 15) / 16) - return AVERROR_INVALIDDATA; + s->nb_slices = (avctx->height + 15) / 16; + av_fast_mallocz(&s->slices, &s->slices_size, s->nb_slices * sizeof(*s->slices)); + if (!s->slices) + return AVERROR(ENOMEM); for (int n = 0; n < s->nb_slices; n++) { unsigned slice_size; @@ -275,6 +294,13 @@ static int decode_frame(AVCodecContext *avctx, return avpkt->size; } +static av_cold int decode_end(AVCodecContext *avctx) +{ + VMIXContext *s = avctx->priv_data; + av_freep(&s->slices); + return 0; +} + const FFCodec ff_vmix_decoder = { .p.name = "vmix", CODEC_LONG_NAME("vMix Video"), @@ -282,6 +308,7 @@ const FFCodec ff_vmix_decoder = { .p.id = AV_CODEC_ID_VMIX, .priv_data_size = sizeof(VMIXContext), .init = decode_init, + .close = decode_end, FF_CODEC_DECODE_CB(decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS, diff --git a/src/third_party/ffmpeg/libavcodec/vorbis.c b/src/third_party/ffmpeg/libavcodec/vorbis.c index d0b660b4..3d859975 100644 --- a/src/third_party/ffmpeg/libavcodec/vorbis.c +++ b/src/third_party/ffmpeg/libavcodec/vorbis.c @@ -27,8 +27,10 @@ */ #include "libavutil/common.h" +#include "libavutil/error.h" +#include "libavutil/log.h" +#include "libavutil/macros.h" -#include "avcodec.h" #include "vorbis.h" #include "vorbis_data.h" @@ -104,7 +106,7 @@ int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num) return 0; } -int ff_vorbis_ready_floor1_list(AVCodecContext *avctx, +int ff_vorbis_ready_floor1_list(void *logctx, vorbis_floor1_entry *list, int values) { int i; @@ -130,7 +132,7 @@ int ff_vorbis_ready_floor1_list(AVCodecContext *avctx, int j; for (j = i + 1; j < values; j++) { if (list[i].x == list[j].x) { - av_log(avctx, AV_LOG_ERROR, + av_log(logctx, AV_LOG_ERROR, "Duplicate value found in floor 1 X coordinates\n"); return AVERROR_INVALIDDATA; } diff --git a/src/third_party/ffmpeg/libavcodec/vorbis.h b/src/third_party/ffmpeg/libavcodec/vorbis.h index aa1ec571..7190465f 100644 --- a/src/third_party/ffmpeg/libavcodec/vorbis.h +++ b/src/third_party/ffmpeg/libavcodec/vorbis.h @@ -23,8 +23,6 @@ #include -#include "avcodec.h" - typedef struct vorbis_floor1_entry { uint16_t x; uint16_t sort; @@ -32,7 +30,7 @@ typedef struct vorbis_floor1_entry { uint16_t high; } vorbis_floor1_entry; -int ff_vorbis_ready_floor1_list(AVCodecContext *avctx, +int ff_vorbis_ready_floor1_list(void *logctx, vorbis_floor1_entry *list, int values); unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n); // x^(1/n) int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num); diff --git a/src/third_party/ffmpeg/libavcodec/vorbisdec.c b/src/third_party/ffmpeg/libavcodec/vorbisdec.c index 1d2a0997..faeaeadd 100644 --- a/src/third_party/ffmpeg/libavcodec/vorbisdec.c +++ b/src/third_party/ffmpeg/libavcodec/vorbisdec.c @@ -210,7 +210,7 @@ static void vorbis_free(vorbis_context *vc) if (vc->codebooks) for (i = 0; i < vc->codebook_count; ++i) { av_freep(&vc->codebooks[i].codevectors); - ff_free_vlc(&vc->codebooks[i].vlc); + ff_vlc_free(&vc->codebooks[i].vlc); } av_freep(&vc->codebooks); @@ -454,11 +454,11 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc) codebook_setup->maxdepth = (codebook_setup->maxdepth+codebook_setup->nb_bits - 1) / codebook_setup->nb_bits; - if ((ret = init_vlc(&codebook_setup->vlc, codebook_setup->nb_bits, + if ((ret = vlc_init(&codebook_setup->vlc, codebook_setup->nb_bits, entries, tmp_vlc_bits, sizeof(*tmp_vlc_bits), sizeof(*tmp_vlc_bits), tmp_vlc_codes, sizeof(*tmp_vlc_codes), sizeof(*tmp_vlc_codes), - INIT_VLC_LE))) { + VLC_INIT_LE))) { av_log(vc->avctx, AV_LOG_ERROR, " Error generating vlc tables. \n"); goto error; } diff --git a/src/third_party/ffmpeg/libavcodec/vp3.c b/src/third_party/ffmpeg/libavcodec/vp3.c index 9e097c89..98dabfc9 100644 --- a/src/third_party/ffmpeg/libavcodec/vp3.c +++ b/src/third_party/ffmpeg/libavcodec/vp3.c @@ -35,6 +35,7 @@ #include #include +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/mem_internal.h" @@ -346,7 +347,6 @@ static void vp3_decode_flush(AVCodecContext *avctx) static av_cold int vp3_decode_end(AVCodecContext *avctx) { Vp3DecodeContext *s = avctx->priv_data; - int i, j; free_tables(avctx); av_freep(&s->edge_emu_buffer); @@ -359,20 +359,20 @@ static av_cold int vp3_decode_end(AVCodecContext *avctx) av_frame_free(&s->last_frame.f); av_frame_free(&s->golden_frame.f); - for (i = 0; i < FF_ARRAY_ELEMS(s->coeff_vlc); i++) - ff_free_vlc(&s->coeff_vlc[i]); + for (int i = 0; i < FF_ARRAY_ELEMS(s->coeff_vlc); i++) + ff_vlc_free(&s->coeff_vlc[i]); - ff_free_vlc(&s->superblock_run_length_vlc); - ff_free_vlc(&s->fragment_run_length_vlc); - ff_free_vlc(&s->mode_code_vlc); - ff_free_vlc(&s->motion_vector_vlc); + ff_vlc_free(&s->superblock_run_length_vlc); + ff_vlc_free(&s->fragment_run_length_vlc); + ff_vlc_free(&s->mode_code_vlc); + ff_vlc_free(&s->motion_vector_vlc); - for (j = 0; j < 2; j++) - for (i = 0; i < 7; i++) - ff_free_vlc(&s->vp4_mv_vlc[j][i]); + for (int j = 0; j < 2; j++) + for (int i = 0; i < 7; i++) + ff_vlc_free(&s->vp4_mv_vlc[j][i]); - for (i = 0; i < 2; i++) - ff_free_vlc(&s->block_pattern_vlc[i]); + for (int i = 0; i < 2; i++) + ff_vlc_free(&s->block_pattern_vlc[i]); return 0; } @@ -385,10 +385,9 @@ static av_cold int vp3_decode_end(AVCodecContext *avctx) */ static int init_block_mapping(Vp3DecodeContext *s) { - int sb_x, sb_y, plane; - int x, y, i, j = 0; + int j = 0; - for (plane = 0; plane < 3; plane++) { + for (int plane = 0; plane < 3; plane++) { int sb_width = plane ? s->c_superblock_width : s->y_superblock_width; int sb_height = plane ? s->c_superblock_height @@ -396,11 +395,11 @@ static int init_block_mapping(Vp3DecodeContext *s) int frag_width = s->fragment_width[!!plane]; int frag_height = s->fragment_height[!!plane]; - for (sb_y = 0; sb_y < sb_height; sb_y++) - for (sb_x = 0; sb_x < sb_width; sb_x++) - for (i = 0; i < 16; i++) { - x = 4 * sb_x + hilbert_offset[i][0]; - y = 4 * sb_y + hilbert_offset[i][1]; + for (int sb_y = 0; sb_y < sb_height; sb_y++) + for (int sb_x = 0; sb_x < sb_width; sb_x++) + for (int i = 0; i < 16; i++) { + int x = 4 * sb_x + hilbert_offset[i][0]; + int y = 4 * sb_y + hilbert_offset[i][1]; if (x < frag_width && y < frag_height) s->superblock_fragments[j++] = s->fragment_start[plane] + @@ -420,12 +419,11 @@ static int init_block_mapping(Vp3DecodeContext *s) static void init_dequantizer(Vp3DecodeContext *s, int qpi) { int ac_scale_factor = s->coded_ac_scale_factor[s->qps[qpi]]; - int i, plane, inter, qri, bmi, bmj, qistart; - for (inter = 0; inter < 2; inter++) { - for (plane = 0; plane < 3; plane++) { + for (int inter = 0; inter < 2; inter++) { + for (int plane = 0; plane < 3; plane++) { int dc_scale_factor = s->coded_dc_scale_factor[!!plane][s->qps[qpi]]; - int sum = 0; + int sum = 0, bmi, bmj, qistart, qri; for (qri = 0; qri < s->qr_count[inter][plane]; qri++) { sum += s->qr_size[inter][plane][qri]; if (s->qps[qpi] <= sum) @@ -434,7 +432,7 @@ static void init_dequantizer(Vp3DecodeContext *s, int qpi) qistart = sum - s->qr_size[inter][plane][qri]; bmi = s->qr_base[inter][plane][qri]; bmj = s->qr_base[inter][plane][qri + 1]; - for (i = 0; i < 64; i++) { + for (int i = 0; i < 64; i++) { int coeff = (2 * (sum - s->qps[qpi]) * s->base_matrix[bmi][i] - 2 * (qistart - s->qps[qpi]) * s->base_matrix[bmj][i] + s->qr_size[inter][plane][qri]) / @@ -471,7 +469,7 @@ static void init_loop_filter(Vp3DecodeContext *s) */ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) { - int superblock_starts[3] = { + const int superblock_starts[3] = { 0, s->u_superblock_start, s->v_superblock_start }; int bit = 0; @@ -479,9 +477,7 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) int current_run = 0; int num_partial_superblocks = 0; - int i, j; int current_fragment; - int plane; int plane0_num_coded_frags = 0; if (s->keyframe) { @@ -536,7 +532,7 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) if (current_run == 34) current_run += get_bits(gb, 12); - for (j = 0; j < current_run; current_superblock++) { + for (int j = 0; j < current_run; current_superblock++) { if (current_superblock >= s->superblock_count) { av_log(s->avctx, AV_LOG_ERROR, "Invalid fully coded superblock run length\n"); @@ -572,7 +568,7 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) s->coded_fragment_list[0] = s->keyframe ? s->kf_coded_fragment_list : s->nkf_coded_fragment_list; - for (plane = 0; plane < 3; plane++) { + for (int plane = 0; plane < 3; plane++) { int sb_start = superblock_starts[plane]; int sb_end = sb_start + (plane ? s->c_superblock_count : s->y_superblock_count); @@ -580,9 +576,9 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) if (s->keyframe) { if (s->num_kf_coded_fragment[plane] == -1) { - for (i = sb_start; i < sb_end; i++) { + for (int i = sb_start; i < sb_end; i++) { /* iterate through all 16 fragments in a superblock */ - for (j = 0; j < 16; j++) { + for (int j = 0; j < 16; j++) { /* if the fragment is in bounds, check its coding status */ current_fragment = s->superblock_fragments[i * 16 + j]; if (current_fragment != -1) { @@ -595,12 +591,12 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) } else num_coded_frags = s->num_kf_coded_fragment[plane]; } else { - for (i = sb_start; i < sb_end && get_bits_left(gb) > 0; i++) { + for (int i = sb_start; i < sb_end && get_bits_left(gb) > 0; i++) { if (get_bits_left(gb) < plane0_num_coded_frags >> 2) { return AVERROR_INVALIDDATA; } /* iterate through all 16 fragments in a superblock */ - for (j = 0; j < 16; j++) { + for (int j = 0; j < 16; j++) { /* if the fragment is in bounds, check its coding status */ current_fragment = s->superblock_fragments[i * 16 + j]; if (current_fragment != -1) { @@ -635,7 +631,7 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) if (!plane) plane0_num_coded_frags = num_coded_frags; s->total_num_coded_frags += num_coded_frags; - for (i = 0; i < 64; i++) + for (int i = 0; i < 64; i++) s->num_coded_frags[plane][i] = num_coded_frags; if (plane < 2) s->coded_fragment_list[plane + 1] = s->coded_fragment_list[plane] + @@ -697,7 +693,7 @@ static int vp4_get_block_pattern(Vp3DecodeContext *s, GetBitContext *gb, int *ne static int vp4_unpack_macroblocks(Vp3DecodeContext *s, GetBitContext *gb) { - int plane, i, j, k, fragment; + int fragment; int next_block_pattern_table; int bit, current_run, has_partial; @@ -708,7 +704,7 @@ static int vp4_unpack_macroblocks(Vp3DecodeContext *s, GetBitContext *gb) has_partial = 0; bit = get_bits1(gb); - for (i = 0; i < s->yuv_macroblock_count; i += current_run) { + for (int i = 0; i < s->yuv_macroblock_count; i += current_run) { if (get_bits_left(gb) <= 0) return AVERROR_INVALIDDATA; current_run = vp4_get_mb_count(s, gb); @@ -724,7 +720,7 @@ static int vp4_unpack_macroblocks(Vp3DecodeContext *s, GetBitContext *gb) return AVERROR_INVALIDDATA; bit = get_bits1(gb); current_run = vp4_get_mb_count(s, gb); - for (i = 0; i < s->yuv_macroblock_count; i++) { + for (int i = 0; i < s->yuv_macroblock_count; i++) { if (!s->superblock_coding[i]) { if (!current_run) { bit ^= 1; @@ -739,9 +735,7 @@ static int vp4_unpack_macroblocks(Vp3DecodeContext *s, GetBitContext *gb) } next_block_pattern_table = 0; - i = 0; - for (plane = 0; plane < 3; plane++) { - int sb_x, sb_y; + for (int plane = 0, i = 0; plane < 3; plane++) { int sb_width = plane ? s->c_superblock_width : s->y_superblock_width; int sb_height = plane ? s->c_superblock_height : s->y_superblock_height; int mb_width = plane ? s->c_macroblock_width : s->macroblock_width; @@ -749,9 +743,9 @@ static int vp4_unpack_macroblocks(Vp3DecodeContext *s, GetBitContext *gb) int fragment_width = s->fragment_width[!!plane]; int fragment_height = s->fragment_height[!!plane]; - for (sb_y = 0; sb_y < sb_height; sb_y++) { - for (sb_x = 0; sb_x < sb_width; sb_x++) { - for (j = 0; j < 4; j++) { + for (int sb_y = 0; sb_y < sb_height; sb_y++) { + for (int sb_x = 0; sb_x < sb_width; sb_x++) { + for (int j = 0; j < 4; j++) { int mb_x = 2 * sb_x + (j >> 1); int mb_y = 2 * sb_y + (j >> 1) ^ (j & 1); int mb_coded, pattern, coded; @@ -768,7 +762,7 @@ static int vp4_unpack_macroblocks(Vp3DecodeContext *s, GetBitContext *gb) else pattern = 0; - for (k = 0; k < 4; k++) { + for (int k = 0; k < 4; k++) { if (BLOCK_X >= fragment_width || BLOCK_Y >= fragment_height) continue; fragment = s->fragment_start[plane] + BLOCK_Y * fragment_width + BLOCK_X; @@ -791,7 +785,6 @@ static int vp4_unpack_macroblocks(Vp3DecodeContext *s, GetBitContext *gb) */ static int unpack_modes(Vp3DecodeContext *s, GetBitContext *gb) { - int i, j, k, sb_x, sb_y; int scheme; int current_macroblock; int current_fragment; @@ -801,7 +794,7 @@ static int unpack_modes(Vp3DecodeContext *s, GetBitContext *gb) Vp3Fragment *frag; if (s->keyframe) { - for (i = 0; i < s->fragment_count; i++) + for (int i = 0; i < s->fragment_count; i++) s->all_fragments[i].coding_method = MODE_INTRA; } else { /* fetch the mode coding scheme for this frame */ @@ -809,9 +802,9 @@ static int unpack_modes(Vp3DecodeContext *s, GetBitContext *gb) /* is it a custom coding scheme? */ if (scheme == 0) { - for (i = 0; i < 8; i++) + for (int i = 0; i < 8; i++) custom_mode_alphabet[i] = MODE_INTER_NO_MV; - for (i = 0; i < 8; i++) + for (int i = 0; i < 8; i++) custom_mode_alphabet[get_bits(gb, 3)] = i; alphabet = custom_mode_alphabet; } else @@ -819,12 +812,13 @@ static int unpack_modes(Vp3DecodeContext *s, GetBitContext *gb) /* iterate through all of the macroblocks that contain 1 or more * coded fragments */ - for (sb_y = 0; sb_y < s->y_superblock_height; sb_y++) { - for (sb_x = 0; sb_x < s->y_superblock_width; sb_x++) { + for (int sb_y = 0; sb_y < s->y_superblock_height; sb_y++) { + for (int sb_x = 0; sb_x < s->y_superblock_width; sb_x++) { if (get_bits_left(gb) <= 0) return -1; - for (j = 0; j < 4; j++) { + for (int j = 0; j < 4; j++) { + int k; int mb_x = 2 * sb_x + (j >> 1); int mb_y = 2 * sb_y + (((j >> 1) + j) & 1); current_macroblock = mb_y * s->macroblock_width + mb_x; @@ -905,7 +899,6 @@ static int vp4_get_mv(Vp3DecodeContext *s, GetBitContext *gb, int axis, int last */ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb) { - int j, k, sb_x, sb_y; int coding_mode; int motion_x[4]; int motion_y[4]; @@ -927,12 +920,12 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb) /* iterate through all of the macroblocks that contain 1 or more * coded fragments */ - for (sb_y = 0; sb_y < s->y_superblock_height; sb_y++) { - for (sb_x = 0; sb_x < s->y_superblock_width; sb_x++) { + for (int sb_y = 0; sb_y < s->y_superblock_height; sb_y++) { + for (int sb_x = 0; sb_x < s->y_superblock_width; sb_x++) { if (get_bits_left(gb) <= 0) return -1; - for (j = 0; j < 4; j++) { + for (int j = 0; j < 4; j++) { int mb_x = 2 * sb_x + (j >> 1); int mb_y = 2 * sb_y + (((j >> 1) + j) & 1); current_macroblock = mb_y * s->macroblock_width + mb_x; @@ -980,7 +973,7 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb) /* fetch 4 vectors from the bitstream, one for each * Y fragment, then average for the C fragment vectors */ - for (k = 0; k < 4; k++) { + for (int k = 0; k < 4; k++) { current_fragment = BLOCK_Y * s->fragment_width[0] + BLOCK_X; if (s->all_fragments[current_fragment].coding_method != MODE_COPY) { if (coding_mode == 0) { @@ -1036,7 +1029,7 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb) } /* assign the motion vectors to the correct fragments */ - for (k = 0; k < 4; k++) { + for (int k = 0; k < 4; k++) { current_fragment = BLOCK_Y * s->fragment_width[0] + BLOCK_X; if (s->macroblock_coding[current_macroblock] == MODE_INTER_FOURMV) { @@ -1077,13 +1070,13 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb) motion_x[1] = (motion_x[1] >> 1) | (motion_x[1] & 1); } frag = 2 * mb_y * s->fragment_width[1] + mb_x; - for (k = 0; k < 2; k++) { + for (int k = 0; k < 2; k++) { s->motion_val[1][frag][0] = motion_x[k]; s->motion_val[1][frag][1] = motion_y[k]; frag += s->fragment_width[1]; } } else { - for (k = 0; k < 4; k++) { + for (int k = 0; k < 4; k++) { frag = BLOCK_Y * s->fragment_width[1] + BLOCK_X; if (s->macroblock_coding[current_macroblock] == MODE_INTER_FOURMV) { s->motion_val[1][frag][0] = motion_x[k]; @@ -1103,11 +1096,11 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb) static int unpack_block_qpis(Vp3DecodeContext *s, GetBitContext *gb) { - int qpi, i, j, bit, run_length, blocks_decoded, num_blocks_at_qpi; int num_blocks = s->total_num_coded_frags; - for (qpi = 0; qpi < s->nqps - 1 && num_blocks > 0; qpi++) { - i = blocks_decoded = num_blocks_at_qpi = 0; + for (int qpi = 0; qpi < s->nqps - 1 && num_blocks > 0; qpi++) { + int i = 0, blocks_decoded = 0, num_blocks_at_qpi = 0; + int bit, run_length; bit = get_bits1(gb) ^ 1; run_length = 0; @@ -1127,7 +1120,7 @@ static int unpack_block_qpis(Vp3DecodeContext *s, GetBitContext *gb) if (!bit) num_blocks_at_qpi += run_length; - for (j = 0; j < run_length; i++) { + for (int j = 0; j < run_length; i++) { if (i >= s->total_num_coded_frags) return -1; @@ -1181,11 +1174,11 @@ static inline int get_coeff(GetBitContext *gb, int token, int16_t *coeff) * be passed into the next call to this same function. */ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb, - VLC *table, int coeff_index, + const VLC *table, int coeff_index, int plane, int eob_run) { - int i, j = 0; + int j = 0; int token; int zero_run = 0; int16_t coeff = 0; @@ -1195,7 +1188,7 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb, int16_t *dct_tokens = s->dct_tokens[plane][coeff_index]; /* local references to structure members to avoid repeated dereferences */ - int *coded_fragment_list = s->coded_fragment_list[plane]; + const int *coded_fragment_list = s->coded_fragment_list[plane]; Vp3Fragment *all_fragments = s->all_fragments; const VLCElem *vlc_table = table->table; @@ -1266,7 +1259,7 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb, // zero runs code multiple coefficients, // so don't try to decode coeffs for those higher levels - for (i = coeff_index + 1; i <= coeff_index + zero_run; i++) + for (int i = coeff_index + 1; i <= coeff_index + zero_run; i++) s->num_coded_frags[plane][i]--; coeff_i++; } else { @@ -1281,7 +1274,7 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb, // decrement the number of blocks that have higher coefficients for each // EOB run at this level if (blocks_ended) - for (i = coeff_index + 1; i < 64; i++) + for (int i = coeff_index + 1; i < 64; i++) s->num_coded_frags[plane][i] -= blocks_ended; // setup the next buffer @@ -1303,7 +1296,6 @@ static void reverse_dc_prediction(Vp3DecodeContext *s, */ static int unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb) { - int i; int dc_y_table; int dc_c_table; int ac_y_table; @@ -1357,29 +1349,29 @@ static int unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb) ac_c_table = get_bits(gb, 4); /* build tables of AC VLC tables */ - for (i = 1; i <= 5; i++) { + for (int i = 1; i <= 5; i++) { /* AC VLC table group 1 */ y_tables[i] = &s->coeff_vlc[ac_y_table + 16]; c_tables[i] = &s->coeff_vlc[ac_c_table + 16]; } - for (i = 6; i <= 14; i++) { + for (int i = 6; i <= 14; i++) { /* AC VLC table group 2 */ y_tables[i] = &s->coeff_vlc[ac_y_table + 32]; c_tables[i] = &s->coeff_vlc[ac_c_table + 32]; } - for (i = 15; i <= 27; i++) { + for (int i = 15; i <= 27; i++) { /* AC VLC table group 3 */ y_tables[i] = &s->coeff_vlc[ac_y_table + 48]; c_tables[i] = &s->coeff_vlc[ac_c_table + 48]; } - for (i = 28; i <= 63; i++) { + for (int i = 28; i <= 63; i++) { /* AC VLC table group 4 */ y_tables[i] = &s->coeff_vlc[ac_y_table + 64]; c_tables[i] = &s->coeff_vlc[ac_c_table + 64]; } /* decode all AC coefficients */ - for (i = 1; i <= 63; i++) { + for (int i = 1; i <= 63; i++) { residual_eob_run = unpack_vlcs(s, gb, y_tables[i], i, 0, residual_eob_run); if (residual_eob_run < 0) @@ -1406,7 +1398,7 @@ static int unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb) * @return < 0 on error */ static int vp4_unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb, - VLC *vlc_tables[64], + const VLC *vlc_tables[64], int plane, int eob_tracker[64], int fragment) { int token; @@ -1466,24 +1458,20 @@ static void vp4_dc_predictor_reset(VP4Predictor *p) static void vp4_dc_pred_before(const Vp3DecodeContext *s, VP4Predictor dc_pred[6][6], int sb_x) { - int i, j; - - for (i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) dc_pred[0][i + 1] = s->dc_pred_row[sb_x * 4 + i]; - for (j = 1; j < 5; j++) - for (i = 0; i < 4; i++) + for (int j = 1; j < 5; j++) + for (int i = 0; i < 4; i++) vp4_dc_predictor_reset(&dc_pred[j][i + 1]); } static void vp4_dc_pred_after(Vp3DecodeContext *s, VP4Predictor dc_pred[6][6], int sb_x) { - int i; - - for (i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) s->dc_pred_row[sb_x * 4 + i] = dc_pred[4][i + 1]; - for (i = 1; i < 5; i++) + for (int i = 1; i < 5; i++) dc_pred[i][0] = dc_pred[i][4]; } @@ -1519,10 +1507,9 @@ static int vp4_dc_pred(const Vp3DecodeContext *s, const VP4Predictor * dc_pred, static void vp4_set_tokens_base(Vp3DecodeContext *s) { - int plane, i; int16_t *base = s->dct_tokens_base; - for (plane = 0; plane < 3; plane++) { - for (i = 0; i < 64; i++) { + for (int plane = 0; plane < 3; plane++) { + for (int i = 0; i < 64; i++) { s->dct_tokens[plane][i] = base; base += s->fragment_width[!!plane] * s->fragment_height[!!plane]; } @@ -1531,13 +1518,11 @@ static void vp4_set_tokens_base(Vp3DecodeContext *s) static int vp4_unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb) { - int i, j; int dc_y_table; int dc_c_table; int ac_y_table; int ac_c_table; - VLC *tables[2][64]; - int plane, sb_y, sb_x; + const VLC *tables[2][64]; int eob_tracker[64]; VP4Predictor dc_pred[6][6]; int last_dc[NB_VP4_DC_TYPES]; @@ -1557,22 +1542,22 @@ static int vp4_unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb) /* DC table group */ tables[0][0] = &s->coeff_vlc[dc_y_table]; tables[1][0] = &s->coeff_vlc[dc_c_table]; - for (i = 1; i <= 5; i++) { + for (int i = 1; i <= 5; i++) { /* AC VLC table group 1 */ tables[0][i] = &s->coeff_vlc[ac_y_table + 16]; tables[1][i] = &s->coeff_vlc[ac_c_table + 16]; } - for (i = 6; i <= 14; i++) { + for (int i = 6; i <= 14; i++) { /* AC VLC table group 2 */ tables[0][i] = &s->coeff_vlc[ac_y_table + 32]; tables[1][i] = &s->coeff_vlc[ac_c_table + 32]; } - for (i = 15; i <= 27; i++) { + for (int i = 15; i <= 27; i++) { /* AC VLC table group 3 */ tables[0][i] = &s->coeff_vlc[ac_y_table + 48]; tables[1][i] = &s->coeff_vlc[ac_c_table + 48]; } - for (i = 28; i <= 63; i++) { + for (int i = 28; i <= 63; i++) { /* AC VLC table group 4 */ tables[0][i] = &s->coeff_vlc[ac_y_table + 64]; tables[1][i] = &s->coeff_vlc[ac_c_table + 64]; @@ -1582,21 +1567,21 @@ static int vp4_unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb) memset(last_dc, 0, sizeof(last_dc)); - for (plane = 0; plane < ((s->avctx->flags & AV_CODEC_FLAG_GRAY) ? 1 : 3); plane++) { + for (int plane = 0; plane < ((s->avctx->flags & AV_CODEC_FLAG_GRAY) ? 1 : 3); plane++) { memset(eob_tracker, 0, sizeof(eob_tracker)); /* initialise dc prediction */ - for (i = 0; i < s->fragment_width[!!plane]; i++) + for (int i = 0; i < s->fragment_width[!!plane]; i++) vp4_dc_predictor_reset(&s->dc_pred_row[i]); - for (j = 0; j < 6; j++) - for (i = 0; i < 6; i++) + for (int j = 0; j < 6; j++) + for (int i = 0; i < 6; i++) vp4_dc_predictor_reset(&dc_pred[j][i]); - for (sb_y = 0; sb_y * 4 < s->fragment_height[!!plane]; sb_y++) { - for (sb_x = 0; sb_x *4 < s->fragment_width[!!plane]; sb_x++) { + for (int sb_y = 0; sb_y * 4 < s->fragment_height[!!plane]; sb_y++) { + for (int sb_x = 0; sb_x *4 < s->fragment_width[!!plane]; sb_x++) { vp4_dc_pred_before(s, dc_pred, sb_x); - for (j = 0; j < 16; j++) { + for (int j = 0; j < 16; j++) { int hx = hilbert_offset[j][0]; int hy = hilbert_offset[j][1]; int x = 4 * sb_x + hx; @@ -1653,7 +1638,6 @@ static void reverse_dc_prediction(Vp3DecodeContext *s, #define PUR 2 #define PL 1 - int x, y; int i = first_fragment; int predicted_dc; @@ -1723,9 +1707,9 @@ static void reverse_dc_prediction(Vp3DecodeContext *s, last_dc[2] = 0; /* for each fragment row... */ - for (y = 0; y < fragment_height; y++) { + for (int y = 0; y < fragment_height; y++) { /* for each fragment in a row... */ - for (x = 0; x < fragment_width; x++, i++) { + for (int x = 0; x < fragment_width; x++, i++) { /* reverse prediction if this block was coded */ if (s->all_fragments[i].coding_method != MODE_COPY) { @@ -1796,7 +1780,6 @@ static void reverse_dc_prediction(Vp3DecodeContext *s, static void apply_loop_filter(Vp3DecodeContext *s, int plane, int ystart, int yend) { - int x, y; int *bounding_values = s->bounding_values_array + 127; int width = s->fragment_width[!!plane]; @@ -1808,8 +1791,8 @@ static void apply_loop_filter(Vp3DecodeContext *s, int plane, stride = -stride; plane_data += s->data_offset[plane] + 8 * ystart * stride; - for (y = ystart; y < yend; y++) { - for (x = 0; x < width; x++) { + for (int y = ystart; y < yend; y++) { + for (int x = 0; x < width; x++) { /* This code basically just deblocks on the edges of coded blocks. * However, it has to be much more complicated because of the * brain damaged deblock ordering used in VP3/Theora. Order matters @@ -1860,11 +1843,11 @@ static void apply_loop_filter(Vp3DecodeContext *s, int plane, * Pull DCT tokens from the 64 levels to decode and dequant the coefficients * for the next block in coding order */ -static inline int vp3_dequant(Vp3DecodeContext *s, Vp3Fragment *frag, +static inline int vp3_dequant(Vp3DecodeContext *s, const Vp3Fragment *frag, int plane, int inter, int16_t block[64]) { - int16_t *dequantizer = s->qmat[frag->qpi][inter][plane]; - uint8_t *perm = s->idct_scantable; + const int16_t *dequantizer = s->qmat[frag->qpi][inter][plane]; + const uint8_t *perm = s->idct_scantable; int i = 0; do { @@ -1907,7 +1890,7 @@ end: */ static void vp3_draw_horiz_band(Vp3DecodeContext *s, int y) { - int h, cy, i; + int h, cy; int offset[AV_NUM_DATA_POINTERS]; if (HAVE_THREADS && s->avctx->active_thread_type & FF_THREAD_FRAME) { @@ -1936,7 +1919,7 @@ static void vp3_draw_horiz_band(Vp3DecodeContext *s, int y) offset[0] = s->current_frame.f->linesize[0] * y; offset[1] = s->current_frame.f->linesize[1] * cy; offset[2] = s->current_frame.f->linesize[2] * cy; - for (i = 3; i < AV_NUM_DATA_POINTERS; i++) + for (int i = 3; i < AV_NUM_DATA_POINTERS; i++) offset[i] = 0; emms_c(); @@ -1947,7 +1930,7 @@ static void vp3_draw_horiz_band(Vp3DecodeContext *s, int y) * Wait for the reference frame of the current fragment. * The progress value is in luma pixel rows. */ -static void await_reference_row(Vp3DecodeContext *s, Vp3Fragment *fragment, +static void await_reference_row(Vp3DecodeContext *s, const Vp3Fragment *fragment, int motion_y, int y) { const ThreadFrame *ref_frame; @@ -1971,13 +1954,13 @@ static void await_reference_row(Vp3DecodeContext *s, Vp3Fragment *fragment, * @return non-zero if temp (edge_emu_buffer) was populated */ static int vp4_mc_loop_filter(Vp3DecodeContext *s, int plane, int motion_x, int motion_y, int bx, int by, - uint8_t * motion_source, int stride, int src_x, int src_y, uint8_t *temp) + const uint8_t *motion_source, ptrdiff_t stride, + int src_x, int src_y, uint8_t *temp) { int motion_shift = plane ? 4 : 2; int subpel_mask = plane ? 3 : 1; int *bounding_values = s->bounding_values_array + 127; - int i; int x, y; int x2, y2; int x_subpel, y_subpel; @@ -2058,7 +2041,7 @@ static int vp4_mc_loop_filter(Vp3DecodeContext *s, int plane, int motion_x, int safe_loop_filter(v_loop_filter, loop + (y_offset + 1)*loop_stride + 1, loop_stride, bounding_values); } - for (i = 0; i < 9; i++) + for (int i = 0; i < 9; i++) memcpy(temp + i*stride, loop + (i + 1) * loop_stride + 1, 9); return 1; @@ -2071,29 +2054,35 @@ static int vp4_mc_loop_filter(Vp3DecodeContext *s, int plane, int motion_x, int */ static void render_slice(Vp3DecodeContext *s, int slice) { - int x, y, i, j, fragment; int16_t *block = s->block; int motion_x = 0xdeadbeef, motion_y = 0xdeadbeef; + /* When decoding keyframes, the earlier frames may not be available, + * so to avoid using undefined pointer arithmetic on them we just + * use the current frame instead. Nothing is ever read from these + * frames in case of a keyframe. */ + const AVFrame *last_frame = s->last_frame.f->data[0] ? + s->last_frame.f : s->current_frame.f; + const AVFrame *golden_frame = s->golden_frame.f->data[0] ? + s->golden_frame.f : s->current_frame.f; int motion_halfpel_index; - uint8_t *motion_source; - int plane, first_pixel; + int first_pixel; if (slice >= s->c_superblock_height) return; - for (plane = 0; plane < 3; plane++) { + for (int plane = 0; plane < 3; plane++) { uint8_t *output_plane = s->current_frame.f->data[plane] + s->data_offset[plane]; - uint8_t *last_plane = s->last_frame.f->data[plane] + + const uint8_t *last_plane = last_frame->data[plane] + s->data_offset[plane]; - uint8_t *golden_plane = s->golden_frame.f->data[plane] + + const uint8_t *golden_plane = golden_frame->data[plane] + s->data_offset[plane]; ptrdiff_t stride = s->current_frame.f->linesize[plane]; int plane_width = s->width >> (plane && s->chroma_x_shift); int plane_height = s->height >> (plane && s->chroma_y_shift); - int8_t(*motion_val)[2] = s->motion_val[!!plane]; + const int8_t (*motion_val)[2] = s->motion_val[!!plane]; - int sb_x, sb_y = slice << (!plane && s->chroma_y_shift); + int sb_y = slice << (!plane && s->chroma_y_shift); int slice_height = sb_y + 1 + (!plane && s->chroma_y_shift); int slice_width = plane ? s->c_superblock_width : s->y_superblock_width; @@ -2113,14 +2102,14 @@ static void render_slice(Vp3DecodeContext *s, int slice) /* for each superblock row in the slice (both of them)... */ for (; sb_y < slice_height; sb_y++) { /* for each superblock in a row... */ - for (sb_x = 0; sb_x < slice_width; sb_x++) { + for (int sb_x = 0; sb_x < slice_width; sb_x++) { /* for each block in a superblock... */ - for (j = 0; j < 16; j++) { - x = 4 * sb_x + hilbert_offset[j][0]; - y = 4 * sb_y + hilbert_offset[j][1]; - fragment = y * fragment_width + x; + for (int j = 0; j < 16; j++) { + int x = 4 * sb_x + hilbert_offset[j][0]; + int y = 4 * sb_y + hilbert_offset[j][1]; + int fragment = y * fragment_width + x; - i = fragment_start + fragment; + int i = fragment_start + fragment; // bounds check if (x >= fragment_width || y >= fragment_height) @@ -2136,6 +2125,7 @@ static void render_slice(Vp3DecodeContext *s, int slice) /* transform if this block was coded */ if (s->all_fragments[i].coding_method != MODE_COPY) { + const uint8_t *motion_source; if ((s->all_fragments[i].coding_method == MODE_USING_GOLDEN) || (s->all_fragments[i].coding_method == MODE_GOLDEN_MV)) motion_source = golden_plane; @@ -2327,13 +2317,10 @@ static av_cold int init_frames(Vp3DecodeContext *s) static av_cold int vp3_decode_init(AVCodecContext *avctx) { Vp3DecodeContext *s = avctx->priv_data; - int i, inter, plane, ret; + int ret; int c_width; int c_height; int y_fragment_count, c_fragment_count; -#if CONFIG_VP4_DECODER - int j; -#endif ret = init_frames(s); if (ret < 0) @@ -2362,7 +2349,7 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) ff_videodsp_init(&s->vdsp, 8); ff_vp3dsp_init(&s->vp3dsp, avctx->flags); - for (i = 0; i < 64; i++) { + for (int i = 0; i < 64; i++) { #define TRANSPOSE(x) (((x) >> 3) | (((x) & 7) << 3)) s->idct_permutation[i] = TRANSPOSE(i); s->idct_scantable[i] = TRANSPOSE(ff_zigzag_direct[i]); @@ -2371,7 +2358,7 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) /* initialize to an impossible value which will force a recalculation * in the first frame decode */ - for (i = 0; i < 3; i++) + for (int i = 0; i < 3; i++) s->qps[i] = -1; ret = av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &s->chroma_x_shift, &s->chroma_y_shift); @@ -2416,7 +2403,7 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) if (!s->theora_tables) { const uint8_t (*bias_tabs)[32][2]; - for (i = 0; i < 64; i++) { + for (int i = 0; i < 64; i++) { s->coded_dc_scale_factor[0][i] = s->version < 2 ? vp31_dc_scale_factor[i] : vp4_y_dc_scale_factor[i]; s->coded_dc_scale_factor[1][i] = s->version < 2 ? vp31_dc_scale_factor[i] : vp4_uv_dc_scale_factor[i]; s->coded_ac_scale_factor[i] = s->version < 2 ? vp31_ac_scale_factor[i] : vp4_ac_scale_factor[i]; @@ -2426,8 +2413,8 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) s->filter_limit_values[i] = s->version < 2 ? vp31_filter_limit_values[i] : vp4_filter_limit_values[i]; } - for (inter = 0; inter < 2; inter++) { - for (plane = 0; plane < 3; plane++) { + for (int inter = 0; inter < 2; inter++) { + for (int plane = 0; plane < 3; plane++) { s->qr_count[inter][plane] = 1; s->qr_size[inter][plane][0] = 63; s->qr_base[inter][plane][0] = @@ -2438,7 +2425,7 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) /* init VLC tables */ bias_tabs = CONFIG_VP4_DECODER && s->version >= 2 ? vp4_bias : vp3_bias; for (int i = 0; i < FF_ARRAY_ELEMS(s->coeff_vlc); i++) { - ret = ff_init_vlc_from_lengths(&s->coeff_vlc[i], 11, 32, + ret = ff_vlc_init_from_lengths(&s->coeff_vlc[i], 11, 32, &bias_tabs[i][0][1], 2, &bias_tabs[i][0][0], 2, 1, 0, 0, avctx); @@ -2446,10 +2433,10 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) return ret; } } else { - for (i = 0; i < FF_ARRAY_ELEMS(s->coeff_vlc); i++) { + for (int i = 0; i < FF_ARRAY_ELEMS(s->coeff_vlc); i++) { const HuffTable *tab = &s->huffman_table[i]; - ret = ff_init_vlc_from_lengths(&s->coeff_vlc[i], 11, tab->nb_entries, + ret = ff_vlc_init_from_lengths(&s->coeff_vlc[i], 11, tab->nb_entries, &tab->entries[0].len, sizeof(*tab->entries), &tab->entries[0].sym, sizeof(*tab->entries), 1, 0, 0, avctx); @@ -2458,25 +2445,25 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) } } - ret = ff_init_vlc_from_lengths(&s->superblock_run_length_vlc, SUPERBLOCK_VLC_BITS, 34, + ret = ff_vlc_init_from_lengths(&s->superblock_run_length_vlc, SUPERBLOCK_VLC_BITS, 34, superblock_run_length_vlc_lens, 1, NULL, 0, 0, 1, 0, avctx); if (ret < 0) return ret; - ret = ff_init_vlc_from_lengths(&s->fragment_run_length_vlc, 5, 30, + ret = ff_vlc_init_from_lengths(&s->fragment_run_length_vlc, 5, 30, fragment_run_length_vlc_len, 1, NULL, 0, 0, 0, 0, avctx); if (ret < 0) return ret; - ret = ff_init_vlc_from_lengths(&s->mode_code_vlc, 3, 8, + ret = ff_vlc_init_from_lengths(&s->mode_code_vlc, 3, 8, mode_code_vlc_len, 1, NULL, 0, 0, 0, 0, avctx); if (ret < 0) return ret; - ret = ff_init_vlc_from_lengths(&s->motion_vector_vlc, VP3_MV_VLC_BITS, 63, + ret = ff_vlc_init_from_lengths(&s->motion_vector_vlc, VP3_MV_VLC_BITS, 63, &motion_vector_vlc_table[0][1], 2, &motion_vector_vlc_table[0][0], 2, 1, -31, 0, avctx); @@ -2484,9 +2471,9 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) return ret; #if CONFIG_VP4_DECODER - for (j = 0; j < 2; j++) - for (i = 0; i < 7; i++) { - ret = ff_init_vlc_from_lengths(&s->vp4_mv_vlc[j][i], VP4_MV_VLC_BITS, 63, + for (int j = 0; j < 2; j++) + for (int i = 0; i < 7; i++) { + ret = ff_vlc_init_from_lengths(&s->vp4_mv_vlc[j][i], VP4_MV_VLC_BITS, 63, &vp4_mv_vlc[j][i][0][1], 2, &vp4_mv_vlc[j][i][0][0], 2, 1, -31, 0, avctx); @@ -2495,8 +2482,8 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) } /* version >= 2 */ - for (i = 0; i < 2; i++) - if ((ret = init_vlc(&s->block_pattern_vlc[i], 3, 14, + for (int i = 0; i < 2; i++) + if ((ret = vlc_init(&s->block_pattern_vlc[i], 3, 14, &vp4_block_pattern_vlc[i][0][1], 2, 1, &vp4_block_pattern_vlc[i][0][0], 2, 1, 0)) < 0) return ret; @@ -2511,24 +2498,19 @@ static int update_frames(AVCodecContext *avctx) Vp3DecodeContext *s = avctx->priv_data; int ret = 0; - /* shuffle frames (last = current) */ - ff_thread_release_ext_buffer(avctx, &s->last_frame); - ret = ff_thread_ref_frame(&s->last_frame, &s->current_frame); - if (ret < 0) - goto fail; - if (s->keyframe) { ff_thread_release_ext_buffer(avctx, &s->golden_frame); ret = ff_thread_ref_frame(&s->golden_frame, &s->current_frame); } + /* shuffle frames */ + ff_thread_release_ext_buffer(avctx, &s->last_frame); + FFSWAP(ThreadFrame, s->last_frame, s->current_frame); -fail: - ff_thread_release_ext_buffer(avctx, &s->current_frame); return ret; } #if HAVE_THREADS -static int ref_frame(Vp3DecodeContext *s, ThreadFrame *dst, ThreadFrame *src) +static int ref_frame(Vp3DecodeContext *s, ThreadFrame *dst, const ThreadFrame *src) { ff_thread_release_ext_buffer(s->avctx, dst); if (src->f->data[0]) @@ -2536,7 +2518,7 @@ static int ref_frame(Vp3DecodeContext *s, ThreadFrame *dst, ThreadFrame *src) return 0; } -static int ref_frames(Vp3DecodeContext *dst, Vp3DecodeContext *src) +static int ref_frames(Vp3DecodeContext *dst, const Vp3DecodeContext *src) { int ret; if ((ret = ref_frame(dst, &dst->current_frame, &src->current_frame)) < 0 || @@ -2548,8 +2530,9 @@ static int ref_frames(Vp3DecodeContext *dst, Vp3DecodeContext *src) static int vp3_update_thread_context(AVCodecContext *dst, const AVCodecContext *src) { - Vp3DecodeContext *s = dst->priv_data, *s1 = src->priv_data; - int qps_changed = 0, i, err; + Vp3DecodeContext *s = dst->priv_data; + const Vp3DecodeContext *s1 = src->priv_data; + int qps_changed = 0, err; if (!s1->current_frame.f->data[0] || s->width != s1->width || s->height != s1->height) { @@ -2566,7 +2549,7 @@ static int vp3_update_thread_context(AVCodecContext *dst, const AVCodecContext * s->keyframe = s1->keyframe; // copy qscale data if necessary - for (i = 0; i < 3; i++) { + for (int i = 0; i < 3; i++) { if (s->qps[i] != s1->qps[1]) { qps_changed = 1; memcpy(&s->qmat[i], &s1->qmat[i], sizeof(s->qmat[i])); @@ -2595,7 +2578,7 @@ static int vp3_decode_frame(AVCodecContext *avctx, AVFrame *frame, int buf_size = avpkt->size; Vp3DecodeContext *s = avctx->priv_data; GetBitContext gb; - int i, ret; + int ret; if ((ret = init_get_bits8(&gb, buf, buf_size)) < 0) return ret; @@ -2645,14 +2628,14 @@ static int vp3_decode_frame(AVCodecContext *avctx, AVFrame *frame, } if (!s->theora) skip_bits(&gb, 1); - for (i = 0; i < 3; i++) + for (int i = 0; i < 3; i++) s->last_qps[i] = s->qps[i]; s->nqps = 0; do { s->qps[s->nqps++] = get_bits(&gb, 6); } while (s->theora >= 0x030200 && s->nqps < 3 && get_bits1(&gb)); - for (i = s->nqps; i < 3; i++) + for (int i = s->nqps; i < 3; i++) s->qps[i] = -1; if (s->avctx->debug & FF_DEBUG_PICT_INFO) @@ -2666,7 +2649,7 @@ static int vp3_decode_frame(AVCodecContext *avctx, AVFrame *frame, if (s->qps[0] != s->last_qps[0]) init_loop_filter(s); - for (i = 0; i < s->nqps; i++) + for (int i = 0; i < s->nqps; i++) // reinit all dequantizers if the first one changed, because // the DC of the first quantizer must be used for all matrices if (s->qps[i] != s->last_qps[i] || s->qps[0] != s->last_qps[0]) @@ -2756,9 +2739,9 @@ static int vp3_decode_frame(AVCodecContext *avctx, AVFrame *frame, ff_thread_report_progress(&s->last_frame, INT_MAX, 0); } } + ff_thread_finish_setup(avctx); memset(s->all_fragments, 0, s->fragment_count * sizeof(Vp3Fragment)); - ff_thread_finish_setup(avctx); if (s->version < 2) { if ((ret = unpack_superblocks(s, &gb)) < 0) { @@ -2800,7 +2783,7 @@ static int vp3_decode_frame(AVCodecContext *avctx, AVFrame *frame, #endif } - for (i = 0; i < 3; i++) { + for (int i = 0; i < 3; i++) { int height = s->height >> (i && s->chroma_y_shift); if (s->flipped_image) s->data_offset[i] = 0; @@ -2809,12 +2792,12 @@ static int vp3_decode_frame(AVCodecContext *avctx, AVFrame *frame, } s->last_slice_end = 0; - for (i = 0; i < s->c_superblock_height; i++) + for (int i = 0; i < s->c_superblock_height; i++) render_slice(s, i); // filter the last row if (s->version < 2) - for (i = 0; i < 3; i++) { + for (int i = 0; i < 3; i++) { int row = (s->height >> (3 + (i && s->chroma_y_shift))) - 1; apply_loop_filter(s, i, row, row + 1); } @@ -3003,7 +2986,7 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb) static int theora_decode_tables(AVCodecContext *avctx, GetBitContext *gb) { Vp3DecodeContext *s = avctx->priv_data; - int i, n, matrices, inter, plane, ret; + int n, matrices, ret; if (!s->theora_header) return AVERROR_INVALIDDATA; @@ -3012,7 +2995,7 @@ static int theora_decode_tables(AVCodecContext *avctx, GetBitContext *gb) n = get_bits(gb, 3); /* loop filter limit values table */ if (n) - for (i = 0; i < 64; i++) + for (int i = 0; i < 64; i++) s->filter_limit_values[i] = get_bits(gb, n); } @@ -3021,7 +3004,7 @@ static int theora_decode_tables(AVCodecContext *avctx, GetBitContext *gb) else n = 16; /* quality threshold table */ - for (i = 0; i < 64; i++) + for (int i = 0; i < 64; i++) s->coded_ac_scale_factor[i] = get_bits(gb, n); if (s->theora >= 0x030200) @@ -3029,7 +3012,7 @@ static int theora_decode_tables(AVCodecContext *avctx, GetBitContext *gb) else n = 16; /* dc scale factor table */ - for (i = 0; i < 64; i++) + for (int i = 0; i < 64; i++) s->coded_dc_scale_factor[0][i] = s->coded_dc_scale_factor[1][i] = get_bits(gb, n); @@ -3043,12 +3026,12 @@ static int theora_decode_tables(AVCodecContext *avctx, GetBitContext *gb) return -1; } - for (n = 0; n < matrices; n++) - for (i = 0; i < 64; i++) - s->base_matrix[n][i] = get_bits(gb, 8); + for (int j = 0; j < matrices; j++) + for (int i = 0; i < 64; i++) + s->base_matrix[j][i] = get_bits(gb, 8); - for (inter = 0; inter <= 1; inter++) { - for (plane = 0; plane <= 2; plane++) { + for (int inter = 0; inter <= 1; inter++) { + for (int plane = 0; plane <= 2; plane++) { int newqr = 1; if (inter || plane > 0) newqr = get_bits1(gb); @@ -3071,7 +3054,7 @@ static int theora_decode_tables(AVCodecContext *avctx, GetBitContext *gb) int qi = 0; for (;;) { - i = get_bits(gb, av_log2(matrices - 1) + 1); + int i = get_bits(gb, av_log2(matrices - 1) + 1); if (i >= matrices) { av_log(avctx, AV_LOG_ERROR, "invalid base matrix index\n"); @@ -3113,7 +3096,6 @@ static av_cold int theora_decode_init(AVCodecContext *avctx) int ptype; const uint8_t *header_start[3]; int header_len[3]; - int i; int ret; avctx->pix_fmt = AV_PIX_FMT_YUV420P; @@ -3131,7 +3113,7 @@ static av_cold int theora_decode_init(AVCodecContext *avctx) return -1; } - for (i = 0; i < 3; i++) { + for (int i = 0; i < 3; i++) { if (header_len[i] <= 0) continue; ret = init_get_bits8(&gb, header_start[i], header_len[i]); diff --git a/src/third_party/ffmpeg/libavcodec/vp56.c b/src/third_party/ffmpeg/libavcodec/vp56.c index a5c5b236..f2ee3faf 100644 --- a/src/third_party/ffmpeg/libavcodec/vp56.c +++ b/src/third_party/ffmpeg/libavcodec/vp56.c @@ -607,8 +607,7 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, AVFrame *rframe, } if (avctx->pix_fmt == AV_PIX_FMT_YUVA420P) { - av_frame_unref(s->alpha_context->frames[VP56_FRAME_CURRENT]); - if ((ret = av_frame_ref(s->alpha_context->frames[VP56_FRAME_CURRENT], p)) < 0) { + if ((ret = av_frame_replace(s->alpha_context->frames[VP56_FRAME_CURRENT], p)) < 0) { av_frame_unref(p); if (res == VP56_SIZE_CHANGE) ff_set_dimensions(avctx, 0, 0); @@ -764,8 +763,7 @@ static int ff_vp56_decode_mbs(AVCodecContext *avctx, void *data, next: if ((p->flags & AV_FRAME_FLAG_KEY) || s->golden_frame) { - av_frame_unref(s->frames[VP56_FRAME_GOLDEN]); - if ((res = av_frame_ref(s->frames[VP56_FRAME_GOLDEN], p)) < 0) + if ((res = av_frame_replace(s->frames[VP56_FRAME_GOLDEN], p)) < 0) return res; } diff --git a/src/third_party/ffmpeg/libavcodec/vp6.c b/src/third_party/ffmpeg/libavcodec/vp6.c index 7a519cf1..97d63a58 100644 --- a/src/third_party/ffmpeg/libavcodec/vp6.c +++ b/src/third_party/ffmpeg/libavcodec/vp6.c @@ -279,7 +279,7 @@ static int vp6_build_huff_tree(VP56Context *s, uint8_t coeff_model[], nodes[map[2*i+1]].count = b + !b; } - ff_free_vlc(vlc); + ff_vlc_free(vlc); /* then build the huffman tree according to probabilities */ return ff_huff_build_tree(s->avctx, vlc, size, FF_HUFFMAN_BITS, nodes, vp6_huff_cmp, @@ -708,11 +708,11 @@ static av_cold void vp6_decode_free_context(VP56Context *s) ff_vp56_free_context(s); for (pt=0; pt<2; pt++) { - ff_free_vlc(&s->dccv_vlc[pt]); - ff_free_vlc(&s->runv_vlc[pt]); + ff_vlc_free(&s->dccv_vlc[pt]); + ff_vlc_free(&s->runv_vlc[pt]); for (ct=0; ct<3; ct++) for (cg=0; cg<6; cg++) - ff_free_vlc(&s->ract_vlc[pt][ct][cg]); + ff_vlc_free(&s->ract_vlc[pt][ct][cg]); } } diff --git a/src/third_party/ffmpeg/libavcodec/vp8.c b/src/third_party/ffmpeg/libavcodec/vp8.c index 50afe19b..64b1c7f6 100644 --- a/src/third_party/ffmpeg/libavcodec/vp8.c +++ b/src/third_party/ffmpeg/libavcodec/vp8.c @@ -31,6 +31,7 @@ #include "avcodec.h" #include "codec_internal.h" #include "decode.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "mathops.h" #include "thread.h" @@ -104,23 +105,21 @@ static int vp8_alloc_frame(VP8Context *s, VP8Frame *f, int ref) if ((ret = ff_thread_get_ext_buffer(s->avctx, &f->tf, ref ? AV_GET_BUFFER_FLAG_REF : 0)) < 0) return ret; - if (!(f->seg_map = av_buffer_allocz(s->mb_width * s->mb_height))) + if (!(f->seg_map = av_buffer_allocz(s->mb_width * s->mb_height))) { + ret = AVERROR(ENOMEM); goto fail; - if (s->avctx->hwaccel) { - const AVHWAccel *hwaccel = s->avctx->hwaccel; - if (hwaccel->frame_priv_data_size) { - f->hwaccel_priv_buf = ff_hwaccel_frame_priv_alloc(s->avctx, hwaccel); - if (!f->hwaccel_priv_buf) - goto fail; - f->hwaccel_picture_private = f->hwaccel_priv_buf->data; - } } + ret = ff_hwaccel_frame_priv_alloc(s->avctx, &f->hwaccel_picture_private, + &f->hwaccel_priv_buf); + if (ret < 0) + goto fail; + return 0; fail: av_buffer_unref(&f->seg_map); ff_thread_release_ext_buffer(s->avctx, &f->tf); - return AVERROR(ENOMEM); + return ret; } static void vp8_release_frame(VP8Context *s, VP8Frame *f) @@ -168,8 +167,8 @@ static void vp8_decode_flush_impl(AVCodecContext *avctx, int free_mem) if (free_mem) free_buffers(s); - if (avctx->hwaccel && avctx->hwaccel->flush) - avctx->hwaccel->flush(avctx); + if (FF_HW_HAS_CB(avctx, flush)) + FF_HW_SIMPLE_CALL(avctx, flush); } static void vp8_decode_flush(AVCodecContext *avctx) @@ -2766,15 +2765,16 @@ int vp78_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, ff_thread_finish_setup(avctx); if (avctx->hwaccel) { - ret = avctx->hwaccel->start_frame(avctx, avpkt->data, avpkt->size); + const FFHWAccel *hwaccel = ffhwaccel(avctx->hwaccel); + ret = hwaccel->start_frame(avctx, avpkt->data, avpkt->size); if (ret < 0) goto err; - ret = avctx->hwaccel->decode_slice(avctx, avpkt->data, avpkt->size); + ret = hwaccel->decode_slice(avctx, avpkt->data, avpkt->size); if (ret < 0) goto err; - ret = avctx->hwaccel->end_frame(avctx); + ret = hwaccel->end_frame(avctx); if (ret < 0) goto err; diff --git a/src/third_party/ffmpeg/libavcodec/vp9.c b/src/third_party/ffmpeg/libavcodec/vp9.c index 4f704ec0..3cc27aa8 100644 --- a/src/third_party/ffmpeg/libavcodec/vp9.c +++ b/src/third_party/ffmpeg/libavcodec/vp9.c @@ -27,6 +27,7 @@ #include "codec_internal.h" #include "decode.h" #include "get_bits.h" +#include "hwaccel_internal.h" #include "hwconfig.h" #include "profiles.h" #include "thread.h" @@ -119,12 +120,14 @@ static int vp9_frame_alloc(AVCodecContext *avctx, VP9Frame *f) s->frame_extradata_pool = av_buffer_pool_init(sz * (1 + sizeof(VP9mvrefPair)), NULL); if (!s->frame_extradata_pool) { s->frame_extradata_pool_size = 0; + ret = AVERROR(ENOMEM); goto fail; } s->frame_extradata_pool_size = sz; } f->extradata = av_buffer_pool_get(s->frame_extradata_pool); if (!f->extradata) { + ret = AVERROR(ENOMEM); goto fail; } memset(f->extradata->data, 0, f->extradata->size); @@ -132,22 +135,16 @@ static int vp9_frame_alloc(AVCodecContext *avctx, VP9Frame *f) f->segmentation_map = f->extradata->data; f->mv = (VP9mvrefPair *) (f->extradata->data + sz); - if (avctx->hwaccel) { - const AVHWAccel *hwaccel = avctx->hwaccel; - av_assert0(!f->hwaccel_picture_private); - if (hwaccel->frame_priv_data_size) { - f->hwaccel_priv_buf = ff_hwaccel_frame_priv_alloc(avctx, hwaccel); - if (!f->hwaccel_priv_buf) - goto fail; - f->hwaccel_picture_private = f->hwaccel_priv_buf->data; - } - } + ret = ff_hwaccel_frame_priv_alloc(avctx, &f->hwaccel_picture_private, + &f->hwaccel_priv_buf); + if (ret < 0) + goto fail; return 0; fail: vp9_frame_unref(avctx, f); - return AVERROR(ENOMEM); + return ret; } static int vp9_frame_ref(AVCodecContext *avctx, VP9Frame *dst, VP9Frame *src) @@ -253,7 +250,7 @@ static int update_size(AVCodecContext *avctx, int w, int h) *fmtp++ = s->pix_fmt; *fmtp = AV_PIX_FMT_NONE; - ret = ff_thread_get_format(avctx, pix_fmts); + ret = ff_get_format(avctx, pix_fmts); if (ret < 0) return ret; @@ -1639,13 +1636,14 @@ static int vp9_decode_frame(AVCodecContext *avctx, AVFrame *frame, } if (avctx->hwaccel) { - ret = avctx->hwaccel->start_frame(avctx, NULL, 0); + const FFHWAccel *hwaccel = ffhwaccel(avctx->hwaccel); + ret = hwaccel->start_frame(avctx, NULL, 0); if (ret < 0) return ret; - ret = avctx->hwaccel->decode_slice(avctx, pkt->data, pkt->size); + ret = hwaccel->decode_slice(avctx, pkt->data, pkt->size); if (ret < 0) return ret; - ret = avctx->hwaccel->end_frame(avctx); + ret = hwaccel->end_frame(avctx); if (ret < 0) return ret; goto finish; @@ -1802,8 +1800,8 @@ static void vp9_decode_flush(AVCodecContext *avctx) for (i = 0; i < 8; i++) ff_thread_release_ext_buffer(avctx, &s->s.refs[i]); - if (avctx->hwaccel && avctx->hwaccel->flush) - avctx->hwaccel->flush(avctx); + if (FF_HW_HAS_CB(avctx, flush)) + FF_HW_SIMPLE_CALL(avctx, flush); } static av_cold int vp9_decode_init(AVCodecContext *avctx) diff --git a/src/third_party/ffmpeg/libavcodec/vqcdec.c b/src/third_party/ffmpeg/libavcodec/vqcdec.c index c3bce879..462d810a 100644 --- a/src/third_party/ffmpeg/libavcodec/vqcdec.c +++ b/src/third_party/ffmpeg/libavcodec/vqcdec.c @@ -53,7 +53,7 @@ static VLC vector_vlc; static av_cold void vqc_init_static_data(void) { - INIT_VLC_STATIC_FROM_LENGTHS(&vector_vlc, VECTOR_VLC_BITS, FF_ARRAY_ELEMS(vector_nbits), + VLC_INIT_STATIC_FROM_LENGTHS(&vector_vlc, VECTOR_VLC_BITS, FF_ARRAY_ELEMS(vector_nbits), vector_nbits, 1, vector_symbols, 1, 1, 0, 0, 1 << VECTOR_VLC_BITS); diff --git a/src/third_party/ffmpeg/libavcodec/vulkan_av1.c b/src/third_party/ffmpeg/libavcodec/vulkan_av1.c index d0f40192..b1373722 100644 --- a/src/third_party/ffmpeg/libavcodec/vulkan_av1.c +++ b/src/third_party/ffmpeg/libavcodec/vulkan_av1.c @@ -104,12 +104,9 @@ static int vk_av1_fill_pict(AVCodecContext *avctx, const AV1Frame **ref_src, static int vk_av1_create_params(AVCodecContext *avctx, AVBufferRef **buf) { - VkResult ret; - const AV1DecContext *s = avctx->priv_data; FFVulkanDecodeContext *dec = avctx->internal->hwaccel_priv_data; FFVulkanDecodeShared *ctx = (FFVulkanDecodeShared *)dec->shared_ref->data; - FFVulkanFunctions *vk = &ctx->s.vkfn; const AV1RawSequenceHeader *seq = s->raw_seq; @@ -118,10 +115,7 @@ static int vk_av1_create_params(AVCodecContext *avctx, AVBufferRef **buf) VkVideoDecodeAV1SessionParametersCreateInfoMESA av1_params; VkVideoSessionParametersCreateInfoKHR session_params_create; - AVBufferRef *tmp; - VkVideoSessionParametersKHR *par = av_malloc(sizeof(*par)); - if (!par) - return AVERROR(ENOMEM); + int err; av1_sequence_header = (StdVideoAV1MESASequenceHeader) { .flags = (StdVideoAV1MESASequenceHeaderFlags) { @@ -189,26 +183,12 @@ static int vk_av1_create_params(AVCodecContext *avctx, AVBufferRef **buf) .videoSessionParametersTemplate = NULL, }; - /* Create session parameters */ - ret = vk->CreateVideoSessionParametersKHR(ctx->s.hwctx->act_dev, &session_params_create, - ctx->s.hwctx->alloc, par); - if (ret != VK_SUCCESS) { - av_log(avctx, AV_LOG_ERROR, "Unable to create Vulkan video session parameters: %s!\n", - ff_vk_ret2str(ret)); - return AVERROR_EXTERNAL; - } - - tmp = av_buffer_create((uint8_t *)par, sizeof(*par), ff_vk_decode_free_params, - ctx, 0); - if (!tmp) { - ff_vk_decode_free_params(ctx, (uint8_t *)par); - return AVERROR(ENOMEM); - } + err = ff_vk_decode_create_params(buf, avctx, ctx, &session_params_create); + if (err < 0) + return err; av_log(avctx, AV_LOG_DEBUG, "Created frame parameters\n"); - *buf = tmp; - return 0; } @@ -572,11 +552,11 @@ static void vk_av1_free_frame_priv(void *_hwctx, uint8_t *data) av_free(ap); } -const AVHWAccel ff_av1_vulkan_hwaccel = { - .name = "av1_vulkan", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AV1, - .pix_fmt = AV_PIX_FMT_VULKAN, +const FFHWAccel ff_av1_vulkan_hwaccel = { + .p.name = "av1_vulkan", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, + .p.pix_fmt = AV_PIX_FMT_VULKAN, .start_frame = &vk_av1_start_frame, .decode_slice = &vk_av1_decode_slice, .end_frame = &vk_av1_end_frame, diff --git a/src/third_party/ffmpeg/libavcodec/vulkan_decode.c b/src/third_party/ffmpeg/libavcodec/vulkan_decode.c index f20733fb..ef4a1c38 100644 --- a/src/third_party/ffmpeg/libavcodec/vulkan_decode.c +++ b/src/third_party/ffmpeg/libavcodec/vulkan_decode.c @@ -176,6 +176,7 @@ int ff_vk_decode_prepare_frame(FFVulkanDecodeContext *dec, AVFrame *pic, { int err; FFVulkanDecodeShared *ctx = (FFVulkanDecodeShared *)dec->shared_ref->data; + FFVulkanFunctions *vk = &ctx->s.vkfn; vkpic->slices_size = 0; @@ -189,6 +190,9 @@ int ff_vk_decode_prepare_frame(FFVulkanDecodeContext *dec, AVFrame *pic, vkpic->img_view_out = NULL; vkpic->img_view_dest = NULL; + vkpic->destroy_image_view = vk->DestroyImageView; + vkpic->wait_semaphores = vk->WaitSemaphores; + if (dec->layered_dpb && alloc_dpb) { vkpic->img_view_ref = ctx->layered_view; vkpic->img_aspect_ref = ctx->layered_aspect; @@ -554,9 +558,6 @@ int ff_vk_decode_frame(AVCodecContext *avctx, void ff_vk_decode_free_frame(AVHWDeviceContext *dev_ctx, FFVulkanDecodePicture *vp) { AVVulkanDeviceContext *hwctx = dev_ctx->hwctx; - PFN_vkGetDeviceProcAddr device_proc_addr; - PFN_vkWaitSemaphores wait_semaphores; - PFN_vkDestroyImageView destroy_image_view; VkSemaphoreWaitInfo sem_wait = (VkSemaphoreWaitInfo) { .sType = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO, @@ -565,27 +566,22 @@ void ff_vk_decode_free_frame(AVHWDeviceContext *dev_ctx, FFVulkanDecodePicture * .semaphoreCount = 1, }; - /* Guaranteed to exist */ - device_proc_addr = (PFN_vkGetDeviceProcAddr)hwctx->get_proc_addr(hwctx->inst, "vkGetDeviceProcAddr"); - destroy_image_view = (PFN_vkDestroyImageView)device_proc_addr(hwctx->act_dev, "vkDestroyImageView"); - wait_semaphores = (PFN_vkWaitSemaphores)device_proc_addr(hwctx->act_dev, "vkWaitSemaphores"); - /* We do not have to lock the frame here because we're not interested * in the actual current semaphore value, but only that it's later than * the time we submitted the image for decoding. */ if (vp->sem) - wait_semaphores(hwctx->act_dev, &sem_wait, UINT64_MAX); + vp->wait_semaphores(hwctx->act_dev, &sem_wait, UINT64_MAX); /* Free slices data */ av_buffer_unref(&vp->slices_buf); /* Destroy image view (out) */ if (vp->img_view_out && vp->img_view_out != vp->img_view_dest) - destroy_image_view(hwctx->act_dev, vp->img_view_out, hwctx->alloc); + vp->destroy_image_view(hwctx->act_dev, vp->img_view_out, hwctx->alloc); /* Destroy image view (ref, unlayered) */ if (vp->img_view_dest) - destroy_image_view(hwctx->act_dev, vp->img_view_dest, hwctx->alloc); + vp->destroy_image_view(hwctx->act_dev, vp->img_view_dest, hwctx->alloc); av_frame_free(&vp->dpb_frame); } @@ -682,7 +678,7 @@ static VkResult vulkan_setup_profile(AVCodecContext *avctx, VkVideoProfileListInfoKHR *profile_list = &prof->profile_list; VkVideoDecodeH264ProfileInfoKHR *h264_profile = &prof->h264_profile; - VkVideoDecodeH264ProfileInfoKHR *h265_profile = &prof->h265_profile; + VkVideoDecodeH265ProfileInfoKHR *h265_profile = &prof->h265_profile; VkVideoDecodeAV1ProfileInfoMESA *av1_profile = &prof->av1_profile; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->sw_pix_fmt); @@ -696,8 +692,8 @@ static VkResult vulkan_setup_profile(AVCodecContext *avctx, /* Vulkan transmits all the constrant_set flags, rather than wanting them * merged in the profile IDC */ - h264_profile->stdProfileIdc = cur_profile & ~(FF_PROFILE_H264_CONSTRAINED | - FF_PROFILE_H264_INTRA); + h264_profile->stdProfileIdc = cur_profile & ~(AV_PROFILE_H264_CONSTRAINED | + AV_PROFILE_H264_INTRA); h264_profile->pictureLayout = avctx->field_order == AV_FIELD_UNKNOWN || avctx->field_order == AV_FIELD_PROGRESSIVE ? @@ -789,8 +785,8 @@ static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_ } cur_profile = avctx->profile; - base_profile = avctx->codec_id == AV_CODEC_ID_H264 ? FF_PROFILE_H264_CONSTRAINED_BASELINE : - avctx->codec_id == AV_CODEC_ID_H265 ? FF_PROFILE_HEVC_MAIN : + base_profile = avctx->codec_id == AV_CODEC_ID_H264 ? AV_PROFILE_H264_CONSTRAINED_BASELINE : + avctx->codec_id == AV_CODEC_ID_H265 ? AV_PROFILE_HEVC_MAIN : avctx->codec_id == AV_CODEC_ID_AV1 ? STD_VIDEO_AV1_MESA_PROFILE_MAIN : 0; @@ -837,8 +833,8 @@ static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_ return AVERROR_EXTERNAL; } - max_level = avctx->codec_id == AV_CODEC_ID_H264 ? h264_caps.maxLevelIdc : - avctx->codec_id == AV_CODEC_ID_H265 ? h265_caps.maxLevelIdc : + max_level = avctx->codec_id == AV_CODEC_ID_H264 ? ff_vk_h264_level_to_av(h264_caps.maxLevelIdc) : + avctx->codec_id == AV_CODEC_ID_H265 ? ff_vk_h265_level_to_av(h265_caps.maxLevelIdc) : avctx->codec_id == AV_CODEC_ID_AV1 ? av1_caps.maxLevelIdc : 0; @@ -863,6 +859,9 @@ static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_ caps->maxDpbSlots); av_log(avctx, AV_LOG_VERBOSE, " Maximum active references: %u\n", caps->maxActiveReferencePictures); + av_log(avctx, AV_LOG_VERBOSE, " Codec header name: '%s' (driver), '%s' (compiled)\n", + caps->stdHeaderVersion.extensionName, + dec_ext[avctx->codec_id]->extensionName); av_log(avctx, AV_LOG_VERBOSE, " Codec header version: %i.%i.%i (driver), %i.%i.%i (compiled)\n", CODEC_VER(caps->stdHeaderVersion.specVersion), CODEC_VER(dec_ext[avctx->codec_id]->specVersion)); @@ -1054,7 +1053,7 @@ int ff_vk_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx) return err; } -void ff_vk_decode_free_params(void *opaque, uint8_t *data) +static void vk_decode_free_params(void *opaque, uint8_t *data) { FFVulkanDecodeShared *ctx = opaque; FFVulkanFunctions *vk = &ctx->s.vkfn; @@ -1064,6 +1063,35 @@ void ff_vk_decode_free_params(void *opaque, uint8_t *data) av_free(par); } +int ff_vk_decode_create_params(AVBufferRef **par_ref, void *logctx, FFVulkanDecodeShared *ctx, + const VkVideoSessionParametersCreateInfoKHR *session_params_create) +{ + VkVideoSessionParametersKHR *par = av_malloc(sizeof(*par)); + const FFVulkanFunctions *vk = &ctx->s.vkfn; + VkResult ret; + + if (!par) + return AVERROR(ENOMEM); + + /* Create session parameters */ + ret = vk->CreateVideoSessionParametersKHR(ctx->s.hwctx->act_dev, session_params_create, + ctx->s.hwctx->alloc, par); + if (ret != VK_SUCCESS) { + av_log(logctx, AV_LOG_ERROR, "Unable to create Vulkan video session parameters: %s!\n", + ff_vk_ret2str(ret)); + av_free(par); + return AVERROR_EXTERNAL; + } + *par_ref = av_buffer_create((uint8_t *)par, sizeof(*par), + vk_decode_free_params, ctx, 0); + if (!*par_ref) { + vk_decode_free_params(ctx, (uint8_t *)par); + return AVERROR(ENOMEM); + } + + return 0; +} + int ff_vk_decode_uninit(AVCodecContext *avctx) { FFVulkanDecodeContext *dec = avctx->internal->hwaccel_priv_data; @@ -1072,7 +1100,7 @@ int ff_vk_decode_uninit(AVCodecContext *avctx) /* Wait on and free execution pool */ ff_vk_exec_pool_free(&ctx->s, &dec->exec_pool); - av_buffer_pool_uninit(&dec->tmp_pool); + av_freep(&dec->hevc_headers); av_buffer_unref(&dec->session_params); av_buffer_unref(&dec->shared_ref); av_freep(&dec->slice_off); diff --git a/src/third_party/ffmpeg/libavcodec/vulkan_decode.h b/src/third_party/ffmpeg/libavcodec/vulkan_decode.h index 1b4e1cc7..c983b440 100644 --- a/src/third_party/ffmpeg/libavcodec/vulkan_decode.h +++ b/src/third_party/ffmpeg/libavcodec/vulkan_decode.h @@ -20,14 +20,14 @@ #define AVCODEC_VULKAN_DECODE_H #include "decode.h" -#include "hwconfig.h" +#include "hwaccel_internal.h" #include "internal.h" #include "vulkan_video.h" typedef struct FFVulkanDecodeProfileData { VkVideoDecodeH264ProfileInfoKHR h264_profile; - VkVideoDecodeH264ProfileInfoKHR h265_profile; + VkVideoDecodeH265ProfileInfoKHR h265_profile; VkVideoDecodeAV1ProfileInfoMESA av1_profile; VkVideoDecodeUsageInfoKHR usage; VkVideoProfileInfoKHR profile; @@ -64,8 +64,8 @@ typedef struct FFVulkanDecodeContext { uint32_t frame_id_alloc_mask; /* For AV1 only */ /* Thread-local state below */ - AVBufferPool *tmp_pool; /* Pool for temporary data, if needed (HEVC) */ - size_t tmp_pool_ele_size; + struct HEVCHeaderSet *hevc_headers; + size_t hevc_headers_size; uint32_t *slice_off; unsigned int slice_off_max; @@ -97,6 +97,10 @@ typedef struct FFVulkanDecodePicture { /* Slice data */ AVBufferRef *slices_buf; size_t slices_size; + + /* Vulkan functions needed for destruction, as no other context is guaranteed to exist */ + PFN_vkWaitSemaphores wait_semaphores; + PFN_vkDestroyImageView destroy_image_view; } FFVulkanDecodePicture; /** @@ -156,9 +160,10 @@ int ff_vk_get_decode_buffer(FFVulkanDecodeContext *ctx, AVBufferRef **buf, void *create_pNext, size_t size); /** - * Free VkVideoSessionParametersKHR. + * Create VkVideoSessionParametersKHR wrapped in an AVBufferRef. */ -void ff_vk_decode_free_params(void *opaque, uint8_t *data); +int ff_vk_decode_create_params(AVBufferRef **par_ref, void *logctx, FFVulkanDecodeShared *ctx, + const VkVideoSessionParametersCreateInfoKHR *session_params_create); /** * Flush decoder. diff --git a/src/third_party/ffmpeg/libavcodec/vulkan_h264.c b/src/third_party/ffmpeg/libavcodec/vulkan_h264.c index 84bcef79..32ef32d6 100644 --- a/src/third_party/ffmpeg/libavcodec/vulkan_h264.c +++ b/src/third_party/ffmpeg/libavcodec/vulkan_h264.c @@ -43,6 +43,8 @@ typedef struct H264VulkanDecodePicture { VkVideoDecodeH264PictureInfoKHR h264_pic_info; } H264VulkanDecodePicture; +const static int h264_scaling_list8_order[] = { 0, 3, 1, 4, 2, 5 }; + static int vk_h264_fill_pict(AVCodecContext *avctx, H264Picture **ref_src, VkVideoReferenceSlotInfoKHR *ref_slot, /* Main structure */ VkVideoPictureResourceInfoKHR *ref, /* Goes in ^ */ @@ -143,12 +145,13 @@ static void set_sps(const SPS *sps, }; for (int i = 0; i < STD_VIDEO_H264_SCALING_LIST_4X4_NUM_LISTS; i++) - memcpy(vksps_scaling->ScalingList4x4[i], sps->scaling_matrix4[i], - STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS * sizeof(**sps->scaling_matrix4)); + for (int j = 0; j < STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS; j++) + vksps_scaling->ScalingList4x4[i][j] = sps->scaling_matrix4[i][ff_zigzag_scan[j]]; for (int i = 0; i < STD_VIDEO_H264_SCALING_LIST_8X8_NUM_LISTS; i++) - memcpy(vksps_scaling->ScalingList8x8[i], sps->scaling_matrix8[i], - STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS * sizeof(**sps->scaling_matrix8)); + for (int j = 0; j < STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS; j++) + vksps_scaling->ScalingList8x8[i][j] = + sps->scaling_matrix8[h264_scaling_list8_order[i]][ff_zigzag_direct[j]]; *vksps_vui_header = (StdVideoH264HrdParameters) { .cpb_cnt_minus1 = sps->cpb_cnt - 1, @@ -248,12 +251,13 @@ static void set_pps(const PPS *pps, const SPS *sps, }; for (int i = 0; i < STD_VIDEO_H264_SCALING_LIST_4X4_NUM_LISTS; i++) - memcpy(vkpps_scaling->ScalingList4x4[i], pps->scaling_matrix4[i], - STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS * sizeof(**pps->scaling_matrix4)); + for (int j = 0; j < STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS; j++) + vkpps_scaling->ScalingList4x4[i][j] = pps->scaling_matrix4[i][ff_zigzag_scan[j]]; for (int i = 0; i < STD_VIDEO_H264_SCALING_LIST_8X8_NUM_LISTS; i++) - memcpy(vkpps_scaling->ScalingList8x8[i], pps->scaling_matrix8[i], - STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS * sizeof(**pps->scaling_matrix8)); + for (int j = 0; j < STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS; j++) + vkpps_scaling->ScalingList8x8[i][j] = + pps->scaling_matrix8[h264_scaling_list8_order[i]][ff_zigzag_direct[j]]; *vkpps = (StdVideoH264PictureParameterSet) { .seq_parameter_set_id = pps->sps_id, @@ -281,10 +285,9 @@ static void set_pps(const PPS *pps, const SPS *sps, static int vk_h264_create_params(AVCodecContext *avctx, AVBufferRef **buf) { - VkResult ret; + int err; FFVulkanDecodeContext *dec = avctx->internal->hwaccel_priv_data; FFVulkanDecodeShared *ctx = (FFVulkanDecodeShared *)dec->shared_ref->data; - FFVulkanFunctions *vk = &ctx->s.vkfn; const H264Context *h = avctx->priv_data; /* SPS */ @@ -315,11 +318,6 @@ static int vk_h264_create_params(AVCodecContext *avctx, AVBufferRef **buf) .videoSessionParametersTemplate = NULL, }; - AVBufferRef *tmp; - VkVideoSessionParametersKHR *par = av_malloc(sizeof(*par)); - if (!par) - return AVERROR(ENOMEM); - /* SPS list */ for (int i = 0; i < FF_ARRAY_ELEMS(h->ps.sps_list); i++) { if (h->ps.sps_list[i]) { @@ -343,27 +341,13 @@ static int vk_h264_create_params(AVCodecContext *avctx, AVBufferRef **buf) h264_params.maxStdSPSCount = h264_params_info.stdSPSCount; h264_params.maxStdPPSCount = h264_params_info.stdPPSCount; - /* Create session parameters */ - ret = vk->CreateVideoSessionParametersKHR(ctx->s.hwctx->act_dev, &session_params_create, - ctx->s.hwctx->alloc, par); - if (ret != VK_SUCCESS) { - av_log(avctx, AV_LOG_ERROR, "Unable to create Vulkan video session parameters: %s!\n", - ff_vk_ret2str(ret)); - return AVERROR_EXTERNAL; - } - - tmp = av_buffer_create((uint8_t *)par, sizeof(*par), ff_vk_decode_free_params, - ctx, 0); - if (!tmp) { - ff_vk_decode_free_params(ctx, (uint8_t *)par); - return AVERROR(ENOMEM); - } + err = ff_vk_decode_create_params(buf, avctx, ctx, &session_params_create); + if (err < 0) + return err; av_log(avctx, AV_LOG_DEBUG, "Created frame parameters: %i SPS %i PPS\n", h264_params_info.stdSPSCount, h264_params_info.stdPPSCount); - *buf = tmp; - return 0; } @@ -558,11 +542,11 @@ static void vk_h264_free_frame_priv(void *_hwctx, uint8_t *data) av_free(hp); } -const AVHWAccel ff_h264_vulkan_hwaccel = { - .name = "h264_vulkan", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, - .pix_fmt = AV_PIX_FMT_VULKAN, +const FFHWAccel ff_h264_vulkan_hwaccel = { + .p.name = "h264_vulkan", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, + .p.pix_fmt = AV_PIX_FMT_VULKAN, .start_frame = &vk_h264_start_frame, .decode_slice = &vk_h264_decode_slice, .end_frame = &vk_h264_end_frame, diff --git a/src/third_party/ffmpeg/libavcodec/vulkan_hevc.c b/src/third_party/ffmpeg/libavcodec/vulkan_hevc.c index ab0f6b96..52f223ce 100644 --- a/src/third_party/ffmpeg/libavcodec/vulkan_hevc.c +++ b/src/third_party/ffmpeg/libavcodec/vulkan_hevc.c @@ -17,6 +17,7 @@ */ #include "hevcdec.h" +#include "hevc_data.h" #include "hevc_ps.h" #include "vulkan_decode.h" @@ -67,49 +68,33 @@ typedef struct HEVCHeaderSet { HEVCHeaderVPS *hvps; } HEVCHeaderSet; -static int get_data_set_buf(FFVulkanDecodeContext *s, AVBufferRef **data_buf, - int nb_vps, AVBufferRef * const vps_list[HEVC_MAX_VPS_COUNT]) +static int alloc_hevc_header_structs(FFVulkanDecodeContext *s, + int nb_vps, + AVBufferRef * const vps_list[HEVC_MAX_VPS_COUNT]) { uint8_t *data_ptr; HEVCHeaderSet *hdr; - size_t base_size = sizeof(StdVideoH265SequenceParameterSet)*HEVC_MAX_SPS_COUNT + - sizeof(HEVCHeaderSPS)*HEVC_MAX_SPS_COUNT + - sizeof(StdVideoH265PictureParameterSet)*HEVC_MAX_PPS_COUNT + - sizeof(HEVCHeaderPPS)*HEVC_MAX_PPS_COUNT + - sizeof(StdVideoH265VideoParameterSet)*HEVC_MAX_VPS_COUNT + - sizeof(HEVCHeaderVPS *); - - size_t vps_size = sizeof(StdVideoH265ProfileTierLevel) + - sizeof(StdVideoH265DecPicBufMgr) + - sizeof(StdVideoH265HrdParameters)*HEVC_MAX_LAYER_SETS + - sizeof(HEVCHeaderVPSSet *); - - size_t buf_size = base_size + vps_size*nb_vps; - + size_t buf_size = sizeof(HEVCHeaderSet) + nb_vps*sizeof(HEVCHeaderVPS); for (int i = 0; i < nb_vps; i++) { const HEVCVPS *vps = (const HEVCVPS *)vps_list[i]->data; buf_size += sizeof(HEVCHeaderVPSSet)*vps->vps_num_hrd_parameters; } - if (buf_size > s->tmp_pool_ele_size) { - av_buffer_pool_uninit(&s->tmp_pool); - s->tmp_pool_ele_size = 0; - s->tmp_pool = av_buffer_pool_init(buf_size, NULL); - if (!s->tmp_pool) + if (buf_size > s->hevc_headers_size) { + av_freep(&s->hevc_headers); + s->hevc_headers_size = 0; + s->hevc_headers = av_mallocz(buf_size); + if (!s->hevc_headers) return AVERROR(ENOMEM); - s->tmp_pool_ele_size = buf_size; + s->hevc_headers_size = buf_size; } - *data_buf = av_buffer_pool_get(s->tmp_pool); - if (!(*data_buf)) - return AVERROR(ENOMEM); - - /* Setup pointers */ - data_ptr = (*data_buf)->data; - hdr = (HEVCHeaderSet *)data_ptr; - hdr->hvps = (HEVCHeaderVPS *)(data_ptr + base_size); - data_ptr += base_size + vps_size*nb_vps; + /* Setup struct pointers */ + hdr = s->hevc_headers; + data_ptr = (uint8_t *)hdr; + hdr->hvps = (HEVCHeaderVPS *)(data_ptr + sizeof(HEVCHeaderSet)); + data_ptr += sizeof(HEVCHeaderSet) + nb_vps*sizeof(HEVCHeaderVPS); for (int i = 0; i < nb_vps; i++) { const HEVCVPS *vps = (const HEVCVPS *)vps_list[i]->data; hdr->hvps[i].sls = (HEVCHeaderVPSSet *)data_ptr; @@ -205,6 +190,43 @@ static StdVideoH265LevelIdc convert_to_vk_level_idc(int level_idc) } } +static void copy_scaling_list(const ScalingList *sl, StdVideoH265ScalingLists *vksl) +{ + for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_4X4_NUM_LISTS; i++) { + for (int j = 0; j < STD_VIDEO_H265_SCALING_LIST_4X4_NUM_ELEMENTS; j++) { + uint8_t pos = 4 * ff_hevc_diag_scan4x4_y[j] + ff_hevc_diag_scan4x4_x[j]; + vksl->ScalingList4x4[i][j] = sl->sl[0][i][pos]; + } + } + + for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_8X8_NUM_LISTS; i++) { + for (int j = 0; j < STD_VIDEO_H265_SCALING_LIST_8X8_NUM_ELEMENTS; j++) { + uint8_t pos = 8 * ff_hevc_diag_scan8x8_y[j] + ff_hevc_diag_scan8x8_x[j]; + vksl->ScalingList8x8[i][j] = sl->sl[1][i][pos]; + } + } + + for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS; i++) { + for (int j = 0; j < STD_VIDEO_H265_SCALING_LIST_16X16_NUM_ELEMENTS; j++) { + uint8_t pos = 8 * ff_hevc_diag_scan8x8_y[j] + ff_hevc_diag_scan8x8_x[j]; + vksl->ScalingList16x16[i][j] = sl->sl[2][i][pos]; + } + } + + for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS; i++) { + for (int j = 0; j < STD_VIDEO_H265_SCALING_LIST_32X32_NUM_ELEMENTS; j++) { + uint8_t pos = 8 * ff_hevc_diag_scan8x8_y[j] + ff_hevc_diag_scan8x8_x[j]; + vksl->ScalingList32x32[i][j] = sl->sl[3][i * 3][pos]; + } + } + + memcpy(vksl->ScalingListDCCoef16x16, sl->sl_dc[0], + STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS * sizeof(*vksl->ScalingListDCCoef16x16)); + + for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS; i++) + vksl->ScalingListDCCoef32x32[i] = sl->sl_dc[1][i * 3]; +} + static void set_sps(const HEVCSPS *sps, int sps_idx, StdVideoH265ScalingLists *vksps_scaling, StdVideoH265HrdParameters *vksps_vui_header, @@ -218,27 +240,7 @@ static void set_sps(const HEVCSPS *sps, int sps_idx, StdVideoH265ShortTermRefPicSet *str, StdVideoH265LongTermRefPicsSps *ltr) { - for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_4X4_NUM_LISTS; i++) - memcpy(vksps_scaling->ScalingList4x4[i], sps->scaling_list.sl[0][i], - STD_VIDEO_H265_SCALING_LIST_4X4_NUM_ELEMENTS * sizeof(**vksps_scaling->ScalingList4x4)); - - for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_8X8_NUM_LISTS; i++) - memcpy(vksps_scaling->ScalingList8x8[i], sps->scaling_list.sl[1][i], - STD_VIDEO_H265_SCALING_LIST_8X8_NUM_ELEMENTS * sizeof(**vksps_scaling->ScalingList8x8)); - - for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS; i++) - memcpy(vksps_scaling->ScalingList16x16[i], sps->scaling_list.sl[2][i], - STD_VIDEO_H265_SCALING_LIST_16X16_NUM_ELEMENTS * sizeof(**vksps_scaling->ScalingList16x16)); - - for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS; i++) - memcpy(vksps_scaling->ScalingList32x32[i], sps->scaling_list.sl[3][i * 3], - STD_VIDEO_H265_SCALING_LIST_32X32_NUM_ELEMENTS * sizeof(**vksps_scaling->ScalingList32x32)); - - memcpy(vksps_scaling->ScalingListDCCoef16x16, sps->scaling_list.sl_dc[0], - STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS * sizeof(*vksps_scaling->ScalingListDCCoef16x16)); - - for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS; i++) - vksps_scaling->ScalingListDCCoef32x32[i] = sps->scaling_list.sl_dc[1][i * 3]; + copy_scaling_list(&sps->scaling_list, vksps_scaling); *vksps_vui_header = (StdVideoH265HrdParameters) { .flags = (StdVideoH265HrdFlags) { @@ -464,27 +466,7 @@ static void set_pps(const HEVCPPS *pps, const HEVCSPS *sps, StdVideoH265PictureParameterSet *vkpps, StdVideoH265PredictorPaletteEntries *pal) { - for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_4X4_NUM_LISTS; i++) - memcpy(vkpps_scaling->ScalingList4x4[i], pps->scaling_list.sl[0][i], - STD_VIDEO_H265_SCALING_LIST_4X4_NUM_ELEMENTS * sizeof(**vkpps_scaling->ScalingList4x4)); - - for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_8X8_NUM_LISTS; i++) - memcpy(vkpps_scaling->ScalingList8x8[i], pps->scaling_list.sl[1][i], - STD_VIDEO_H265_SCALING_LIST_8X8_NUM_ELEMENTS * sizeof(**vkpps_scaling->ScalingList8x8)); - - for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS; i++) - memcpy(vkpps_scaling->ScalingList16x16[i], pps->scaling_list.sl[2][i], - STD_VIDEO_H265_SCALING_LIST_16X16_NUM_ELEMENTS * sizeof(**vkpps_scaling->ScalingList16x16)); - - for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS; i++) - memcpy(vkpps_scaling->ScalingList32x32[i], pps->scaling_list.sl[3][i * 3], - STD_VIDEO_H265_SCALING_LIST_32X32_NUM_ELEMENTS * sizeof(**vkpps_scaling->ScalingList32x32)); - - memcpy(vkpps_scaling->ScalingListDCCoef16x16, pps->scaling_list.sl_dc[0], - STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS * sizeof(*vkpps_scaling->ScalingListDCCoef16x16)); - - for (int i = 0; i < STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS; i++) - vkpps_scaling->ScalingListDCCoef32x32[i] = sps->scaling_list.sl_dc[1][i * 3]; + copy_scaling_list(&pps->scaling_list, vkpps_scaling); *vkpps = (StdVideoH265PictureParameterSet) { .flags = (StdVideoH265PpsFlags) { @@ -652,11 +634,9 @@ static void set_vps(const HEVCVPS *vps, static int vk_hevc_create_params(AVCodecContext *avctx, AVBufferRef **buf) { int err; - VkResult ret; const HEVCContext *h = avctx->priv_data; FFVulkanDecodeContext *dec = avctx->internal->hwaccel_priv_data; FFVulkanDecodeShared *ctx = (FFVulkanDecodeShared *)dec->shared_ref->data; - FFVulkanFunctions *vk = &ctx->s.vkfn; VkVideoDecodeH265SessionParametersAddInfoKHR h265_params_info = { .sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_KHR, @@ -676,22 +656,16 @@ static int vk_hevc_create_params(AVCodecContext *avctx, AVBufferRef **buf) }; int nb_vps = 0; - AVBufferRef *data_set; HEVCHeaderSet *hdr; - AVBufferRef *tmp; - VkVideoSessionParametersKHR *par = av_malloc(sizeof(*par)); - if (!par) - return AVERROR(ENOMEM); - for (int i = 0; h->ps.vps_list[i]; i++) nb_vps++; - err = get_data_set_buf(dec, &data_set, nb_vps, h->ps.vps_list); + err = alloc_hevc_header_structs(dec, nb_vps, h->ps.vps_list); if (err < 0) return err; - hdr = (HEVCHeaderSet *)data_set->data; + hdr = dec->hevc_headers; h265_params_info.pStdSPSs = hdr->sps; h265_params_info.pStdPPSs = hdr->pps; @@ -727,29 +701,14 @@ static int vk_hevc_create_params(AVCodecContext *avctx, AVBufferRef **buf) h265_params.maxStdPPSCount = h265_params_info.stdPPSCount; h265_params.maxStdVPSCount = h265_params_info.stdVPSCount; - /* Create session parameters */ - ret = vk->CreateVideoSessionParametersKHR(ctx->s.hwctx->act_dev, &session_params_create, - ctx->s.hwctx->alloc, par); - av_buffer_unref(&data_set); - if (ret != VK_SUCCESS) { - av_log(avctx, AV_LOG_ERROR, "Unable to create Vulkan video session parameters: %s!\n", - ff_vk_ret2str(ret)); - return AVERROR_EXTERNAL; - } - - tmp = av_buffer_create((uint8_t *)par, sizeof(*par), ff_vk_decode_free_params, - ctx, 0); - if (!tmp) { - ff_vk_decode_free_params(ctx, (uint8_t *)par); - return AVERROR(ENOMEM); - } + err = ff_vk_decode_create_params(buf, avctx, ctx, &session_params_create); + if (err < 0) + return err; av_log(avctx, AV_LOG_DEBUG, "Created frame parameters: %i SPS %i PPS %i VPS\n", h265_params_info.stdSPSCount, h265_params_info.stdPPSCount, h265_params_info.stdVPSCount); - *buf = tmp; - return 0; } @@ -954,11 +913,11 @@ static void vk_hevc_free_frame_priv(void *_hwctx, uint8_t *data) av_free(hp); } -const AVHWAccel ff_hevc_vulkan_hwaccel = { - .name = "hevc_vulkan", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, - .pix_fmt = AV_PIX_FMT_VULKAN, +const FFHWAccel ff_hevc_vulkan_hwaccel = { + .p.name = "hevc_vulkan", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, + .p.pix_fmt = AV_PIX_FMT_VULKAN, .start_frame = &vk_hevc_start_frame, .decode_slice = &vk_hevc_decode_slice, .end_frame = &vk_hevc_end_frame, diff --git a/src/third_party/ffmpeg/libavcodec/vulkan_video.c b/src/third_party/ffmpeg/libavcodec/vulkan_video.c index 9a363aab..236aa124 100644 --- a/src/third_party/ffmpeg/libavcodec/vulkan_video.c +++ b/src/third_party/ffmpeg/libavcodec/vulkan_video.c @@ -154,6 +154,51 @@ VkVideoComponentBitDepthFlagBitsKHR ff_vk_depth_from_av_depth(int depth) return VK_VIDEO_COMPONENT_BIT_DEPTH_INVALID_KHR; } +int ff_vk_h264_level_to_av(StdVideoH264LevelIdc level) +{ + switch (level) { + case STD_VIDEO_H264_LEVEL_IDC_1_0: return 10; + case STD_VIDEO_H264_LEVEL_IDC_1_1: return 11; + case STD_VIDEO_H264_LEVEL_IDC_1_2: return 12; + case STD_VIDEO_H264_LEVEL_IDC_1_3: return 13; + case STD_VIDEO_H264_LEVEL_IDC_2_0: return 20; + case STD_VIDEO_H264_LEVEL_IDC_2_1: return 21; + case STD_VIDEO_H264_LEVEL_IDC_2_2: return 22; + case STD_VIDEO_H264_LEVEL_IDC_3_0: return 30; + case STD_VIDEO_H264_LEVEL_IDC_3_1: return 31; + case STD_VIDEO_H264_LEVEL_IDC_3_2: return 32; + case STD_VIDEO_H264_LEVEL_IDC_4_0: return 40; + case STD_VIDEO_H264_LEVEL_IDC_4_1: return 41; + case STD_VIDEO_H264_LEVEL_IDC_4_2: return 42; + case STD_VIDEO_H264_LEVEL_IDC_5_0: return 50; + case STD_VIDEO_H264_LEVEL_IDC_5_1: return 51; + case STD_VIDEO_H264_LEVEL_IDC_5_2: return 52; + case STD_VIDEO_H264_LEVEL_IDC_6_0: return 60; + case STD_VIDEO_H264_LEVEL_IDC_6_1: return 61; + default: + case STD_VIDEO_H264_LEVEL_IDC_6_2: return 62; + } +} + +int ff_vk_h265_level_to_av(StdVideoH265LevelIdc level) +{ + switch (level) { + case STD_VIDEO_H265_LEVEL_IDC_1_0: return 10; + case STD_VIDEO_H265_LEVEL_IDC_2_0: return 20; + case STD_VIDEO_H265_LEVEL_IDC_2_1: return 21; + case STD_VIDEO_H265_LEVEL_IDC_3_0: return 30; + case STD_VIDEO_H265_LEVEL_IDC_3_1: return 31; + case STD_VIDEO_H265_LEVEL_IDC_4_0: return 40; + case STD_VIDEO_H265_LEVEL_IDC_4_1: return 41; + case STD_VIDEO_H265_LEVEL_IDC_5_0: return 50; + case STD_VIDEO_H265_LEVEL_IDC_5_1: return 51; + case STD_VIDEO_H265_LEVEL_IDC_6_0: return 60; + case STD_VIDEO_H265_LEVEL_IDC_6_1: return 61; + default: + case STD_VIDEO_H265_LEVEL_IDC_6_2: return 62; + } +} + static void free_data_buf(void *opaque, uint8_t *data) { FFVulkanContext *ctx = opaque; diff --git a/src/third_party/ffmpeg/libavcodec/vulkan_video.h b/src/third_party/ffmpeg/libavcodec/vulkan_video.h index 183ce89b..b28e3fe0 100644 --- a/src/third_party/ffmpeg/libavcodec/vulkan_video.h +++ b/src/third_party/ffmpeg/libavcodec/vulkan_video.h @@ -71,6 +71,13 @@ VkVideoChromaSubsamplingFlagBitsKHR ff_vk_subsampling_from_av_desc(const AVPixFm */ VkVideoComponentBitDepthFlagBitsKHR ff_vk_depth_from_av_depth(int depth); + +/** + * Convert level from Vulkan to AV. + */ +int ff_vk_h264_level_to_av(StdVideoH264LevelIdc level); +int ff_vk_h265_level_to_av(StdVideoH265LevelIdc level); + typedef struct FFVkVideoBuffer { FFVkBuffer buf; uint8_t *mem; diff --git a/src/third_party/ffmpeg/libavcodec/vvc_mp4toannexb_bsf.c b/src/third_party/ffmpeg/libavcodec/vvc_mp4toannexb_bsf.c index 9e606cdc..25c37269 100644 --- a/src/third_party/ffmpeg/libavcodec/vvc_mp4toannexb_bsf.c +++ b/src/third_party/ffmpeg/libavcodec/vvc_mp4toannexb_bsf.c @@ -24,14 +24,12 @@ #include "libavutil/intreadwrite.h" #include "libavutil/mem.h" -#include "avcodec.h" #include "bsf.h" #include "bsf_internal.h" #include "bytestream.h" +#include "defs.h" #include "vvc.h" -#include "libavcodec/get_bits.h" - #define MIN_VVCC_LENGTH 23 typedef struct VVCBSFContext { diff --git a/src/third_party/ffmpeg/libavcodec/vvc_parser.c b/src/third_party/ffmpeg/libavcodec/vvc_parser.c index 3951ebe5..c661595e 100644 --- a/src/third_party/ffmpeg/libavcodec/vvc_parser.c +++ b/src/third_party/ffmpeg/libavcodec/vvc_parser.c @@ -225,10 +225,10 @@ static void get_slice_poc(VVCParserContext *s, int *poc, } else { if ((poc_lsb < prev_poc_lsb) && ((prev_poc_lsb - poc_lsb) >= (max_poc_lsb / 2))) - poc_msb = prev_poc_msb + max_poc_lsb; + poc_msb = prev_poc_msb + (unsigned)max_poc_lsb; else if ((poc_lsb > prev_poc_lsb) && ((poc_lsb - prev_poc_lsb) > (max_poc_lsb / 2))) - poc_msb = prev_poc_msb - max_poc_lsb; + poc_msb = prev_poc_msb - (unsigned)max_poc_lsb; else poc_msb = prev_poc_msb; } diff --git a/src/third_party/ffmpeg/libavcodec/wavarc.c b/src/third_party/ffmpeg/libavcodec/wavarc.c index 6daad6a5..09ed4d47 100644 --- a/src/third_party/ffmpeg/libavcodec/wavarc.c +++ b/src/third_party/ffmpeg/libavcodec/wavarc.c @@ -111,7 +111,7 @@ static av_cold int wavarc_init(AVCodecContext *avctx) } s->max_framesize = s->nb_samples * 16; - s->bitstream = av_calloc(s->max_framesize, sizeof(*s->bitstream)); + s->bitstream = av_calloc(s->max_framesize + AV_INPUT_BUFFER_PADDING_SIZE, sizeof(*s->bitstream)); if (!s->bitstream) return AVERROR(ENOMEM); @@ -154,11 +154,11 @@ static void do_stereo(WavArcContext *s, int ch, int correlated, int len) } else { if (correlated) { for (int n = 0; n < nb_samples; n++) - s->samples[1][n + len] += s->samples[0][n + len]; + s->samples[1][n + len] += (unsigned)s->samples[0][n + len]; } for (int n = 0; n < len; n++) { s->pred[0][n] = s->samples[1][nb_samples + n]; - s->pred[1][n] = s->pred[0][n] - s->samples[0][nb_samples + n]; + s->pred[1][n] = s->pred[0][n] - (unsigned)s->samples[0][nb_samples + n]; } } } @@ -205,7 +205,7 @@ static int decode_1dif(AVCodecContext *avctx, if (block_type < 4 && block_type >= 0) { k = 1 + (avctx->sample_fmt == AV_SAMPLE_FMT_S16P); k = get_urice(gb, k) + 1; - if (k > 32) + if (k >= 32) return AVERROR_INVALIDDATA; } @@ -218,6 +218,10 @@ static int decode_1dif(AVCodecContext *avctx, continue; case 6: s->shift = get_urice(gb, 2); + if ((unsigned)s->shift > 31) { + s->shift = 0; + return AVERROR_INVALIDDATA; + } continue; case 5: if (avctx->sample_fmt == AV_SAMPLE_FMT_U8P) { @@ -239,18 +243,18 @@ static int decode_1dif(AVCodecContext *avctx, break; case 3: for (int n = 0; n < s->nb_samples; n++) - samples[n + 4] = get_srice(gb, k) + (samples[n + 3] - samples[n + 2]) * 3 + + samples[n + 4] = get_srice(gb, k) + (samples[n + 3] - (unsigned)samples[n + 2]) * 3 + samples[n + 1]; finished = 1; break; case 2: for (int n = 0; n < s->nb_samples; n++) - samples[n + 4] = get_srice(gb, k) + (samples[n + 3] * 2 - samples[n + 2]); + samples[n + 4] = get_srice(gb, k) + (samples[n + 3] * 2U - samples[n + 2]); finished = 1; break; case 1: for (int n = 0; n < s->nb_samples; n++) - samples[n + 4] = get_srice(gb, k) + samples[n + 3]; + samples[n + 4] = get_srice(gb, k) + (unsigned)samples[n + 3]; finished = 1; break; case 0: @@ -297,7 +301,7 @@ static int decode_2slp(AVCodecContext *avctx, if (block_type < 5 && block_type >= 0) { k = 1 + (avctx->sample_fmt == AV_SAMPLE_FMT_S16P); k = get_urice(gb, k) + 1; - if (k > 32) + if (k >= 32) return AVERROR_INVALIDDATA; } @@ -307,13 +311,17 @@ static int decode_2slp(AVCodecContext *avctx, return AVERROR_EOF; case 8: s->nb_samples = get_urice(gb, 8); - if (s->nb_samples > 570) { + if (s->nb_samples > 570U) { s->nb_samples = 570; return AVERROR_INVALIDDATA; } continue; case 7: s->shift = get_urice(gb, 2); + if ((unsigned)s->shift > 31) { + s->shift = 0; + return AVERROR_INVALIDDATA; + } continue; case 6: if (avctx->sample_fmt == AV_SAMPLE_FMT_U8P) { @@ -335,13 +343,13 @@ static int decode_2slp(AVCodecContext *avctx, break; case 4: for (int n = 0; n < s->nb_samples; n++) - samples[n + 70] = get_srice(gb, k) + (samples[n + 69] - samples[n + 68]) * 3 + + samples[n + 70] = get_srice(gb, k) + (samples[n + 69] - (unsigned)samples[n + 68]) * 3 + samples[n + 67]; finished = 1; break; case 3: for (int n = 0; n < s->nb_samples; n++) - samples[n + 70] = get_srice(gb, k) + (samples[n + 69] * 2 - samples[n + 68]); + samples[n + 70] = get_srice(gb, k) + (samples[n + 69] * 2U - samples[n + 68]); finished = 1; break; case 2: @@ -351,7 +359,7 @@ static int decode_2slp(AVCodecContext *avctx, break; case 1: for (int n = 0; n < s->nb_samples; n++) - samples[n + 70] = get_srice(gb, k) + samples[n + 69]; + samples[n + 70] = get_srice(gb, k) + (unsigned)samples[n + 69]; finished = 1; break; case 0: @@ -404,13 +412,13 @@ static int ac_init(AVCodecContext *avctx, return 0; } -static unsigned ac_get_prob(WavArcContext *s) +static uint16_t ac_get_prob(WavArcContext *s) { - return ((s->freq_range - 1) + ((unsigned)s->ac_value - (unsigned)s->ac_low) * - (unsigned)s->freq_range) / (((unsigned)s->ac_high - (unsigned)s->ac_low) + 1) & 0xffffu; + return ((s->freq_range - 1) + (s->ac_value - s->ac_low) * s->freq_range) / + ((s->ac_high - s->ac_low) + 1U); } -static unsigned ac_map_symbol(WavArcContext *s, unsigned prob) +static uint8_t ac_map_symbol(WavArcContext *s, uint16_t prob) { int idx = 255; @@ -427,33 +435,43 @@ static int ac_normalize(AVCodecContext *avctx, WavArcContext *s, GetBitContext * { int range; - range = (unsigned)s->ac_high - (unsigned)s->ac_low + 1; - s->ac_high = (int16_t)((range * (unsigned)s->range_high) / (unsigned)s->freq_range) + -1 + s->ac_low; - s->ac_low += (int16_t)((range * (unsigned)s->range_low) / (unsigned)s->freq_range); + if (s->ac_high < s->ac_low) + goto fail; + + range = (s->ac_high - s->ac_low) + 1; + s->ac_high = (range * s->range_high) / s->freq_range + s->ac_low - 1; + s->ac_low += (range * s->range_low) / s->freq_range; + + if (s->ac_high < s->ac_low) + goto fail; for (;;) { if ((s->ac_high & 0x8000) != (s->ac_low & 0x8000)) { - if ((s->ac_low & 0x4000) == 0 || (s->ac_high & 0x4000) != 0) + if (((s->ac_low & 0x4000) == 0) || ((s->ac_high & 0x4000) != 0)) return 0; s->ac_value ^= 0x4000; s->ac_low &= 0x3fff; s->ac_high |= 0x4000; } - s->ac_low = s->ac_low << 1; - s->ac_high = s->ac_high * 2 + 1; - if (s->ac_high < s->ac_low) { - av_log(avctx, AV_LOG_ERROR, "invalid state\n"); - return AVERROR_INVALIDDATA; - } + s->ac_low = s->ac_low * 2; + s->ac_high = s->ac_high * 2 | 1; + if (s->ac_high < s->ac_low) + goto fail; if (get_bits_left(gb) <= 0) { av_log(avctx, AV_LOG_ERROR, "overread in arithmetic coder\n"); - return AVERROR_INVALIDDATA; + goto fail; } s->ac_value = s->ac_value * 2 + get_bits1(gb); + if (s->ac_low > s->ac_value || s->ac_high < s->ac_value) + goto fail; } + +fail: + av_log(avctx, AV_LOG_ERROR, "invalid state\n"); + return AVERROR_INVALIDDATA; } static void ac_init_model(WavArcContext *s) @@ -476,11 +494,11 @@ static int ac_read_model(AVCodecContext *avctx, end = get_bits(gb, 8); for (;;) { - while (start <= end) + while (start <= end) { + if (get_bits_left(gb) < 8) + return AVERROR_INVALIDDATA; s->model[start++] = get_bits(gb, 8); - - if (get_bits_left(gb) < 8) - return AVERROR_INVALIDDATA; + } if (get_bits_left(gb) < 8) return AVERROR_INVALIDDATA; @@ -521,6 +539,8 @@ static int decode_5elp(AVCodecContext *avctx, if (block_type >= 0 && block_type <= 7) { k = 1 + (avctx->sample_fmt == AV_SAMPLE_FMT_S16P); k = get_urice(gb, k) + 1; + if (k >= 32) + return AVERROR_INVALIDDATA; } if (block_type <= 2 || block_type == 6 || block_type == 13 || @@ -560,9 +580,9 @@ static int decode_5elp(AVCodecContext *avctx, } for (int n = 0; n < s->nb_samples; n++) { - unsigned prob = ac_get_prob(s); - prob = ac_map_symbol(s, prob); - ac_out[n] = prob - 0x80; + uint16_t prob = ac_get_prob(s); + int ac = ac_map_symbol(s, prob); + ac_out[n] = ac - 0x80; if ((ret = ac_normalize(avctx, s, &ac_gb)) < 0) return ret; } @@ -579,13 +599,17 @@ static int decode_5elp(AVCodecContext *avctx, return AVERROR_EOF; case 11: s->nb_samples = get_urice(gb, 8); - if (s->nb_samples > 570) { + if (s->nb_samples > 570U) { s->nb_samples = 570; return AVERROR_INVALIDDATA; } continue; case 10: s->shift = get_urice(gb, 2); + if ((unsigned)s->shift > 31) { + s->shift = 0; + return AVERROR_INVALIDDATA; + } continue; case 9: if (avctx->sample_fmt == AV_SAMPLE_FMT_U8P) { @@ -608,11 +632,16 @@ static int decode_5elp(AVCodecContext *avctx, case 20: case 7: for (int n = 0; n < s->nb_samples; n++) - samples[n + 70] = ac_out[n] + samples[n + 69] * 3 - samples[n + 68] * 3 + samples[n + 67]; + samples[n + 70] += ac_out[n] + samples[n + 69] * 3U - samples[n + 68] * 3U + samples[n + 67]; finished = 1; break; case 19: case 6: + for (int n = 0; n < 70; n++) { + ac_pred[n] = samples[n]; + samples[n] = 0; + } + for (int n = 0; n < s->nb_samples; n++) { int sum = 15; @@ -621,24 +650,31 @@ static int decode_5elp(AVCodecContext *avctx, samples[n + 70] += ac_out[n] + (sum >> 4); } + + for (int n = 0; n < 70; n++) + samples[n] = ac_pred[n]; + + for (int n = 0; n < s->nb_samples; n++) + samples[n + 70] += ac_out[n] + samples[n + 69] * 3U - samples[n + 68] * 3U + samples[n + 67]; + finished = 1; break; case 18: case 5: for (int n = 0; n < s->nb_samples; n++) - samples[n + 70] = ac_out[n] + samples[n + 69] * 2 - samples[n + 68]; + samples[n + 70] += ac_out[n] + samples[n + 69] * 2U - samples[n + 68]; finished = 1; break; case 17: case 4: for (int n = 0; n < s->nb_samples; n++) - samples[n + 70] = ac_out[n]; + samples[n + 70] += ac_out[n]; finished = 1; break; case 16: case 3: for (int n = 0; n < s->nb_samples; n++) - samples[n + 70] = ac_out[n] + samples[n + 69]; + samples[n + 70] += ac_out[n] + (unsigned)samples[n + 69]; finished = 1; break; case 15: @@ -661,7 +697,7 @@ static int decode_5elp(AVCodecContext *avctx, samples[n] = ac_pred[n]; for (int n = 0; n < s->nb_samples; n++) - samples[n + 70] += samples[n + 69] * 2 - samples[n + 68]; + samples[n + 70] += samples[n + 69] * 2U - samples[n + 68]; finished = 1; break; @@ -678,14 +714,14 @@ static int decode_5elp(AVCodecContext *avctx, for (int o = 0; o < order; o++) sum += s->filter[ch][o] * (unsigned)samples[n + 70 - o - 1]; - samples[n + 70] += ac_out[n] + (sum >> 4); + samples[n + 70] += (unsigned)ac_out[n] + (sum >> 4); } for (int n = 0; n < 70; n++) samples[n] = ac_pred[n]; for (int n = 0; n < s->nb_samples; n++) - samples[n + 70] += samples[n + 69]; + samples[n + 70] += (unsigned)samples[n + 69]; finished = 1; break; @@ -697,7 +733,7 @@ static int decode_5elp(AVCodecContext *avctx, for (int o = 0; o < order; o++) sum += s->filter[ch][o] * (unsigned)samples[n + 70 - o - 1]; - samples[n + 70] += ac_out[n] + (sum >> 4); + samples[n + 70] += (unsigned)ac_out[n] + (sum >> 4); } finished = 1; break; diff --git a/src/third_party/ffmpeg/libavcodec/wavpack.c b/src/third_party/ffmpeg/libavcodec/wavpack.c index 4346304f..966f4b83 100644 --- a/src/third_party/ffmpeg/libavcodec/wavpack.c +++ b/src/third_party/ffmpeg/libavcodec/wavpack.c @@ -96,12 +96,10 @@ typedef struct WavpackFrameContext { uint8_t *value_lookup[MAX_HISTORY_BINS]; } WavpackFrameContext; -#define WV_MAX_FRAME_DECODERS 14 - typedef struct WavpackContext { AVCodecContext *avctx; - WavpackFrameContext *fdec[WV_MAX_FRAME_DECODERS]; + WavpackFrameContext **fdec; int fdec_num; int block; @@ -796,71 +794,73 @@ static inline int wv_unpack_stereo(WavpackFrameContext *s, GetBitContext *gb, if (last) break; for (i = 0; i < s->terms; i++) { - t = s->decorr[i].value; + Decorr *decorr = &s->decorr[i]; + + t = decorr->value; if (t > 0) { if (t > 8) { if (t & 1) { - A = 2U * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1]; - B = 2U * s->decorr[i].samplesB[0] - s->decorr[i].samplesB[1]; + A = 2U * decorr->samplesA[0] - decorr->samplesA[1]; + B = 2U * decorr->samplesB[0] - decorr->samplesB[1]; } else { - A = (int)(3U * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1]) >> 1; - B = (int)(3U * s->decorr[i].samplesB[0] - s->decorr[i].samplesB[1]) >> 1; + A = (int)(3U * decorr->samplesA[0] - decorr->samplesA[1]) >> 1; + B = (int)(3U * decorr->samplesB[0] - decorr->samplesB[1]) >> 1; } - s->decorr[i].samplesA[1] = s->decorr[i].samplesA[0]; - s->decorr[i].samplesB[1] = s->decorr[i].samplesB[0]; - j = 0; + decorr->samplesA[1] = decorr->samplesA[0]; + decorr->samplesB[1] = decorr->samplesB[0]; + j = 0; } else { - A = s->decorr[i].samplesA[pos]; - B = s->decorr[i].samplesB[pos]; + A = decorr->samplesA[pos]; + B = decorr->samplesB[pos]; j = (pos + t) & 7; } if (type != AV_SAMPLE_FMT_S16P) { - L2 = L + ((s->decorr[i].weightA * (int64_t)A + 512) >> 10); - R2 = R + ((s->decorr[i].weightB * (int64_t)B + 512) >> 10); + L2 = L + ((decorr->weightA * (int64_t)A + 512) >> 10); + R2 = R + ((decorr->weightB * (int64_t)B + 512) >> 10); } else { - L2 = L + (unsigned)((int)(s->decorr[i].weightA * (unsigned)A + 512) >> 10); - R2 = R + (unsigned)((int)(s->decorr[i].weightB * (unsigned)B + 512) >> 10); + L2 = L + (unsigned)((int)(decorr->weightA * (unsigned)A + 512) >> 10); + R2 = R + (unsigned)((int)(decorr->weightB * (unsigned)B + 512) >> 10); } if (A && L) - s->decorr[i].weightA -= ((((L ^ A) >> 30) & 2) - 1) * s->decorr[i].delta; + decorr->weightA -= ((((L ^ A) >> 30) & 2) - 1) * decorr->delta; if (B && R) - s->decorr[i].weightB -= ((((R ^ B) >> 30) & 2) - 1) * s->decorr[i].delta; - s->decorr[i].samplesA[j] = L = L2; - s->decorr[i].samplesB[j] = R = R2; + decorr->weightB -= ((((R ^ B) >> 30) & 2) - 1) * decorr->delta; + decorr->samplesA[j] = L = L2; + decorr->samplesB[j] = R = R2; } else if (t == -1) { if (type != AV_SAMPLE_FMT_S16P) - L2 = L + ((s->decorr[i].weightA * (int64_t)s->decorr[i].samplesA[0] + 512) >> 10); + L2 = L + ((decorr->weightA * (int64_t)decorr->samplesA[0] + 512) >> 10); else - L2 = L + (unsigned)((int)(s->decorr[i].weightA * (unsigned)s->decorr[i].samplesA[0] + 512) >> 10); - UPDATE_WEIGHT_CLIP(s->decorr[i].weightA, s->decorr[i].delta, s->decorr[i].samplesA[0], L); + L2 = L + (unsigned)((int)(decorr->weightA * (unsigned)decorr->samplesA[0] + 512) >> 10); + UPDATE_WEIGHT_CLIP(decorr->weightA, decorr->delta, decorr->samplesA[0], L); L = L2; if (type != AV_SAMPLE_FMT_S16P) - R2 = R + ((s->decorr[i].weightB * (int64_t)L2 + 512) >> 10); + R2 = R + ((decorr->weightB * (int64_t)L2 + 512) >> 10); else - R2 = R + (unsigned)((int)(s->decorr[i].weightB * (unsigned)L2 + 512) >> 10); - UPDATE_WEIGHT_CLIP(s->decorr[i].weightB, s->decorr[i].delta, L2, R); - R = R2; - s->decorr[i].samplesA[0] = R; + R2 = R + (unsigned)((int)(decorr->weightB * (unsigned)L2 + 512) >> 10); + UPDATE_WEIGHT_CLIP(decorr->weightB, decorr->delta, L2, R); + R = R2; + decorr->samplesA[0] = R; } else { if (type != AV_SAMPLE_FMT_S16P) - R2 = R + ((s->decorr[i].weightB * (int64_t)s->decorr[i].samplesB[0] + 512) >> 10); + R2 = R + ((decorr->weightB * (int64_t)decorr->samplesB[0] + 512) >> 10); else - R2 = R + (unsigned)((int)(s->decorr[i].weightB * (unsigned)s->decorr[i].samplesB[0] + 512) >> 10); - UPDATE_WEIGHT_CLIP(s->decorr[i].weightB, s->decorr[i].delta, s->decorr[i].samplesB[0], R); + R2 = R + (unsigned)((int)(decorr->weightB * (unsigned)decorr->samplesB[0] + 512) >> 10); + UPDATE_WEIGHT_CLIP(decorr->weightB, decorr->delta, decorr->samplesB[0], R); R = R2; if (t == -3) { - R2 = s->decorr[i].samplesA[0]; - s->decorr[i].samplesA[0] = R; + R2 = decorr->samplesA[0]; + decorr->samplesA[0] = R; } if (type != AV_SAMPLE_FMT_S16P) - L2 = L + ((s->decorr[i].weightA * (int64_t)R2 + 512) >> 10); + L2 = L + ((decorr->weightA * (int64_t)R2 + 512) >> 10); else - L2 = L + (unsigned)((int)(s->decorr[i].weightA * (unsigned)R2 + 512) >> 10); - UPDATE_WEIGHT_CLIP(s->decorr[i].weightA, s->decorr[i].delta, R2, L); - L = L2; - s->decorr[i].samplesB[0] = L; + L2 = L + (unsigned)((int)(decorr->weightA * (unsigned)R2 + 512) >> 10); + UPDATE_WEIGHT_CLIP(decorr->weightA, decorr->delta, R2, L); + L = L2; + decorr->samplesB[0] = L; } } @@ -922,25 +922,27 @@ static inline int wv_unpack_mono(WavpackFrameContext *s, GetBitContext *gb, if (last) break; for (i = 0; i < s->terms; i++) { - t = s->decorr[i].value; + Decorr *decorr = &s->decorr[i]; + + t = decorr->value; if (t > 8) { if (t & 1) - A = 2U * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1]; + A = 2U * decorr->samplesA[0] - decorr->samplesA[1]; else - A = (int)(3U * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1]) >> 1; - s->decorr[i].samplesA[1] = s->decorr[i].samplesA[0]; - j = 0; + A = (int)(3U * decorr->samplesA[0] - decorr->samplesA[1]) >> 1; + decorr->samplesA[1] = decorr->samplesA[0]; + j = 0; } else { - A = s->decorr[i].samplesA[pos]; + A = decorr->samplesA[pos]; j = (pos + t) & 7; } if (type != AV_SAMPLE_FMT_S16P) - S = T + ((s->decorr[i].weightA * (int64_t)A + 512) >> 10); + S = T + ((decorr->weightA * (int64_t)A + 512) >> 10); else - S = T + (unsigned)((int)(s->decorr[i].weightA * (unsigned)A + 512) >> 10); + S = T + (unsigned)((int)(decorr->weightA * (unsigned)A + 512) >> 10); if (A && T) - s->decorr[i].weightA -= ((((T ^ A) >> 30) & 2) - 1) * s->decorr[i].delta; - s->decorr[i].samplesA[j] = T = S; + decorr->weightA -= ((((T ^ A) >> 30) & 2) - 1) * decorr->delta; + decorr->samplesA[j] = T = S; } pos = (pos + 1) & 7; crc = crc * 3 + S; @@ -971,7 +973,8 @@ static inline int wv_unpack_mono(WavpackFrameContext *s, GetBitContext *gb, static av_cold int wv_alloc_frame_context(WavpackContext *c) { - if (c->fdec_num == WV_MAX_FRAME_DECODERS) + c->fdec = av_realloc_f(c->fdec, c->fdec_num + 1, sizeof(*c->fdec)); + if (!c->fdec) return -1; c->fdec[c->fdec_num] = av_mallocz(sizeof(**c->fdec)); @@ -1064,6 +1067,7 @@ static av_cold int wavpack_decode_end(AVCodecContext *avctx) for (int i = 0; i < s->fdec_num; i++) av_freep(&s->fdec[i]); + av_freep(&s->fdec); s->fdec_num = 0; ff_thread_release_ext_buffer(avctx, &s->curr_frame); @@ -1127,7 +1131,7 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no, else if ((s->frame_flags & 0x03) <= 1) sample_fmt = AV_SAMPLE_FMT_S16P; else - sample_fmt = AV_SAMPLE_FMT_S32P; + sample_fmt = AV_SAMPLE_FMT_S32P; if (wc->ch_offset && avctx->sample_fmt != sample_fmt) return AVERROR_INVALIDDATA; @@ -1219,36 +1223,38 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no, } t = 0; for (i = s->terms - 1; (i >= 0) && (t < size); i--) { - if (s->decorr[i].value > 8) { - s->decorr[i].samplesA[0] = + Decorr *decorr = &s->decorr[i]; + + if (decorr->value > 8) { + decorr->samplesA[0] = wp_exp2(bytestream2_get_le16(&gb)); - s->decorr[i].samplesA[1] = + decorr->samplesA[1] = wp_exp2(bytestream2_get_le16(&gb)); if (s->stereo_in) { - s->decorr[i].samplesB[0] = + decorr->samplesB[0] = wp_exp2(bytestream2_get_le16(&gb)); - s->decorr[i].samplesB[1] = + decorr->samplesB[1] = wp_exp2(bytestream2_get_le16(&gb)); - t += 4; + t += 4; } t += 4; - } else if (s->decorr[i].value < 0) { - s->decorr[i].samplesA[0] = + } else if (decorr->value < 0) { + decorr->samplesA[0] = wp_exp2(bytestream2_get_le16(&gb)); - s->decorr[i].samplesB[0] = + decorr->samplesB[0] = wp_exp2(bytestream2_get_le16(&gb)); - t += 4; + t += 4; } else { - for (j = 0; j < s->decorr[i].value; j++) { - s->decorr[i].samplesA[j] = + for (j = 0; j < decorr->value; j++) { + decorr->samplesA[j] = wp_exp2(bytestream2_get_le16(&gb)); if (s->stereo_in) { - s->decorr[i].samplesB[j] = + decorr->samplesB[j] = wp_exp2(bytestream2_get_le16(&gb)); } } - t += s->decorr[i].value * 2 * (s->stereo_in + 1); + t += decorr->value * 2 * (s->stereo_in + 1); } } got_samples = 1; @@ -1415,18 +1421,12 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no, size = bytestream2_get_byte(&gb); chan |= (bytestream2_get_byte(&gb) & 0xF) << 8; chan += 1; - if (avctx->ch_layout.nb_channels != chan) - av_log(avctx, AV_LOG_WARNING, "%i channels signalled" - " instead of %i.\n", chan, avctx->ch_layout.nb_channels); chmask = bytestream2_get_le24(&gb); break; case 5: size = bytestream2_get_byte(&gb); chan |= (bytestream2_get_byte(&gb) & 0xF) << 8; chan += 1; - if (avctx->ch_layout.nb_channels != chan) - av_log(avctx, AV_LOG_WARNING, "%i channels signalled" - " instead of %i.\n", chan, avctx->ch_layout.nb_channels); chmask = bytestream2_get_le32(&gb); break; default: @@ -1519,11 +1519,7 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no, return AVERROR_INVALIDDATA; } } else { - ret = av_channel_layout_copy(&new_ch_layout, &avctx->ch_layout); - if (ret < 0) { - av_log(avctx, AV_LOG_ERROR, "Error copying channel layout\n"); - return ret; - } + av_channel_layout_default(&new_ch_layout, chan); } } else { av_channel_layout_default(&new_ch_layout, s->stereo + 1); diff --git a/src/third_party/ffmpeg/libavcodec/wavpackenc.c b/src/third_party/ffmpeg/libavcodec/wavpackenc.c index 9271e879..33a5dfcc 100644 --- a/src/third_party/ffmpeg/libavcodec/wavpackenc.c +++ b/src/third_party/ffmpeg/libavcodec/wavpackenc.c @@ -2592,7 +2592,16 @@ static int wavpack_encode_block(WavPackEncodeContext *s, s->avctx->ch_layout.u.mask != AV_CH_LAYOUT_STEREO) { put_metadata_block(&pb, WP_ID_CHANINFO, 5); bytestream2_put_byte(&pb, s->avctx->ch_layout.nb_channels); - bytestream2_put_le32(&pb, s->avctx->ch_layout.u.mask); + if (s->avctx->ch_layout.u.mask >> 32) + bytestream2_put_le32(&pb, 0); + else + bytestream2_put_le32(&pb, s->avctx->ch_layout.u.mask); + bytestream2_put_byte(&pb, 0); + } else if (s->flags & WV_INITIAL_BLOCK && + s->avctx->ch_layout.order == AV_CHANNEL_ORDER_UNSPEC) { + put_metadata_block(&pb, WP_ID_CHANINFO, 5); + bytestream2_put_byte(&pb, s->avctx->ch_layout.nb_channels); + bytestream2_put_le32(&pb, 0); bytestream2_put_byte(&pb, 0); } diff --git a/src/third_party/ffmpeg/libavcodec/webp.c b/src/third_party/ffmpeg/libavcodec/webp.c index d35cb66f..54b3fde6 100644 --- a/src/third_party/ffmpeg/libavcodec/webp.c +++ b/src/third_party/ffmpeg/libavcodec/webp.c @@ -233,7 +233,7 @@ static void image_ctx_free(ImageContext *img) if (img->huffman_groups) { for (i = 0; i < img->nb_huffman_groups; i++) { for (j = 0; j < HUFFMAN_CODES_PER_META_CODE; j++) - ff_free_vlc(&img->huffman_groups[i * HUFFMAN_CODES_PER_META_CODE + j].vlc); + ff_vlc_free(&img->huffman_groups[i * HUFFMAN_CODES_PER_META_CODE + j].vlc); } av_free(img->huffman_groups); } @@ -300,9 +300,9 @@ static int huff_reader_build_canonical(HuffReader *r, const uint8_t *code_length return AVERROR_INVALIDDATA; } - ret = init_vlc(&r->vlc, 8, alphabet_size, + ret = vlc_init(&r->vlc, 8, alphabet_size, code_lengths, sizeof(*code_lengths), sizeof(*code_lengths), - codes, sizeof(*codes), sizeof(*codes), INIT_VLC_OUTPUT_LE); + codes, sizeof(*codes), sizeof(*codes), VLC_INIT_OUTPUT_LE); if (ret < 0) { av_free(codes); return ret; @@ -415,7 +415,7 @@ static int read_huffman_code_normal(WebPContext *s, HuffReader *hc, ret = huff_reader_build_canonical(hc, code_lengths, alphabet_size); finish: - ff_free_vlc(&code_len_hc.vlc); + ff_vlc_free(&code_len_hc.vlc); av_free(code_lengths); return ret; } diff --git a/src/third_party/ffmpeg/libavcodec/wma.c b/src/third_party/ffmpeg/libavcodec/wma.c index 41d16e52..3b4d049a 100644 --- a/src/third_party/ffmpeg/libavcodec/wma.c +++ b/src/third_party/ffmpeg/libavcodec/wma.c @@ -42,7 +42,7 @@ static av_cold int init_coef_vlc(VLC *vlc, uint16_t **prun_table, float *flevel_table; int i, l, j, k, level, ret; - ret = init_vlc(vlc, VLCBITS, n, table_bits, 1, 1, table_codes, 4, 4, 0); + ret = vlc_init(vlc, VLCBITS, n, table_bits, 1, 1, table_codes, 4, 4, 0); if (ret < 0) return ret; @@ -372,11 +372,11 @@ int ff_wma_end(AVCodecContext *avctx) av_tx_uninit(&s->mdct_ctx[i]); if (s->use_exp_vlc) - ff_free_vlc(&s->exp_vlc); + ff_vlc_free(&s->exp_vlc); if (s->use_noise_coding) - ff_free_vlc(&s->hgain_vlc); + ff_vlc_free(&s->hgain_vlc); for (i = 0; i < 2; i++) { - ff_free_vlc(&s->coef_vlc[i]); + ff_vlc_free(&s->coef_vlc[i]); av_freep(&s->run_table[i]); av_freep(&s->level_table[i]); av_freep(&s->int_table[i]); diff --git a/src/third_party/ffmpeg/libavcodec/wmadec.c b/src/third_party/ffmpeg/libavcodec/wmadec.c index bc18d182..ab48e28e 100644 --- a/src/third_party/ffmpeg/libavcodec/wmadec.c +++ b/src/third_party/ffmpeg/libavcodec/wmadec.c @@ -119,7 +119,7 @@ static av_cold int wma_decode_init(AVCodecContext *avctx) } if (s->use_noise_coding) { - ret = ff_init_vlc_from_lengths(&s->hgain_vlc, HGAINVLCBITS, + ret = ff_vlc_init_from_lengths(&s->hgain_vlc, HGAINVLCBITS, FF_ARRAY_ELEMS(ff_wma_hgain_hufftab), &ff_wma_hgain_hufftab[0][1], 2, &ff_wma_hgain_hufftab[0][0], 2, 1, @@ -130,7 +130,7 @@ static av_cold int wma_decode_init(AVCodecContext *avctx) if (s->use_exp_vlc) { // FIXME move out of context - ret = init_vlc(&s->exp_vlc, EXPVLCBITS, sizeof(ff_aac_scalefactor_bits), + ret = vlc_init(&s->exp_vlc, EXPVLCBITS, sizeof(ff_aac_scalefactor_bits), ff_aac_scalefactor_bits, 1, 1, ff_aac_scalefactor_code, 4, 4, 0); if (ret < 0) diff --git a/src/third_party/ffmpeg/libavcodec/wmaprodec.c b/src/third_party/ffmpeg/libavcodec/wmaprodec.c index f523f363..61b86ad6 100644 --- a/src/third_party/ffmpeg/libavcodec/wmaprodec.c +++ b/src/third_party/ffmpeg/libavcodec/wmaprodec.c @@ -320,25 +320,25 @@ static av_cold int get_rate(AVCodecContext *avctx) static av_cold void decode_init_static(void) { - INIT_VLC_STATIC_FROM_LENGTHS(&sf_vlc, SCALEVLCBITS, HUFF_SCALE_SIZE, + VLC_INIT_STATIC_FROM_LENGTHS(&sf_vlc, SCALEVLCBITS, HUFF_SCALE_SIZE, &scale_table[0][1], 2, &scale_table[0][0], 2, 1, -60, 0, 616); - INIT_VLC_STATIC_FROM_LENGTHS(&sf_rl_vlc, VLCBITS, HUFF_SCALE_RL_SIZE, + VLC_INIT_STATIC_FROM_LENGTHS(&sf_rl_vlc, VLCBITS, HUFF_SCALE_RL_SIZE, &scale_rl_table[0][1], 2, &scale_rl_table[0][0], 2, 1, 0, 0, 1406); - INIT_VLC_STATIC_FROM_LENGTHS(&coef_vlc[0], VLCBITS, HUFF_COEF0_SIZE, + VLC_INIT_STATIC_FROM_LENGTHS(&coef_vlc[0], VLCBITS, HUFF_COEF0_SIZE, coef0_lens, 1, coef0_syms, 2, 2, 0, 0, 2108); - INIT_VLC_STATIC_FROM_LENGTHS(&coef_vlc[1], VLCBITS, HUFF_COEF1_SIZE, + VLC_INIT_STATIC_FROM_LENGTHS(&coef_vlc[1], VLCBITS, HUFF_COEF1_SIZE, &coef1_table[0][1], 2, &coef1_table[0][0], 2, 1, 0, 0, 3912); - INIT_VLC_STATIC_FROM_LENGTHS(&vec4_vlc, VLCBITS, HUFF_VEC4_SIZE, + VLC_INIT_STATIC_FROM_LENGTHS(&vec4_vlc, VLCBITS, HUFF_VEC4_SIZE, vec4_lens, 1, vec4_syms, 2, 2, -1, 0, 604); - INIT_VLC_STATIC_FROM_LENGTHS(&vec2_vlc, VLCBITS, HUFF_VEC2_SIZE, + VLC_INIT_STATIC_FROM_LENGTHS(&vec2_vlc, VLCBITS, HUFF_VEC2_SIZE, &vec2_table[0][1], 2, &vec2_table[0][0], 2, 1, -1, 0, 562); - INIT_VLC_STATIC_FROM_LENGTHS(&vec1_vlc, VLCBITS, HUFF_VEC1_SIZE, + VLC_INIT_STATIC_FROM_LENGTHS(&vec1_vlc, VLCBITS, HUFF_VEC1_SIZE, &vec1_table[0][1], 2, &vec1_table[0][0], 2, 1, 0, 0, 562); diff --git a/src/third_party/ffmpeg/libavcodec/wmavoice.c b/src/third_party/ffmpeg/libavcodec/wmavoice.c index 44fda0e2..dd7cc64d 100644 --- a/src/third_party/ffmpeg/libavcodec/wmavoice.c +++ b/src/third_party/ffmpeg/libavcodec/wmavoice.c @@ -31,6 +31,7 @@ #include "libavutil/float_dsp.h" #include "libavutil/mem_internal.h" #include "libavutil/thread.h" +#include "libavutil/tx.h" #include "avcodec.h" #include "codec_internal.h" #include "decode.h" @@ -41,8 +42,6 @@ #include "acelp_vectors.h" #include "acelp_filters.h" #include "lsp.h" -#include "dct.h" -#include "rdft.h" #include "sinewin.h" #define MAX_BLOCKS 8 ///< maximum number of blocks per frame @@ -263,10 +262,10 @@ typedef struct WMAVoiceContext { * smoothing and so on, and context variables for FFT/iFFT. * @{ */ - RDFTContext rdft, irdft; ///< contexts for FFT-calculation in the - ///< postfilter (for denoise filter) - DCTContext dct, dst; ///< contexts for phase shift (in Hilbert - ///< transform, part of postfilter) + AVTXContext *rdft, *irdft; ///< contexts for FFT-calculation in the + av_tx_fn rdft_fn, irdft_fn; ///< postfilter (for denoise filter) + AVTXContext *dct, *dst; ///< contexts for phase shift (in Hilbert + av_tx_fn dct_fn, dst_fn; ///< transform, part of postfilter) float sin[511], cos[511]; ///< 8-bit cosine/sine windows over [-pi,pi] ///< range float postfilter_agc; ///< gain control memory, used in @@ -277,9 +276,9 @@ typedef struct WMAVoiceContext { ///< by postfilter float denoise_filter_cache[MAX_FRAMESIZE]; int denoise_filter_cache_size; ///< samples in #denoise_filter_cache - DECLARE_ALIGNED(32, float, tilted_lpcs_pf)[0x80]; + DECLARE_ALIGNED(32, float, tilted_lpcs_pf)[0x82]; ///< aligned buffer for LPC tilting - DECLARE_ALIGNED(32, float, denoise_coeffs_pf)[0x80]; + DECLARE_ALIGNED(32, float, denoise_coeffs_pf)[0x82]; ///< aligned buffer for denoise coefficients DECLARE_ALIGNED(32, float, synth_filter_out_buf)[0x80 + MAX_LSPS_ALIGN16]; ///< aligned buffer for postfilter speech @@ -321,7 +320,7 @@ static av_cold void wmavoice_init_static_data(void) 14, 14, 14, 14 }; - INIT_VLC_STATIC_FROM_LENGTHS(&frame_type_vlc, VLC_NBITS, + VLC_INIT_STATIC_FROM_LENGTHS(&frame_type_vlc, VLC_NBITS, FF_ARRAY_ELEMS(bits), bits, 1, NULL, 0, 0, 0, 0, 132); } @@ -388,10 +387,24 @@ static av_cold int wmavoice_decode_init(AVCodecContext *ctx) s->spillover_bitsize = 3 + av_ceil_log2(ctx->block_align); s->do_apf = flags & 0x1; if (s->do_apf) { - if ((ret = ff_rdft_init(&s->rdft, 7, DFT_R2C)) < 0 || - (ret = ff_rdft_init(&s->irdft, 7, IDFT_C2R)) < 0 || - (ret = ff_dct_init (&s->dct, 6, DCT_I)) < 0 || - (ret = ff_dct_init (&s->dst, 6, DST_I)) < 0) + float scale = 1.0f; + + ret = av_tx_init(&s->rdft, &s->rdft_fn, AV_TX_FLOAT_RDFT, 0, 1 << 7, &scale, 0); + if (ret < 0) + return ret; + + ret = av_tx_init(&s->irdft, &s->irdft_fn, AV_TX_FLOAT_RDFT, 1, 1 << 7, &scale, 0); + if (ret < 0) + return ret; + + scale = 1.0 / (1 << 6); + ret = av_tx_init(&s->dct, &s->dct_fn, AV_TX_FLOAT_DCT_I, 0, 1 << 6, &scale, 0); + if (ret < 0) + return ret; + + scale = 1.0 / (1 << 6); + ret = av_tx_init(&s->dst, &s->dst_fn, AV_TX_FLOAT_DST_I, 0, 1 << 6, &scale, 0); + if (ret < 0) return ret; ff_sine_window_init(s->cos, 256); @@ -596,20 +609,25 @@ static float tilt_factor(const float *lpcs, int n_lpcs) /** * Derive denoise filter coefficients (in real domain) from the LPCs. */ -static void calc_input_response(WMAVoiceContext *s, float *lpcs, - int fcb_type, float *coeffs, int remainder) +static void calc_input_response(WMAVoiceContext *s, float *lpcs_src, + int fcb_type, float *coeffs_dst, int remainder) { float last_coeff, min = 15.0, max = -15.0; float irange, angle_mul, gain_mul, range, sq; + LOCAL_ALIGNED_32(float, coeffs, [0x82]); + LOCAL_ALIGNED_32(float, lpcs, [0x82]); + LOCAL_ALIGNED_32(float, lpcs_dct, [0x82]); int n, idx; + memcpy(coeffs, coeffs_dst, 0x82*sizeof(float)); + /* Create frequency power spectrum of speech input (i.e. RDFT of LPCs) */ - s->rdft.rdft_calc(&s->rdft, lpcs); + s->rdft_fn(s->rdft, lpcs, lpcs_src, sizeof(float)); #define log_range(var, assign) do { \ float tmp = log10f(assign); var = tmp; \ max = FFMAX(max, tmp); min = FFMIN(min, tmp); \ } while (0) - log_range(last_coeff, lpcs[1] * lpcs[1]); + log_range(last_coeff, lpcs[64] * lpcs[64]); for (n = 1; n < 64; n++) log_range(lpcs[n], lpcs[n * 2] * lpcs[n * 2] + lpcs[n * 2 + 1] * lpcs[n * 2 + 1]); @@ -649,8 +667,8 @@ static void calc_input_response(WMAVoiceContext *s, float *lpcs, * is a sine input) by doing a phase shift (in theory, H(sin())=cos()). * Hilbert_Transform(RDFT(x)) = Laplace_Transform(x), which calculates the * "moment" of the LPCs in this filter. */ - s->dct.dct_calc(&s->dct, lpcs); - s->dst.dct_calc(&s->dst, lpcs); + s->dct_fn(s->dct, lpcs_dct, lpcs, sizeof(float)); + s->dst_fn(s->dst, lpcs, lpcs_dct, sizeof(float)); /* Split out the coefficient indexes into phase/magnitude pairs */ idx = 255 + av_clip(lpcs[64], -255, 255); @@ -668,25 +686,25 @@ static void calc_input_response(WMAVoiceContext *s, float *lpcs, coeffs[n * 2 + 1] = coeffs[n] * s->sin[idx]; coeffs[n * 2] = coeffs[n] * s->cos[idx]; } - coeffs[1] = last_coeff; + coeffs[64] = last_coeff; /* move into real domain */ - s->irdft.rdft_calc(&s->irdft, coeffs); + s->irdft_fn(s->irdft, coeffs_dst, coeffs, sizeof(AVComplexFloat)); /* tilt correction and normalize scale */ - memset(&coeffs[remainder], 0, sizeof(coeffs[0]) * (128 - remainder)); + memset(&coeffs_dst[remainder], 0, sizeof(coeffs_dst[0]) * (128 - remainder)); if (s->denoise_tilt_corr) { float tilt_mem = 0; - coeffs[remainder - 1] = 0; + coeffs_dst[remainder - 1] = 0; ff_tilt_compensation(&tilt_mem, - -1.8 * tilt_factor(coeffs, remainder - 1), - coeffs, remainder); + -1.8 * tilt_factor(coeffs_dst, remainder - 1), + coeffs_dst, remainder); } - sq = (1.0 / 64.0) * sqrtf(1 / avpriv_scalarproduct_float_c(coeffs, coeffs, + sq = (1.0 / 64.0) * sqrtf(1 / avpriv_scalarproduct_float_c(coeffs_dst, coeffs_dst, remainder)); for (n = 0; n < remainder; n++) - coeffs[n] *= sq; + coeffs_dst[n] *= sq; } /** @@ -722,6 +740,8 @@ static void wiener_denoise(WMAVoiceContext *s, int fcb_type, int remainder, lim, n; if (fcb_type != FCB_TYPE_SILENCE) { + LOCAL_ALIGNED_32(float, coeffs_f, [0x82]); + LOCAL_ALIGNED_32(float, synth_f, [0x82]); float *tilted_lpcs = s->tilted_lpcs_pf, *coeffs = s->denoise_coeffs_pf, tilt_mem = 0; @@ -742,16 +762,16 @@ static void wiener_denoise(WMAVoiceContext *s, int fcb_type, /* apply coefficients (in frequency spectrum domain), i.e. complex * number multiplication */ memset(&synth_pf[size], 0, sizeof(synth_pf[0]) * (128 - size)); - s->rdft.rdft_calc(&s->rdft, synth_pf); - s->rdft.rdft_calc(&s->rdft, coeffs); - synth_pf[0] *= coeffs[0]; - synth_pf[1] *= coeffs[1]; - for (n = 1; n < 64; n++) { - float v1 = synth_pf[n * 2], v2 = synth_pf[n * 2 + 1]; - synth_pf[n * 2] = v1 * coeffs[n * 2] - v2 * coeffs[n * 2 + 1]; - synth_pf[n * 2 + 1] = v2 * coeffs[n * 2] + v1 * coeffs[n * 2 + 1]; + s->rdft_fn(s->rdft, synth_f, synth_pf, sizeof(float)); + s->rdft_fn(s->rdft, coeffs_f, coeffs, sizeof(float)); + synth_f[0] *= coeffs_f[0]; + synth_f[1] *= coeffs_f[1]; + for (n = 1; n <= 64; n++) { + float v1 = synth_f[n * 2], v2 = synth_f[n * 2 + 1]; + synth_f[n * 2] = v1 * coeffs_f[n * 2] - v2 * coeffs_f[n * 2 + 1]; + synth_f[n * 2 + 1] = v2 * coeffs_f[n * 2] + v1 * coeffs_f[n * 2 + 1]; } - s->irdft.rdft_calc(&s->irdft, synth_pf); + s->irdft_fn(s->irdft, synth_pf, synth_f, sizeof(AVComplexFloat)); } /* merge filter output with the history of previous runs */ @@ -1986,10 +2006,10 @@ static av_cold int wmavoice_decode_end(AVCodecContext *ctx) WMAVoiceContext *s = ctx->priv_data; if (s->do_apf) { - ff_rdft_end(&s->rdft); - ff_rdft_end(&s->irdft); - ff_dct_end(&s->dct); - ff_dct_end(&s->dst); + av_tx_uninit(&s->rdft); + av_tx_uninit(&s->irdft); + av_tx_uninit(&s->dct); + av_tx_uninit(&s->dst); } return 0; diff --git a/src/third_party/ffmpeg/libavcodec/wnv1.c b/src/third_party/ffmpeg/libavcodec/wnv1.c index 5c57db00..ffc9174a 100644 --- a/src/third_party/ffmpeg/libavcodec/wnv1.c +++ b/src/third_party/ffmpeg/libavcodec/wnv1.c @@ -115,10 +115,10 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *p, static av_cold void wnv1_init_static(void) { - INIT_VLC_STATIC_FROM_LENGTHS(&code_vlc, CODE_VLC_BITS, 16, + VLC_INIT_STATIC_FROM_LENGTHS(&code_vlc, CODE_VLC_BITS, 16, &code_tab[0][1], 2, &code_tab[0][0], 2, 1, - -7, INIT_VLC_OUTPUT_LE, 1 << CODE_VLC_BITS); + -7, VLC_INIT_OUTPUT_LE, 1 << CODE_VLC_BITS); } static av_cold int decode_init(AVCodecContext *avctx) diff --git a/src/third_party/ffmpeg/libavcodec/x86/Makefile b/src/third_party/ffmpeg/libavcodec/x86/Makefile index 118daca3..d5fb3064 100644 --- a/src/third_party/ffmpeg/libavcodec/x86/Makefile +++ b/src/third_party/ffmpeg/libavcodec/x86/Makefile @@ -5,11 +5,9 @@ OBJS-$(CONFIG_AC3DSP) += x86/ac3dsp_init.o OBJS-$(CONFIG_AUDIODSP) += x86/audiodsp_init.o OBJS-$(CONFIG_BLOCKDSP) += x86/blockdsp_init.o OBJS-$(CONFIG_BSWAPDSP) += x86/bswapdsp_init.o -OBJS-$(CONFIG_DCT) += x86/dct_init.o OBJS-$(CONFIG_DIRAC_DECODER) += x86/diracdsp_init.o \ x86/dirac_dwt_init.o OBJS-$(CONFIG_FDCTDSP) += x86/fdctdsp_init.o -OBJS-$(CONFIG_FFT) += x86/fft_init.o OBJS-$(CONFIG_FMTCONVERT) += x86/fmtconvert_init.o OBJS-$(CONFIG_H263DSP) += x86/h263dsp_init.o OBJS-$(CONFIG_H264CHROMA) += x86/h264chroma_init.o @@ -75,7 +73,6 @@ OBJS-$(CONFIG_UTVIDEO_DECODER) += x86/utvideodsp_init.o OBJS-$(CONFIG_V210_DECODER) += x86/v210-init.o OBJS-$(CONFIG_V210_ENCODER) += x86/v210enc_init.o OBJS-$(CONFIG_VORBIS_DECODER) += x86/vorbisdsp_init.o -OBJS-$(CONFIG_VP3_DECODER) += x86/hpeldsp_vp3_init.o OBJS-$(CONFIG_VP6_DECODER) += x86/vp6dsp_init.o OBJS-$(CONFIG_VP9_DECODER) += x86/vp9dsp_init.o \ x86/vp9dsp_init_10bpp.o \ @@ -99,8 +96,6 @@ X86ASM-OBJS-$(CONFIG_AC3DSP) += x86/ac3dsp.o \ X86ASM-OBJS-$(CONFIG_AUDIODSP) += x86/audiodsp.o X86ASM-OBJS-$(CONFIG_BLOCKDSP) += x86/blockdsp.o X86ASM-OBJS-$(CONFIG_BSWAPDSP) += x86/bswapdsp.o -X86ASM-OBJS-$(CONFIG_DCT) += x86/dct32.o -X86ASM-OBJS-$(CONFIG_FFT) += x86/fft.o X86ASM-OBJS-$(CONFIG_FMTCONVERT) += x86/fmtconvert.o X86ASM-OBJS-$(CONFIG_H263DSP) += x86/h263_loopfilter.o X86ASM-OBJS-$(CONFIG_H264CHROMA) += x86/h264_chromamc.o \ @@ -127,7 +122,7 @@ X86ASM-OBJS-$(CONFIG_LLVIDDSP) += x86/lossless_videodsp.o X86ASM-OBJS-$(CONFIG_LLVIDENCDSP) += x86/lossless_videoencdsp.o X86ASM-OBJS-$(CONFIG_LPC) += x86/lpc.o X86ASM-OBJS-$(CONFIG_ME_CMP) += x86/me_cmp.o -X86ASM-OBJS-$(CONFIG_MPEGAUDIODSP) += x86/imdct36.o +X86ASM-OBJS-$(CONFIG_MPEGAUDIODSP) += x86/dct32.o x86/imdct36.o X86ASM-OBJS-$(CONFIG_MPEGVIDEOENC) += x86/mpegvideoencdsp.o X86ASM-OBJS-$(CONFIG_OPUS_DECODER) += x86/opusdsp.o X86ASM-OBJS-$(CONFIG_OPUS_ENCODER) += x86/celt_pvq_search.o @@ -192,7 +187,6 @@ X86ASM-OBJS-$(CONFIG_UTVIDEO_DECODER) += x86/utvideodsp.o X86ASM-OBJS-$(CONFIG_V210_ENCODER) += x86/v210enc.o X86ASM-OBJS-$(CONFIG_V210_DECODER) += x86/v210.o X86ASM-OBJS-$(CONFIG_VORBIS_DECODER) += x86/vorbisdsp.o -X86ASM-OBJS-$(CONFIG_VP3_DECODER) += x86/hpeldsp_vp3.o X86ASM-OBJS-$(CONFIG_VP6_DECODER) += x86/vp6dsp.o X86ASM-OBJS-$(CONFIG_VP9_DECODER) += x86/vp9intrapred.o \ x86/vp9intrapred_16bpp.o \ diff --git a/src/third_party/ffmpeg/libavcodec/x86/hpeldsp.asm b/src/third_party/ffmpeg/libavcodec/x86/hpeldsp.asm index 7a2b7135..3bc27861 100644 --- a/src/third_party/ffmpeg/libavcodec/x86/hpeldsp.asm +++ b/src/third_party/ffmpeg/libavcodec/x86/hpeldsp.asm @@ -165,6 +165,47 @@ cglobal put_no_rnd_pixels8_x2, 4,5 RET +; void ff_put_no_rnd_pixels8_x2_exact(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) +INIT_MMX mmxext +cglobal put_no_rnd_pixels8_x2_exact, 4,5 + lea r4, [r2*3] + pcmpeqb m6, m6 +.loop: + mova m0, [r1] + mova m2, [r1+r2] + mova m1, [r1+1] + mova m3, [r1+r2+1] + pxor m0, m6 + pxor m2, m6 + pxor m1, m6 + pxor m3, m6 + PAVGB m0, m1 + PAVGB m2, m3 + pxor m0, m6 + pxor m2, m6 + mova [r0], m0 + mova [r0+r2], m2 + mova m0, [r1+r2*2] + mova m1, [r1+r2*2+1] + mova m2, [r1+r4] + mova m3, [r1+r4+1] + pxor m0, m6 + pxor m1, m6 + pxor m2, m6 + pxor m3, m6 + PAVGB m0, m1 + PAVGB m2, m3 + pxor m0, m6 + pxor m2, m6 + mova [r0+r2*2], m0 + mova [r0+r4], m2 + lea r1, [r1+r2*4] + lea r0, [r0+r2*4] + sub r3d, 4 + jg .loop + RET + + ; void ff_put_pixels8_y2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) %macro PUT_PIXELS8_Y2 0 %if cpuflag(sse2) @@ -235,6 +276,42 @@ cglobal put_no_rnd_pixels8_y2, 4,5 RET +; void ff_put_no_rnd_pixels8_y2_exact(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) +INIT_MMX mmxext +cglobal put_no_rnd_pixels8_y2_exact, 4,5 + lea r4, [r2*3] + mova m0, [r1] + pcmpeqb m6, m6 + add r1, r2 + pxor m0, m6 +.loop: + mova m1, [r1] + mova m2, [r1+r2] + pxor m1, m6 + pxor m2, m6 + PAVGB m0, m1 + PAVGB m1, m2 + pxor m0, m6 + pxor m1, m6 + mova [r0], m0 + mova [r0+r2], m1 + mova m1, [r1+r2*2] + mova m0, [r1+r4] + pxor m1, m6 + pxor m0, m6 + PAVGB m2, m1 + PAVGB m1, m0 + pxor m2, m6 + pxor m1, m6 + mova [r0+r2*2], m2 + mova [r0+r4], m1 + lea r1, [r1+r2*4] + lea r0, [r0+r2*4] + sub r3d, 4 + jg .loop + RET + + ; void ff_avg_pixels8_x2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) %macro AVG_PIXELS8_X2 0 %if cpuflag(sse2) diff --git a/src/third_party/ffmpeg/libavcodec/x86/hpeldsp.h b/src/third_party/ffmpeg/libavcodec/x86/hpeldsp.h index fd740da7..ac7e625f 100644 --- a/src/third_party/ffmpeg/libavcodec/x86/hpeldsp.h +++ b/src/third_party/ffmpeg/libavcodec/x86/hpeldsp.h @@ -22,8 +22,6 @@ #include #include -#include "libavcodec/hpeldsp.h" - void ff_avg_pixels8_x2_mmx(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); @@ -50,6 +48,4 @@ void ff_put_pixels16_xy2_sse2(uint8_t *block, const uint8_t *pixels, void ff_put_pixels16_xy2_ssse3(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); -void ff_hpeldsp_vp3_init_x86(HpelDSPContext *c, int cpu_flags, int flags); - #endif /* AVCODEC_X86_HPELDSP_H */ diff --git a/src/third_party/ffmpeg/libavcodec/x86/hpeldsp_init.c b/src/third_party/ffmpeg/libavcodec/x86/hpeldsp_init.c index 09c48c34..f08c66f5 100644 --- a/src/third_party/ffmpeg/libavcodec/x86/hpeldsp_init.c +++ b/src/third_party/ffmpeg/libavcodec/x86/hpeldsp_init.c @@ -22,8 +22,6 @@ * MMX optimization by Nick Kurshev */ -#include "config_components.h" - #include "libavutil/attributes.h" #include "libavutil/cpu.h" #include "libavutil/x86/cpu.h" @@ -47,10 +45,16 @@ void ff_avg_pixels16_y2_sse2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); void ff_put_no_rnd_pixels8_x2_mmxext(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); +void ff_put_no_rnd_pixels8_x2_exact_mmxext(uint8_t *block, + const uint8_t *pixels, + ptrdiff_t line_size, int h); void ff_put_pixels8_y2_mmxext(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); void ff_put_no_rnd_pixels8_y2_mmxext(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); +void ff_put_no_rnd_pixels8_y2_exact_mmxext(uint8_t *block, + const uint8_t *pixels, + ptrdiff_t line_size, int h); void ff_avg_pixels8_x2_mmxext(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); void ff_avg_pixels8_y2_mmxext(uint8_t *block, const uint8_t *pixels, @@ -183,6 +187,9 @@ static void hpeldsp_init_mmxext(HpelDSPContext *c, int flags) c->avg_pixels_tab[1][2] = ff_avg_pixels8_y2_mmxext; c->avg_pixels_tab[1][3] = ff_avg_pixels8_xy2_mmxext; + 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; + 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; @@ -235,7 +242,4 @@ av_cold void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags) if (EXTERNAL_SSSE3(cpu_flags)) hpeldsp_init_ssse3(c, flags); - - if (CONFIG_VP3_DECODER) - ff_hpeldsp_vp3_init_x86(c, cpu_flags, flags); } diff --git a/src/third_party/ffmpeg/libavcodec/x86/idctdsp_init.c b/src/third_party/ffmpeg/libavcodec/x86/idctdsp_init.c index f28a1ad7..2d165b97 100644 --- a/src/third_party/ffmpeg/libavcodec/x86/idctdsp_init.c +++ b/src/third_party/ffmpeg/libavcodec/x86/idctdsp_init.c @@ -45,10 +45,12 @@ av_cold int ff_init_scantable_permutation_x86(uint8_t *idct_permutation, int i; switch (perm_type) { +#if ARCH_X86_32 case FF_IDCT_PERM_SIMPLE: for (i = 0; i < 64; i++) idct_permutation[i] = simple_mmx_permutation[i]; return 1; +#endif case FF_IDCT_PERM_SSE2: for (i = 0; i < 64; i++) idct_permutation[i] = (i & 0x38) | idct_sse2_row_perm[i & 7]; diff --git a/src/third_party/ffmpeg/libavcodec/x86/mpegaudiodsp.c b/src/third_party/ffmpeg/libavcodec/x86/mpegaudiodsp.c index 6586fe07..43662cd2 100644 --- a/src/third_party/ffmpeg/libavcodec/x86/mpegaudiodsp.c +++ b/src/third_party/ffmpeg/libavcodec/x86/mpegaudiodsp.c @@ -45,6 +45,9 @@ void ff_four_imdct36_float_sse(float *out, float *buf, float *in, float *win, void ff_four_imdct36_float_avx(float *out, float *buf, float *in, float *win, float *tmpbuf); +void ff_dct32_float_sse2(float *out, const float *in); +void ff_dct32_float_avx (float *out, const float *in); + DECLARE_ALIGNED(16, static float, mdct_win_sse)[2][4][4*40]; #if HAVE_6REGS && HAVE_SSE_INLINE @@ -267,6 +270,7 @@ av_cold void ff_mpadsp_init_x86(MPADSPContext *s) #if HAVE_SSE if (EXTERNAL_SSE2(cpu_flags)) { s->imdct36_blocks_float = imdct36_blocks_sse2; + s->dct32_float = ff_dct32_float_sse2; } if (EXTERNAL_SSE3(cpu_flags)) { s->imdct36_blocks_float = imdct36_blocks_sse3; @@ -279,6 +283,8 @@ av_cold void ff_mpadsp_init_x86(MPADSPContext *s) if (EXTERNAL_AVX(cpu_flags)) { s->imdct36_blocks_float = imdct36_blocks_avx; } + if (EXTERNAL_AVX_FAST(cpu_flags)) + s->dct32_float = ff_dct32_float_avx; #endif #endif /* HAVE_X86ASM */ } diff --git a/src/third_party/ffmpeg/libavcodec/x86/mpegvideoenc_template.c b/src/third_party/ffmpeg/libavcodec/x86/mpegvideoenc_template.c index b5b0a5ff..5f013be7 100644 --- a/src/third_party/ffmpeg/libavcodec/x86/mpegvideoenc_template.c +++ b/src/third_party/ffmpeg/libavcodec/x86/mpegvideoenc_template.c @@ -225,7 +225,8 @@ static int RENAME(dct_quantize)(MpegEncContext *s, if(s->mb_intra) block[0]= level; else block[0]= temp_block[0]; - if (s->idsp.perm_type == FF_IDCT_PERM_SIMPLE) { + av_assert2(ARCH_X86_32 || s->idsp.perm_type != FF_IDCT_PERM_SIMPLE); + if (ARCH_X86_32 && s->idsp.perm_type == FF_IDCT_PERM_SIMPLE) { if(last_non_zero_p1 <= 1) goto end; block[0x08] = temp_block[0x01]; block[0x10] = temp_block[0x08]; block[0x20] = temp_block[0x10]; diff --git a/src/third_party/ffmpeg/libavcodec/x86/proresdsp_init.c b/src/third_party/ffmpeg/libavcodec/x86/proresdsp_init.c index bde79ab8..f7abbfa6 100644 --- a/src/third_party/ffmpeg/libavcodec/x86/proresdsp_init.c +++ b/src/third_party/ffmpeg/libavcodec/x86/proresdsp_init.c @@ -30,12 +30,12 @@ void ff_prores_idct_put_10_sse2(uint16_t *dst, ptrdiff_t linesize, void ff_prores_idct_put_10_avx (uint16_t *dst, ptrdiff_t linesize, int16_t *block, const int16_t *qmat); -av_cold void ff_proresdsp_init_x86(ProresDSPContext *dsp, AVCodecContext *avctx) +av_cold void ff_proresdsp_init_x86(ProresDSPContext *dsp, int bits_per_raw_sample) { #if ARCH_X86_64 int cpu_flags = av_get_cpu_flags(); - if (avctx->bits_per_raw_sample == 10){ + if (bits_per_raw_sample == 10) { if (EXTERNAL_SSE2(cpu_flags)) { dsp->idct_permutation_type = FF_IDCT_PERM_TRANSPOSE; dsp->idct_put = ff_prores_idct_put_10_sse2; diff --git a/src/third_party/ffmpeg/libavcodec/x86/snowdsp.c b/src/third_party/ffmpeg/libavcodec/x86/snowdsp.c index bca1f9bd..bd0aa766 100644 --- a/src/third_party/ffmpeg/libavcodec/x86/snowdsp.c +++ b/src/third_party/ffmpeg/libavcodec/x86/snowdsp.c @@ -24,7 +24,6 @@ #include "libavutil/attributes.h" #include "libavutil/cpu.h" #include "libavutil/x86/asm.h" -#include "libavcodec/snow.h" #include "libavcodec/snow_dwt.h" #if HAVE_INLINE_ASM diff --git a/src/third_party/ffmpeg/libavcodec/xan.c b/src/third_party/ffmpeg/libavcodec/xan.c index 14fc2443..cc0ecea5 100644 --- a/src/third_party/ffmpeg/libavcodec/xan.c +++ b/src/third_party/ffmpeg/libavcodec/xan.c @@ -622,8 +622,7 @@ static int xan_decode_frame(AVCodecContext *avctx, AVFrame *frame, if (xan_wc3_decode_frame(s, frame) < 0) return AVERROR_INVALIDDATA; - av_frame_unref(s->last_frame); - if ((ret = av_frame_ref(s->last_frame, frame)) < 0) + if ((ret = av_frame_replace(s->last_frame, frame)) < 0) return ret; *got_frame = 1; diff --git a/src/third_party/ffmpeg/libavcodec/xvididct.c b/src/third_party/ffmpeg/libavcodec/xvididct.c index f338901a..dcea3221 100644 --- a/src/third_party/ffmpeg/libavcodec/xvididct.c +++ b/src/third_party/ffmpeg/libavcodec/xvididct.c @@ -69,24 +69,24 @@ static int idct_row(short *in, const int *const tab, int rnd) if (!(right | in[4])) { const int k = c4 * in[0] + rnd; if (left) { - const int a0 = k + c2 * in[2]; - const int a1 = k + c6 * in[2]; - const int a2 = k - c6 * in[2]; - const int a3 = k - c2 * in[2]; + const unsigned a0 = k + c2 * in[2]; + const unsigned a1 = k + c6 * in[2]; + const unsigned a2 = k - c6 * in[2]; + const unsigned a3 = k - c2 * in[2]; const int b0 = c1 * in[1] + c3 * in[3]; const int b1 = c3 * in[1] - c7 * in[3]; const int b2 = c5 * in[1] - c1 * in[3]; const int b3 = c7 * in[1] - c5 * in[3]; - in[0] = (a0 + b0) >> ROW_SHIFT; - in[1] = (a1 + b1) >> ROW_SHIFT; - in[2] = (a2 + b2) >> ROW_SHIFT; - in[3] = (a3 + b3) >> ROW_SHIFT; - in[4] = (a3 - b3) >> ROW_SHIFT; - in[5] = (a2 - b2) >> ROW_SHIFT; - in[6] = (a1 - b1) >> ROW_SHIFT; - in[7] = (a0 - b0) >> ROW_SHIFT; + in[0] = (int)(a0 + b0) >> ROW_SHIFT; + in[1] = (int)(a1 + b1) >> ROW_SHIFT; + in[2] = (int)(a2 + b2) >> ROW_SHIFT; + in[3] = (int)(a3 + b3) >> ROW_SHIFT; + in[4] = (int)(a3 - b3) >> ROW_SHIFT; + in[5] = (int)(a2 - b2) >> ROW_SHIFT; + in[6] = (int)(a1 - b1) >> ROW_SHIFT; + in[7] = (int)(a0 - b0) >> ROW_SHIFT; } else { const int a0 = k >> ROW_SHIFT; if (a0) { @@ -114,7 +114,7 @@ static int idct_row(short *in, const int *const tab, int rnd) in[5] = a1; in[6] = a1; } else { - const int k = c4 * in[0] + rnd; + const unsigned int k = c4 * in[0] + rnd; const unsigned int a0 = k + c2 * in[2] + c4 * in[4] + c6 * in[6]; const unsigned int a1 = k + c6 * in[2] - c4 * in[4] - c2 * in[6]; const unsigned int a2 = k - c6 * in[2] - c4 * in[4] + c2 * in[6]; diff --git a/src/third_party/ffmpeg/libavcodec/ylc.c b/src/third_party/ffmpeg/libavcodec/ylc.c index c0c4d27c..b03df315 100644 --- a/src/third_party/ffmpeg/libavcodec/ylc.c +++ b/src/third_party/ffmpeg/libavcodec/ylc.c @@ -87,7 +87,7 @@ static int build_vlc(AVCodecContext *avctx, VLC *vlc, const uint32_t *table) uint8_t xlat[256]; int cur_node, i, j, pos = 0; - ff_free_vlc(vlc); + ff_vlc_free(vlc); for (i = 0; i < 256; i++) { nodes[i].count = table[i]; @@ -142,7 +142,7 @@ static int build_vlc(AVCodecContext *avctx, VLC *vlc, const uint32_t *table) get_tree_codes(bits, lens, xlat, nodes, cur_node - 1, 0, 0, &pos); - return ff_init_vlc_sparse(vlc, YLC_VLC_BITS, pos, lens, 2, 2, + return ff_vlc_init_sparse(vlc, YLC_VLC_BITS, pos, lens, 2, 2, bits, 4, 4, xlat, 1, 1, 0); } @@ -438,7 +438,7 @@ static av_cold int decode_end(AVCodecContext *avctx) YLCContext *s = avctx->priv_data; for (int i = 0; i < FF_ARRAY_ELEMS(s->vlc); i++) - ff_free_vlc(&s->vlc[i]); + ff_vlc_free(&s->vlc[i]); av_freep(&s->buffer); s->buffer_size = 0; diff --git a/src/third_party/ffmpeg/libavcodec/yuv4enc.c b/src/third_party/ffmpeg/libavcodec/yuv4enc.c index 8123260d..2a9d3442 100644 --- a/src/third_party/ffmpeg/libavcodec/yuv4enc.c +++ b/src/third_party/ffmpeg/libavcodec/yuv4enc.c @@ -29,10 +29,10 @@ static int yuv4_encode_frame(AVCodecContext *avctx, AVPacket *pkt, { uint8_t *dst; const uint8_t *y, *u, *v; - int i, j, ret; + int ret; - ret = ff_get_encode_buffer(avctx, pkt, 6 * (avctx->width + 1 >> 1) - * (avctx->height + 1 >> 1), 0); + ret = ff_get_encode_buffer(avctx, pkt, 6 * ((avctx->width + 1) / 2) + * ((avctx->height + 1) / 2), 0); if (ret < 0) return ret; dst = pkt->data; @@ -41,8 +41,8 @@ static int yuv4_encode_frame(AVCodecContext *avctx, AVPacket *pkt, u = pic->data[1]; v = pic->data[2]; - for (i = 0; i < avctx->height + 1 >> 1; i++) { - for (j = 0; j < avctx->width + 1 >> 1; j++) { + for (int i = 0; i < avctx->height / 2; i++) { + for (int j = 0; j < (avctx->width + 1) / 2; j++) { *dst++ = u[j] ^ 0x80; *dst++ = v[j] ^ 0x80; *dst++ = y[ 2 * j ]; @@ -55,6 +55,17 @@ static int yuv4_encode_frame(AVCodecContext *avctx, AVPacket *pkt, v += pic->linesize[2]; } + if (avctx->height & 1) { + for (int j = 0; j < (avctx->width + 1) / 2; j++) { + *dst++ = u[j] ^ 0x80; + *dst++ = v[j] ^ 0x80; + *dst++ = y[2 * j ]; + *dst++ = y[2 * j + 1]; + *dst++ = y[2 * j ]; + *dst++ = y[2 * j + 1]; + } + } + *got_packet = 1; return 0; } diff --git a/src/third_party/ffmpeg/libavcodec/zerocodec.c b/src/third_party/ffmpeg/libavcodec/zerocodec.c index 6c3bcebc..48f78d1d 100644 --- a/src/third_party/ffmpeg/libavcodec/zerocodec.c +++ b/src/third_party/ffmpeg/libavcodec/zerocodec.c @@ -93,8 +93,7 @@ static int zerocodec_decode_frame(AVCodecContext *avctx, AVFrame *pic, dst -= pic->linesize[0]; } - av_frame_unref(zc->previous_frame); - if ((ret = av_frame_ref(zc->previous_frame, pic)) < 0) + if ((ret = av_frame_replace(zc->previous_frame, pic)) < 0) return ret; *got_frame = 1; diff --git a/src/third_party/ffmpeg/libavutil/Makefile b/src/third_party/ffmpeg/libavutil/Makefile index bd9c6f9e..4711f8cd 100644 --- a/src/third_party/ffmpeg/libavutil/Makefile +++ b/src/third_party/ffmpeg/libavutil/Makefile @@ -31,6 +31,7 @@ HEADERS = adler32.h \ encryption_info.h \ error.h \ eval.h \ + executor.h \ fifo.h \ file.h \ frame.h \ @@ -91,6 +92,7 @@ HEADERS = adler32.h \ tea.h \ tx.h \ film_grain_params.h \ + video_hint.h ARCH_HEADERS = bswap.h \ intmath.h \ @@ -126,6 +128,7 @@ OBJS = adler32.o \ encryption_info.o \ error.o \ eval.o \ + executor.o \ fifo.o \ file.o \ file_open.o \ @@ -181,6 +184,7 @@ OBJS = adler32.o \ uuid.o \ version.o \ video_enc_params.o \ + video_hint.o \ film_grain_params.o \ diff --git a/src/third_party/ffmpeg/libavutil/aarch64/autorename_libavutil_aarch64_cpu.c b/src/third_party/ffmpeg/libavutil/aarch64/autorename_libavutil_aarch64_cpu.c new file mode 100644 index 00000000..3adbdc6f --- /dev/null +++ b/src/third_party/ffmpeg/libavutil/aarch64/autorename_libavutil_aarch64_cpu.c @@ -0,0 +1,2 @@ +// File automatically generated. See crbug.com/495833. +#include "cpu.c" diff --git a/src/third_party/ffmpeg/libavutil/audio_fifo.c b/src/third_party/ffmpeg/libavutil/audio_fifo.c index f4103178..dc2dea9b 100644 --- a/src/third_party/ffmpeg/libavutil/audio_fifo.c +++ b/src/third_party/ffmpeg/libavutil/audio_fifo.c @@ -116,7 +116,7 @@ int av_audio_fifo_realloc(AVAudioFifo *af, int nb_samples) return 0; } -int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples) +int av_audio_fifo_write(AVAudioFifo *af, void * const *data, int nb_samples) { int i, ret, size; @@ -142,12 +142,13 @@ 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 av_audio_fifo_peek(const AVAudioFifo *af, void * const *data, int nb_samples) { return av_audio_fifo_peek_at(af, data, nb_samples, 0); } -int av_audio_fifo_peek_at(AVAudioFifo *af, void **data, int nb_samples, int offset) +int av_audio_fifo_peek_at(const AVAudioFifo *af, void * const *data, + int nb_samples, int offset) { int i, ret, size; @@ -171,7 +172,7 @@ int av_audio_fifo_peek_at(AVAudioFifo *af, void **data, int nb_samples, int offs return nb_samples; } -int av_audio_fifo_read(AVAudioFifo *af, void **data, int nb_samples) +int av_audio_fifo_read(AVAudioFifo *af, void * const *data, int nb_samples) { int i, size; diff --git a/src/third_party/ffmpeg/libavutil/audio_fifo.h b/src/third_party/ffmpeg/libavutil/audio_fifo.h index d1e4c856..fa5f59a2 100644 --- a/src/third_party/ffmpeg/libavutil/audio_fifo.h +++ b/src/third_party/ffmpeg/libavutil/audio_fifo.h @@ -91,7 +91,7 @@ int av_audio_fifo_realloc(AVAudioFifo *af, int nb_samples); * code on failure. If successful, the number of samples * actually written will always be nb_samples. */ -int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples); +int av_audio_fifo_write(AVAudioFifo *af, void * const *data, int nb_samples); /** * Peek data from an AVAudioFifo. @@ -107,7 +107,7 @@ int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples); * 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); +int av_audio_fifo_peek(const AVAudioFifo *af, void * const *data, int nb_samples); /** * Peek data from an AVAudioFifo. @@ -124,7 +124,8 @@ int av_audio_fifo_peek(AVAudioFifo *af, void **data, int nb_samples); * 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_at(AVAudioFifo *af, void **data, int nb_samples, int offset); +int av_audio_fifo_peek_at(const AVAudioFifo *af, void * const *data, + int nb_samples, int offset); /** * Read data from an AVAudioFifo. @@ -140,7 +141,7 @@ int av_audio_fifo_peek_at(AVAudioFifo *af, void **data, int nb_samples, int offs * 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_read(AVAudioFifo *af, void **data, int nb_samples); +int av_audio_fifo_read(AVAudioFifo *af, void * const *data, int nb_samples); /** * Drain data from an AVAudioFifo. diff --git a/src/third_party/ffmpeg/libavutil/avstring.c b/src/third_party/ffmpeg/libavutil/avstring.c index e460b5be..8751ce55 100644 --- a/src/third_party/ffmpeg/libavutil/avstring.c +++ b/src/third_party/ffmpeg/libavutil/avstring.c @@ -32,7 +32,6 @@ #include "bprint.h" #include "error.h" #include "macros.h" -#include "version.h" int av_strstart(const char *str, const char *pfx, const char **ptr) { diff --git a/src/third_party/ffmpeg/libavutil/avstring.h b/src/third_party/ffmpeg/libavutil/avstring.h index ac113d8c..12f8fec9 100644 --- a/src/third_party/ffmpeg/libavutil/avstring.h +++ b/src/third_party/ffmpeg/libavutil/avstring.h @@ -24,7 +24,6 @@ #include #include #include "attributes.h" -#include "version.h" /** * @addtogroup lavu_string @@ -265,7 +264,7 @@ int av_strncasecmp(const char *a, const char *b, size_t n); /** * Locale-independent strings replace. - * @note This means only ASCII-range characters are replace + * @note This means only ASCII-range characters are replaced. */ char *av_strireplace(const char *str, const char *from, const char *to); diff --git a/src/third_party/ffmpeg/libavutil/avutil.h b/src/third_party/ffmpeg/libavutil/avutil.h index 64b68bdb..a362c8ba 100644 --- a/src/third_party/ffmpeg/libavutil/avutil.h +++ b/src/third_party/ffmpeg/libavutil/avutil.h @@ -257,7 +257,12 @@ const char *av_get_media_type_string(enum AVMediaType media_type); * Internal time base represented as fractional value */ +#ifdef __cplusplus +/* ISO C++ forbids compound-literals. */ +#define AV_TIME_BASE_Q av_make_q(1, AV_TIME_BASE) +#else #define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE} +#endif /** * @} @@ -294,7 +299,6 @@ char av_get_picture_type_char(enum AVPictureType pict_type); */ #include "common.h" -#include "error.h" #include "rational.h" #include "version.h" #include "macros.h" diff --git a/src/third_party/ffmpeg/libavutil/bprint.c b/src/third_party/ffmpeg/libavutil/bprint.c index 5b540ebc..4e957171 100644 --- a/src/third_party/ffmpeg/libavutil/bprint.c +++ b/src/third_party/ffmpeg/libavutil/bprint.c @@ -71,7 +71,7 @@ void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max) unsigned size_auto = (char *)buf + sizeof(*buf) - buf->reserved_internal_buffer; - if (size_max == 1) + if (size_max == AV_BPRINT_SIZE_AUTOMATIC) size_max = size_auto; buf->str = buf->reserved_internal_buffer; buf->len = 0; @@ -84,6 +84,11 @@ void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max) void av_bprint_init_for_buffer(AVBPrint *buf, char *buffer, unsigned size) { + if (size == 0) { + av_bprint_init(buf, 0, AV_BPRINT_SIZE_COUNT_ONLY); + return; + } + buf->str = buffer; buf->len = 0; buf->size = size; diff --git a/src/third_party/ffmpeg/libavutil/bprint.h b/src/third_party/ffmpeg/libavutil/bprint.h index f27d30f7..85597454 100644 --- a/src/third_party/ffmpeg/libavutil/bprint.h +++ b/src/third_party/ffmpeg/libavutil/bprint.h @@ -144,6 +144,9 @@ void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max); * Init a print buffer using a pre-existing buffer. * * The buffer will not be reallocated. + * In case size equals zero, the AVBPrint will be initialized to use + * the internal buffer as if using AV_BPRINT_SIZE_COUNT_ONLY with + * av_bprint_init(). * * @param buf buffer structure to init * @param buffer byte buffer to use for the string data diff --git a/src/third_party/ffmpeg/libavutil/channel_layout.c b/src/third_party/ffmpeg/libavutil/channel_layout.c index e2f75122..9b581ae6 100644 --- a/src/third_party/ffmpeg/libavutil/channel_layout.c +++ b/src/third_party/ffmpeg/libavutil/channel_layout.c @@ -108,7 +108,9 @@ int av_channel_name(char *buf, size_t buf_size, enum AVChannel channel_id) av_bprint_init_for_buffer(&bp, buf, buf_size); av_channel_name_bprint(&bp, channel_id); - return bp.len; + if (bp.len >= INT_MAX) + return AVERROR(ERANGE); + return bp.len + 1; } void av_channel_description_bprint(AVBPrint *bp, enum AVChannel channel_id) @@ -135,7 +137,9 @@ int av_channel_description(char *buf, size_t buf_size, enum AVChannel channel_id av_bprint_init_for_buffer(&bp, buf, buf_size); av_channel_description_bprint(&bp, channel_id); - return bp.len; + if (bp.len >= INT_MAX) + return AVERROR(ERANGE); + return bp.len + 1; } enum AVChannel av_channel_from_string(const char *str) @@ -789,7 +793,9 @@ int av_channel_layout_describe(const AVChannelLayout *channel_layout, if (ret < 0) return ret; - return bp.len; + if (bp.len >= INT_MAX) + return AVERROR(ERANGE); + return bp.len + 1; } enum AVChannel diff --git a/src/third_party/ffmpeg/libavutil/channel_layout.h b/src/third_party/ffmpeg/libavutil/channel_layout.h index f345415c..ac2ddfa0 100644 --- a/src/third_party/ffmpeg/libavutil/channel_layout.h +++ b/src/third_party/ffmpeg/libavutil/channel_layout.h @@ -358,8 +358,16 @@ typedef struct AVChannelLayout { void *opaque; } AVChannelLayout; +/** + * Macro to define native channel layouts + * + * @note This doesn't use designated initializers for compatibility with C++ 17 and older. + */ #define AV_CHANNEL_LAYOUT_MASK(nb, m) \ - { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = (nb), .u = { .mask = (m) }} + { /* .order */ AV_CHANNEL_ORDER_NATIVE, \ + /* .nb_channels */ (nb), \ + /* .u.mask */ { m }, \ + /* .opaque */ NULL } /** * @name Common pre-defined channel layouts @@ -396,8 +404,12 @@ typedef struct AVChannelLayout { #define AV_CHANNEL_LAYOUT_HEXADECAGONAL AV_CHANNEL_LAYOUT_MASK(16, AV_CH_LAYOUT_HEXADECAGONAL) #define AV_CHANNEL_LAYOUT_STEREO_DOWNMIX AV_CHANNEL_LAYOUT_MASK(2, AV_CH_LAYOUT_STEREO_DOWNMIX) #define AV_CHANNEL_LAYOUT_22POINT2 AV_CHANNEL_LAYOUT_MASK(24, AV_CH_LAYOUT_22POINT2) + #define AV_CHANNEL_LAYOUT_AMBISONIC_FIRST_ORDER \ - { .order = AV_CHANNEL_ORDER_AMBISONIC, .nb_channels = 4, .u = { .mask = 0 }} + { /* .order */ AV_CHANNEL_ORDER_AMBISONIC, \ + /* .nb_channels */ 4, \ + /* .u.mask */ { 0 }, \ + /* .opaque */ NULL } /** @} */ struct AVBPrint; diff --git a/src/third_party/ffmpeg/libavutil/common.h b/src/third_party/ffmpeg/libavutil/common.h index fd1404be..de2140a6 100644 --- a/src/third_party/ffmpeg/libavutil/common.h +++ b/src/third_party/ffmpeg/libavutil/common.h @@ -40,6 +40,7 @@ #include #include "attributes.h" +#include "error.h" #include "macros.h" //rounded division & shift diff --git a/src/third_party/ffmpeg/libavutil/dict.c b/src/third_party/ffmpeg/libavutil/dict.c index f673977a..7f23d533 100644 --- a/src/third_party/ffmpeg/libavutil/dict.c +++ b/src/third_party/ffmpeg/libavutil/dict.c @@ -18,13 +18,15 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include +#include #include #include "avassert.h" #include "avstring.h" #include "dict.h" #include "dict_internal.h" -#include "internal.h" +#include "error.h" #include "mem.h" #include "time_internal.h" #include "bprint.h" diff --git a/src/third_party/ffmpeg/libavutil/emms.h b/src/third_party/ffmpeg/libavutil/emms.h new file mode 100644 index 00000000..4ec01274 --- /dev/null +++ b/src/third_party/ffmpeg/libavutil/emms.h @@ -0,0 +1,66 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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_EMMS_H +#define AVUTIL_EMMS_H + +#include "config.h" +#include "libavutil/attributes.h" + +#if ARCH_X86 + +void avpriv_emms_asm(void); + +#if HAVE_MMX_INLINE +#ifndef __MMX__ +#include "libavutil/cpu.h" +#endif + +# define emms_c emms_c +/** + * Empty mmx state. + * this must be called between any dsp function and float/double code. + * for example sin(); dsp->idct_put(); emms_c(); cos() + * Note, *alloc() and *free() also use float code in some libc implementations + * thus this also applies to them or any function using them. + */ +static av_always_inline void emms_c(void) +{ +/* Some inlined functions may also use mmx instructions regardless of + * runtime cpuflags. With that in mind, we unconditionally empty the + * mmx state if the target cpu chosen at configure time supports it. + */ +#if !defined(__MMX__) + if(av_get_cpu_flags() & AV_CPU_FLAG_MMX) +#endif + __asm__ volatile ("emms" ::: "memory"); +} +#elif HAVE_MMX && HAVE_MM_EMPTY +# include +# define emms_c _mm_empty +#elif HAVE_MMX_EXTERNAL +# define emms_c avpriv_emms_asm +#endif /* HAVE_MMX_INLINE */ + +#endif /* ARCH_X86 */ + +#ifndef emms_c +# define emms_c() do {} while(0) +#endif + +#endif /* AVUTIL_EMMS_H */ diff --git a/src/third_party/ffmpeg/libavutil/encryption_info.c b/src/third_party/ffmpeg/libavutil/encryption_info.c index be7ce38e..8cf51566 100644 --- a/src/third_party/ffmpeg/libavutil/encryption_info.c +++ b/src/third_party/ffmpeg/libavutil/encryption_info.c @@ -16,6 +16,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + #include "encryption_info.h" #include "mem.h" #include "intreadwrite.h" diff --git a/src/third_party/ffmpeg/libavutil/executor.c b/src/third_party/ffmpeg/libavutil/executor.c new file mode 100644 index 00000000..0da919f4 --- /dev/null +++ b/src/third_party/ffmpeg/libavutil/executor.c @@ -0,0 +1,201 @@ +/* + * Copyright (C) 2023 Nuo Mi + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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 "internal.h" +#include "mem.h" +#include "thread.h" + +#include "executor.h" + +#if !HAVE_THREADS + +#define ExecutorThread char + +#define executor_thread_create(t, a, s, ar) 0 +#define executor_thread_join(t, r) do {} while(0) + +#else + +#define ExecutorThread pthread_t + +#define executor_thread_create(t, a, s, ar) pthread_create(t, a, s, ar) +#define executor_thread_join(t, r) pthread_join(t, r) + +#endif //!HAVE_THREADS + +typedef struct ThreadInfo { + AVExecutor *e; + ExecutorThread thread; +} ThreadInfo; + +struct AVExecutor { + AVTaskCallbacks cb; + int thread_count; + + ThreadInfo *threads; + uint8_t *local_contexts; + + AVMutex lock; + AVCond cond; + int die; + + AVTask *tasks; +}; + +static AVTask* remove_task(AVTask **prev, AVTask *t) +{ + *prev = t->next; + t->next = NULL; + return t; +} + +static void add_task(AVTask **prev, AVTask *t) +{ + t->next = *prev; + *prev = t; +} + +static int run_one_task(AVExecutor *e, void *lc) +{ + AVTaskCallbacks *cb = &e->cb; + AVTask **prev; + + for (prev = &e->tasks; *prev && !cb->ready(*prev, cb->user_data); prev = &(*prev)->next) + /* nothing */; + if (*prev) { + AVTask *t = remove_task(prev, *prev); + ff_mutex_unlock(&e->lock); + cb->run(t, lc, cb->user_data); + ff_mutex_lock(&e->lock); + return 1; + } + return 0; +} + +#if HAVE_THREADS +static void *executor_worker_task(void *data) +{ + ThreadInfo *ti = (ThreadInfo*)data; + AVExecutor *e = ti->e; + void *lc = e->local_contexts + (ti - e->threads) * e->cb.local_context_size; + + ff_mutex_lock(&e->lock); + while (1) { + if (e->die) break; + + if (!run_one_task(e, lc)) { + //no task in one loop + ff_cond_wait(&e->cond, &e->lock); + } + } + ff_mutex_unlock(&e->lock); + return NULL; +} +#endif + +static void executor_free(AVExecutor *e, const int has_lock, const int has_cond) +{ + if (e->thread_count) { + //signal die + ff_mutex_lock(&e->lock); + e->die = 1; + ff_cond_broadcast(&e->cond); + ff_mutex_unlock(&e->lock); + + for (int i = 0; i < e->thread_count; i++) + executor_thread_join(e->threads[i].thread, NULL); + } + if (has_cond) + ff_cond_destroy(&e->cond); + if (has_lock) + ff_mutex_destroy(&e->lock); + + av_free(e->threads); + av_free(e->local_contexts); + + av_free(e); +} + +AVExecutor* av_executor_alloc(const AVTaskCallbacks *cb, int thread_count) +{ + AVExecutor *e; + int has_lock = 0, has_cond = 0; + if (!cb || !cb->user_data || !cb->ready || !cb->run || !cb->priority_higher) + return NULL; + + e = av_mallocz(sizeof(*e)); + if (!e) + return NULL; + e->cb = *cb; + + e->local_contexts = av_calloc(thread_count, e->cb.local_context_size); + if (!e->local_contexts) + goto free_executor; + + e->threads = av_calloc(thread_count, sizeof(*e->threads)); + if (!e->threads) + goto free_executor; + + has_lock = !ff_mutex_init(&e->lock, NULL); + has_cond = !ff_cond_init(&e->cond, NULL); + + if (!has_lock || !has_cond) + goto free_executor; + + for (/* nothing */; e->thread_count < thread_count; e->thread_count++) { + ThreadInfo *ti = e->threads + e->thread_count; + ti->e = e; + if (executor_thread_create(&ti->thread, NULL, executor_worker_task, ti)) + goto free_executor; + } + return e; + +free_executor: + executor_free(e, has_lock, has_cond); + return NULL; +} + +void av_executor_free(AVExecutor **executor) +{ + if (!executor || !*executor) + return; + executor_free(*executor, 1, 1); + *executor = NULL; +} + +void av_executor_execute(AVExecutor *e, AVTask *t) +{ + AVTaskCallbacks *cb = &e->cb; + AVTask **prev; + + ff_mutex_lock(&e->lock); + if (t) { + for (prev = &e->tasks; *prev && cb->priority_higher(*prev, t); prev = &(*prev)->next) + /* nothing */; + add_task(prev, t); + } + ff_cond_signal(&e->cond); + ff_mutex_unlock(&e->lock); + +#if !HAVE_THREADS + // We are running in a single-threaded environment, so we must handle all tasks ourselves + while (run_one_task(e, e->local_contexts)) + /* nothing */; +#endif +} diff --git a/src/third_party/ffmpeg/libavutil/executor.h b/src/third_party/ffmpeg/libavutil/executor.h new file mode 100644 index 00000000..c602bcb6 --- /dev/null +++ b/src/third_party/ffmpeg/libavutil/executor.h @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2023 Nuo Mi + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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_EXECUTOR_H +#define AVUTIL_EXECUTOR_H + +typedef struct AVExecutor AVExecutor; +typedef struct AVTask AVTask; + +struct AVTask { + AVTask *next; +}; + +typedef struct AVTaskCallbacks { + void *user_data; + + int local_context_size; + + // return 1 if a's priority > b's priority + int (*priority_higher)(const AVTask *a, const AVTask *b); + + // task is ready for run + int (*ready)(const AVTask *t, void *user_data); + + // run the task + int (*run)(AVTask *t, void *local_context, void *user_data); +} AVTaskCallbacks; + +/** + * Alloc executor + * @param callbacks callback structure for executor + * @param thread_count worker thread number + * @return return the executor + */ +AVExecutor* av_executor_alloc(const AVTaskCallbacks *callbacks, int thread_count); + +/** + * Free executor + * @param e pointer to executor + */ +void av_executor_free(AVExecutor **e); + +/** + * Add task to executor + * @param e pointer to executor + * @param t pointer to task. If NULL, it will wakeup one work thread + */ +void av_executor_execute(AVExecutor *e, AVTask *t); + +#endif //AVUTIL_EXECUTOR_H diff --git a/src/third_party/ffmpeg/libavutil/fifo.c b/src/third_party/ffmpeg/libavutil/fifo.c index 51a5af6f..b0807abb 100644 --- a/src/third_party/ffmpeg/libavutil/fifo.c +++ b/src/third_party/ffmpeg/libavutil/fifo.c @@ -252,12 +252,12 @@ int av_fifo_read_to_cb(AVFifo *f, AVFifoCB write_cb, return ret; } -int av_fifo_peek(AVFifo *f, void *buf, size_t nb_elems, size_t offset) +int av_fifo_peek(const AVFifo *f, void *buf, size_t nb_elems, size_t offset) { return fifo_peek_common(f, buf, &nb_elems, offset, NULL, NULL); } -int av_fifo_peek_to_cb(AVFifo *f, AVFifoCB write_cb, void *opaque, +int av_fifo_peek_to_cb(const AVFifo *f, AVFifoCB write_cb, void *opaque, size_t *nb_elems, size_t offset) { return fifo_peek_common(f, NULL, nb_elems, offset, write_cb, opaque); @@ -293,6 +293,7 @@ void av_fifo_freep2(AVFifo **f) #if FF_API_FIFO_OLD_API +#include "internal.h" FF_DISABLE_DEPRECATION_WARNINGS #define OLD_FIFO_SIZE_MAX (size_t)FFMIN3(INT_MAX, UINT32_MAX, SIZE_MAX) diff --git a/src/third_party/ffmpeg/libavutil/fifo.h b/src/third_party/ffmpeg/libavutil/fifo.h index 70f9376d..ce3a2aed 100644 --- a/src/third_party/ffmpeg/libavutil/fifo.h +++ b/src/third_party/ffmpeg/libavutil/fifo.h @@ -200,7 +200,7 @@ int av_fifo_read_to_cb(AVFifo *f, AVFifoCB write_cb, * * @return a non-negative number on success, a negative error code on failure */ -int av_fifo_peek(AVFifo *f, void *buf, size_t nb_elems, size_t offset); +int av_fifo_peek(const AVFifo *f, void *buf, size_t nb_elems, size_t offset); /** * Feed data from a FIFO into a user-provided callback. @@ -217,7 +217,7 @@ int av_fifo_peek(AVFifo *f, void *buf, size_t nb_elems, size_t offset); * * @return a non-negative number on success, a negative error code on failure */ -int av_fifo_peek_to_cb(AVFifo *f, AVFifoCB write_cb, void *opaque, +int av_fifo_peek_to_cb(const AVFifo *f, AVFifoCB write_cb, void *opaque, size_t *nb_elems, size_t offset); /** diff --git a/src/third_party/ffmpeg/libavutil/file.c b/src/third_party/ffmpeg/libavutil/file.c index 6a2f3aa9..cc17885b 100644 --- a/src/third_party/ffmpeg/libavutil/file.c +++ b/src/third_party/ffmpeg/libavutil/file.c @@ -17,6 +17,7 @@ */ #include "config.h" +#include "error.h" #include "file.h" #include "file_open.h" #include "internal.h" diff --git a/src/third_party/ffmpeg/libavutil/frame.c b/src/third_party/ffmpeg/libavutil/frame.c index b6cee2d8..a3f07ca0 100644 --- a/src/third_party/ffmpeg/libavutil/frame.c +++ b/src/third_party/ffmpeg/libavutil/frame.c @@ -833,7 +833,6 @@ AVFrameSideData *av_frame_get_side_data(const AVFrame *frame, static int frame_copy_video(AVFrame *dst, const AVFrame *src) { - const uint8_t *src_data[4]; int planes; if (dst->width < src->width || @@ -848,10 +847,9 @@ static int frame_copy_video(AVFrame *dst, const AVFrame *src) if (!dst->data[i] || !src->data[i]) return AVERROR(EINVAL); - memcpy(src_data, src->data, sizeof(src_data)); - av_image_copy(dst->data, dst->linesize, - src_data, src->linesize, - dst->format, src->width, src->height); + av_image_copy2(dst->data, dst->linesize, + src->data, src->linesize, + dst->format, src->width, src->height); return 0; } diff --git a/src/third_party/ffmpeg/libavutil/frame.h b/src/third_party/ffmpeg/libavutil/frame.h index 575ded3c..516e84d7 100644 --- a/src/third_party/ffmpeg/libavutil/frame.h +++ b/src/third_party/ffmpeg/libavutil/frame.h @@ -214,6 +214,16 @@ enum AVFrameSideDataType { * Ambient viewing environment metadata, as defined by H.274. */ AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT, + + /** + * Provide encoder-specific hinting information about changed/unchanged + * portions of a frame. It can be used to pass information about which + * macroblocks can be skipped because they didn't change from the + * corresponding ones in the previous frame. This could be useful for + * applications which know this information in advance to speed up + * encoding. + */ + AV_FRAME_DATA_VIDEO_HINT, }; enum AVActiveFormatDescription { diff --git a/src/third_party/ffmpeg/libavutil/hash.c b/src/third_party/ffmpeg/libavutil/hash.c index 9a497481..12333982 100644 --- a/src/third_party/ffmpeg/libavutil/hash.c +++ b/src/third_party/ffmpeg/libavutil/hash.c @@ -20,6 +20,8 @@ #include #include +#include +#include #include "hash.h" #include "adler32.h" diff --git a/src/third_party/ffmpeg/libavutil/hmac.c b/src/third_party/ffmpeg/libavutil/hmac.c index 7d241fc7..302d7b04 100644 --- a/src/third_party/ffmpeg/libavutil/hmac.c +++ b/src/third_party/ffmpeg/libavutil/hmac.c @@ -23,6 +23,7 @@ #include #include "attributes.h" +#include "error.h" #include "hmac.h" #include "md5.h" #include "sha.h" diff --git a/src/third_party/ffmpeg/libavutil/hwcontext.c b/src/third_party/ffmpeg/libavutil/hwcontext.c index 33965982..3650d465 100644 --- a/src/third_party/ffmpeg/libavutil/hwcontext.c +++ b/src/third_party/ffmpeg/libavutil/hwcontext.c @@ -819,8 +819,7 @@ int av_hwframe_map(AVFrame *dst, const AVFrame *src, int flags) return AVERROR(EINVAL); } hwmap = (HWMapDescriptor*)src->buf[0]->data; - av_frame_unref(dst); - return av_frame_ref(dst, hwmap->source); + return av_frame_replace(dst, hwmap->source); } } @@ -950,6 +949,5 @@ fail: int ff_hwframe_map_replace(AVFrame *dst, const AVFrame *src) { HWMapDescriptor *hwmap = (HWMapDescriptor*)dst->buf[0]->data; - av_frame_unref(hwmap->source); - return av_frame_ref(hwmap->source, src); + return av_frame_replace(hwmap->source, src); } diff --git a/src/third_party/ffmpeg/libavutil/hwcontext_cuda.c b/src/third_party/ffmpeg/libavutil/hwcontext_cuda.c index 4b298fa9..0312d3b9 100644 --- a/src/third_party/ffmpeg/libavutil/hwcontext_cuda.c +++ b/src/third_party/ffmpeg/libavutil/hwcontext_cuda.c @@ -290,7 +290,7 @@ static void cuda_device_uninit(AVHWDeviceContext *device_ctx) if (hwctx->internal->is_allocated && hwctx->cuda_ctx) { if (hwctx->internal->flags & AV_CUDA_USE_PRIMARY_CONTEXT) CHECK_CU(cu->cuDevicePrimaryCtxRelease(hwctx->internal->cuda_device)); - else + else if (!(hwctx->internal->flags & AV_CUDA_USE_CURRENT_CONTEXT)) CHECK_CU(cu->cuCtxDestroy(hwctx->cuda_ctx)); hwctx->cuda_ctx = NULL; @@ -361,6 +361,11 @@ static int cuda_context_init(AVHWDeviceContext *device_ctx, int flags) { hwctx->internal->cuda_device)); if (ret < 0) return ret; + } else if (flags & AV_CUDA_USE_CURRENT_CONTEXT) { + ret = CHECK_CU(cu->cuCtxGetCurrent(&hwctx->cuda_ctx)); + if (ret < 0) + return ret; + av_log(device_ctx, AV_LOG_INFO, "Using current CUDA context.\n"); } else { ret = CHECK_CU(cu->cuCtxCreate(&hwctx->cuda_ctx, desired_flags, hwctx->internal->cuda_device)); @@ -382,8 +387,21 @@ static int cuda_flags_from_opts(AVHWDeviceContext *device_ctx, AVDictionary *opts, int *flags) { AVDictionaryEntry *primary_ctx_opt = av_dict_get(opts, "primary_ctx", NULL, 0); + AVDictionaryEntry *current_ctx_opt = av_dict_get(opts, "current_ctx", NULL, 0); - if (primary_ctx_opt && strtol(primary_ctx_opt->value, NULL, 10)) { + int use_primary_ctx = 0, use_current_ctx = 0; + if (primary_ctx_opt) + use_primary_ctx = strtol(primary_ctx_opt->value, NULL, 10); + + if (current_ctx_opt) + use_current_ctx = strtol(current_ctx_opt->value, NULL, 10); + + if (use_primary_ctx && use_current_ctx) { + av_log(device_ctx, AV_LOG_ERROR, "Requested both primary and current CUDA context simultaneously.\n"); + return AVERROR(EINVAL); + } + + if (primary_ctx_opt && use_primary_ctx) { av_log(device_ctx, AV_LOG_VERBOSE, "Using CUDA primary device context\n"); *flags |= AV_CUDA_USE_PRIMARY_CONTEXT; } else if (primary_ctx_opt) { @@ -391,6 +409,14 @@ static int cuda_flags_from_opts(AVHWDeviceContext *device_ctx, *flags &= ~AV_CUDA_USE_PRIMARY_CONTEXT; } + if (current_ctx_opt && use_current_ctx) { + av_log(device_ctx, AV_LOG_VERBOSE, "Using CUDA current device context\n"); + *flags |= AV_CUDA_USE_CURRENT_CONTEXT; + } else if (current_ctx_opt) { + av_log(device_ctx, AV_LOG_VERBOSE, "Disabling use of CUDA current device context\n"); + *flags &= ~AV_CUDA_USE_CURRENT_CONTEXT; + } + return 0; } diff --git a/src/third_party/ffmpeg/libavutil/hwcontext_cuda.h b/src/third_party/ffmpeg/libavutil/hwcontext_cuda.h index cefbe0ce..cbad434f 100644 --- a/src/third_party/ffmpeg/libavutil/hwcontext_cuda.h +++ b/src/third_party/ffmpeg/libavutil/hwcontext_cuda.h @@ -62,6 +62,11 @@ typedef struct AVCUDADeviceContext { */ #define AV_CUDA_USE_PRIMARY_CONTEXT (1 << 0) +/** + * Use current device context instead of creating a new one. + */ +#define AV_CUDA_USE_CURRENT_CONTEXT (1 << 1) + /** * @} */ diff --git a/src/third_party/ffmpeg/libavutil/hwcontext_d3d11va.c b/src/third_party/ffmpeg/libavutil/hwcontext_d3d11va.c index aa50538d..cc8c97d2 100644 --- a/src/third_party/ffmpeg/libavutil/hwcontext_d3d11va.c +++ b/src/third_party/ffmpeg/libavutil/hwcontext_d3d11va.c @@ -452,8 +452,8 @@ static int d3d11va_transfer_data(AVHWFramesContext *ctx, AVFrame *dst, fill_texture_ptrs(map_data, map_linesize, ctx, &desc, &map); - av_image_copy(dst->data, dst->linesize, (const uint8_t **)map_data, map_linesize, - ctx->sw_format, w, h); + av_image_copy2(dst->data, dst->linesize, map_data, map_linesize, + ctx->sw_format, w, h); ID3D11DeviceContext_Unmap(device_hwctx->device_context, staging, 0); } else { @@ -464,8 +464,8 @@ static int d3d11va_transfer_data(AVHWFramesContext *ctx, AVFrame *dst, fill_texture_ptrs(map_data, map_linesize, ctx, &desc, &map); - av_image_copy(map_data, map_linesize, (const uint8_t **)src->data, src->linesize, - ctx->sw_format, w, h); + av_image_copy2(map_data, map_linesize, src->data, src->linesize, + ctx->sw_format, w, h); ID3D11DeviceContext_Unmap(device_hwctx->device_context, staging, 0); diff --git a/src/third_party/ffmpeg/libavutil/hwcontext_dxva2.c b/src/third_party/ffmpeg/libavutil/hwcontext_dxva2.c index ea378df7..2c11f151 100644 --- a/src/third_party/ffmpeg/libavutil/hwcontext_dxva2.c +++ b/src/third_party/ffmpeg/libavutil/hwcontext_dxva2.c @@ -356,8 +356,8 @@ static int dxva2_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst, if (ret < 0) goto fail; - av_image_copy(map->data, map->linesize, (const uint8_t **)src->data, src->linesize, - ctx->sw_format, src->width, src->height); + av_image_copy2(map->data, map->linesize, src->data, src->linesize, + ctx->sw_format, src->width, src->height); fail: av_frame_free(&map); diff --git a/src/third_party/ffmpeg/libavutil/hwcontext_qsv.c b/src/third_party/ffmpeg/libavutil/hwcontext_qsv.c index d4b564ba..1bfda9e6 100644 --- a/src/third_party/ffmpeg/libavutil/hwcontext_qsv.c +++ b/src/third_party/ffmpeg/libavutil/hwcontext_qsv.c @@ -1902,7 +1902,7 @@ static int qsv_map_to(AVHWFramesContext *dst_ctx, case AV_PIX_FMT_VAAPI: { mfxHDLPair *pair = (mfxHDLPair*)hwctx->surfaces[i].Data.MemId; - if (*(VASurfaceID*)pair->first == (VASurfaceID)src->data[3]) { + if (*(VASurfaceID*)pair->first == (VASurfaceID)(uintptr_t)src->data[3]) { index = i; break; } diff --git a/src/third_party/ffmpeg/libavutil/hwcontext_vaapi.c b/src/third_party/ffmpeg/libavutil/hwcontext_vaapi.c index 6c3a227d..558fed94 100644 --- a/src/third_party/ffmpeg/libavutil/hwcontext_vaapi.c +++ b/src/third_party/ffmpeg/libavutil/hwcontext_vaapi.c @@ -1048,6 +1048,9 @@ static const struct { #if defined(VA_FOURCC_Y412) && defined(DRM_FORMAT_XVYU12_16161616) DRM_MAP(Y412, 1, DRM_FORMAT_XVYU12_16161616), #endif +#if defined(VA_FOURCC_X2R10G10B10) && defined(DRM_FORMAT_XRGB2101010) + DRM_MAP(X2R10G10B10, 1, DRM_FORMAT_XRGB2101010), +#endif }; #undef DRM_MAP diff --git a/src/third_party/ffmpeg/libavutil/hwcontext_vulkan.c b/src/third_party/ffmpeg/libavutil/hwcontext_vulkan.c index 75314f14..c676f4fc 100644 --- a/src/third_party/ffmpeg/libavutil/hwcontext_vulkan.c +++ b/src/third_party/ffmpeg/libavutil/hwcontext_vulkan.c @@ -99,6 +99,7 @@ typedef struct VulkanDevicePriv { VkPhysicalDeviceVulkan13Features device_features_1_3; VkPhysicalDeviceDescriptorBufferFeaturesEXT desc_buf_features; VkPhysicalDeviceShaderAtomicFloatFeaturesEXT atomic_float_features; + VkPhysicalDeviceCooperativeMatrixFeaturesKHR coop_matrix_features; /* Queues */ pthread_mutex_t **qf_mutex; @@ -405,6 +406,7 @@ static const VulkanOptExtension optional_device_exts[] = { { VK_EXT_DESCRIPTOR_BUFFER_EXTENSION_NAME, FF_VK_EXT_DESCRIPTOR_BUFFER, }, { VK_EXT_PHYSICAL_DEVICE_DRM_EXTENSION_NAME, FF_VK_EXT_DEVICE_DRM }, { VK_EXT_SHADER_ATOMIC_FLOAT_EXTENSION_NAME, FF_VK_EXT_ATOMIC_FLOAT }, + { VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME, FF_VK_EXT_COOP_MATRIX }, /* Imports/exports */ { VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME, FF_VK_EXT_EXTERNAL_FD_MEMORY }, @@ -1202,9 +1204,13 @@ static int vulkan_device_create_internal(AVHWDeviceContext *ctx, VkPhysicalDeviceTimelineSemaphoreFeatures timeline_features = { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES, }; + VkPhysicalDeviceCooperativeMatrixFeaturesKHR coop_matrix_features = { + .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR, + .pNext = &timeline_features, + }; VkPhysicalDeviceShaderAtomicFloatFeaturesEXT atomic_float_features = { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT, - .pNext = &timeline_features, + .pNext = &coop_matrix_features, }; VkPhysicalDeviceDescriptorBufferFeaturesEXT desc_buf_features = { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT, @@ -1242,7 +1248,9 @@ static int vulkan_device_create_internal(AVHWDeviceContext *ctx, p->desc_buf_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT; p->desc_buf_features.pNext = &p->atomic_float_features; p->atomic_float_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT; - p->atomic_float_features.pNext = NULL; + p->atomic_float_features.pNext = &p->coop_matrix_features; + p->coop_matrix_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR; + p->coop_matrix_features.pNext = NULL; ctx->free = vulkan_device_free; @@ -1304,6 +1312,8 @@ static int vulkan_device_create_internal(AVHWDeviceContext *ctx, p->atomic_float_features.shaderBufferFloat32Atomics = atomic_float_features.shaderBufferFloat32Atomics; p->atomic_float_features.shaderBufferFloat32AtomicAdd = atomic_float_features.shaderBufferFloat32AtomicAdd; + p->coop_matrix_features.cooperativeMatrix = coop_matrix_features.cooperativeMatrix; + dev_info.pNext = &hwctx->device_features; /* Setup queue family */ @@ -1768,19 +1778,18 @@ static void vulkan_free_internal(AVVkFrame *f) av_freep(&f->internal); } -static void vulkan_frame_free(void *opaque, uint8_t *data) +static void vulkan_frame_free(AVHWFramesContext *hwfc, AVVkFrame *f) { - AVVkFrame *f = (AVVkFrame *)data; - AVHWFramesContext *hwfc = opaque; AVVulkanDeviceContext *hwctx = hwfc->device_ctx->hwctx; VulkanDevicePriv *p = hwfc->device_ctx->internal->priv; FFVulkanFunctions *vk = &p->vkctx.vkfn; int nb_images = ff_vk_count_images(f); VkSemaphoreWaitInfo sem_wait = { - .sType = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO, - .pSemaphores = f->sem, - .pValues = f->sem_value, + .sType = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO, + .flags = 0x0, + .pSemaphores = f->sem, + .pValues = f->sem_value, .semaphoreCount = nb_images, }; @@ -1797,6 +1806,11 @@ static void vulkan_frame_free(void *opaque, uint8_t *data) av_free(f); } +static void vulkan_frame_free_cb(void *opaque, uint8_t *data) +{ + vulkan_frame_free(opaque, (AVVkFrame*)data); +} + static int alloc_bind_mem(AVHWFramesContext *hwfc, AVVkFrame *f, void *alloc_pnext, size_t alloc_pnext_stride) { @@ -2077,7 +2091,7 @@ static int create_frame(AVHWFramesContext *hwfc, AVVkFrame **frame, return 0; fail: - vulkan_frame_free(hwfc, (uint8_t *)f); + vulkan_frame_free(hwfc, f); return err; } @@ -2179,7 +2193,8 @@ static AVBufferRef *vulkan_pool_alloc(void *opaque, size_t size) } err = create_frame(hwfc, &f, hwctx->tiling, hwctx->usage, hwctx->img_flags, - hwctx->nb_layers, eiinfo.handleTypes ? &eiinfo : NULL); + hwctx->nb_layers, + eiinfo.handleTypes ? &eiinfo : hwctx->create_pnext); if (err) return NULL; @@ -2198,14 +2213,14 @@ static AVBufferRef *vulkan_pool_alloc(void *opaque, size_t size) goto fail; avbuf = av_buffer_create((uint8_t *)f, sizeof(AVVkFrame), - vulkan_frame_free, hwfc, 0); + vulkan_frame_free_cb, hwfc, 0); if (!avbuf) goto fail; return avbuf; fail: - vulkan_frame_free(hwfc, (uint8_t *)f); + vulkan_frame_free(hwfc, f); return NULL; } @@ -2346,7 +2361,7 @@ static int vulkan_frames_init(AVHWFramesContext *hwfc) if (err) return err; - vulkan_frame_free(hwfc, (uint8_t *)f); + vulkan_frame_free(hwfc, f); /* If user did not specify a pool, hwfc->pool will be set to the internal one * in hwcontext.c just after this gets called */ @@ -2393,31 +2408,7 @@ static int vulkan_transfer_get_formats(AVHWFramesContext *hwfc, #if CONFIG_LIBDRM static void vulkan_unmap_from_drm(AVHWFramesContext *hwfc, HWMapDescriptor *hwmap) { - AVVkFrame *f = hwmap->priv; - AVVulkanDeviceContext *hwctx = hwfc->device_ctx->hwctx; - VulkanDevicePriv *p = hwfc->device_ctx->internal->priv; - FFVulkanFunctions *vk = &p->vkctx.vkfn; - const int nb_images = ff_vk_count_images(f); - - VkSemaphoreWaitInfo wait_info = { - .sType = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO, - .flags = 0x0, - .pSemaphores = f->sem, - .pValues = f->sem_value, - .semaphoreCount = nb_images, - }; - - vk->WaitSemaphores(hwctx->act_dev, &wait_info, UINT64_MAX); - - vulkan_free_internal(f); - - for (int i = 0; i < nb_images; i++) { - vk->DestroyImage(hwctx->act_dev, f->img[i], hwctx->alloc); - vk->FreeMemory(hwctx->act_dev, f->mem[i], hwctx->alloc); - vk->DestroySemaphore(hwctx->act_dev, f->sem[i], hwctx->alloc); - } - - av_free(f); + vulkan_frame_free(hwfc, hwmap->priv); } static const struct { @@ -2755,7 +2746,7 @@ static int vulkan_map_from_drm(AVHWFramesContext *hwfc, AVFrame *dst, return 0; fail: - vulkan_frame_free(hwfc->device_ctx->hwctx, (uint8_t *)f); + vulkan_frame_free(hwfc->device_ctx->hwctx, f); dst->data[0] = NULL; return err; } @@ -3054,7 +3045,6 @@ static int vulkan_transfer_data_from_cuda(AVHWFramesContext *hwfc, fail: CHECK_CU(cu->cuCtxPopCurrent(&dummy)); vulkan_free_internal(dst_f); - dst_f->internal = NULL; av_buffer_unref(&dst->buf[0]); return err; } @@ -3631,7 +3621,6 @@ static int vulkan_transfer_data_to_cuda(AVHWFramesContext *hwfc, AVFrame *dst, fail: CHECK_CU(cu->cuCtxPopCurrent(&dummy)); vulkan_free_internal(dst_f); - dst_f->internal = NULL; av_buffer_unref(&dst->buf[0]); return err; } diff --git a/src/third_party/ffmpeg/libavutil/imgutils.c b/src/third_party/ffmpeg/libavutil/imgutils.c index 9ab5757c..da381269 100644 --- a/src/third_party/ffmpeg/libavutil/imgutils.c +++ b/src/third_party/ffmpeg/libavutil/imgutils.c @@ -378,8 +378,8 @@ void av_image_copy_plane(uint8_t *dst, int dst_linesize, image_copy_plane(dst, dst_linesize, src, src_linesize, bytewidth, height); } -static void image_copy(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4], - const uint8_t *src_data[4], const ptrdiff_t src_linesizes[4], +static void image_copy(uint8_t *const dst_data[4], const ptrdiff_t dst_linesizes[4], + const uint8_t *const src_data[4], const ptrdiff_t src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height, void (*copy_plane)(uint8_t *, ptrdiff_t, const uint8_t *, ptrdiff_t, ptrdiff_t, int)) @@ -419,8 +419,8 @@ static void image_copy(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4], } } -void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], - const uint8_t *src_data[4], const int src_linesizes[4], +void av_image_copy(uint8_t *const dst_data[4], const int dst_linesizes[4], + const uint8_t * const src_data[4], const int src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height) { ptrdiff_t dst_linesizes1[4], src_linesizes1[4]; @@ -435,8 +435,8 @@ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], width, height, image_copy_plane); } -void av_image_copy_uc_from(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4], - const uint8_t *src_data[4], const ptrdiff_t src_linesizes[4], +void av_image_copy_uc_from(uint8_t * const dst_data[4], const ptrdiff_t dst_linesizes[4], + const uint8_t * const src_data[4], const ptrdiff_t src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height) { image_copy(dst_data, dst_linesizes, src_data, src_linesizes, pix_fmt, @@ -579,7 +579,7 @@ static void memset_bytes(uint8_t *dst, size_t dst_size, uint8_t *clear, // if it's a subsampled packed format). #define MAX_BLOCK_SIZE 32 -int av_image_fill_black(uint8_t *dst_data[4], const ptrdiff_t dst_linesize[4], +int av_image_fill_black(uint8_t * const dst_data[4], const ptrdiff_t dst_linesize[4], enum AVPixelFormat pix_fmt, enum AVColorRange range, int width, int height) { diff --git a/src/third_party/ffmpeg/libavutil/imgutils.h b/src/third_party/ffmpeg/libavutil/imgutils.h index e10ac149..fa3bb101 100644 --- a/src/third_party/ffmpeg/libavutil/imgutils.h +++ b/src/third_party/ffmpeg/libavutil/imgutils.h @@ -170,10 +170,26 @@ void av_image_copy_plane_uc_from(uint8_t *dst, ptrdiff_t dst_linesize, * @param width width of the image in pixels * @param height height of the image in pixels */ -void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], - const uint8_t *src_data[4], const int src_linesizes[4], +void av_image_copy(uint8_t * const dst_data[4], const int dst_linesizes[4], + const uint8_t * const src_data[4], const int src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height); +/** + * Wrapper around av_image_copy() to workaround the limitation + * that the conversion from uint8_t * const * to const uint8_t * const * + * is not performed automatically in C. + * @see av_image_copy() + */ +static inline +void av_image_copy2(uint8_t * const dst_data[4], const int dst_linesizes[4], + uint8_t * const src_data[4], const int src_linesizes[4], + enum AVPixelFormat pix_fmt, int width, int height) +{ + av_image_copy(dst_data, dst_linesizes, + (const uint8_t * const *)src_data, src_linesizes, + pix_fmt, width, height); +} + /** * Copy image data located in uncacheable (e.g. GPU mapped) memory. Where * available, this function will use special functionality for reading from such @@ -188,8 +204,8 @@ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], * @note On x86, the linesizes currently need to be aligned to the cacheline * size (i.e. 64) to get improved performance. */ -void av_image_copy_uc_from(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4], - const uint8_t *src_data[4], const ptrdiff_t src_linesizes[4], +void av_image_copy_uc_from(uint8_t * const dst_data[4], const ptrdiff_t dst_linesizes[4], + const uint8_t * const src_data[4], const ptrdiff_t src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height); /** @@ -319,7 +335,7 @@ int av_image_check_sar(unsigned int w, unsigned int h, AVRational sar); * @param height the height of the image in pixels * @return 0 if the image data was cleared, a negative AVERROR code otherwise */ -int av_image_fill_black(uint8_t *dst_data[4], const ptrdiff_t dst_linesize[4], +int av_image_fill_black(uint8_t * const dst_data[4], const ptrdiff_t dst_linesize[4], enum AVPixelFormat pix_fmt, enum AVColorRange range, int width, int height); diff --git a/src/third_party/ffmpeg/libavutil/internal.h b/src/third_party/ffmpeg/libavutil/internal.h index a71c39e0..d612acd2 100644 --- a/src/third_party/ffmpeg/libavutil/internal.h +++ b/src/third_party/ffmpeg/libavutil/internal.h @@ -43,14 +43,6 @@ #include "macros.h" #include "pixfmt.h" -#if ARCH_X86 -# include "x86/emms.h" -#endif - -#ifndef emms_c -# define emms_c() do {} while(0) -#endif - #ifndef attribute_align_arg #if ARCH_X86_32 && AV_GCC_VERSION_AT_LEAST(4,2) # define attribute_align_arg __attribute__((force_align_arg_pointer)) diff --git a/src/third_party/ffmpeg/libavutil/intreadwrite.h b/src/third_party/ffmpeg/libavutil/intreadwrite.h index 4c8413a5..21df7887 100644 --- a/src/third_party/ffmpeg/libavutil/intreadwrite.h +++ b/src/third_party/ffmpeg/libavutil/intreadwrite.h @@ -72,8 +72,6 @@ typedef union { # include "mips/intreadwrite.h" #elif ARCH_PPC # include "ppc/intreadwrite.h" -#elif ARCH_TOMI -# include "tomi/intreadwrite.h" #elif ARCH_X86 # include "x86/intreadwrite.h" #endif @@ -215,7 +213,7 @@ typedef union { * by per-arch headers. */ -#if defined(__GNUC__) +#if defined(__GNUC__) || defined(__clang__) union unaligned_64 { uint64_t l; } __attribute__((packed)) av_alias; union unaligned_32 { uint32_t l; } __attribute__((packed)) av_alias; diff --git a/src/third_party/ffmpeg/libavutil/md5.c b/src/third_party/ffmpeg/libavutil/md5.c index 0170d8dd..c01820da 100644 --- a/src/third_party/ffmpeg/libavutil/md5.c +++ b/src/third_party/ffmpeg/libavutil/md5.c @@ -31,9 +31,11 @@ */ #include +#include #include "bswap.h" #include "intreadwrite.h" +#include "macros.h" #include "mem.h" #include "md5.h" diff --git a/src/third_party/ffmpeg/libavutil/mem.h b/src/third_party/ffmpeg/libavutil/mem.h index 62b4ca6e..ab7648ac 100644 --- a/src/third_party/ffmpeg/libavutil/mem.h +++ b/src/third_party/ffmpeg/libavutil/mem.h @@ -27,12 +27,10 @@ #ifndef AVUTIL_MEM_H #define AVUTIL_MEM_H -#include +#include #include #include "attributes.h" -#include "avutil.h" -#include "version.h" /** * @addtogroup lavu_mem diff --git a/src/third_party/ffmpeg/libavutil/murmur3.c b/src/third_party/ffmpeg/libavutil/murmur3.c index f2e2a9ea..c88a236a 100644 --- a/src/third_party/ffmpeg/libavutil/murmur3.c +++ b/src/third_party/ffmpeg/libavutil/murmur3.c @@ -20,6 +20,7 @@ #include #include +#include #include "mem.h" #include "intreadwrite.h" #include "murmur3.h" diff --git a/src/third_party/ffmpeg/libavutil/pixdesc.c b/src/third_party/ffmpeg/libavutil/pixdesc.c index e1e0dd2a..6ded9467 100644 --- a/src/third_party/ffmpeg/libavutil/pixdesc.c +++ b/src/third_party/ffmpeg/libavutil/pixdesc.c @@ -2223,6 +2223,34 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { }, .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE, }, + [AV_PIX_FMT_GBRAP14LE] = { + .name = "gbrap14le", + .nb_components = 4, + .log2_chroma_w = 0, + .log2_chroma_h = 0, + .comp = { + { 2, 2, 0, 0, 14 }, /* R */ + { 0, 2, 0, 0, 14 }, /* G */ + { 1, 2, 0, 0, 14 }, /* B */ + { 3, 2, 0, 0, 14 }, /* A */ + }, + .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB | + AV_PIX_FMT_FLAG_ALPHA, + }, + [AV_PIX_FMT_GBRAP14BE] = { + .name = "gbrap14be", + .nb_components = 4, + .log2_chroma_w = 0, + .log2_chroma_h = 0, + .comp = { + { 2, 2, 0, 0, 14 }, /* R */ + { 0, 2, 0, 0, 14 }, /* G */ + { 1, 2, 0, 0, 14 }, /* B */ + { 3, 2, 0, 0, 14 }, /* A */ + }, + .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | + AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA, + }, [AV_PIX_FMT_GBRAP12LE] = { .name = "gbrap12le", .nb_components = 4, diff --git a/src/third_party/ffmpeg/libavutil/pixfmt.h b/src/third_party/ffmpeg/libavutil/pixfmt.h index 63e07ba6..a26c72d5 100644 --- a/src/third_party/ffmpeg/libavutil/pixfmt.h +++ b/src/third_party/ffmpeg/libavutil/pixfmt.h @@ -426,6 +426,9 @@ enum AVPixelFormat { AV_PIX_FMT_P412BE, ///< interleaved chroma YUV 4:4:4, 36bpp, data in the high bits, big-endian AV_PIX_FMT_P412LE, ///< interleaved chroma YUV 4:4:4, 36bpp, data in the high bits, little-endian + AV_PIX_FMT_GBRAP14BE, ///< planar GBR 4:4:4:4 56bpp, big-endian + AV_PIX_FMT_GBRAP14LE, ///< planar GBR 4:4:4:4 56bpp, little-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 }; @@ -484,6 +487,7 @@ enum AVPixelFormat { #define AV_PIX_FMT_GBRP16 AV_PIX_FMT_NE(GBRP16BE, GBRP16LE) #define AV_PIX_FMT_GBRAP10 AV_PIX_FMT_NE(GBRAP10BE, GBRAP10LE) #define AV_PIX_FMT_GBRAP12 AV_PIX_FMT_NE(GBRAP12BE, GBRAP12LE) +#define AV_PIX_FMT_GBRAP14 AV_PIX_FMT_NE(GBRAP14BE, GBRAP14LE) #define AV_PIX_FMT_GBRAP16 AV_PIX_FMT_NE(GBRAP16BE, GBRAP16LE) #define AV_PIX_FMT_BAYER_BGGR16 AV_PIX_FMT_NE(BAYER_BGGR16BE, BAYER_BGGR16LE) diff --git a/src/third_party/ffmpeg/libavutil/riscv/bswap_rvb.S b/src/third_party/ffmpeg/libavutil/riscv/bswap_rvb.S new file mode 100644 index 00000000..3ff53ccb --- /dev/null +++ b/src/third_party/ffmpeg/libavutil/riscv/bswap_rvb.S @@ -0,0 +1,65 @@ +/* + * Copyright © 2022 Rémi Denis-Courmont. + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#if (__riscv_xlen >= 64) + .macro bswap32_rvb out, in, count + andi t0, \count, 4 + beqz t0, 1f + /* Align input to 64-bit */ + lwu t0, (\in) + addi \out, \out, 4 + rev8 t0, t0 + addi \count, \count, -1 + srli t0, t0, __riscv_xlen - 32 + addi \in, \in, 4 + sw t0, -4(\out) +1: + andi t3, \count, -2 + sh2add \count, \count, \out + beqz t3, 3f + sh2add t3, t3, \out +2: /* 2 elements (64 bits) at a time on a 64-bit boundary */ + ld t0, (\in) + addi \out, \out, 8 + rev8 t0, t0 +#if (__riscv_xlen == 64) + srli t2, t0, 32 + sw t0, -4(\out) +#else + srli t1, t0, __riscv_xlen - 64 + srli t2, t0, __riscv_xlen - 32 + sw t1, -4(\out) +#endif + addi \in, \in, 8 + sw t2, -8(\out) + bne \out, t3, 2b +3: + beq \out, \count, 5f +4: /* Process last element */ + lwu t0, (\in) + addi \out, \out, 4 + rev8 t0, t0 + addi \in, \in, 4 + srli t0, t0, __riscv_xlen - 32 + sw t0, -4(\out) +5: + ret + .endm +#endif diff --git a/src/third_party/ffmpeg/libavutil/riscv/float_dsp_rvv.S b/src/third_party/ffmpeg/libavutil/riscv/float_dsp_rvv.S index 7cfc890b..91b70bf1 100644 --- a/src/third_party/ffmpeg/libavutil/riscv/float_dsp_rvv.S +++ b/src/third_party/ffmpeg/libavutil/riscv/float_dsp_rvv.S @@ -75,32 +75,37 @@ endfunc func ff_vector_fmul_window_rvv, zve32f // a0: dst, a1: src0, a2: src1, a3: window, a4: length - addi t0, a4, -1 - add t1, t0, a4 - sh2add a2, t0, a2 - sh2add t0, t1, a0 - sh2add t3, t1, a3 - li t1, -4 // byte stride + vsetvli t0, zero, e16, m4, ta, ma + sh2add a2, a4, a2 + vid.v v0 + sh3add t3, a4, a3 + vadd.vi v0, v0, 1 + sh3add t0, a4, a0 1: - vsetvli t2, a4, e32, m4, ta, ma - vle32.v v16, (a1) + vsetvli t2, a4, e16, m2, ta, ma slli t4, t2, 2 - vlse32.v v20, (a2), t1 - sub a4, a4, t2 - vle32.v v24, (a3) - add a1, a1, t4 - vlse32.v v28, (t3), t1 - sub a2, a2, t4 - vfmul.vv v0, v16, v28 - add a3, a3, t4 - vfmul.vv v8, v16, v24 + vrsub.vx v2, v0, t2 sub t3, t3, t4 - vfnmsac.vv v0, v20, v24 - vfmacc.vv v8, v20, v28 - vse32.v v0, (a0) - add a0, a0, t4 - vsse32.v v8, (t0), t1 + vsetvli zero, zero, e32, m4, ta, ma + sub a2, a2, t4 + vle32.v v8, (t3) sub t0, t0, t4 + vle32.v v4, (a2) + sub a4, a4, t2 + vrgatherei16.vv v28, v8, v2 + vle32.v v16, (a1) + add a1, a1, t4 + vrgatherei16.vv v20, v4, v2 + vle32.v v24, (a3) + add a3, a3, t4 + vfmul.vv v12, v16, v28 + vfmul.vv v16, v16, v24 + vfnmsac.vv v12, v20, v24 + vfmacc.vv v16, v20, v28 + vrgatherei16.vv v8, v16, v2 + vse32.v v12, (a0) + add a0, a0, t4 + vse32.v v8, (t0) bnez a4, 1b ret @@ -125,20 +130,25 @@ func ff_vector_fmul_add_rvv, zve32f ret endfunc +// TODO factor vrsub, separate last iteration? // (a0) = (a1) * reverse(a2) [0..a3-1] func ff_vector_fmul_reverse_rvv, zve32f + vsetvli t0, zero, e16, m4, ta, ma sh2add a2, a3, a2 - li t2, -4 // byte stride - addi a2, a2, -4 + vid.v v0 + vadd.vi v0, v0, 1 1: - vsetvli t0, a3, e32, m8, ta, ma + vsetvli t0, a3, e16, m4, ta, ma slli t1, t0, 2 - vle32.v v16, (a1) - sub a3, a3, t0 - vlse32.v v24, (a2), t2 - add a1, a1, t1 - vfmul.vv v16, v16, v24 + vrsub.vx v4, v0, t0 // v4[i] = [VL-1, VL-2... 1, 0] sub a2, a2, t1 + vsetvli zero, zero, e32, m8, ta, ma + vle32.v v8, (a2) + sub a3, a3, t0 + vle32.v v16, (a1) + add a1, a1, t1 + vrgatherei16.vv v24, v8, v4 // v24 = reverse(v8) + vfmul.vv v16, v16, v24 vse32.v v16, (a0) add a0, a0, t1 bnez a3, 1b diff --git a/src/third_party/ffmpeg/libavutil/riscv/timer.h b/src/third_party/ffmpeg/libavutil/riscv/timer.h index a34157a5..174b469c 100644 --- a/src/third_party/ffmpeg/libavutil/riscv/timer.h +++ b/src/third_party/ffmpeg/libavutil/riscv/timer.h @@ -24,21 +24,21 @@ #if HAVE_INLINE_ASM #include -static inline uint64_t rdcycle64(void) +static inline uint64_t ff_read_time(void) { #if (__riscv_xlen >= 64) uintptr_t cycles; - __asm__ volatile ("rdcycle %0" : "=r"(cycles)); + __asm__ volatile ("rdtime %0" : "=r" (cycles)); #else uint64_t cycles; uint32_t hi, lo, check; __asm__ volatile ( - "1: rdcycleh %0\n" - " rdcycle %1\n" - " rdcycleh %2\n" + "1: rdtimeh %0\n" + " rdtime %1\n" + " rdtimeh %2\n" " bne %0, %2, 1b\n" : "=r" (hi), "=r" (lo), "=r" (check)); cycles = (((uint64_t)hi) << 32) | lo; @@ -47,7 +47,8 @@ static inline uint64_t rdcycle64(void) return cycles; } -#define AV_READ_TIME rdcycle64 +#define AV_READ_TIME ff_read_time +#define FF_TIMER_UNITS "ticks" #endif #endif /* AVUTIL_RISCV_TIMER_H */ diff --git a/src/third_party/ffmpeg/libavutil/samplefmt.c b/src/third_party/ffmpeg/libavutil/samplefmt.c index 6d3ec34d..e1be5f05 100644 --- a/src/third_party/ffmpeg/libavutil/samplefmt.c +++ b/src/third_party/ffmpeg/libavutil/samplefmt.c @@ -219,7 +219,7 @@ int av_samples_alloc_array_and_samples(uint8_t ***audio_data, int *linesize, int return ret; } -int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset, +int av_samples_copy(uint8_t * const *dst, uint8_t * const *src, int dst_offset, int src_offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt) { @@ -243,7 +243,7 @@ int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset, return 0; } -int av_samples_set_silence(uint8_t **audio_data, int offset, int nb_samples, +int av_samples_set_silence(uint8_t * const *audio_data, int offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt) { int planar = av_sample_fmt_is_planar(sample_fmt); diff --git a/src/third_party/ffmpeg/libavutil/samplefmt.h b/src/third_party/ffmpeg/libavutil/samplefmt.h index 6bad0e25..43a57a42 100644 --- a/src/third_party/ffmpeg/libavutil/samplefmt.h +++ b/src/third_party/ffmpeg/libavutil/samplefmt.h @@ -246,7 +246,7 @@ int av_samples_alloc_array_and_samples(uint8_t ***audio_data, int *linesize, int * @param nb_channels number of audio channels * @param sample_fmt audio sample format */ -int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset, +int av_samples_copy(uint8_t * const *dst, uint8_t * const *src, int dst_offset, int src_offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt); @@ -259,7 +259,7 @@ int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset, * @param nb_channels number of audio channels * @param sample_fmt audio sample format */ -int av_samples_set_silence(uint8_t **audio_data, int offset, int nb_samples, +int av_samples_set_silence(uint8_t * const *audio_data, int offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt); /** diff --git a/src/third_party/ffmpeg/libavutil/spherical.c b/src/third_party/ffmpeg/libavutil/spherical.c index ed66344a..800d3459 100644 --- a/src/third_party/ffmpeg/libavutil/spherical.c +++ b/src/third_party/ffmpeg/libavutil/spherical.c @@ -19,6 +19,7 @@ */ #include "avstring.h" +#include "macros.h" #include "mem.h" #include "spherical.h" diff --git a/src/third_party/ffmpeg/libavutil/tests/channel_layout.c b/src/third_party/ffmpeg/libavutil/tests/channel_layout.c index 5516db09..c537e7e7 100644 --- a/src/third_party/ffmpeg/libavutil/tests/channel_layout.c +++ b/src/third_party/ffmpeg/libavutil/tests/channel_layout.c @@ -18,33 +18,111 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "libavutil/channel_layout.c" +#include +#include +#include + +#include "libavutil/bprint.h" +#include "libavutil/channel_layout.h" +#include "libavutil/internal.h" +#include "libavutil/mem.h" + +#define BPRINT_ARGS1(bp, ...) (bp), __VA_ARGS__ +#define BPRINT_ARGS0(bp, ...) __VA_ARGS__, (bp) +#define ORD_ARGS1(str, size, ...) (str), (size), __VA_ARGS__ +#define ORD_ARGS0(str, size, ...) __VA_ARGS__, (str), (size) + +// This macro presumes the AVBPrint to have been cleared before usage. +#define CMP_BPRINT_AND_NONBPRINT(bp, func_name, ARG_ORDER, ...) do { \ + char *str; \ + int size; \ + func_name ## _bprint(BPRINT_ARGS ## ARG_ORDER((bp), __VA_ARGS__)); \ + if (strlen((bp)->str) != (bp)->len) { \ + printf("strlen of AVBPrint-string returned by "#func_name"_bprint" \ + " differs from AVBPrint.len: %"SIZE_SPECIFIER" vs. %u\n", \ + strlen((bp)->str), (bp)->len); \ + break; \ + } \ + size = func_name(ORD_ARGS ## ARG_ORDER(NULL, 0, __VA_ARGS__)); \ + if (size <= 0) { \ + printf(#func_name " returned %d\n", size); \ + break; \ + } \ + if ((bp)->len != size - 1) { \ + printf("Return value %d of " #func_name " inconsistent with length"\ + " %u obtained from corresponding bprint version\n", \ + size, (bp)->len); \ + break; \ + } \ + str = av_malloc(size); \ + if (!str) { \ + printf("string of size %d could not be allocated.\n", size); \ + break; \ + } \ + size = func_name(ORD_ARGS ## ARG_ORDER(str, size, __VA_ARGS__)); \ + if (size <= 0 || (bp)->len != size - 1) { \ + printf("Return value %d of " #func_name " inconsistent with length"\ + " %d obtained in first pass.\n", size, (bp)->len); \ + av_free(str); \ + break; \ + } \ + if (strcmp(str, (bp)->str)) { \ + printf("Ordinary and _bprint versions of "#func_name" disagree: " \ + "'%s' vs. '%s'\n", str, (bp)->str); \ + av_free(str); \ + break; \ + } \ + av_free(str); \ + } while (0) + + +static void channel_name(AVBPrint *bp, enum AVChannel channel) +{ + av_bprint_clear(bp); + CMP_BPRINT_AND_NONBPRINT(bp, av_channel_name, 1, channel); +} + +static void channel_description(AVBPrint *bp, enum AVChannel channel) +{ + av_bprint_clear(bp); + CMP_BPRINT_AND_NONBPRINT(bp, av_channel_description, 1, channel); +} + +static void channel_layout_from_mask(AVChannelLayout *layout, + AVBPrint *bp, uint64_t channel_layout) +{ + av_channel_layout_uninit(layout); + av_bprint_clear(bp); + if (!av_channel_layout_from_mask(layout, channel_layout) && + av_channel_layout_check(layout)) + CMP_BPRINT_AND_NONBPRINT(bp, av_channel_layout_describe, 0, layout); + else + av_bprintf(bp, "fail"); +} + +static void channel_layout_from_string(AVChannelLayout *layout, + AVBPrint *bp, const char *channel_layout) +{ + av_channel_layout_uninit(layout); + av_bprint_clear(bp); + if (!av_channel_layout_from_string(layout, channel_layout) && + av_channel_layout_check(layout)) + CMP_BPRINT_AND_NONBPRINT(bp, av_channel_layout_describe, 0, layout); + else + av_bprintf(bp, "fail"); +} #define CHANNEL_NAME(x) \ - av_bprint_clear(&bp); \ - av_channel_name_bprint(&bp, x); + channel_name(&bp, (x)); #define CHANNEL_DESCRIPTION(x) \ - av_bprint_clear(&bp); \ - av_channel_description_bprint(&bp, x); + channel_description(&bp, (x)); #define CHANNEL_LAYOUT_FROM_MASK(x) \ - av_channel_layout_uninit(&layout); \ - av_bprint_clear(&bp); \ - if (!av_channel_layout_from_mask(&layout, x) && \ - av_channel_layout_check(&layout)) \ - av_channel_layout_describe_bprint(&layout, &bp); \ - else \ - av_bprintf(&bp, "fail"); + channel_layout_from_mask(&layout, &bp, (x)); #define CHANNEL_LAYOUT_FROM_STRING(x) \ - av_channel_layout_uninit(&layout); \ - av_bprint_clear(&bp); \ - if (!av_channel_layout_from_string(&layout, x) && \ - av_channel_layout_check(&layout)) \ - av_channel_layout_describe_bprint(&layout, &bp); \ - else \ - av_bprintf(&bp, "fail"); + channel_layout_from_string(&layout, &bp, (x)); #define CHANNEL_LAYOUT_CHANNEL_FROM_INDEX(x) \ ret = av_channel_layout_channel_from_index(&layout, x); \ @@ -72,7 +150,7 @@ int main(void) { const AVChannelLayout *playout; - AVChannelLayout layout = { 0 }; + AVChannelLayout layout = { 0 }, layout2 = { 0 }; AVBPrint bp; void *iter = NULL; uint64_t mask; @@ -246,6 +324,15 @@ int main(void) CHANNEL_LAYOUT_FROM_STRING("FR+FL@Foo+USR63@Foo"); printf("With \"FR+FL@Foo+USR63@Foo\": %33s\n", bp.str); + ret = av_channel_layout_copy(&layout2, &layout); + if (ret < 0) { + printf("Copying channel layout \"FR+FL@Foo+USR63@Foo\" failed; " + "ret %d\n", ret); + } + ret = av_channel_layout_compare(&layout, &layout2); + if (ret) + printf("Channel layout and its copy compare unequal; ret: %d\n", ret); + printf("\nTesting av_channel_layout_index_from_string\n"); CHANNEL_LAYOUT_INDEX_FROM_STRING("FR"); printf("On \"FR+FL@Foo+USR63@Foo\" layout with \"FR\": %18d\n", ret); @@ -347,6 +434,7 @@ int main(void) printf("On \"ambisonic 2+stereo\" layout with AV_CH_LAYOUT_QUAD: 0x%"PRIx64"\n", mask); av_channel_layout_uninit(&layout); + av_channel_layout_uninit(&layout2); av_bprint_finalize(&bp, NULL); return 0; diff --git a/src/third_party/ffmpeg/libavutil/tests/lzo.c b/src/third_party/ffmpeg/libavutil/tests/lzo.c index a5655dbf..d7a78a16 100644 --- a/src/third_party/ffmpeg/libavutil/tests/lzo.c +++ b/src/third_party/ffmpeg/libavutil/tests/lzo.c @@ -19,6 +19,8 @@ */ #include +#include +#include #include #include "libavutil/log.h" diff --git a/src/third_party/ffmpeg/libavutil/tests/murmur3.c b/src/third_party/ffmpeg/libavutil/tests/murmur3.c index b8d6b1fe..7a793dac 100644 --- a/src/third_party/ffmpeg/libavutil/tests/murmur3.c +++ b/src/third_party/ffmpeg/libavutil/tests/murmur3.c @@ -18,6 +18,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include +#include + #include "libavutil/intreadwrite.h" #include "libavutil/mem.h" #include "libavutil/murmur3.h" diff --git a/src/third_party/ffmpeg/libavutil/tests/pixdesc.c b/src/third_party/ffmpeg/libavutil/tests/pixdesc.c index 34e2bea9..b13aba59 100644 --- a/src/third_party/ffmpeg/libavutil/tests/pixdesc.c +++ b/src/third_party/ffmpeg/libavutil/tests/pixdesc.c @@ -19,6 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/log.h" #include "libavutil/pixdesc.c" int main(void){ diff --git a/src/third_party/ffmpeg/libavutil/thread.h b/src/third_party/ffmpeg/libavutil/thread.h index 2f5e7e1c..2ded498c 100644 --- a/src/third_party/ffmpeg/libavutil/thread.h +++ b/src/third_party/ffmpeg/libavutil/thread.h @@ -163,6 +163,15 @@ static inline int strict_pthread_once(pthread_once_t *once_control, void (*init_ #define ff_mutex_unlock pthread_mutex_unlock #define ff_mutex_destroy pthread_mutex_destroy +#define AVCond pthread_cond_t + +#define ff_cond_init pthread_cond_init +#define ff_cond_destroy pthread_cond_destroy +#define ff_cond_signal pthread_cond_signal +#define ff_cond_broadcast pthread_cond_broadcast +#define ff_cond_wait pthread_cond_wait +#define ff_cond_timedwait pthread_cond_timedwait + #define AVOnce pthread_once_t #define AV_ONCE_INIT PTHREAD_ONCE_INIT @@ -178,6 +187,16 @@ static inline int ff_mutex_lock(AVMutex *mutex){ return 0; } static inline int ff_mutex_unlock(AVMutex *mutex){ return 0; } static inline int ff_mutex_destroy(AVMutex *mutex){ return 0; } +#define AVCond char + +static inline int ff_cond_init(AVCond *cond, const void *attr){ return 0; } +static inline int ff_cond_destroy(AVCond *cond){ return 0; } +static inline int ff_cond_signal(AVCond *cond){ return 0; } +static inline int ff_cond_broadcast(AVCond *cond){ return 0; } +static inline int ff_cond_wait(AVCond *cond, AVMutex *mutex){ return 0; } +static inline int ff_cond_timedwait(AVCond *cond, AVMutex *mutex, + const void *abstime){ return 0; } + #define AVOnce char #define AV_ONCE_INIT 0 diff --git a/src/third_party/ffmpeg/libavutil/threadmessage.c b/src/third_party/ffmpeg/libavutil/threadmessage.c index f0e23f28..20b38820 100644 --- a/src/third_party/ffmpeg/libavutil/threadmessage.c +++ b/src/third_party/ffmpeg/libavutil/threadmessage.c @@ -19,6 +19,9 @@ */ #include +#include + +#include "error.h" #include "fifo.h" #include "mem.h" #include "threadmessage.h" diff --git a/src/third_party/ffmpeg/libavutil/timer.h b/src/third_party/ffmpeg/libavutil/timer.h index 861ba7e9..2cd299ec 100644 --- a/src/third_party/ffmpeg/libavutil/timer.h +++ b/src/third_party/ffmpeg/libavutil/timer.h @@ -105,9 +105,9 @@ #if CONFIG_LINUX_PERF #define START_TIMER \ - static int linux_perf_fd; \ + static int linux_perf_fd = -1; \ uint64_t tperf; \ - if (!linux_perf_fd) { \ + if (linux_perf_fd == -1) { \ struct perf_event_attr attr = { \ .type = PERF_TYPE_HARDWARE, \ .size = sizeof(struct perf_event_attr), \ diff --git a/src/third_party/ffmpeg/libavutil/timestamp.h b/src/third_party/ffmpeg/libavutil/timestamp.h index e082f01b..9ae64da8 100644 --- a/src/third_party/ffmpeg/libavutil/timestamp.h +++ b/src/third_party/ffmpeg/libavutil/timestamp.h @@ -24,7 +24,7 @@ #ifndef AVUTIL_TIMESTAMP_H #define AVUTIL_TIMESTAMP_H -#include "common.h" +#include "avutil.h" #if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS) && !defined(PRId64) #error missing -D__STDC_FORMAT_MACROS / #define __STDC_FORMAT_MACROS diff --git a/src/third_party/ffmpeg/libavutil/tx.c b/src/third_party/ffmpeg/libavutil/tx.c index 52e8685b..0abfbe0e 100644 --- a/src/third_party/ffmpeg/libavutil/tx.c +++ b/src/third_party/ffmpeg/libavutil/tx.c @@ -439,7 +439,9 @@ int ff_tx_decompose_length(int dst[TX_MAX_DECOMPOSITIONS], enum AVTXType type, /* Check direction for non-orthogonal codelets */ if (((cd->flags & FF_TX_FORWARD_ONLY) && inv) || - ((cd->flags & (FF_TX_INVERSE_ONLY | AV_TX_FULL_IMDCT)) && !inv)) + ((cd->flags & (FF_TX_INVERSE_ONLY | AV_TX_FULL_IMDCT)) && !inv) || + ((cd->flags & (FF_TX_FORWARD_ONLY | AV_TX_REAL_TO_REAL)) && inv) || + ((cd->flags & (FF_TX_FORWARD_ONLY | AV_TX_REAL_TO_IMAGINARY)) && inv)) continue; /* Check if the CPU supports the required ISA */ @@ -562,6 +564,10 @@ static void print_flags(AVBPrint *bp, uint64_t f) av_bprintf(bp, "%spreshuf", prev > 1 ? sep : ""); if ((f & AV_TX_FULL_IMDCT) && ++prev) av_bprintf(bp, "%simdct_full", prev > 1 ? sep : ""); + if ((f & AV_TX_REAL_TO_REAL) && ++prev) + av_bprintf(bp, "%sreal_to_real", prev > 1 ? sep : ""); + if ((f & AV_TX_REAL_TO_IMAGINARY) && ++prev) + av_bprintf(bp, "%sreal_to_imaginary", prev > 1 ? sep : ""); if ((f & FF_TX_ASM_CALL) && ++prev) av_bprintf(bp, "%sasm_call", prev > 1 ? sep : ""); av_bprintf(bp, "]"); @@ -574,18 +580,24 @@ static void print_type(AVBPrint *bp, enum AVTXType type) type == AV_TX_FLOAT_FFT ? "fft_float" : type == AV_TX_FLOAT_MDCT ? "mdct_float" : type == AV_TX_FLOAT_RDFT ? "rdft_float" : + type == AV_TX_FLOAT_DCT_I ? "dctI_float" : + type == AV_TX_FLOAT_DST_I ? "dstI_float" : type == AV_TX_DOUBLE_FFT ? "fft_double" : type == AV_TX_DOUBLE_MDCT ? "mdct_double" : type == AV_TX_DOUBLE_RDFT ? "rdft_double" : + type == AV_TX_DOUBLE_DCT_I ? "dctI_double" : + type == AV_TX_DOUBLE_DST_I ? "dstI_double" : type == AV_TX_INT32_FFT ? "fft_int32" : type == AV_TX_INT32_MDCT ? "mdct_int32" : type == AV_TX_INT32_RDFT ? "rdft_int32" : + type == AV_TX_INT32_DCT_I ? "dctI_int32" : + type == AV_TX_INT32_DST_I ? "dstI_int32" : "unknown"); } static void print_cd_info(const FFTXCodelet *cd, int prio, int len, int print_prio) { - AVBPrint bp = { 0 }; + AVBPrint bp; av_bprint_init(&bp, 0, AV_BPRINT_SIZE_AUTOMATIC); av_bprintf(&bp, "%s - type: ", cd->name); @@ -708,7 +720,7 @@ av_cold int ff_tx_init_subtx(AVTXContext *s, enum AVTXType type, int codelet_list_idx = codelet_list_num; int nb_cd_matches = 0; #if !CONFIG_SMALL - AVBPrint bp = { 0 }; + AVBPrint bp; #endif /* We still accept functions marked with SLOW, even if the CPU is @@ -719,7 +731,11 @@ av_cold int ff_tx_init_subtx(AVTXContext *s, enum AVTXType type, uint64_t req_flags = flags; /* Flags the codelet may require to be present */ - uint64_t inv_req_mask = AV_TX_FULL_IMDCT | FF_TX_PRESHUFFLE | FF_TX_ASM_CALL; + uint64_t inv_req_mask = AV_TX_FULL_IMDCT | + AV_TX_REAL_TO_REAL | + AV_TX_REAL_TO_IMAGINARY | + FF_TX_PRESHUFFLE | + FF_TX_ASM_CALL; /* Unaligned codelets are compatible with the aligned flag */ if (req_flags & FF_TX_ALIGNED) @@ -744,7 +760,9 @@ av_cold int ff_tx_init_subtx(AVTXContext *s, enum AVTXType type, /* Check direction for non-orthogonal codelets */ if (((cd->flags & FF_TX_FORWARD_ONLY) && inv) || - ((cd->flags & (FF_TX_INVERSE_ONLY | AV_TX_FULL_IMDCT)) && !inv)) + ((cd->flags & (FF_TX_INVERSE_ONLY | AV_TX_FULL_IMDCT)) && !inv) || + ((cd->flags & (FF_TX_FORWARD_ONLY | AV_TX_REAL_TO_REAL)) && inv) || + ((cd->flags & (FF_TX_FORWARD_ONLY | AV_TX_REAL_TO_IMAGINARY)) && inv)) continue; /* Check if the requested flags match from both sides */ diff --git a/src/third_party/ffmpeg/libavutil/tx.h b/src/third_party/ffmpeg/libavutil/tx.h index 064edbc0..4696988c 100644 --- a/src/third_party/ffmpeg/libavutil/tx.h +++ b/src/third_party/ffmpeg/libavutil/tx.h @@ -105,6 +105,30 @@ enum AVTXType { AV_TX_DOUBLE_DCT = 10, AV_TX_INT32_DCT = 11, + /** + * Discrete Cosine Transform I + * + * The forward transform is a DCT-I. + * The inverse transform is a DCT-I multiplied by 2/(N + 1). + * + * The input array is always overwritten. + */ + AV_TX_FLOAT_DCT_I = 12, + AV_TX_DOUBLE_DCT_I = 13, + AV_TX_INT32_DCT_I = 14, + + /** + * Discrete Sine Transform I + * + * The forward transform is a DST-I. + * The inverse transform is a DST-I multiplied by 2/(N + 1). + * + * The input array is always overwritten. + */ + AV_TX_FLOAT_DST_I = 15, + AV_TX_DOUBLE_DST_I = 16, + AV_TX_INT32_DST_I = 17, + /* Not part of the API, do not use */ AV_TX_NB, }; @@ -149,6 +173,16 @@ enum AVTXFlags { * Ignored for all transforms but inverse MDCTs. */ AV_TX_FULL_IMDCT = 1ULL << 2, + + /** + * Perform a real to half-complex RDFT. + * Only the real, or imaginary coefficients will + * be output, depending on the flag used. Only available for forward RDFTs. + * Output array must have enough space to hold N complex values + * (regular size for a real to complex transform). + */ + AV_TX_REAL_TO_REAL = 1ULL << 3, + AV_TX_REAL_TO_IMAGINARY = 1ULL << 4, }; /** diff --git a/src/third_party/ffmpeg/libavutil/tx_priv.h b/src/third_party/ffmpeg/libavutil/tx_priv.h index d5ff8e14..d3fcdbf5 100644 --- a/src/third_party/ffmpeg/libavutil/tx_priv.h +++ b/src/third_party/ffmpeg/libavutil/tx_priv.h @@ -22,6 +22,7 @@ #include "tx.h" #include "thread.h" #include "mem_internal.h" +#include "common.h" #include "attributes.h" #ifdef TX_FLOAT diff --git a/src/third_party/ffmpeg/libavutil/tx_template.c b/src/third_party/ffmpeg/libavutil/tx_template.c index 983de75a..8dc3d251 100644 --- a/src/third_party/ffmpeg/libavutil/tx_template.c +++ b/src/third_party/ffmpeg/libavutil/tx_template.c @@ -43,6 +43,10 @@ SR_TABLE(32768) \ SR_TABLE(65536) \ SR_TABLE(131072) \ + SR_TABLE(262144) \ + SR_TABLE(524288) \ + SR_TABLE(1048576) \ + SR_TABLE(2097152) \ #define SR_TABLE(len) \ TABLE_DEF(len, len/4 + 1); @@ -218,8 +222,8 @@ static av_always_inline void NAME(TXComplex *out, TXComplex *in, \ BF(t[3].im, t[2].re, in[2].re, in[3].re); \ BF(t[3].re, t[2].im, in[2].im, in[3].im); \ \ - out[D0*stride].re = dc.re + t[0].re + t[2].re; \ - out[D0*stride].im = dc.im + t[0].im + t[2].im; \ + out[D0*stride].re = dc.re + (TXUSample)t[0].re + t[2].re; \ + out[D0*stride].im = dc.im + (TXUSample)t[0].im + t[2].im; \ \ SMUL(t[4].re, t[0].re, tab[0], tab[2], t[2].re, t[0].re); \ SMUL(t[4].im, t[0].im, tab[0], tab[2], t[2].im, t[0].im); \ @@ -231,14 +235,14 @@ static av_always_inline void NAME(TXComplex *out, TXComplex *in, \ BF(z0[2].re, z0[1].re, t[4].re, t[5].re); \ BF(z0[2].im, z0[1].im, t[4].im, t[5].im); \ \ - out[D1*stride].re = dc.re + z0[3].re; \ - out[D1*stride].im = dc.im + z0[0].im; \ - out[D2*stride].re = dc.re + z0[2].re; \ - out[D2*stride].im = dc.im + z0[1].im; \ - out[D3*stride].re = dc.re + z0[1].re; \ - out[D3*stride].im = dc.im + z0[2].im; \ - out[D4*stride].re = dc.re + z0[0].re; \ - out[D4*stride].im = dc.im + z0[3].im; \ + out[D1*stride].re = dc.re + (TXUSample)z0[3].re; \ + out[D1*stride].im = dc.im + (TXUSample)z0[0].im; \ + out[D2*stride].re = dc.re + (TXUSample)z0[2].re; \ + out[D2*stride].im = dc.im + (TXUSample)z0[1].im; \ + out[D3*stride].re = dc.re + (TXUSample)z0[1].re; \ + out[D3*stride].im = dc.im + (TXUSample)z0[2].im; \ + out[D4*stride].re = dc.re + (TXUSample)z0[0].re; \ + out[D4*stride].im = dc.im + (TXUSample)z0[3].im; \ } DECL_FFT5(fft5, 0, 1, 2, 3, 4) @@ -717,6 +721,10 @@ DECL_SR_CODELET(16384,8192,4096) DECL_SR_CODELET(32768,16384,8192) DECL_SR_CODELET(65536,32768,16384) DECL_SR_CODELET(131072,65536,32768) +DECL_SR_CODELET(262144,131072,65536) +DECL_SR_CODELET(524288,262144,131072) +DECL_SR_CODELET(1048576,524288,262144) +DECL_SR_CODELET(2097152,1048576,524288) static av_cold int TX_NAME(ff_tx_fft_init)(AVTXContext *s, const FFTXCodelet *cd, @@ -1605,14 +1613,18 @@ static av_cold int TX_NAME(ff_tx_rdft_init)(AVTXContext *s, int ret; double f, m; TXSample *tab; + uint64_t r2r = flags & AV_TX_REAL_TO_REAL; + int len4 = FFALIGN(len, 4) / 4; s->scale_d = *((SCALE_TYPE *)scale); s->scale_f = s->scale_d; + flags &= ~(AV_TX_REAL_TO_REAL | AV_TX_REAL_TO_IMAGINARY); + if ((ret = ff_tx_init_subtx(s, TX_TYPE(FFT), flags, NULL, len >> 1, inv, scale))) return ret; - if (!(s->exp = av_mallocz((8 + (len >> 2) - 1)*sizeof(*s->exp)))) + if (!(s->exp = av_mallocz((8 + 2*len4)*sizeof(*s->exp)))) return AVERROR(ENOMEM); tab = (TXSample *)s->exp; @@ -1627,21 +1639,27 @@ static av_cold int TX_NAME(ff_tx_rdft_init)(AVTXContext *s, *tab++ = RESCALE(-m); *tab++ = RESCALE( (0.5 - 0.0) * m); - *tab++ = RESCALE( (0.0 - 0.5) * m); + if (r2r) + *tab++ = 1 / s->scale_f; + else + *tab++ = RESCALE( (0.0 - 0.5) * m); *tab++ = RESCALE( (0.5 - inv) * m); *tab++ = RESCALE(-(0.5 - inv) * m); - for (int i = 0; i < len >> 2; i++) + for (int i = 0; i < len4; i++) *tab++ = RESCALE(cos(i*f)); - for (int i = len >> 2; i >= 0; i--) - *tab++ = RESCALE(cos(i*f) * (inv ? +1.0 : -1.0)); + + tab = ((TXSample *)s->exp) + len4 + 8; + + for (int i = 0; i < len4; i++) + *tab++ = RESCALE(cos(((len - i*4)/4.0)*f)) * (inv ? 1 : -1); return 0; } -#define DECL_RDFT(name, inv) \ -static void TX_NAME(ff_tx_rdft_ ##name)(AVTXContext *s, void *_dst, \ - void *_src, ptrdiff_t stride) \ +#define DECL_RDFT(n, inv) \ +static void TX_NAME(ff_tx_rdft_ ##n)(AVTXContext *s, void *_dst, \ + void *_src, ptrdiff_t stride) \ { \ const int len2 = s->len >> 1; \ const int len4 = s->len >> 2; \ @@ -1690,41 +1708,132 @@ static void TX_NAME(ff_tx_rdft_ ##name)(AVTXContext *s, void *_dst, \ data[len2].re = data[0].im; \ data[ 0].im = data[len2].im = 0; \ } \ -} - -DECL_RDFT(r2c, 0) -DECL_RDFT(c2r, 1) - -static const FFTXCodelet TX_NAME(ff_tx_rdft_r2c_def) = { - .name = TX_NAME_STR("rdft_r2c"), - .function = TX_NAME(ff_tx_rdft_r2c), - .type = TX_TYPE(RDFT), - .flags = AV_TX_UNALIGNED | AV_TX_INPLACE | - FF_TX_OUT_OF_PLACE | FF_TX_FORWARD_ONLY, - .factors = { 2, TX_FACTOR_ANY }, - .nb_factors = 2, - .min_len = 2, - .max_len = TX_LEN_UNLIMITED, - .init = TX_NAME(ff_tx_rdft_init), - .cpu_flags = FF_TX_CPU_FLAGS_ALL, - .prio = FF_TX_PRIO_BASE, +} \ + \ +static const FFTXCodelet TX_NAME(ff_tx_rdft_ ##n## _def) = { \ + .name = TX_NAME_STR("rdft_" #n), \ + .function = TX_NAME(ff_tx_rdft_ ##n), \ + .type = TX_TYPE(RDFT), \ + .flags = AV_TX_UNALIGNED | AV_TX_INPLACE | FF_TX_OUT_OF_PLACE | \ + (inv ? FF_TX_INVERSE_ONLY : FF_TX_FORWARD_ONLY), \ + .factors = { 4, TX_FACTOR_ANY }, \ + .nb_factors = 2, \ + .min_len = 4, \ + .max_len = TX_LEN_UNLIMITED, \ + .init = TX_NAME(ff_tx_rdft_init), \ + .cpu_flags = FF_TX_CPU_FLAGS_ALL, \ + .prio = FF_TX_PRIO_BASE, \ }; -static const FFTXCodelet TX_NAME(ff_tx_rdft_c2r_def) = { - .name = TX_NAME_STR("rdft_c2r"), - .function = TX_NAME(ff_tx_rdft_c2r), - .type = TX_TYPE(RDFT), - .flags = AV_TX_UNALIGNED | AV_TX_INPLACE | - FF_TX_OUT_OF_PLACE | FF_TX_INVERSE_ONLY, - .factors = { 2, TX_FACTOR_ANY }, - .nb_factors = 2, - .min_len = 2, - .max_len = TX_LEN_UNLIMITED, - .init = TX_NAME(ff_tx_rdft_init), - .cpu_flags = FF_TX_CPU_FLAGS_ALL, - .prio = FF_TX_PRIO_BASE, +DECL_RDFT(r2c, 0) +DECL_RDFT(c2r, 1) + +#define DECL_RDFT_HALF(n, mode, mod2) \ +static void TX_NAME(ff_tx_rdft_ ##n)(AVTXContext *s, void *_dst, \ + void *_src, ptrdiff_t stride) \ +{ \ + const int len = s->len; \ + const int len2 = len >> 1; \ + const int len4 = len >> 2; \ + const int aligned_len4 = FFALIGN(len, 4)/4; \ + const TXSample *fact = (void *)s->exp; \ + const TXSample *tcos = fact + 8; \ + const TXSample *tsin = tcos + aligned_len4; \ + TXComplex *data = _dst; \ + TXSample *out = _dst; /* Half-complex is forward-only */ \ + TXSample tmp_dc; \ + av_unused TXSample tmp_mid; \ + TXSample tmp[4]; \ + TXComplex sf, sl; \ + \ + s->fn[0](&s->sub[0], _dst, _src, sizeof(TXComplex)); \ + \ + tmp_dc = data[0].re; \ + data[ 0].re = tmp_dc + data[0].im; \ + tmp_dc = tmp_dc - data[0].im; \ + \ + data[ 0].re = MULT(fact[0], data[ 0].re); \ + tmp_dc = MULT(fact[1], tmp_dc); \ + data[len4].re = MULT(fact[2], data[len4].re); \ + \ + if (!mod2) { \ + data[len4].im = MULT(fact[3], data[len4].im); \ + } else { \ + sf = data[len4]; \ + sl = data[len4 + 1]; \ + if (mode == AV_TX_REAL_TO_REAL) \ + tmp[0] = MULT(fact[4], (sf.re + sl.re)); \ + else \ + tmp[0] = MULT(fact[5], (sf.im - sl.im)); \ + tmp[1] = MULT(fact[6], (sf.im + sl.im)); \ + tmp[2] = MULT(fact[7], (sf.re - sl.re)); \ + \ + if (mode == AV_TX_REAL_TO_REAL) { \ + tmp[3] = tmp[1]*tcos[len4] - tmp[2]*tsin[len4]; \ + tmp_mid = (tmp[0] - tmp[3]); \ + } else { \ + tmp[3] = tmp[1]*tsin[len4] + tmp[2]*tcos[len4]; \ + tmp_mid = (tmp[0] + tmp[3]); \ + } \ + } \ + \ + /* NOTE: unrolling this breaks non-mod8 lengths */ \ + for (int i = 1; i <= len4; i++) { \ + TXSample tmp[4]; \ + TXComplex sf = data[i]; \ + TXComplex sl = data[len2 - i]; \ + \ + if (mode == AV_TX_REAL_TO_REAL) \ + tmp[0] = MULT(fact[4], (sf.re + sl.re)); \ + else \ + tmp[0] = MULT(fact[5], (sf.im - sl.im)); \ + \ + tmp[1] = MULT(fact[6], (sf.im + sl.im)); \ + tmp[2] = MULT(fact[7], (sf.re - sl.re)); \ + \ + if (mode == AV_TX_REAL_TO_REAL) { \ + tmp[3] = tmp[1]*tcos[i] - tmp[2]*tsin[i]; \ + out[i] = (tmp[0] + tmp[3]); \ + out[len - i] = (tmp[0] - tmp[3]); \ + } else { \ + tmp[3] = tmp[1]*tsin[i] + tmp[2]*tcos[i]; \ + out[i - 1] = (tmp[3] - tmp[0]); \ + out[len - i - 1] = (tmp[0] + tmp[3]); \ + } \ + } \ + \ + for (int i = 1; i < (len4 + (mode == AV_TX_REAL_TO_IMAGINARY)); i++) \ + out[len2 - i] = out[len - i]; \ + \ + if (mode == AV_TX_REAL_TO_REAL) { \ + out[len2] = tmp_dc; \ + if (mod2) \ + out[len4 + 1] = tmp_mid * fact[5]; \ + } else if (mod2) { \ + out[len4] = tmp_mid; \ + } \ +} \ + \ +static const FFTXCodelet TX_NAME(ff_tx_rdft_ ##n## _def) = { \ + .name = TX_NAME_STR("rdft_" #n), \ + .function = TX_NAME(ff_tx_rdft_ ##n), \ + .type = TX_TYPE(RDFT), \ + .flags = AV_TX_UNALIGNED | AV_TX_INPLACE | mode | \ + FF_TX_OUT_OF_PLACE | FF_TX_FORWARD_ONLY, \ + .factors = { 2 + 2*(!mod2), TX_FACTOR_ANY }, \ + .nb_factors = 2, \ + .min_len = 2 + 2*(!mod2), \ + .max_len = TX_LEN_UNLIMITED, \ + .init = TX_NAME(ff_tx_rdft_init), \ + .cpu_flags = FF_TX_CPU_FLAGS_ALL, \ + .prio = FF_TX_PRIO_BASE, \ }; +DECL_RDFT_HALF(r2r, AV_TX_REAL_TO_REAL, 0) +DECL_RDFT_HALF(r2r_mod2, AV_TX_REAL_TO_REAL, 1) +DECL_RDFT_HALF(r2i, AV_TX_REAL_TO_IMAGINARY, 0) +DECL_RDFT_HALF(r2i_mod2, AV_TX_REAL_TO_IMAGINARY, 1) + static av_cold int TX_NAME(ff_tx_dct_init)(AVTXContext *s, const FFTXCodelet *cd, uint64_t flags, @@ -1899,6 +2008,107 @@ static const FFTXCodelet TX_NAME(ff_tx_dctIII_def) = { .prio = FF_TX_PRIO_BASE, }; +static av_cold int TX_NAME(ff_tx_dcstI_init)(AVTXContext *s, + const FFTXCodelet *cd, + uint64_t flags, + FFTXCodeletOptions *opts, + int len, int inv, + const void *scale) +{ + int ret; + SCALE_TYPE rsc = *((SCALE_TYPE *)scale); + + if (inv) { + len *= 2; + s->len *= 2; + rsc *= 0.5; + } + + /* We want a half-complex RDFT */ + flags |= cd->type == TX_TYPE(DCT_I) ? AV_TX_REAL_TO_REAL : + AV_TX_REAL_TO_IMAGINARY; + + if ((ret = ff_tx_init_subtx(s, TX_TYPE(RDFT), flags, NULL, + (len - 1 + 2*(cd->type == TX_TYPE(DST_I)))*2, + 0, &rsc))) + return ret; + + s->tmp = av_mallocz((len + 1)*2*sizeof(TXSample)); + if (!s->tmp) + return AVERROR(ENOMEM); + + return 0; +} + +static void TX_NAME(ff_tx_dctI)(AVTXContext *s, void *_dst, + void *_src, ptrdiff_t stride) +{ + TXSample *dst = _dst; + TXSample *src = _src; + const int len = s->len - 1; + TXSample *tmp = (TXSample *)s->tmp; + + stride /= sizeof(TXSample); + + for (int i = 0; i < len; i++) + tmp[i] = tmp[2*len - i] = src[i * stride]; + + tmp[len] = src[len * stride]; /* Middle */ + + s->fn[0](&s->sub[0], dst, tmp, sizeof(TXSample)); +} + +static void TX_NAME(ff_tx_dstI)(AVTXContext *s, void *_dst, + void *_src, ptrdiff_t stride) +{ + TXSample *dst = _dst; + TXSample *src = _src; + const int len = s->len + 1; + TXSample *tmp = (void *)s->tmp; + + stride /= sizeof(TXSample); + + tmp[0] = 0; + + for (int i = 1; i < len; i++) { + TXSample a = src[(i - 1) * stride]; + tmp[i] = -a; + tmp[2*len - i] = a; + } + + tmp[len] = 0; /* i == n, Nyquist */ + + s->fn[0](&s->sub[0], dst, tmp, sizeof(float)); +} + +static const FFTXCodelet TX_NAME(ff_tx_dctI_def) = { + .name = TX_NAME_STR("dctI"), + .function = TX_NAME(ff_tx_dctI), + .type = TX_TYPE(DCT_I), + .flags = AV_TX_UNALIGNED | AV_TX_INPLACE | FF_TX_OUT_OF_PLACE, + .factors = { 2, TX_FACTOR_ANY }, + .nb_factors = 2, + .min_len = 2, + .max_len = TX_LEN_UNLIMITED, + .init = TX_NAME(ff_tx_dcstI_init), + .cpu_flags = FF_TX_CPU_FLAGS_ALL, + .prio = FF_TX_PRIO_BASE, +}; + +static const FFTXCodelet TX_NAME(ff_tx_dstI_def) = { + .name = TX_NAME_STR("dstI"), + .function = TX_NAME(ff_tx_dstI), + .type = TX_TYPE(DST_I), + .flags = AV_TX_UNALIGNED | AV_TX_INPLACE | FF_TX_OUT_OF_PLACE, + .factors = { 2, TX_FACTOR_ANY }, + .nb_factors = 2, + .min_len = 2, + .max_len = TX_LEN_UNLIMITED, + .init = TX_NAME(ff_tx_dcstI_init), + .cpu_flags = FF_TX_CPU_FLAGS_ALL, + .prio = FF_TX_PRIO_BASE, +}; + int TX_TAB(ff_tx_mdct_gen_exp)(AVTXContext *s, int *pre_tab) { int off = 0; @@ -1947,6 +2157,10 @@ const FFTXCodelet * const TX_NAME(ff_tx_codelet_list)[] = { &TX_NAME(ff_tx_fft32768_ns_def), &TX_NAME(ff_tx_fft65536_ns_def), &TX_NAME(ff_tx_fft131072_ns_def), + &TX_NAME(ff_tx_fft262144_ns_def), + &TX_NAME(ff_tx_fft524288_ns_def), + &TX_NAME(ff_tx_fft1048576_ns_def), + &TX_NAME(ff_tx_fft2097152_ns_def), /* Prime factor codelets */ &TX_NAME(ff_tx_fft3_ns_def), @@ -1985,9 +2199,15 @@ const FFTXCodelet * const TX_NAME(ff_tx_codelet_list)[] = { &TX_NAME(ff_tx_mdct_naive_inv_def), &TX_NAME(ff_tx_mdct_inv_full_def), &TX_NAME(ff_tx_rdft_r2c_def), + &TX_NAME(ff_tx_rdft_r2r_def), + &TX_NAME(ff_tx_rdft_r2r_mod2_def), + &TX_NAME(ff_tx_rdft_r2i_def), + &TX_NAME(ff_tx_rdft_r2i_mod2_def), &TX_NAME(ff_tx_rdft_c2r_def), &TX_NAME(ff_tx_dctII_def), &TX_NAME(ff_tx_dctIII_def), + &TX_NAME(ff_tx_dctI_def), + &TX_NAME(ff_tx_dstI_def), NULL, }; diff --git a/src/third_party/ffmpeg/libavutil/version.h b/src/third_party/ffmpeg/libavutil/version.h index 24af520e..4c0c545d 100644 --- a/src/third_party/ffmpeg/libavutil/version.h +++ b/src/third_party/ffmpeg/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 58 -#define LIBAVUTIL_VERSION_MINOR 14 +#define LIBAVUTIL_VERSION_MINOR 27 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ diff --git a/src/third_party/ffmpeg/libavutil/video_hint.c b/src/third_party/ffmpeg/libavutil/video_hint.c new file mode 100644 index 00000000..431716ab --- /dev/null +++ b/src/third_party/ffmpeg/libavutil/video_hint.c @@ -0,0 +1,81 @@ +/* + * Copyright 2023 Elias Carotti + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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 + +#include "avstring.h" +#include "frame.h" +#include "macros.h" +#include "mem.h" +#include "video_hint.h" + +AVVideoHint *av_video_hint_alloc(size_t nb_rects, + size_t *out_size) +{ + struct TestStruct { + AVVideoHint hint; + AVVideoRect rect; + }; + const size_t rect_offset = offsetof(struct TestStruct, rect); + size_t size = rect_offset; + AVVideoHint *hint; + + *out_size = 0; + if (nb_rects > (SIZE_MAX - size) / sizeof(AVVideoRect)) + return NULL; + size += sizeof(AVVideoRect) * nb_rects; + + hint = av_mallocz(size); + if (!hint) + return NULL; + + hint->nb_rects = nb_rects; + hint->rect_offset = rect_offset; + hint->rect_size = sizeof(AVVideoRect); + + *out_size = size; + + return hint; +} + +AVVideoHint *av_video_hint_create_side_data(AVFrame *frame, + size_t nb_rects) +{ + AVVideoHint *hint; + AVBufferRef *buf; + size_t size = 0; + + hint = av_video_hint_alloc(nb_rects, &size); + if (!hint) + return NULL; + + buf = av_buffer_create((uint8_t *)hint, size, NULL, NULL, 0); + if (!buf) { + av_freep(&hint); + return NULL; + } + + if (!av_frame_new_side_data_from_buf(frame, AV_FRAME_DATA_VIDEO_HINT, buf)) { + av_buffer_unref(&buf); + return NULL; + } + + return hint; +} diff --git a/src/third_party/ffmpeg/libavutil/video_hint.h b/src/third_party/ffmpeg/libavutil/video_hint.h new file mode 100644 index 00000000..1b219609 --- /dev/null +++ b/src/third_party/ffmpeg/libavutil/video_hint.h @@ -0,0 +1,107 @@ +/** + * Copyright 2023 Elias Carotti + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General 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_VIDEO_HINT_H +#define AVUTIL_VIDEO_HINT_H + +#include +#include +#include "libavutil/avassert.h" +#include "libavutil/frame.h" + +typedef struct AVVideoRect { + uint32_t x, y; + uint32_t width, height; +} AVVideoRect; + +typedef enum AVVideoHintType { + /* rectangled delimit the constant areas (unchanged), default is changed */ + AV_VIDEO_HINT_TYPE_CONSTANT, + + /* rectangled delimit the constant areas (changed), default is not changed */ + AV_VIDEO_HINT_TYPE_CHANGED, +} AVVideoHintType; + +typedef struct AVVideoHint { + /** + * Number of AVVideoRect present. + * + * May be 0, in which case no per-rectangle information is present. In this + * case the values of rect_offset / rect_size are unspecified and should + * not be accessed. + */ + size_t nb_rects; + + /** + * Offset in bytes from the beginning of this structure at which the array + * of AVVideoRect starts. + */ + size_t rect_offset; + + /** + * Size in bytes of AVVideoRect. + */ + size_t rect_size; + + AVVideoHintType type; +} AVVideoHint; + +static av_always_inline AVVideoRect * +av_video_hint_rects(const AVVideoHint *hints) { + return (AVVideoRect *)((uint8_t *)hints + hints->rect_offset); +} + +static av_always_inline AVVideoRect * +av_video_hint_get_rect(const AVVideoHint *hints, size_t idx) { + return (AVVideoRect *)((uint8_t *)hints + hints->rect_offset + idx * hints->rect_size); +} + +/** + * Allocate memory for the AVVideoHint struct along with an nb_rects-sized + * arrays of AVVideoRect. + * + * The side data contains a list of rectangles for the portions of the frame + * which changed from the last encoded one (and the remainder are assumed to be + * changed), or, alternately (depending on the type parameter) the unchanged + * ones (and the remanining ones are those which changed). + * Macroblocks will thus be hinted either to be P_SKIP-ped or go through the + * regular encoding procedure. + * + * It's responsibility of the caller to fill the AVRects accordingly, and to set + * the proper AVVideoHintType field. + * + * @param out_size if non-NULL, the size in bytes of the resulting data array is + * written here + * + * @return newly allocated AVVideoHint struct (must be freed by the caller using + * av_free()) on success, NULL on memory allocation failure + */ +AVVideoHint *av_video_hint_alloc(size_t nb_rects, + size_t *out_size); + +/** + * Same as av_video_hint_alloc(), except newly-allocated AVVideoHint is attached + * as side data of type AV_FRAME_DATA_VIDEO_HINT_INFO to frame. + */ +AVVideoHint *av_video_hint_create_side_data(AVFrame *frame, + size_t nb_rects); + + +#endif /* AVUTIL_VIDEO_HINT_H */ diff --git a/src/third_party/ffmpeg/libavutil/vulkan.c b/src/third_party/ffmpeg/libavutil/vulkan.c index 48f5f4b5..dec8ccad 100644 --- a/src/third_party/ffmpeg/libavutil/vulkan.c +++ b/src/third_party/ffmpeg/libavutil/vulkan.c @@ -90,9 +90,13 @@ int ff_vk_load_props(FFVulkanContext *s) s->hprops = (VkPhysicalDeviceExternalMemoryHostPropertiesEXT) { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT, }; + s->coop_matrix_props = (VkPhysicalDeviceCooperativeMatrixPropertiesKHR) { + .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_KHR, + .pNext = &s->hprops, + }; s->subgroup_props = (VkPhysicalDeviceSubgroupSizeControlProperties) { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES, - .pNext = &s->hprops, + .pNext = &s->coop_matrix_props, }; s->desc_buf_props = (VkPhysicalDeviceDescriptorBufferPropertiesEXT) { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_PROPERTIES_EXT, @@ -161,6 +165,25 @@ int ff_vk_load_props(FFVulkanContext *s) vk->GetPhysicalDeviceQueueFamilyProperties2(s->hwctx->phys_dev, &s->tot_nb_qfs, s->qf_props); + if (s->extensions & FF_VK_EXT_COOP_MATRIX) { + vk->GetPhysicalDeviceCooperativeMatrixPropertiesKHR(s->hwctx->phys_dev, + &s->coop_mat_props_nb, NULL); + + if (s->coop_mat_props_nb) { + s->coop_mat_props = av_malloc_array(s->coop_mat_props_nb, + sizeof(VkCooperativeMatrixPropertiesKHR)); + for (int i = 0; i < s->coop_mat_props_nb; i++) { + s->coop_mat_props[i] = (VkCooperativeMatrixPropertiesKHR) { + .sType = VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_KHR, + }; + } + + vk->GetPhysicalDeviceCooperativeMatrixPropertiesKHR(s->hwctx->phys_dev, + &s->coop_mat_props_nb, + s->coop_mat_props); + } + } + return 0; } @@ -1861,6 +1884,7 @@ void ff_vk_pipeline_free(FFVulkanContext *s, FFVulkanPipeline *pl) av_freep(&pl->desc_set); av_freep(&pl->desc_bind); + av_freep(&pl->bound_buffer_indices); av_freep(&pl->push_consts); pl->push_consts_num = 0; } @@ -1870,6 +1894,7 @@ void ff_vk_uninit(FFVulkanContext *s) av_freep(&s->query_props); av_freep(&s->qf_props); av_freep(&s->video_props); + av_freep(&s->coop_mat_props); av_buffer_unref(&s->frames_ref); } diff --git a/src/third_party/ffmpeg/libavutil/vulkan.h b/src/third_party/ffmpeg/libavutil/vulkan.h index 20b81105..25c5ad4b 100644 --- a/src/third_party/ffmpeg/libavutil/vulkan.h +++ b/src/third_party/ffmpeg/libavutil/vulkan.h @@ -236,11 +236,15 @@ typedef struct FFVulkanContext { VkPhysicalDeviceExternalMemoryHostPropertiesEXT hprops; VkPhysicalDeviceDescriptorBufferPropertiesEXT desc_buf_props; VkPhysicalDeviceSubgroupSizeControlProperties subgroup_props; + VkPhysicalDeviceCooperativeMatrixPropertiesKHR coop_matrix_props; VkQueueFamilyQueryResultStatusPropertiesKHR *query_props; VkQueueFamilyVideoPropertiesKHR *video_props; VkQueueFamilyProperties2 *qf_props; int tot_nb_qfs; + VkCooperativeMatrixPropertiesKHR *coop_mat_props; + uint32_t coop_mat_props_nb; + VkPhysicalDeviceShaderAtomicFloatFeaturesEXT atomic_float_feats; VkPhysicalDeviceVulkan12Features feats_12; VkPhysicalDeviceFeatures2 feats; diff --git a/src/third_party/ffmpeg/libavutil/vulkan_functions.h b/src/third_party/ffmpeg/libavutil/vulkan_functions.h index 58a625dd..65021b04 100644 --- a/src/third_party/ffmpeg/libavutil/vulkan_functions.h +++ b/src/third_party/ffmpeg/libavutil/vulkan_functions.h @@ -45,6 +45,7 @@ typedef enum FFVulkanExtensions { FF_VK_EXT_VIDEO_DECODE_H265 = 1ULL << 13, /* VK_EXT_video_decode_h265 */ FF_VK_EXT_VIDEO_DECODE_AV1 = 1ULL << 14, /* VK_MESA_video_decode_av1 */ FF_VK_EXT_ATOMIC_FLOAT = 1ULL << 15, /* VK_EXT_shader_atomic_float */ + FF_VK_EXT_COOP_MATRIX = 1ULL << 16, /* VK_KHR_cooperative_matrix */ FF_VK_EXT_NO_FLAG = 1ULL << 31, } FFVulkanExtensions; @@ -80,6 +81,7 @@ typedef enum FFVulkanExtensions { MACRO(1, 0, FF_VK_EXT_NO_FLAG, GetPhysicalDeviceImageFormatProperties2) \ MACRO(1, 0, FF_VK_EXT_NO_FLAG, GetPhysicalDeviceQueueFamilyProperties) \ MACRO(1, 0, FF_VK_EXT_NO_FLAG, GetPhysicalDeviceQueueFamilyProperties2) \ + MACRO(1, 0, FF_VK_EXT_COOP_MATRIX, GetPhysicalDeviceCooperativeMatrixPropertiesKHR) \ \ /* Command pool */ \ MACRO(1, 1, FF_VK_EXT_NO_FLAG, CreateCommandPool) \ diff --git a/src/third_party/ffmpeg/libavutil/vulkan_loader.h b/src/third_party/ffmpeg/libavutil/vulkan_loader.h index c45c674e..f88722f2 100644 --- a/src/third_party/ffmpeg/libavutil/vulkan_loader.h +++ b/src/third_party/ffmpeg/libavutil/vulkan_loader.h @@ -46,6 +46,7 @@ static inline uint64_t ff_vk_extensions_to_mask(const char * const *extensions, { VK_EXT_DEBUG_UTILS_EXTENSION_NAME, FF_VK_EXT_DEBUG_UTILS }, { VK_EXT_PHYSICAL_DEVICE_DRM_EXTENSION_NAME, FF_VK_EXT_DEVICE_DRM }, { VK_EXT_SHADER_ATOMIC_FLOAT_EXTENSION_NAME, FF_VK_EXT_ATOMIC_FLOAT }, + { VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME, FF_VK_EXT_COOP_MATRIX }, #ifdef _WIN32 { VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME, FF_VK_EXT_EXTERNAL_WIN32_MEMORY }, { VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME, FF_VK_EXT_EXTERNAL_WIN32_SEM }, diff --git a/src/third_party/ffmpeg/libavutil/wchar_filename.h b/src/third_party/ffmpeg/libavutil/wchar_filename.h index fbc0a551..868a30b5 100644 --- a/src/third_party/ffmpeg/libavutil/wchar_filename.h +++ b/src/third_party/ffmpeg/libavutil/wchar_filename.h @@ -21,7 +21,8 @@ #ifdef _WIN32 -#define WIN32_LEAN_AND_MEAN +#include +#include #include #include "mem.h"